apt-cacher-ng는 Ubuntu 클라이언트에서 "sudo apt update"에 응답하는 데 몇 가지 문제가 있습니다.

apt-cacher-ng는 Ubuntu 클라이언트에서 "sudo apt update"에 응답하는 데 몇 가지 문제가 있습니다.

Ubuntu 18.04에서는 제대로 작동했지만 Ubuntu 20.04에서는 apt-cacher-ng의 문제는 다음과 같습니다.

$ sudo apt update 
Get:1 http://archive.ubuntu.com/ubuntu focal InRelease [265 kB]
Hit:2 http://security.ubuntu.com/ubuntu focal-security InRelease
Hit:3 http://archive.ubuntu.com/ubuntu focal-updates InRelease                                                                                                                                                                                                                 
Hit:4 http://archive.ubuntu.com/ubuntu focal-backports InRelease                                                                                                                                                                                                               
Ign:5 http://archive.ubuntu.com/ubuntu focal/main amd64 c-n-f Metadata                                                                                                                                                                                                         
Ign:6 http://archive.ubuntu.com/ubuntu focal/universe amd64 Packages
Ign:7 http://archive.ubuntu.com/ubuntu focal/universe i386 Packages
Ign:8 http://archive.ubuntu.com/ubuntu focal/universe Translation-en
Ign:9 http://archive.ubuntu.com/ubuntu focal/universe amd64 c-n-f Metadata
Ign:10 http://archive.ubuntu.com/ubuntu focal/multiverse amd64 c-n-f Metadata
Ign:5 http://archive.ubuntu.com/ubuntu focal/main amd64 c-n-f Metadata
Get:6 http://archive.ubuntu.com/ubuntu focal/universe amd64 Packages [8,600 kB]
Get:7 http://archive.ubuntu.com/ubuntu focal/universe i386 Packages [4,624 kB]                                                                                                                                                                                                 
Get:8 http://archive.ubuntu.com/ubuntu focal/universe Translation-en [5,131 kB]                                                                                                                                                                                                
Get:8 http://archive.ubuntu.com/ubuntu focal/universe Translation-en [5,131 kB]                                                                                                                                                                                                
Ign:9 http://archive.ubuntu.com/ubuntu focal/universe amd64 c-n-f Metadata                                                                                                                                                                                                     
Ign:10 http://archive.ubuntu.com/ubuntu focal/multiverse amd64 c-n-f Metadata                                                                                                                                                                                                  
Ign:5 http://archive.ubuntu.com/ubuntu focal/main amd64 c-n-f Metadata                                                                                                                                                                                                         
Ign:9 http://archive.ubuntu.com/ubuntu focal/universe amd64 c-n-f Metadata                                                                                                                                                                                                     
Ign:10 http://archive.ubuntu.com/ubuntu focal/multiverse amd64 c-n-f Metadata                                                                                                                                                                                                  
Err:5 http://archive.ubuntu.com/ubuntu focal/main amd64 c-n-f Metadata                                                                                                                                                                                                         
  403  Forbidden file type or location [IP: 192.168.17.34 3142]
Ign:9 http://archive.ubuntu.com/ubuntu focal/universe amd64 c-n-f Metadata                                                                                                                                                                                                     
Ign:10 http://archive.ubuntu.com/ubuntu focal/multiverse amd64 c-n-f Metadata                                                                                                                                                                                                  
Fetched 15.2 MB in 1min 15s (203 kB/s)                                                                                                                                                                                                                                         
Reading package lists... Done
E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal/main/cnf/Commands-amd64  403 Forbidden file type or location [IP: 192.168.17.34 3142]
E: Some index files failed to download. They have been ignored, or old ones used instead.

하지만 프록시가 없으면 다음 sudo apt update과 같습니다 .

$ sudo apt update
Hit:1 http://security.ubuntu.com/ubuntu focal-security InRelease         
Hit:2 http://archive.ubuntu.com/ubuntu focal-updates InRelease
Hit:3 http://archive.ubuntu.com/ubuntu focal-backports InRelease
Get:4 http://archive.ubuntu.com/ubuntu focal InRelease [265 kB]
Get:5 http://archive.ubuntu.com/ubuntu focal/main amd64 c-n-f Metadata [29.2 kB]
Get:6 http://archive.ubuntu.com/ubuntu focal/universe amd64 Packages [8,600 kB]                                                                                                                                                                                                
Get:7 http://archive.ubuntu.com/ubuntu focal/universe i386 Packages [4,624 kB]                                                                                                                                                                                                 
Get:8 http://archive.ubuntu.com/ubuntu focal/universe Translation-en [5,131 kB]                                                                                                                                                                                                
Get:9 http://archive.ubuntu.com/ubuntu focal/universe amd64 c-n-f Metadata [264 kB]                                                                                                                                                                                            
Get:10 http://archive.ubuntu.com/ubuntu focal/multiverse amd64 c-n-f Metadata [9,164 B]                                                                                                                                                                                        
Fetched 567 kB in 31s (18.4 kB/s)                                                                                                                                                                                                                                              
Reading package lists... Done
Building dependency tree       
Reading state information... Done
All packages are up to date.

