老機器環境:
$ lsb_release -aNo LSB modules are available.Distributor ID: UbuntuDescription: Ubuntu 12.04.5 LTSRelease: 12.04Codename: precise
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/precise-backports/multiverse/binary-i386/Packages 404
追了一下應當是 12.04 已經不維護了。運氣不錯,有找到 old-releases.ubuntu.com 位置:
- https://archive.ubuntu.com/ubuntu/
- https://old-releases.ubuntu.com/ubuntu/
$ sudo mv /var/lib/apt/lists /var/lib/apt/lists-backup$ sudo mkdir -p /var/lib/apt/lists$ sudo apt-get update
如此就會修復相關資訊,可以在靠 apt-get 安裝軟體了。
此外,若剛好在除錯時,刪除了已安裝過的軟體,接著做了上述後,又要安裝時,會碰到資訊對不上的問題,如:
dpkg:error processing package XXX (--configure):subprocess installed post-installation script returned error exit status 10
解法就是清除 /var/lib/dpkg/info/ 下相關套件的資料後,重新安裝或是跑完後續流程:
$ sudo mkdir /var/lib/dpkg/info/backup
$ sudo mv /var/lib/dpkg/info/XXX* /var/lib/dpkg/info/backup/
$ sudo apt-get install -f
沒有留言:
張貼留言