sudo apt install -y netselect-apt \
&& sudo netselect-apt \
&& sudo apt autoremove -y netselect-apt \
&& rm -f sources.list
The fastest 10 servers seem to be:
http://mirrors.bfsu.edu.cn/debian/
http://mirrors.tuna.tsinghua.edu.cn/debian/
http://mirrors.neusoft.edu.cn/debian/
http://mirrors.jlu.edu.cn/debian/
http://ftp.cn.debian.org/debian/
http://debian.cs.nycu.edu.tw/debian/
http://mirror.i3d.net/debian/
http://mirrors.163.com/debian/
http://mirror.bizflycloud.vn/debian/
http://ftp.kaist.ac.kr/debian/
Of the hosts tested we choose the fastest valid for http:
http://mirrors.bfsu.edu.cn/debian/
Writing sources.list.
Done.
# PVE QEMU debian-12-generic-amd64.qcow2
# echo 'http://mirrors.bfsu.edu.cn/debian/' | sudo tee /etc/apt/mirrors/debian.list
# echo 'http://mirrors.bfsu.edu.cn/debian-security/' | sudo tee -a /etc/apt/mirrors/debian-security.list
sed -i -e "s/deb.debian.org/mirrors.bfsu.edu.cn/" /etc/apt/mirrors/debian.list
sed -i -e "s/deb.debian.org/mirrors.bfsu.edu.cn/" /etc/apt/mirrors/debian-security.list
# PVE LXC debian-12-standard_12.7-1_amd64.tar.zst
sed -i -e "s/deb.debian.org/mirrors.bfsu.edu.cn/" /etc/apt/sources.list
sed -i -e "s/security.debian.org/mirrors.bfsu.edu.cn\/debian-serurity/" /etc/apt/sources.list
# Docker imaage debian:12
sed -i -e "s/deb.debian.org/mirrors.bfsu.edu.cn/" /etc/apt/sources.list.d/debian.sources
# 启用非自由仓库
sed -i 's/main$/main contrib non-free non-free-firmware/' /etc/apt/sources.list
# update
apt update
# 查询软件包版本信息、优先级和来源
apt policy <package_name>
apt-cache policy <package_name>
# 安装指定版本的包
apt install <package_name>=<version_number>
yum repolist
# 显示所有仓库
yum repolist all
# 显示所有启动的仓库
yum repolist enabled
# 显示所有禁用的仓库
yum repolist disabled
最常用的修改操作就是启动和停用, 可以使用以下命令实现: