
今日アップグレードを実行してから、apt-get が使用できなくなりました。
適例:
sudo apt-get install curl
Reading package lists... Done
Building dependency tree
Reading state information... Done
curl is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue [Y/n]? Y
Setting up linux-image-3.2.0-24-generic (3.2.0-24.38) ...
Running depmod.
Failed to symbolic-link /boot/initrd.img-3.2.0-24-generic to initrd.img: File exists
dpkg: error processing linux-image-3.2.0-24-generic (--configure):
subprocess installed post-installation script returned error exit status 17
Errors were encountered while processing:
linux-image-3.2.0-24-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)
私が理解する限り、これが失敗の原因です:
sudo dpkg --configure linux-image-3.2.0-24-generic
Setting up linux-image-3.2.0-24-generic (3.2.0-24.38) ...
Running depmod.
Failed to symbolic-link /boot/initrd.img-3.2.0-24-generic to initrd.img: File exists
dpkg: error processing linux-image-3.2.0-24-generic (--configure):
subprocess installed post-installation script returned error exit status 17
Errors were encountered while processing:
linux-image-3.2.0-24-generic
しかし、これを実行すると、すべてが機能しているように見えます...
/var/lib/dpkg/info/linux-image-3.2.0-24-generic.postinst
echo $?
0
いったい何が起こっているのでしょうか? これは重大なことだと思っているので、いじくり回すのが少し怖いです...
答え1
initrd
ルートディレクトリからシンボリックリンクを削除しました。
sudo rm /initrd.img
ただし、それに対するフェイルセーフを確保したい場合は、initrd.img
削除する前に既存のものをバックアップすることもできます。
そして実行する
sudo apt-get -f install [package]
そして、正常に実行できるはずです。
答え2
試す
sudo apt-get -f install [package]
これによりアップグレードが強制されます。少なくとも試してみる価値はあります。
sudo apt-get update
害もありません。