내가 지원하는 파일 형식 패턴은 다음과 /etc/apt-cacher-ng/acng.conf같습니다.

PfilePattern = .(.d?deb|.db|.rpm|.drpm|.dsc|.tar(.gz|.bz2|.lzma|.xz|.zst)(.gpg)?|.diff(.gz|.bz2|.lzma|.zst|.xz)|.jigdo|.template|changelog|copyright|.udeb|.debdelta|.diff/..gz|(Devel)?ReleaseAnnouncement(\?.)?|[a-f0-9]+-(susedata|updateinfo|primary|deltainfo).xml.gz|fonts/(final/)?[a-z]+32.exe(\?download.)?|/dists/./installer-[^/]+/[0-9][^/]+/images/.)$

그리고 여기는/etc/apt/sources.list

# deb cdrom:[Ubuntu-MATE 20.04 LTS _Focal Fossa_ - Beta amd64 (20200402)]/ focal main multiverse restricted universe

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://archive.ubuntu.com/ubuntu focal main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://archive.ubuntu.com/ubuntu focal-updates main restricted
# deb-src http://bd.archive.ubuntu.com/ubuntu/ bionic-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://archive.ubuntu.com/ubuntu focal universe
deb http://archive.ubuntu.com/ubuntu focal-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 
## team, and may not be under a free licence. Please satisfy yourself as to 
## your rights to use the software. Also, please note that software in 
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://archive.ubuntu.com/ubuntu focal multiverse
deb http://archive.ubuntu.com/ubuntu focal-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
# deb-src http://bd.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
deb http://archive.canonical.com/ubuntu focal partner

deb http://archive.ubuntu.com/ubuntu focal-security main restricted
# deb-src http://security.ubuntu.com/ubuntu bionic-security main restricted
deb http://archive.ubuntu.com/ubuntu focal-security universe
deb http://archive.ubuntu.com/ubuntu focal-security multiverse
deb http://archive.ubuntu.com/ubuntu focal-backports multiverse restricted main universe
#deb http://archive.ubuntu.com/ubuntu focal-proposed multiverse restricted main universe #Not for humans during development stage of release focal

또한 문제는 18.04에서는 발생하지 않기 때문에 20.04에서만 발생합니다(실제 시스템과 VM에서도 마찬가지였습니다). 문제는 sudo apt update리포지토리를 직접 업데이트한 다음 사용하는 경우 에만 발생합니다.apt-chacher-ng~처럼대리패키지를 다운로드하려면 문제가 없습니다. 그렇다면 정확히 어디에서 잘못되고 있습니까?

답변1

apt updateapt-cacher-ng를 통해 20.04에서도 이 오류가 표시되지만 apt upgrade여전히 작동하는 것 같습니다. 서버의 파일에 .xz확장 프로그램, 그것이 단서라면.

http://archive.ubuntu.com/ubuntu/dists/focus-security/main/cnf/

Index of /ubuntu/dists/focal-security/main/cnf

[ICO]   Name    Last modified   Size
[PARENTDIR] Parent Directory        -
[   ]   Commands-amd64.xz   2020-06-03 12:29    2.6K
[   ]   Commands-i386.xz    2020-06-03 12:29    1.7K
[DIR]   by-hash/    2019-10-25 05:33    -

아직 수정 사항을 식별할 수 없습니다... 이것을 에 추가하려고 시도했지만 acng.cnf("휘발성"으로 표시하기 위해) 문제가 해결되었는지 확실하지 않습니다. 적절한 주석을 처리한 후 클라이언트에서 문제가 사라졌기 때문입니다. 프록시 및 수행apt update

#PfilePatternEx: .*(\.xz)
VfilePatternEx: .*(\.xz)$
SVfilePatternEx: .*(\.xz)$

관련 정보