Ubuntu16.04修改apt安装包的源

Ubuntu16.04修改apt安装包的源

1.背景

新装Ubuntu16.04系统,修改apt安装包的源地址,加快访问。

2.问题现象

输入sudo apt-get install 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

3.解决方法

解决办法就是修改软件源设置
1.备份源文件,cp -i /etc/apt/sources.list /etc/apt/sources.list_backup

2.打开sources.list:
sudo gedit /etc/apt/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.更新命令:sudo apt-get update

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

4.感谢

内容源自博文https://blog.csdn.net/sinat_33363493/article/details/51284358 感谢博主分享。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值