关于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版本

关于Ubuntu10.04中使用 apt-get install 安装软件总是出现“E: Package *** has no installation candidate” 错误的解决方案..._第1张图片

如果还不行的话,可以更新一下再操作上述步骤:

sudo apt-get update

sudo apt-get dist-upgrade

 

转载于:https://www.cnblogs.com/treel/p/7434936.html

你可能感兴趣的:(关于Ubuntu10.04中使用 apt-get install 安装软件总是出现“E: Package *** has no installation candidate” 错误的解决方案...)