2024年9月更新:
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\ndeb http://deb.debian.org/debian/ buster-updates main\ndeb-src http://deb.debian.org/debian/ buster-updates main\ndeb http://archive.debian.org/debian buster-backports main" > /etc/apt/sources.list;cat /etc/apt/sources.list;apt-get update;
——————————————————————————————————————————
Debian10更新源经常出问题,一键切换回官方源
cp -r /etc/apt/sources.list /etc/apt/sources.list.bak;echo -e "deb http://deb.debian.org/debian/ buster main contrib non-free\ndeb-src http://deb.debian.org/debian/ buster main contrib non-free\ndeb http://deb.debian.org/debian/ buster-updates main contrib non-free\ndeb-src http://deb.debian.org/debian/ buster-updates main contrib non-free\ndeb http://deb.debian.org/debian/ buster-backports main contrib non-free\ndeb-src http://deb.debian.org/debian/ buster-backports main contrib non-free\ndeb http://deb.debian.org/debian-security/ buster/updates main contrib non-free\ndeb-src http://deb.debian.org/debian-security/ buster/updates main contrib non-free" > /etc/apt/sources.list;cat /etc/apt/sources.list;apt-get update;
如果出现 Repository 'http://security.debian.org/debian-security buster/updates InRelease' changed its 'Suite' value from 'stable' to 'oldstable'
等类似的提示,输入以下命令解决
sudo apt-get --allow-releaseinfo-change update
如果出现 `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,按以下方法解决
sudo 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
如果出现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
,然后再按上面的解决方案就行了,最后记得更新一下系统看看:apt-get update