Loading... # 备份 ```bash mv /etc/apt/sources.list /etc/apt/sources.list.bak ``` # 镜像站 [地址](https://help.mirrors.cernet.edu.cn/ubuntu/?mirror=ISRC-ISCAS) # 修改源 ## 方法一 `vim /etc/apt/sources.list` ```bash # 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释 deb https://mirror.iscas.ac.cn/ubuntu/ jammy main restricted universe multiverse # deb-src https://mirror.iscas.ac.cn/ubuntu/ jammy main restricted universe multiverse deb https://mirror.iscas.ac.cn/ubuntu/ jammy-updates main restricted universe multiverse # deb-src https://mirror.iscas.ac.cn/ubuntu/ jammy-updates main restricted universe multiverse deb https://mirror.iscas.ac.cn/ubuntu/ jammy-backports main restricted universe multiverse # deb-src https://mirror.iscas.ac.cn/ubuntu/ jammy-backports main restricted universe multiverse # deb https://mirror.iscas.ac.cn/ubuntu/ jammy-security main restricted universe multiverse # # deb-src https://mirror.iscas.ac.cn/ubuntu/ jammy-security 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://mirror.iscas.ac.cn/ubuntu/ jammy-proposed main restricted universe multiverse # # deb-src https://mirror.iscas.ac.cn/ubuntu/ jammy-proposed main restricted universe multiverse ``` ## 方法二 直接输入 ```bash cat <<'EOF' > /etc/apt/sources.list # 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释 deb https://mirror.iscas.ac.cn/ubuntu/ jammy main restricted universe multiverse # deb-src https://mirror.iscas.ac.cn/ubuntu/ jammy main restricted universe multiverse deb https://mirror.iscas.ac.cn/ubuntu/ jammy-updates main restricted universe multiverse # deb-src https://mirror.iscas.ac.cn/ubuntu/ jammy-updates main restricted universe multiverse deb https://mirror.iscas.ac.cn/ubuntu/ jammy-backports main restricted universe multiverse # deb-src https://mirror.iscas.ac.cn/ubuntu/ jammy-backports main restricted universe multiverse # deb https://mirror.iscas.ac.cn/ubuntu/ jammy-security main restricted universe multiverse # # deb-src https://mirror.iscas.ac.cn/ubuntu/ jammy-security 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://mirror.iscas.ac.cn/ubuntu/ jammy-proposed main restricted universe multiverse # # deb-src https://mirror.iscas.ac.cn/ubuntu/ jammy-proposed main restricted universe multiverse EOF ``` # 清华源 ## 方法一 ```bash # 默认注释了源码镜像以提高 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 https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-security main restricted universe multiverse # # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-security 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 ``` ## 方法二 ```bash cat <<'EOF' > /etc/apt/sources.list # 默认注释了源码镜像以提高 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 https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-security main restricted universe multiverse # # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-security 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 EOF ``` # 更新 ```bash sodo apt update sudo apt upgrade ``` 最后修改:2023 年 11 月 27 日 © 允许规范转载 打赏 赞赏作者 支付宝微信 赞 如果觉得我的文章对你有用,请随意赞赏