apt-get install에서는 404를 찾을 수 없지만 URL은 유효합니다.

apt-get install에서는 404를 찾을 수 없지만 URL은 유효합니다.

나는적절한 저장소.

이 저장소는 실제로 이미 존재하고 작동하는 저장소를 대체합니다. 이 저장소에서 패키지를 설치할 수 없습니다.

내 안에는 /etc/apt/sources.list다음 줄이 있습니다.

deb http://mirror.cs50.net/appliance50/2014/debs/dists/trusty/main/binary-i386 /

모두 apt-get update제일 좋다. 하지만 apt-get install appliance50(이 저장소의 패키지)와 같은 것이 나에게 다음을 제공합니다.

Err http://mirror.cs50.net/appliance50/2014/debs/dists/trusty/main/binary-i386/  appliance50 2014-0
  404  Not Found
E: Failed to fetch http://mirror.cs50.net/appliance50/2014/debs/dists/trusty/main/binary-i386/./appliance50_2014-0_i386.deb  404  Not Found

E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

하지만 URL을 브라우저에 복사하면 파일이 정상적으로 다운로드됩니다! 몇 가지 기본 단계가 누락되었나요? 이는 이 서버가 요청을 S3으로 리디렉션한다는 사실과 관련이 있습니까?

편집하다:

의견을 바탕으로 다음은 "sudo apt-get -o Debug::Acquire::Http=true install Appliance50"의 출력입니다.

root@ubuntu:~# sudo apt-get -o Debug::Acquire::Http=true install appliance50
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  apt-clone archdetect-deb cifs-utils dmraid dpkg-repack
  gir1.2-appindicator3-0.1 gir1.2-json-1.0 gir1.2-timezonemap-1.0
  gir1.2-xkl-1.0 kpartx kpartx-boot libdebian-installer4
  libdevmapper-event1.02.1 libdmraid1.0.0.rc16 libldb1 libntdb1 libtalloc2
  libtevent0 libtimezonemap1 libwbclient0 localechooser-data lvm2 lzma
  python-crypto python-ldb python-ntdb python-samba python-talloc python-tdb
  python3-icu python3-pam rdate samba-common samba-common-bin samba-libs
  watershed
Use 'apt-get autoremove' to remove them.
The following packages will be upgraded:
  appliance50
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 1,205 kB of archives.
After this operation, 4,096 B of additional disk space will be used.
0% [Working]GET /appliance50/2014/debs/dists/trusty/main/binary-i386/./appliance50_2014-0_i386.deb HTTP/1.1
Host: mirror.cs50.net
User-Agent: Debian APT-HTTP/1.3 (1.0.1ubuntu2)


HTTP/1.1 404 Not Found
Cache-control: no-cache="set-cookie"
Content-Type: text/html; charset=UTF-8
Date: Mon, 04 Aug 2014 14:23:53 GMT
Server: Apache
Set-Cookie: AWSELB=27CBB9F102866AACDE415904FB505399868B9DB4E22AC5183099E4BEEC583EF1DFA3B6E45DCB1D708481F98DC786A644C763A900F7898475BA865AD219D4E4F1F157545837;PATH=/;MAX-AGE=3600
Content-Length: 0
Connection: keep-alive

Err http://mirror.cs50.net/appliance50/2014/debs/dists/trusty/main/binary-i386/  appliance50 2014-0
  404  Not Found
E: Failed to fetch http://mirror.cs50.net/appliance50/2014/debs/dists/trusty/main/binary-i386/./appliance50_2014-0_i386.deb  404  Not Found

E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

답변1

이것은 서버의 버그입니다 apt-get. 올바른 GET 헤더가 전송되지 않아 서버가 404로 응답합니다.

예를 들어 mirror.cs50.net포트 80(HTTP)에서 서버에 텔넷으로 연결하고 다음을 입력합니다(apt-get 요청 시뮬레이션).

GET /appliance50/2014/debs/dists/trusty/main/binary-i386/./appliance50_2014-0_i386.deb HTTP/1.1
User-Agent: Debian APT-HTTP/1.3 (1.0.1ubuntu2)
Host: mirror.cs50.net
Accept: */*

그러면 다음이 표시됩니다.

telnet mirror.cs50.net 80
Trying 54.84.6.206...
Connected to mirror.cs50.net.
Escape character is '^]'.
GET /appliance50/2014/debs/dists/trusty/main/binary-i386/./appliance50_2014-0_i386.deb HTTP/1.1
User-Agent: Debian APT-HTTP/1.3 (1.0.1ubuntu2)
Host: mirror.cs50.net
Accept: */*

HTTP/1.1 404 Not Found
Cache-control: no-cache="set-cookie"
Content-Type: text/html; charset=UTF-8
Date: Mon, 04 Aug 2014 18:31:01 GMT
Server: Apache
Set-Cookie: AWSELB=27CBB9F102866AACDE415904FB505399868B9DB4E22AC5183099E4BEEC583EF1DFA3B6E45DFCB95EFBFF7B8F8F555126DCFFF8A461898475BA865AD219D4E4F1F157545837;PATH=/;MAX-AGE=3600
Content-Length: 0
Connection: keep-alive

GET 요청에서 점( )을 생략하면 /./요청은 리디렉션(302)으로 응답합니다. 이는 올바른 것입니다.

GET /appliance50/2014/debs/dists/trusty/main/binary-i386/appliance50_2014-0_i386.deb HTTP/1.1
Host: mirror.cs50.net
User-Agent: Debian APT-HTTP/1.3 (1.0.1ubuntu2)

HTTP/1.1 302 Found
Cache-control: no-cache="set-cookie"
Content-Type: text/html; charset=UTF-8
Date: Mon, 04 Aug 2014 19:03:27 GMT
Location: http://dkui3cmikz357.cloudfront.net/appliance50/2014/debs/dists/trusty/main/binary-i386/appliance50_2014-0_i386.deb
Server: Apache
Set-Cookie: AWSELB=27CBB9F102866AACDE415904FB505399868B9DB4E22AC5183099E4BEEC583EF1DFA3B6E45DFCB95EFBFF7B8F8F555126DCFFF8A461898475BA865AD219D4E4F1F157545837;PATH=/;MAX-AGE=3600
Content-Length: 0
Connection: keep-alive

나는 이것을 다른 미러로 확인했는데 그들은 같은 상황을 보고했습니다.

Trying 64.50.233.100...
Connected to ftp-nyc.osuosl.org.
Escape character is '^]'.
GET /debian/pool/main/e/./efivar_0.10-5_i386.deb HTTP/1.1         
Host: ftp-nyc.osuosl.org
User-Agent: Debian APT-HTTP/1.3 (1.0.6)

HTTP/1.1 404 Not Found
Date: Mon, 04 Aug 2014 18:47:03 GMT
Server: Apache
Content-Length: 307
Content-Type: text/html; charset=iso-8859-1

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /debian/pool/main/e/efivar_0.10-5_i386.deb was not found on this server.</p>
<hr>
<address>Apache Server at ftp-nyc.osuosl.org Port 80</address>
</body></html>
Connection closed by foreign host.

오류 보고서에 apt-get의 get 헤더를 포함해야 하며 점 슬래시를 제거해야 합니다.

관련 정보