ubuntu 20.04更新错误:403 Sorry, not allowed to fetch that type of file

分享于 

8分钟阅读

ubuntu

  繁體

问题:

使用apt-cacher时,Ubuntu 20.04遇到了问题。我看到不允许获取某种类型文件的错误:


admin7@template:~# apt-get update


Hit:1 http://archive.ubuntu.com/ubuntu focal InRelease


Get:2 http://archive.ubuntu.com/ubuntu focal-updates InRelease [107 kB]


Get:3 http://archive.ubuntu.com/ubuntu focal-backports InRelease [98.3 kB]


Get:4 http://archive.ubuntu.com/ubuntu focal-security InRelease [107 kB]


Get:5 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [147 kB]


Get:6 http://archive.ubuntu.com/ubuntu focal-updates/main Translation-en [54.8 kB]


Get:7 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 c-n-f Metadata [3560 B]


Get:7 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 c-n-f Metadata [3560 B]


Get:7 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 c-n-f Metadata [3560 B]


Get:7 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 c-n-f Metadata [3560 B]


Get:7 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 c-n-f Metadata [3560 B]


Get:7 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 c-n-f Metadata [3560 B]


Ign:7 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 c-n-f Metadata


Get:14 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 c-n-f Metadata [2608 B]


Get:14 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 c-n-f Metadata [2608 B]


Ign:14 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 c-n-f Metadata


Ign:17 http://archive.ubuntu.com/ubuntu focal-backports/universe amd64 c-n-f Metadata


Ign:7 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 c-n-f Metadata


Ign:14 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 c-n-f Metadata


Ign:17 http://archive.ubuntu.com/ubuntu focal-backports/universe amd64 c-n-f Metadata


Ign:7 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 c-n-f Metadata


Ign:14 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 c-n-f Metadata


Ign:17 http://archive.ubuntu.com/ubuntu focal-backports/universe amd64 c-n-f Metadata


Err:7 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 c-n-f Metadata


 403 Sorry, not allowed to fetch that type of file: caa2bcaedd682ba4d80d0710baf3d9fc5e451692820011530d55b767636e4c34 [IP: 10.1.2.3 3142]


Ign:14 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 c-n-f Metadata


Err:17 http://archive.ubuntu.com/ubuntu focal-backports/universe amd64 c-n-f Metadata


 403 Sorry, not allowed to fetch that type of file: 925b094241232d03a4765ecf2eadf174dfa8838476e49191e2f0d8e33980c953 [IP: 10.1.2.3 3142]


Get:18 http://archive.ubuntu.com/ubuntu focal-security/main amd64 Packages [89.4 kB]


Get:19 http://archive.ubuntu.com/ubuntu focal-security/main Translation-en [33.9 kB]


Get:20 http://archive.ubuntu.com/ubuntu focal-security/main amd64 c-n-f Metadata [2384 B]


Get:20 http://archive.ubuntu.com/ubuntu focal-security/main amd64 c-n-f Metadata [2384 B]


Get:20 http://archive.ubuntu.com/ubuntu focal-security/main amd64 c-n-f Metadata [2384 B]


Get:20 http://archive.ubuntu.com/ubuntu focal-security/main amd64 c-n-f Metadata [2384 B]


Get:20 http://archive.ubuntu.com/ubuntu focal-security/main amd64 c-n-f Metadata [2384 B]


Get:20 http://archive.ubuntu.com/ubuntu focal-security/main amd64 c-n-f Metadata [2384 B]


Ign:20 http://archive.ubuntu.com/ubuntu focal-security/main amd64 c-n-f Metadata


Ign:27 http://archive.ubuntu.com/ubuntu focal-security/universe amd64 c-n-f Metadata


Ign:20 http://archive.ubuntu.com/ubuntu focal-security/main amd64 c-n-f Metadata


Ign:27 http://archive.ubuntu.com/ubuntu focal-security/universe amd64 c-n-f Metadata


Ign:20 http://archive.ubuntu.com/ubuntu focal-security/main amd64 c-n-f Metadata


Ign:27 http://archive.ubuntu.com/ubuntu focal-security/universe amd64 c-n-f Metadata


Err:20 http://archive.ubuntu.com/ubuntu focal-security/main amd64 c-n-f Metadata


 403 Sorry, not allowed to fetch that type of file: 8d1b06044b073a6d834a31b177e3da5028e29170ea7aacab20143e2a516ee602 [IP: 10.1.2.3 3142]


Ign:27 http://archive.ubuntu.com/ubuntu focal-security/universe amd64 c-n-f Metadata


Fetched 312 kB in 2s (133 kB/s)


Reading package lists... Done


E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal-updates/main/cnf/Commands-amd64 403 Sorry, not allowed to fetch that type of file: caa2bcaedd682ba4d80d0710baf3d9fc5e451692820011530d55b767636e4c34 [IP: 10.1.2.3 3142]


E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal-backports/universe/cnf/Commands-amd64 403 Sorry, not allowed to fetch that type of file: 925b094241232d03a4765ecf2eadf174dfa8838476e49191e2f0d8e33980c953 [IP: 10.1.2.3 3142]


E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal-security/main/cnf/Commands-amd64 403 Sorry, not allowed to fetch that type of file: 8d1b06044b073a6d834a31b177e3da5028e29170ea7aacab20143e2a516ee602 [IP: 10.1.2.3 3142]


E: Some index files failed to download. They have been ignored, or old ones used instead.



我看到很多文章抱怨类似的问题,他们几乎总是通过编辑package_files_regexp设置来解决,有办法编辑package_files_regexp以便允许这些十六进制字符串?


答案1:

这三个网站不存在。


E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal-updates/main/cnf/Commands-amd64 403 Sorry, not allowed to fetch that type of file: caa2bcaedd682ba4d80d0710baf3d9fc5e451692820011530d55b767636e4c34 [IP: 10.1.2.3 3142]


E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal-backports/universe/cnf/Commands-amd64 403 Sorry, not allowed to fetch that type of file: 925b094241232d03a4765ecf2eadf174dfa8838476e49191e2f0d8e33980c953 [IP: 10.1.2.3 3142]


E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal-security/main/cnf/Commands-amd64 403 Sorry, not allowed to fetch that type of file: 8d1b06044b073a6d834a31b177e3da5028e29170ea7aacab20143e2a516ee602 [IP: 10.1.2.3 3142]



当试图在web浏览器中打开的网页(或者其他资源)是不允许访问的资源时,会发生403禁止错误,它称为403错误,因为这是web服务器用来描述此类错误的HTTP状态代码。


答案2:

某些索引文件无法下载,

我进入apt-cacher配置文件并临时设置:

index_files_regexp = ^(.* ) 

apt-get update现在可以在Ubuntu 20.04主机上工作,这是一个临时的解决方法。



文件  type  Ubuntu  Fetch  APT