打开终端(Open Terminal)
1 将系统自带的该文件做个备份: sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup
2 修改配置:
打开文件:
sudo gedit /etc/apt/sources.list
将下面的内容粘贴到打开文件的最前面,全部粘贴过去,保存,并关闭。
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
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
如果你对上面的地址有疑惑,或者你的Ubuntu系统不是18.04,可以打开下面的地址,选择你的Ubuntu版本,复制里面的链接到文本中。
https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/
3.更新
更新源: sudo apt-get update
更新软件: sudo apt-get upgrade