Ubuntu更新镜像源

安装了Ubuntu13.10,但不能在联网状态下安装相关软件

所谓镜像源,就是ubuntu已联网情况下,希望能自动寻找相关软件安装,比如执行sudo apt-get install lua5.1(自动安装lua)。

因为安装程序是从你所选取的镜像源服务器下载,下载的速度和你选取的镜像源相关。

默认的镜像源速度都比较慢,推荐教育网下去中科大的镜像源:http://mirrors.ustc.edu.cn/,电信网去网易镜像源:http://mirrors.163.com/。 

找到etc/apt/目录下的sources.list文件,因为这个文件默认不是管理员是不能修改的,先要更改文件权限,在终端输入sudo chmod 777 /etc/apt/sources.list

然后用gedit文本编辑器打开编辑:

以lucid(12.04)为例, 编辑/etc/apt/sources.list文件, 把文件替换为以下条目(操作前请做好相应备份)

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


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


然后保存,如果不能保存,在gedit编辑器的edit->prefrences的editor下,将文件修改前备份去掉(Create a backup copy of files before saving),这样就可以保存。

更改完之后,要更新镜像源,在终端输入 sudo apt-get update,更新完后,应该就可以正常安装软件了。


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值