解决apt-get低速问题

因为Ubuntu默认使用的官方源地址,一般都是国外的服务器,所以在使用apt-get的时候下载速度特别慢。不过国内有很多镜像网站可以使用,我使用的网易的镜像。

具体步骤:

  1. 备份/etc/apt/sources.list
    sudo cp /etc/apt/sources.list /etc/apt/sources.list_backup
  2. 修改 /etc/apt/sources.list
    sudo gedit /etc/apt/sources.list
    根据自己的实际情况修改该文件,我的使用trusty,所以将一下代码复制到sources.list文件中
1
2
3
4
5
6
7
8
9
10
deb http://mirrors.163.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty-backports main restricted universe multiverse

或者可以下载相应版本sources.list,覆盖/etc/apt/sources.list即可

3.更新

1
2
$ sudo apt-get update
$ sudo apt-get upgrade

参考
Ubuntu官网:apt-get 列表
网易Ubutu镜像网站

文章目录
,