解决Ubuntu 安装vim 的Package vim has no installation candidate问题,100%有效

当输入sudo apt-get install vim-gtk时
出现了下面问题:
nigel@yq-ubuntu:~/worksp$ sudo apt-get install vim-gtk
Reading package lists... Done
Building dependency tree      
Reading state information... Done
Package vim-gtk 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-gtk' has no installation candidate
解决办法就是修改软件源设置

1.备份源文件,cp -i /etc/apt/sources.list /etc/apt/sources.list_backup

2.打开sources.list,root@ubuntu:/etc/apt# gedit sources.list

3.在源文件中加入如下阿里巴巴的阿里云服务器的地址并保存。(当然也可以是其他公司的地址)

deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse

deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse

4.更新:apt-get update

5.更新后,再安装vim,sudo apt-get install vim

这样问题就解决了。

或者

具体的源地址如何获取参见以下网站:
http://wiki.ubuntu.org.cn/源列表#Vivid.2815.04.29.E7.89.88.E6.9C.AC

sudo gedit /etc/apt/sources.list


将下列源复制粘贴至最前面,然后保存退出

deb http://mirrors.163.com/ubuntu/ vivid main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ vivid-security main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ vivid-updates main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ vivid-proposed main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ vivid-backports main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ vivid main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ vivid-security main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ vivid-updates main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ vivid-proposed main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ vivid-backports main restricted universe multiverse


写上软件源后,再刷新一下,注意一定要刷新,运行:
sudo apt-get update
终于搞定。


Ubuntu 10.10更新为国内网易163源:http://www.linuxdiyf.com/linux/8039.html

简单介绍Fedora 12如何添加163源:http://www.linuxdiyf.com/linux/675.html

Ubuntu 15.10更新源已可用,更新到Ubuntu 15.10的方法:http://www.linuxdiyf.com/linux/11955.html

Ubuntu 15.04更新源:http://www.linuxdiyf.com/linux/11839.html


你可能感兴趣的:(Linux)