更新源及加速操作
Posted suonikeyinsu
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了更新源及加速操作相关的知识,希望对你有一定的参考价值。
参考:http://blog.csdn.net/okman1214/article/details/8149728
使用Ubuntu时,apt-get是很方便的一个工具,但默认使用的欧洲源,国内速度太慢。可以把更新源换成速度更快的镜像,并使用apt-fast去多线程更新。
1、备份更新源文件
$ sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
2、打开更新源文件编辑
$ sudo vi /etc/apt/sources.list
3、根据UBUNTU版本,把全部内容替换为如下内容
版本11.04
deb http://ubuntu.uestc.edu.cn/ubuntu/ natty main restricted universe multiverse
deb http://ubuntu.uestc.edu.cn/ubuntu/ natty-backports main restricted universe multiverse
deb http://ubuntu.uestc.edu.cn/ubuntu/ natty-proposed main restricted universe multiverse
deb http://ubuntu.uestc.edu.cn/ubuntu/ natty-security main restricted universe multiverse
deb http://ubuntu.uestc.edu.cn/ubuntu/ natty-updates main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ natty main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ natty-backports main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ natty-proposed main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ natty-security main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ natty-updates main restricted universe multiverse
版本11.10
deb http://ubuntu.uestc.edu.cn/ubuntu/ oneiric main restricted universe multiverse
deb http://ubuntu.uestc.edu.cn/ubuntu/ oneiric-backports main restricted universe multiverse
deb http://ubuntu.uestc.edu.cn/ubuntu/ oneiric-proposed main restricted universe multiverse
deb http://ubuntu.uestc.edu.cn/ubuntu/ oneiric-security main restricted universe multiverse
deb http://ubuntu.uestc.edu.cn/ubuntu/ oneiric-updates main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ oneiric main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ oneiric-backports main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ oneiric-proposed main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ oneiric-security main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ oneiric-updates main restricted universe multiverse
版本12.04
deb http://ubuntu.uestc.edu.cn/ubuntu/ precise main restricted universe multiverse
deb http://ubuntu.uestc.edu.cn/ubuntu/ precise-backports main restricted universe multiverse
deb http://ubuntu.uestc.edu.cn/ubuntu/ precise-proposed main restricted universe multiverse
deb http://ubuntu.uestc.edu.cn/ubuntu/ precise-security main restricted universe multiverse
deb http://ubuntu.uestc.edu.cn/ubuntu/ precise-updates main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ precise main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ precise-backports main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ precise-proposed main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ precise-security main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ precise-updates main restricted universe multiverse
4、更新系统
$ sudo apt-get update
$ sudo apt-get dist-upgrade
5、安装apt-fast(未测试)
$ sudo add-apt-repository ppa:tldm217/tahutek.net
$ sudo apt-get update
$ sudo apt-get install apt-fast
默认使用4个线程下载,可以通过修改/etc/axelrc中的
#num_connections = 4
比如改为10,并去掉前面的"#"将下载线程改为10。
以上是关于更新源及加速操作的主要内容,如果未能解决你的问题,请参考以下文章