I am trying to set up an apt repository.
This repository is actually replacing one that already exists and is functioning fine. I can't manage to install a package from this repo.
In my /etc/apt/sources.list
, I have the line:
deb http://mirror.cs50.net/appliance50/2014/debs/dists/trusty/main/binary-i386 /
An apt-get update
goes through perfectly fine.
But then something like apt-get install appliance50
(a package in that repo) gives me:
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?
But then copying that URL into a browser downloads the file just fine! Is there some fundamental step that I'm missing? Does it have to do something with the fact that this server is redirecting the request to S3?
Edit:
Here's the output of "sudo apt-get -o Debug::Acquire::Http=true install appliance50", per the comment:
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?
Best Answer
It's a bug on
apt-get
, that is not sending the correct GET headers, so the server answers with 404.For example, telnet to the server
mirror.cs50.net
at port 80 (HTTP), and enter the following (emulating an apt-get request):Then you will see the following:
If we leave out the dot (
/./
) in the GET request, then the request responds with a redirect, i.e. 302, which is correct.I've checkd this out with other mirrors and they report the same:
You should include in your bug report that apt-get should strip the get headers of the dot-n-slash.