当输入sudo apt-get install vim-gtk时 出现了下面问题: nigel@yq-ubuntu:~/worksp$ sudo apt-get install vim-gtk Rea
当输入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
6.如果 安装vim出错,有以下提示:
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
有一些软件包无法被安装。如果您用的是 unstable 发行版,这也许是
因为系统无法达到您要求的状态造成的。该版本中可能会有一些您需要的软件
包尚未被创建或是它们已被从新到(Incoming)目录移出。
下列信息可能会对解决问题有所帮助:
下列软件包有未满足的依赖关系:
vim : 依赖: vim-common (= 2:7.3.429-2ubuntu2.1) 但是 2:7.3.547-4ubuntu1 正要被安装
E: 无法修正错误,因为您要求某些软件包保持现状,就是它们破坏了软件包间的依赖关系。
原因可能是安装vim所依赖的vim-common和系统自带的vim-common版本冲突,解决办法就是先把vim-common卸载了人然后再安装vim即可.
sudo apt-get remove vim-common
sudo apt-get install vim