CentOS-7 minimal 最小安裝 Yum update 遇KeyboardInterrupt錯誤 !!

Yum update 遇KeyboardInterrupt

參考文章來源: https://www.centos.org/forums/viewtopic.php?t=47372

這個特殊狀況是我在測試的VM主機上面安裝Centos7.0 最小安裝版本時遇到。
一開始我以為是VM的問題,因為之前玩GCP不會遇到 (廢話)
後來發現在其他VM主機上也有問題,換了ISO7.4也一樣。
結果Google大神後,才知道原來是個Bug變成每次安裝新主機時都要注意一下。

(135/415): httpd-tools-2.4.6-88.el7.centos.x86_64.rpm | 90 kB 00:00:00
Traceback (most recent call last):
File “/usr/libexec/urlgrabber-ext-down”, line 75, in
main()
File “/usr/libexec/urlgrabber-ext-down”, line 61, in main
fo = PyCurlFileObject(opts.url, opts.filename, opts)
File “/usr/lib/python2.7/site-packages/urlgrabber/grabber.py”, line 1258, in init
self._do_open()
File “/usr/lib/python2.7/site-packages/urlgrabber/grabber.py”, line 1589, in _do_open
self._do_grab()
File “/usr/lib/python2.7/site-packages/urlgrabber/grabber.py”, line 1723, in _do_grab
self._do_perform()
File “/usr/lib/python2.7/site-packages/urlgrabber/grabber.py”, line 1517, in _do_perform
raise KeyboardInterrupt
KeyboardInterrupt
(136/415): grub2-tools-2.02-0.76.el7.centos.x86_64.rpm | 1.8 MB 00:00:02

Exiting on user cancel

如何排除?

首先: 清除更新下載紀錄 (我自己是做到這邊就正常了)

#  yum clean metadata
# yum clean all
# yum upgrade
或
$ sudo bash -c 'yum clean metadata && yum upgrade'

如果不幸以上方式都無法修復這個錯誤
就只能編輯 “/usr/lib/python2.7/site-packages/urlgrabber/grabber.py”
找到1510行 把他 # ,或是不要安裝Centos7 最小版。
改裝一般web server。

YUM UPDATE後還有一下怪問題會發生,就是因為VM外掛的ISO光碟會造成開機進入 時又出現
welcome to emergency mode! after logging in type “journalctl -xb”to view system logs…” 
這是因為第一次安裝完畢後的CD ISO掛載拿掉後,/etc/fstab內的設定沒有刪除或加入。(要檢查一下ISO掛載的狀況)
參考文章來源: https://jisonami.iteye.com/blog/2293585

About dfoneuser