ubuntu apt-get下载慢 解决办法
由于安装的Ubuntu LTS是英文版的,软件源就默认都是 us.archive.ubuntu.com(英国) 的,所以很慢
为了提高下载速度,将源改为国内的 cn.archive.ubuntu.com ,现在 cn.archive.ubuntu.com 指向阿里云的开源镜像站 mirrors.aliyun.com,下载速度很快。
ubuntu 18.04(bionic) 配置如下:
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
在ubuntu下执行命令 sudo mv /etc/apt/sources.list /etc/apt/sources.list_backup 将 sources.list 文件备份
执行 sudo vi /etc/apt/sources.list 编辑 sources.list 文件,有内容则将文件内容清空,并粘贴上面的内容,保存退出
执行 sudo apt-get update 更新apt软件源
完毕。