Debian一键换源

admin
2023-11-26 / 0 评论 / 44 阅读 / 正在检测是否收录...

一键切换国内源

网站教程:网站:https://linuxmirrors.cn/

开源:开源:https://github.com/SuperManito/LinuxMirrors

bash <(curl -sSL https://linuxmirrors.cn/main.sh)

海外使用:

bash <(curl -sSL https://linuxmirrors.cn/main.sh) --abroad 

一键安装Docker:

bash <(curl -sSL https://linuxmirrors.cn/docker.sh)

一键切换官方源

cp -r /etc/apt/sources.list /etc/apt/sources.list.bak;echo -e "deb http://deb.debian.org/debian buster main\ndeb-src http://deb.debian.org/debian buster main\ndeb http://security.debian.org/debian-security buster/updates main\ndeb-src http://security.debian.org/debian-security buster/updates main" > /etc/apt/sources.list;cat /etc/apt/sources.list;apt-get update;

如果出现问题:

1、Repository 'http://security.debian.org/debian-security buster/updates InRelease' changed its 'Suite' value from 'stable' to 'oldstable'

apt-get --allow-releaseinfo-change update

2、GPG error: http://deb.debian.org/debian buster-backports InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0E98404D386FA1D9 NO_PUBKEY 6ED0E7B82643E131

E: The repository 'http://deb.debian.org/debian buster-backports InRelease' is not signed.

说明仓库没有签名,缺PUBKEY,按以下方法解决

apt-key adv --keyserver keyserver.ubuntu.com --recv-keys <PUB_KEY1>  <PUB_KEY2>……

比如上面那个就可以这样:sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0E98404D386FA1D9 6ED0E7B82643E131

3、添加PUBKEY时提示,gpg: failed to start the dirmngr `'/usr/bin/dirmngr'`: No such file or directory

我们只需要在系统上安装dirmngr包

apt install dirmngr --install-recommends -y

4、如果出现E: gnupg, gnupg2 and gnupg1 do not seem to be installed, but one of them is required for this operation 那你还需要先装个gnupg

apt-get install gnupg -y
0

评论

博主关闭了所有页面的评论