跳转至

apt

Abstract

apt 是 Debian 系 Linux 系统中用于管理软件包的高级包管理工具。

Info

适用于使用 apt 的常见系统,以下命令基本都能正常工作。

好消息是,几乎所有镜像站都至少支持 Debian 和 Ubuntu 系统。但,若你使用的系统未被某镜像站收录,则无法使用该镜像源。

Bash
sed -i 's@https\?://[^/]*@https://mirror.sjtu.edu.cn@g' /etc/apt/sources.list && apt update
Bash - 使用 sudo
sudo sed -i 's@https\?://[^/]*@https://mirror.sjtu.edu.cn@g' /etc/apt/sources.list && sudo apt update

适用于 DEB822 格式

通常来说,对于 Debian 12 (bookworm) 及后续版本的👉 容器镜像 👈(Docker Image 之类的),才需要使用以下命令。

Bash
sed -i 's@https\?://deb.debian.org@https://mirror.sjtu.edu.cn@g' /etc/apt/sources.list.d/debian.sources && apt update
Bash
sed -i 's@https\?://[^/]*@https://mirrors.tuna.tsinghua.edu.cn@g' /etc/apt/sources.list && apt update
Bash - 使用 sudo
sudo sed -i 's@https\?://[^/]*@https://mirrors.tuna.tsinghua.edu.cn@g' /etc/apt/sources.list && sudo apt update

适用于 DEB822 格式

通常来说,对于 Debian 12 (bookworm) 及后续版本的👉 容器镜像 👈(Docker Image 之类的),才需要使用以下命令。

Bash
sed -i 's@https\?://deb.debian.org@https://mirrors.tuna.tsinghua.edu.cn@g' /etc/apt/sources.list.d/debian.sources && apt update
Bash
sed -i 's@https\?://[^/]*@https://mirror.nju.edu.cn@g' /etc/apt/sources.list && apt update
Bash - 使用 sudo
sudo sed -i 's@https\?://[^/]*@https://mirror.nju.edu.cn@g' /etc/apt/sources.list && sudo apt update

适用于 DEB822 格式

通常来说,对于 Debian 12 (bookworm) 及后续版本的👉 容器镜像 👈(Docker Image 之类的),才需要使用以下命令。

Bash
sed -i 's@https\?://deb.debian.org@https://mirror.nju.edu.cn@g' /etc/apt/sources.list.d/debian.sources && apt update
Bash
sed -i 's@https\?://[^/]*@https://mirrors.ustc.edu.cn@g' /etc/apt/sources.list && apt update
Bash - 使用 sudo
sudo sed -i 's@https\?://[^/]*@https://mirrors.ustc.edu.cn@g' /etc/apt/sources.list && sudo apt update

适用于 DEB822 格式

通常来说,对于 Debian 12 (bookworm) 及后续版本的👉 容器镜像 👈(Docker Image 之类的),才需要使用以下命令。

Bash
sed -i 's@https\?://deb.debian.org@https://mirrors.ustc.edu.cn@g' /etc/apt/sources.list.d/debian.sources && apt update
Bash
sed -i 's@https\?://[^/]*@https://mirror.sdu.edu.cn@g' /etc/apt/sources.list && apt update
Bash - 使用 sudo
sudo sed -i 's@https\?://[^/]*@https://mirror.sdu.edu.cn@g' /etc/apt/sources.list && sudo apt update

适用于 DEB822 格式

通常来说,对于 Debian 12 (bookworm) 及后续版本的👉 容器镜像 👈(Docker Image 之类的),才需要使用以下命令。

Bash
sed -i 's@https\?://deb.debian.org@https://mirror.sdu.edu.cn@g' /etc/apt/sources.list.d/debian.sources && apt update
Bash
sed -i 's@https\?://[^/]*@https://mirror.lzu.edu.cn@g' /etc/apt/sources.list && apt update
Bash - 使用 sudo
sudo sed -i 's@https\?://[^/]*@https://mirror.lzu.edu.cn@g' /etc/apt/sources.list && sudo apt update

适用于 DEB822 格式

通常来说,对于 Debian 12 (bookworm) 及后续版本的👉 容器镜像 👈(Docker Image 之类的),才需要使用以下命令。

Bash
sed -i 's@https\?://deb.debian.org@https://mirror.lzu.edu.cn@g' /etc/apt/sources.list.d/debian.sources && apt update
Bash
sed -i 's@https\?://[^/]*@https://repo.huaweicloud.com@g' /etc/apt/sources.list && apt update
Bash - 使用 sudo
sudo sed -i 's@https\?://[^/]*@https://repo.huaweicloud.com@g' /etc/apt/sources.list && sudo apt update

适用于 DEB822 格式

通常来说,对于 Debian 12 (bookworm) 及后续版本的👉 容器镜像 👈(Docker Image 之类的),才需要使用以下命令。

Bash
sed -i 's@https\?://deb.debian.org@https://repo.huaweicloud.com@g' /etc/apt/sources.list.d/debian.sources && apt update
Bash
sed -i 's@https\?://[^/]*@https://mirrors.aliyun.com@g' /etc/apt/sources.list && apt update
Bash - 使用 sudo
sudo sed -i 's@https\?://[^/]*@https://mirrors.aliyun.com@g' /etc/apt/sources.list && sudo apt update

适用于 DEB822 格式

通常来说,对于 Debian 12 (bookworm) 及后续版本的👉 容器镜像 👈(Docker Image 之类的),才需要使用以下命令。

Bash
sed -i 's@https\?://deb.debian.org@https://mirrors.aliyun.com@g' /etc/apt/sources.list.d/debian.sources && apt update
Bash
sed -i 's@https\?://[^/]*@https://mirrors.xtom.com.hk@g' /etc/apt/sources.list && apt update
Bash - 使用 sudo
sudo sed -i 's@https\?://[^/]*@https://mirrors.xtom.com.hk@g' /etc/apt/sources.list && sudo apt update

地區限定

🌏 僅推薦位於 🇭🇰 中國香港特別行政區 的使用者使用。

其他地区的用户可能无法访问。

适用于 DEB822 格式

通常来说,对于 Debian 12 (bookworm) 及后续版本的👉 容器镜像 👈(Docker Image 之类的),才需要使用以下命令。

Bash
sed -i 's@https\?://deb.debian.org@https://mirrors.xtom.com.hk@g' /etc/apt/sources.list.d/debian.sources && apt update