在Ubuntu22.04下进行安装。 首先我们需要先备份Ubuntu官方的软件源,执行以下命令将备份原来的软件源。
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
然后使用gedit命令直接编辑源列表文件:
sudo gedit /etc/apt/sources.list
注意:这里直接进行文本复制编辑,然后保存文件,直接关闭文件即可。 复制清华源到源列表里,然后执行更新即可。 清华源链接:
https://mirror.tuna.tsinghua.edu.cn/help/ubuntu/
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse
# deb-src http://security.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse
# 预发布软件源,不建议启用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-proposed main restricted universe multiverse
# # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-proposed main restricted universe multiverse
执行更新列表:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
执行完重启计算机即可。