前言
实现一键替换在线源
一键更新源
- ubuntu 全球镜像站
- 以下支持现有ubuntu 20,22,24
echo "Delete the default source"
rm -rf /etc/apt/sources.listecho "Build a new source"
cat <<'EOF'>>/etc/apt/sources.list.d/ubuntu.sources
Types: deb
URIs: http://mirrors.aliyun.com/ubuntu
Suites: noble noble-updates noble-backports
Components: main restricted universe multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpgTypes: deb
URIs: http://security.ubuntu.com/ubuntu/
Suites: noble-security
Components: main restricted universe multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
EOFecho "update source"
apt update