作者 主題: [心得] ubuntu安裝套件時出現的問題  (閱讀 1931 次)

0 會員 與 1 訪客 正在閱讀本文。

billy3321

  • 活潑的大學生
  • ***
  • 文章數: 269
  • 性別: 男
    • 檢視個人資料
    • 雨蒼的筆記本
[心得] ubuntu安裝套件時出現的問題
« 於: 2008-08-29 00:29 »

安裝上grub-gfxboot之後,裝軟體在重新設定initrd時,都會出現一串訊息,且之後安裝任何軟體都會出現錯誤訊息
茲將錯誤訊息節錄於下

引用
正在設定 linux-image-2.6.24-19-generic (2.6.24-19.41) ...
Running depmod.
update-initramfs: Generating /boot/initrd.img-2.6.24-19-generic
Not updating initrd symbolic links since we are being updated/reinstalled
(2.6.24-19.36 was configured last, according to dpkg)
Not updating image symbolic links since we are being updated/reinstalled
(2.6.24-19.36 was configured last, according to dpkg)
Running postinst hook script /sbin/update-grub.
[: 25: ==: unexpected operator
exec: 25: -a: not found
User postinst hook script [/sbin/update-grub] exited with value 2
dpkg:處理 linux-image-2.6.24-19-generic (--configure)時出錯:
 子程序·post-installation script·返回了錯誤號·2
dpkg:相依關系問題使得 linux-image-generic 的設定工作不能繼續:
 linux-image-generic 相依於 linux-image-2.6.24-19-generic﹔然而:
linux-image-2.6.24-19-generic 套件還沒有被設定。
dpkg:處理 linux-image-generic (--configure)時出錯:
 相依關系問題 - 仍未被設定
在處理時有錯誤發生:
 linux-image-2.6.24-19-generic
 linux-image-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)


此問題最重要的錯誤訊息於此:

引用
Running postinst hook script /sbin/update-grub.
[: 25: ==: unexpected operator
exec: 25: -a: not found
User postinst hook script [/sbin/update-grub] exited with value 2

因此問題是出現在/sbin/update-grub

輸入

# sudo vi /sbin/update-grub

將開頭的

#!/bin/sh

改為

#!/bin/bash

就可以了。

若仍有問題,繼續更改

# sudo vi /usr/sbin/grub-update

一樣跟上面一樣更改

這是之後的安裝畫面

引用
正在設定 linux-image-2.6.24-19-generic (2.6.24-19.41) ...
Running depmod.
update-initramfs: Generating /boot/initrd.img-2.6.24-19-generic
Not updating initrd symbolic links since we are being updated/reinstalled
(2.6.24-19.36 was configured last, according to dpkg)
Not updating image symbolic links since we are being updated/reinstalled
(2.6.24-19.36 was configured last, according to dpkg)
Running postinst hook script /sbin/update-grub.
You shouldn't call /sbin/update-grub. Please call /usr/sbin/update-grub instead!

Searching for GRUB installation directory ... found: /boot/grub
Testing for an existing GRUB menu.lst file ... found: /boot/grub/menu.lst
Searching for splash image ... found: (hd0,2)/boot/grub/splashimages/debblue.xpm.gz

Found kernel: /boot/vmlinuz-2.6.24-19-generic
Found kernel: /boot/memtest86+.bin
Updating /boot/grub/menu.lst ... done



問題解決!