添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

/etc/apt/sources.list中默认的源为如下:

deb mirror://debian.moxa.com/debian/mirrors stretch main contrib non-free deb http://deb.debian.org/debian stretch main contrib non-free deb-src http://deb.debian.org/debian stretch main contrib non-free deb http://deb.debian.org/debian stretch-updates main contrib non-free deb-src http://deb.debian.org/debian stretch-updates main contrib non-free deb http://deb.debian.org/debian stretch-backports main contrib non-free deb-src http://deb.debian.org/debian stretch-backports main contrib non-free deb http://security.debian.org/ stretch/updates main contrib non-free deb-src http://security.debian.org/ stretch/updates main contrib non-free

执行sudo apt-get update会出现下面报错:

Err:39 http://mirrors.163.com/debian stretch-backports/contrib Sources
  404  Not Found
Ign:40 http://mirrors.163.com/debian stretch-backports/main Sources
Ign:41 http://mirrors.163.com/debian stretch-backports/non-free Sources
Ign:42 http://mirrors.163.com/debian stretch-backports/main all Packages
Ign:43 http://mirrors.163.com/debian stretch-backports/main armhf Packages
Ign:44 http://mirrors.163.com/debian stretch-backports/main Translation-en
Ign:45 http://mirrors.163.com/debian stretch-backports/main Translation-en_US
Ign:46 http://mirrors.163.com/debian stretch-backports/non-free all Packages
Ign:47 http://mirrors.163.com/debian stretch-backports/non-free armhf Packages
Ign:48 http://mirrors.163.com/debian stretch-backports/non-free Translation-en_US
Ign:49 http://mirrors.163.com/debian stretch-backports/non-free Translation-en
Err:54 http://mirrors.163.com/debian-security stretch/updates/contrib Sources
  404  Not Found
Ign:55 http://mirrors.163.com/debian-security stretch/updates/main Sources
Ign:56 http://mirrors.163.com/debian-security stretch/updates/non-free Sources
Ign:57 http://mirrors.163.com/debian-security stretch/updates/main armhf Packages
Ign:58 http://mirrors.163.com/debian-security stretch/updates/main all Packages
Ign:59 http://mirrors.163.com/debian-security stretch/updates/main Translation-en
Ign:60 http://mirrors.163.com/debian-security stretch/updates/main Translation-en_US
Ign:61 http://mirrors.163.com/debian-security stretch/updates/non-free armhf Packages
Ign:62 http://mirrors.163.com/debian-security stretch/updates/non-free all Packages
Ign:63 http://mirrors.163.com/debian-security stretch/updates/non-free Translation-en
Ign:64 http://mirrors.163.com/debian-security stretch/updates/non-free Translation-en_US
Reading package lists... Done
W: The repository 'http://mirrors.163.com/debian stretch Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: The repository 'http://mirrors.163.com/debian stretch-updates Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: The repository 'http://mirrors.163.com/debian stretch-backports Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: The repository 'http://mirrors.163.com/debian-security stretch/updates Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: Failed to fetch http://mirrors.163.com/debian/dists/stretch/main/source/Sources  404  Not Found
E: Failed to fetch http://mirrors.163.com/debian/dists/stretch-updates/contrib/source/Sources  404  Not Found
E: Failed to fetch http://mirrors.163.com/debian/dists/stretch-backports/contrib/source/Sources  404  Not Found
E: Failed to fetch http://mirrors.163.com/debian-security/dists/stretch/updates/contrib/source/Sources  404  Not Found
E: Some index files failed to download. They have been ignored, or old ones used instead.

        根据下面的E: N: W:报出的错误,以及上面的ign:相关信息,在整个网络上搜索了各种解决办法,其中绝大部分都是让替换源,以及修改DNS等等的,都没有解决问题。最终将目光锁定在了每个源都会出现的404上面,根据仅有的一点前端知识,加上一顿胡乱分析,猜测可能debian 9的源已经停止维护了。

        然后仔细一搜索发现果然如此。

         然后发现之前不断尝试更换各种源,以及各种修改DNS之类操作的文章以及教程,他们的发布时间都是在2022年以前,然后我真的是恍然大悟,原来不是别人教程错了,而是他们的教程已经过期了。

        从2023年4月23日起,debian9的源包地址更换至新地址。

        新地址如下:

deb http://archive.debian.org/debian/ stretch main contrib non-free
deb-src http://archive.debian.org/debian/ stretch main contrib non-free
deb http://archive.debian.org/debian-security/ stretch/updates main contrib non-free
deb-src http://archive.debian.org/debian-security/ stretch/updates main contrib non-free
deb http://archive.debian.org/debian/ stretch-backports main contrib non-free

        将上面内容替换到/etc/apt/sources.list中,然后执行sudo apt-get update即可。

最终终于完成了安装包更新,然后就可以随便安装需要的工具软件了。

