Debian软件包稳定版、测试版、不稳定版源配置方法
在日常使用中Debian默认版本需要更新软件时，默认都是稳定版，如果需要使用测试版、不稳定版需要手工配置一下源。具体方法如下： 1、修改source.list文件： ```csharp nano /etc/ap/sources.list ``` #####稳定版 ```csharp deb http://deb.debian.org/debian/ stable main deb-src http://deb.debian.org/debian/ stable main ``` #####测试版 ```csharp deb http://deb.debian.org/debian/ testing main deb-src http://deb.debian.org/debian/ testing main ``` #####不稳定版 ```csharp deb http://deb.debian.org/debian/ unstable main deb-src http://deb.debian.org/debian/ unstable main ``` 2、修改完毕后更新源： ```csharp apt update ``` 如果出现一下错误： ```csharp Get:1 http://deb.debian.org/debian unstable InRelease [205 kB] Err:1 http://deb.debian.org/debian unstable InRelease The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0E98404D386FA1D9 NO_PUBKEY 6ED0E7B82643E131 Reading package lists... Done W: GPG error: http://deb.debian.org/debian unstable 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 unstable InRelease' is not signed. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details. ``` 就需要安装一下公钥 ```csharp apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0E98404D386FA1D9 apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 6ED0E7B82643E131 ``` 如果公钥安装报错： ```csharp Executing: /tmp/apt-key-gpghome.ylb9UTkVw4/gpg.1.sh --keyserver keyserver.ubuntu.com --recv-keys 0E98404D386FA1D9 gpg: failed to start the dirmngr '/usr/bin/dirmngr': No such file or directory gpg: connecting dirmngr at '/run/user/0/gnupg/d.iyg1165fg6i4xtaqpoaig85b/S.dirmngr' failed: No such file or directory gpg: keyserver receive failed: No dirmngr ``` 那就需要先把源修改为稳定版，然后安装dirmngr，具体方法如下： ```csharp nano /etc/ap/sources.list apt update apt install dirmngr ``` 安装完成后再用命令导入公钥就可以了，最后执行一下 ```csharp apt update ``` 如果需要搜索制定软件，就可以用 ```csharp apt search 软件名称 ```