2012年4月7日 星期六

執行apt-get install 指令安裝出現問題?有解決方案!

[stayhigh@:~$] sudo apt-get install aptitude
[sudo] password for stayhigh:
正在讀取套件清單... 完成
正在重建相依關係        
正在讀取狀態資料... 完成
aptitude 已經是最新版本了。
升級 0 個,新安裝 0 個,移除 0 個,有 0 個未被升級。
3 個沒有完整得安裝或移除。
此操作完成之後,會多佔用 0B 的磁碟空間。
正在設定 linux-image-2.6.32-40-generic (2.6.32-40.87) ...
Running depmod.
update-initramfs: Generating /boot/initrd.img-2.6.32-40-generic
Running postinst hook script /usr/sbin/update-grub.
/etc/default/grub: 1: f#: not found
User postinst hook script [/usr/sbin/update-grub] exited with value 127
dpkg:在處理 linux-image-2.6.32-40-generic (--configure) 時發生錯誤:
 子程序 installed post-installation script 傳回了錯誤退出狀態 127
dpkg:因相依問題,不能設定 linux-image-generic:
 linux-image-generic 相依於 linux-image-2.6.32-40-generic﹔然而:
  linux-image-2.6.32-40-generic 套件尚未設定。
dpkg:在處理 linux-image-generic (--configure) 時發生錯誤:
 相依問題 - 保留為未設定
dpkg:因相依問題,不能設定 linux-generic:
 linux-generic 相依於 linux-image-generic (= 2.6.32.40.47)﹔然而:
  linux-image-generic 套件尚未設定。
dpkg:在處理 linux-generic (--configure) 時發生錯誤:
 相依問題 - 保留為未設定
No apport report written because the error message indicates its a followup error from a previous failure.
                          No apport report written because the error message indicates its a followup error from a previous failure.
                                                    在處理時有錯誤發生:
 linux-image-2.6.32-40-generic
 linux-image-generic
 linux-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)

解決方案:

由訊息中可知道 問題出現於 /etc/default/grub: 1: f#: not found
檢查/etc/default/grub發現文件中第1行多打了一個字元f
將其刪除後儲存 並執行 sudo update-grub
即可使用之。
現在重新使用指令apt-get install 確認是否問題以排除
[stayhigh@:~$] sudo apt-get install aptitude
正在讀取套件清單... 完成
正在重建相依關係          
正在讀取狀態資料... 完成
aptitude 已經是最新版本了。
升級 0 個,新安裝 0 個,移除 0 個,有 0 個未被升級。

沒有留言:

張貼留言