root@Moxa:~# vi /etc/apt/sources.list
root@Moxa:~# ls
root@Moxa:~# apt-get update
Ign:1 http://archive.debian.org/debian stretch InRelease
Get:2 http://archive.debian.org/debian-security stretch/updates InRelease [59.1 kB]
Get:3 http://archive.debian.org/debian stretch-backports InRelease [78.5 kB]
Get:4 http://archive.debian.org/debian stretch Release [118 kB]
Get:5 http://archive.debian.org/debian-security stretch/updates/contrib Sources [1,384 B]
Get:6 http://archive.debian.org/debian-security stretch/updates/main Sources [413 kB]
Get:7 http://archive.debian.org/debian-security stretch/updates/non-free Sources [3,568 B]
Get:8 http://archive.debian.org/debian-security stretch/updates/main armhf Packages [758 kB]
Get:9 http://archive.debian.org/debian-security stretch/updates/main Translation-en [368 kB]                                                                                                                 
Get:10 http://archive.debian.org/debian-security stretch/updates/contrib armhf Packages [1,764 B]                                                                                                            
Get:11 http://archive.debian.org/debian-security stretch/updates/contrib Translation-en [1,759 B]                                                                                                            
Get:12 http://archive.debian.org/debian-security stretch/updates/non-free armhf Packages [5,320 B]                                                                                                           
Get:13 http://archive.debian.org/debian-security stretch/updates/non-free Translation-en [21.3 kB]                                                                                                           
Get:14 http://archive.debian.org/debian stretch Release.gpg [3,177 B]                                                                                                                                        
Get:15 http://archive.debian.org/debian stretch-backports/main armhf Packages [600 kB]                                                                                                                       
Get:16 http://archive.debian.org/debian stretch-backports/main Translation-en [467 kB]                                                                                                                       
Get:17 http://archive.debian.org/debian stretch-backports/contrib armhf Packages [8,964 B]                                                                                                                   
Get:18 http://archive.debian.org/debian stretch-backports/contrib Translation-en [7,237 B]                                                                                                                   
Get:19 http://archive.debian.org/debian stretch-backports/non-free armhf Packages [14.2 kB]                                                                                                                  
Get:20 http://archive.debian.org/debian stretch-backports/non-free Translation-en [38.5 kB]                                                                                                                  
Get:21 http://archive.debian.org/debian stretch/main Sources [6,736 kB]                                                                                                                                      
Get:22 http://archive.debian.org/debian stretch/non-free Sources [79.1 kB]                                                                                                                                   
Get:23 http://archive.debian.org/debian stretch/contrib Sources [44.5 kB]                                                                                                                                    
Get:24 http://archive.debian.org/debian stretch/main armhf Packages [6,908 kB]                                                                                                                               
Get:25 http://archive.debian.org/debian stretch/main Translation-en [5,377 kB]                                                                                                                               
Get:26 http://archive.debian.org/debian stretch/contrib armhf Packages [41.8 kB]                                                                                                                             
Get:27 http://archive.debian.org/debian stretch/contrib Translation-en [45.8 kB]                                                                                                                             
Get:28 http://archive.debian.org/debian stretch/non-free armhf Packages [59.8 kB]                                                                                                                            
Get:29 http://archive.debian.org/debian stretch/non-free Translation-en [80.2 kB]                                                                                                                            
Fetched 22.3 MB in 58s (383 kB/s)                                                                                                                                                                            
Reading package lists... Done
                                    错误:1 http://security.debian.org/debian-security stretch/updates/main amd64 poppler-utils amd64 0.48.0-2+deb9u4。
                                    “E: The repository ‘http://xxx Release‘ does not have a Release file.”以及“E: Problem executing scripts APT::Update::Post-Invoke-Success 'if /usr/bin/test -w /var/cache/app-info -a -e /usr/bin/appstreamcli; then appstreamcli refresh-cache > /dev/null; fi'”
                                    错误如下:
W: GPG error: http://mirrors.163.com/debian buster-updates InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 648ACFD622F3D138 NO_PUBKEY 0E98404D386FA1D9
                                    最近在在下载一个依赖包的时候,出现了网络源无法使用的问题,解决方法是update。
当我尝试sudo apt-get install指令下载curl时,出现下图问题Failed to fetch一个网址。
sudo apt-get update
然后继续下载就可以了
创建了一个docker,但是vim等基础命令都没有安装,使用apt-get update命令更新源出现如下报错
root@26eac251281c:/var/lib/apt#  apt-get update
Get:1 http://mirrors.sohu.com precise-updates InRelease [8 B]
Ign http://mirrors.sohu.com precise InRelease                 
在新安装的Ubuntu上,我在使用sudo apt-get update更新时,出现如下错误:
W: GPG error: http://mirrors.163.com/debian wheezy-proposed-updates InRelease: The following signatures couldn't be verified because the public key
在网上搜索解决方案后,尝试将原本的软件源换位与debian版本相适配的阿里源或者是清华源。具体方法就是将
/etc/apt/source.list
中的网址更换为阿里源或者清华源的地址,此