1.备份原始源文件source.list,防止修改错误,无法恢复;
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
2.修改源文件source.list
(1)终端执行命令:sudo chmod 777 /etc/apt/source.list更改文件权限使其可编辑;
(2)执行命令:sudo gedit /etc/apt/source.list打开文件进行编辑;
#把下面的阿里源粘贴在source.list的最前面;
#推荐用阿里云源
阿里源:
1 2 3 4 5 6 7 8 9 10 | deb http: / / mirrors.aliyun.com / ubuntu / bionic main restricted universe multiverse deb http: / / mirrors.aliyun.com / ubuntu / bionic - security main restricted universe multiverse deb http: / / mirrors.aliyun.com / ubuntu / bionic - updates main restricted universe multiverse deb 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 main restricted universe multiverse deb - src http: / / mirrors.aliyun.com / ubuntu / bionic - security main restricted universe multiverse deb - src http: / / mirrors.aliyun.com / ubuntu / bionic - updates main restricted universe multiverse deb - src http: / / mirrors.aliyun.com / ubuntu / bionic - proposed main restricted universe multiverse deb - src http: / / mirrors.aliyun.com / ubuntu / bionic - backports main restricted universe multiverse |
清华源:
1 2 3 4 5 6 7 8 9 10 | deb https: / / mirrors.tuna.tsinghua.edu.cn / ubuntu / bionic main restricted universe multiverse deb - src https: / / mirrors.tuna.tsinghua.edu.cn / ubuntu / bionic main restricted universe multiverse deb https: / / mirrors.tuna.tsinghua.edu.cn / ubuntu / bionic - updates main restricted universe multiverse deb - src https: / / mirrors.tuna.tsinghua.edu.cn / ubuntu / bionic - updates main restricted universe multiverse deb https: / / mirrors.tuna.tsinghua.edu.cn / ubuntu / bionic - backports main restricted universe multiverse deb - src https: / / mirrors.tuna.tsinghua.edu.cn / ubuntu / bionic - backports main restricted universe multiverse deb https: / / mirrors.tuna.tsinghua.edu.cn / ubuntu / bionic - security main restricted universe multiverse deb - src https: / / mirrors.tuna.tsinghua.edu.cn / ubuntu / bionic - security main restricted universe multiverse deb https: / / mirrors.tuna.tsinghua.edu.cn / ubuntu / bionic - proposed main restricted universe multiverse deb - src https: / / mirrors.tuna.tsinghua.edu.cn / ubuntu / bionic - proposed main restricted universe multiverse |
163源:
1 2 3 4 5 6 7 8 9 10 | deb http: / / mirrors. 163.com / ubuntu / bionic main restricted universe multiverse deb http: / / mirrors. 163.com / ubuntu / bionic - security main restricted universe multiverse deb http: / / mirrors. 163.com / ubuntu / bionic - updates main restricted universe multiverse deb http: / / mirrors. 163.com / ubuntu / bionic - proposed main restricted universe multiverse deb http: / / mirrors. 163.com / ubuntu / bionic - backports main restricted universe multiverse deb - src http: / / mirrors. 163.com / ubuntu / bionic main restricted universe multiverse deb - src http: / / mirrors. 163.com / ubuntu / bionic - security main restricted universe multiverse deb - src http: / / mirrors. 163.com / ubuntu / bionic - updates main restricted universe multiverse deb - src http: / / mirrors. 163.com / ubuntu / bionic - proposed main restricted universe multiverse deb - src http: / / mirrors. 163.com / ubuntu / bionic - backports main restricted universe multiverse |
#更新软件列表
sudo apt-get update
#更新软件
sudo apt-get upgrade