事件起因 : 想安装xrdp发现无法使用apt安装,然后更新发现更新失败,进而想到修改为国内源,修改源以后 发现报错如下:
root@bogon:/etc/apt# apt-get update && apt-get upgrade && apt-get dist-upgrade
Ign:1 http://mirrors.ustc.edu.cn/kali kali InRelease
Ign:2 http://mirrors.ustc.edu.cn/kali-security kali/updates InRelease
Err:3 http://mirrors.ustc.edu.cn/kali kali Release
404 Not Found [IP: 218.104.71.170 80]
Err:4 http://mirrors.ustc.edu.cn/kali-security kali/updates Release
404 Not Found [IP: 218.104.71.170 80]
Reading package lists... Done
E: The repository 'http://mirrors.ustc.edu.cn/kali kali Release' does not have a Release file.
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.
E: The repository 'http://mirrors.ustc.edu.cn/kali-security kali/updates Release' does not have a Release file.
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.
![](http://i2.51cto.com/102?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_30,g_se,x_10,y_10,shadow_20,type_ZmFuZ3poZW5naGVpdGk=)
解决方案
通过百度 发现可以修改为如下: 参考://docs.kali.org/general-use/kali-linux-sources-list-repositories
编辑apt-get远程源文件
vim /etc/apt/sources-list
注释掉所有的,然后添加下面两条:
deb http://http.kali.org/kali kali-rolling main contrib non-free
deb http://old.kali.org/kali sana main non-free contrib
再次更新效果如下: 【已经可以更新】
root@bogon:/etc/apt# apt-get update
Get:1 http://mirrors.neusoft.edu.cn/kali kali-rolling InRelease [30.5 kB]
Get:2 http://old.kali.org/kali sana InRelease [20.3 kB]
Get:3 http://mirrors.neusoft.edu.cn/kali kali-rolling/main amd64 Packages [15.6 MB]
Get:4 http://old.kali.org/kali sana/main amd64 Packages [12.8 MB]
Get:5 http://mirrors.neusoft.edu.cn/kali kali-rolling/contrib amd64 Packages [112 kB]
Get:6 http://mirrors.neusoft.edu.cn/kali kali-rolling/non-free amd64 Packages [165 kB]
Get:7 http://old.kali.org/kali sana/non-free amd64 Packages [163 kB]
Get:8 http://old.kali.org/kali sana/contrib amd64 Packages [87.7 kB]
Fetched 29.0 MB in 10min 44s (45.0 kB/s)
Reading package lists... Done
更新命令:
apt-get update && apt-get upgrade && apt-get dist-upgrade
问题二:
无法更新源第二种问题:
root@Sec:~# apt-get update --fix-missing
Ign:1 http://repo.mongodb.org/apt/debian wheezy/mongodb-org/3.0 InRelease
Hit:3 http://repo.mongodb.org/apt/debian wheezy/mongodb-org/3.0 Release
Get:2 http://mirrors.neusoft.edu.cn/kali kali-rolling InRelease [30.5 kB]
Hit:5 http://old.kali.org/kali sana InRelease
Err:2 http://mirrors.neusoft.edu.cn/kali kali-rolling InRelease
The following signatures were invalid: EXPKEYSIG ED444FF07D8D0BF6 Kali Linux Repository <devel@kali.org>
Err:5 http://old.kali.org/kali sana InRelease
The following signatures were invalid: EXPKEYSIG ED444FF07D8D0BF6 Kali Linux Repository <devel@kali.org>
Fetched 30.5 kB in 1s (19.9 kB/s)
Reading package lists... Done
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://mirrors.neusoft.edu.cn/kali kali-rolling InRelease: The following signatures were invalid: EXPKEYSIG ED444FF07D8D0BF6 Kali Linux Repository <devel@kali.org>
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://old.kali.org/kali sana InRelease: The following signatures were invalid: EXPKEYSIG ED444FF07D8D0BF6 Kali Linux Repository <devel@kali.org>
W: Failed to fetch http://http.kali.org/kali/dists/kali-rolling/InRelease The following signatures were invalid: EXPKEYSIG ED444FF07D8D0BF6 Kali Linux Repository <devel@kali.org>
W: Failed to fetch http://old.kali.org/kali/dists/sana/InRelease The following signatures were invalid: EXPKEYSIG ED444FF07D8D0BF6 Kali Linux Repository <devel@kali.org>
W: Some index files failed to download. They have been ignored, or old ones used instead.
经过百度发现是key过期了 需要重新添加,执行如下命令: **root@Sec:~# wget -q -O - https://archive.kali.org/archive-key.asc | apt-key add **
再次更新发现恢复正常
root@Sec:~# apt-get update --fix-missing
Ign:1 http://repo.mongodb.org/apt/debian wheezy/mongodb-org/3.0 InRelease
Hit:2 http://old.kali.org/kali sana InRelease
Hit:4 http://repo.mongodb.org/apt/debian wheezy/mongodb-org/3.0 Release
Get:3 http://mirrors.neusoft.edu.cn/kali kali-rolling InRelease [30.5 kB]
Get:6 http://mirrors.neusoft.edu.cn/kali kali-rolling/main amd64 Packages [16.0 MB]
Get:7 http://mirrors.neusoft.edu.cn/kali kali-rolling/contrib amd64 Packages [101 kB]
Get:8 http://mirrors.neusoft.edu.cn/kali kali-rolling/non-free amd64 Packages [166 kB]
Fetched 16.3 MB in 18s (884 kB/s)
Reading package lists... Done