關於Ubuntu10.04中使用 apt-get install 安裝軟件總是出現“E: Package *** has no installation candidate” 錯誤的解決方案


因為近期需要使用Disksim來做實驗,經過多個版本的測試,發現在ubuntu10.04上能成功配置disksim3.0,其他幾個版本總是出現各種各樣的錯誤,所以不得已使用了比較“古老的”10.04版本的Ubuntu,然后發現在10.04系統上安裝一些必須的軟件,譬如vim等等的時候總是顯示如下錯誤:

Reading package lists... Done
Building dependency tree
Reading state information... Done
Package vim is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package vim has no installation candidate

Google一下,發現是缺少某些包,要更新軟件源。然后執行了sudo apt-get update,發現更新過程中出現很多“Failed”,然后繼續Google,發現ubuntu10.4到2016年早已停止了更新支持,ubuntu也不再維護了。官方源以及第三方源包括163,sohu等也不再維護。為了解決這個問題,ubuntu提供了old-release的方案,通過命令行更新源如下:

sudo gedit /etc/apt/sources.list,打開源列表文件,把里面的地址全部注銷(如果不放心,在修改源列表文件之前可以先將文件備份一下),然后換上如下的地址,如果是其他版本的,把lucid替換即可。

deb http://old-releases.ubuntu.com/ubuntu lucid main restricted universe multiverse   
deb http://old-releases.ubuntu.com/ubuntu lucid-security main restricted universe multiverse   
deb http://old-releases.ubuntu.com/ubuntu lucid-updates main restricted universe multiverse   
deb http://old-releases.ubuntu.com/ubuntu lucid-proposed main restricted universe multiverse   
deb http://old-releases.ubuntu.com/ubuntu lucid-backports main restricted universe multiverse   
deb-src http://old-releases.ubuntu.com/ubuntu lucid main restricted universe multiverse   
deb-src http://old-releases.ubuntu.com/ubuntu lucid-security main restricted universe multiverse   
deb-src http://old-releases.ubuntu.com/ubuntu lucid-updates main restricted universe multiverse   
deb-src http://old-releases.ubuntu.com/ubuntu lucid-proposed main restricted universe multiverse   
deb-src http://old-releases.ubuntu.com/ubuntu lucid-backports main restricted universe multiverse  

然后 sudo apt-get update,成功解決了我的問題!

然后安裝vim:sudo apt-get install vim,發現又有錯誤,具體錯誤如下所示:

Reading package lists... Done

Building dependency tree

Reading state information... Done

Vim is already the newest version.

You might want to run 'apt-get -f install ' to correct these:

The following packages have unmet dependencies:

     vim: Depends: vim-common (=2:7.3.429-2ubuntu2.2) but 2:7.2.330-1ubuntu3 is to be installed

             Depends: vim-runtime (=2:7.3.429-2ubuntu2.2) but it is not going to be installed

             Depends: libacl1 (>=2.2.51-5) but 2.2.49-2 is to be installed

             Depends: libc6 (>=2.15) but 2.11.1-0ubuntu7 is to be installed

             Depends: libpython2.7 (>=2.7) but it is not installable

             Depends: libtinfo5 but it is not installable

E: Unmet dependencies. Try 'apt-get -f install ' with no packages (or specify a solution)

根據錯誤提示,在終端輸入指令:sudo apt-get -f install 修復受損軟件包,然后再執行安裝指令:sudo apt-get install vim,成功!!!!vim -v 查看vim版本

如果還不行的話,可以更新一下再操作上述步驟:

sudo apt-get update

sudo apt-get dist-upgrade

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM