旧debian更新源

debian在今年8月已经发布了debian11,而很多主机的版本还是10.3,在更新是会提示找不到源无法更新,可以修改/ect/apt/source.list里面的源地址来继续更新。(这里是阿里云的源)

deb http://mirrors.aliyun.com/debian/ buster main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ buster main non-free contrib
deb http://mirrors.aliyun.com/debian-security buster/updates main
deb-src http://mirrors.aliyun.com/debian-security buster/updates main
deb http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib
deb http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib

除了系统,PHP,mariadb这些程序在使用一段时间后也可能会出现过期无法更新的问题。需要使用apt-key来更新OpenPGP key. apt-key的选项有:

apt-key add <file>          - add the key contained in <file> ('-' for stdin)
  apt-key del <keyid>         - remove the key <keyid>
  apt-key export <keyid>      - output the key <keyid>
  apt-key exportall           - output all trusted keys
  apt-key update              - update keys using the keyring package
  apt-key net-update          - update keys using the network
  apt-key list                - list keys
  apt-key finger              - list fingerprints
  apt-key adv                 - pass advanced options to gpg (download key)

首先需要在官网上去下载最新的GPG文件,再用上面这些来添加进souce.list里面。mariaDB最新的版本是10.7 ,在这里下载更新

关于key失效也可以看这里。关于dirmngr文件夹找不到,可以看这里debian上的PHP版本更新看这里,包括GPG文件。

source.list

一些VPS主机只提供精简版OS,这样子在apt-get一些程序时候会提示找不到等等错误
最好的解决办法就是更改/etc/apt下面的source.list文件
今天一台debian8 64bit mini版本的主机安装mariaDB时候折腾半天,总是提示“无法找到版本” 继续阅读“source.list”

如何解决Ubuntu系统更新时找不到源的错误

使用apt-get命令安装、更新是ubuntu/debian系统维护中的经常性工作,可是,有时候想要使用apt-get install安装一个功能时却会发现404错误,也就是找不到源文件
这一错误的原因就是,ubuntu/debian的版本支持一般只有9个月,而TLS版本可以长达5年,那么,如果你不想升级版本,那一些源文件可能会找不到。
解决的办法也很简单,就是更新系统的source.list文件,使得更新源域名改为old-releases.ubuntu.com 再运行apt-get update就可以正常更新了。

详细教程在这里!