1. 程式人生 > 實用技巧 >ubuntu apt-get下載慢 解決辦法

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軟體源

完畢。