LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Debian: a few 404 errors when installing packages => changing sources.list? (https://www.linuxquestions.org/questions/linux-newbie-8/debian-a-few-404-errors-when-installing-packages-%3D-changing-sources-list-4175617695/)

dedec0 11-15-2017 05:17 PM

Debian: a few 404 errors when installing packages => changing sources.list?
 
We have this Debian 9 machine with several small problems. One of them is that it always gave a few 404 errors when installing very common packages! One recent example: gimp. And the errors shown are in the domain debian.org, something I find very strange.

In the end, we always had the option to "continue without them" when installing from Synpactic. So Gimp is installed and usable, as other packages installed before, with something probably missing. But I did not notice anything in the times I used Gimp - not that I searched for it, I just did what I wanted to do, and it worked fine.

I imagine the problem and solution should be something to be changed in /etc/apt/sources.list . Is this a good idea? What is there is probably what Debian put there when it was installed:

Code:

deb http://ftp.us.debian.org/debian/ stretch main
deb-src http://ftp.us.debian.org/debian/ stretch main

deb http://security.debian.org/debian-security stretch/updates main
deb-src http://security.debian.org/debian-security stretch/updates main

deb http://ftp.us.debian.org/debian/ stretch-updates main
deb-src http://ftp.us.debian.org/debian/ stretch-updates main

And nothing else there, just comments.

Today, when trying to install another package, I could not progress without *removing* Gimp, which I do not want to do. I would, at most, install it right after with the same dependency problem it has now. To install without fixing the problem, I tried to:

- install with Synaptic (asked to remove or to fix broken packages first);

- install with aptitude (similar result to Synaptic's);

- install with "apt-get install" (suggested doing 'apt --fix-broken install', which was something I did not see before).

I decided to try that 'apt --fix*' fix, and its result is not good. See what is on my terminal now:

Code:

# apt --fix-broken install
Reading package lists... Done
Building dependency tree     
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
  libavcodec57 libavformat57 libavutil55 libopenmpt0 libraw15 libswresample2 libswscale4
The following NEW packages will be installed:
  libavcodec57 libavformat57 libavutil55 libopenmpt0 libraw15 libswresample2 libswscale4
0 upgraded, 7 newly installed, 0 to remove and 1 not upgraded.
3 not fully installed or removed.
Need to get 6585 kB of archives.
After this operation, 20.2 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Err:1 http://ftp.us.debian.org/debian stretch/main amd64 libavutil55 amd64 7:3.2.5-1
  404  Not Found [IP: 2600:3404:200:237::2 80]
Err:2 http://ftp.us.debian.org/debian stretch/main amd64 libswresample2 amd64 7:3.2.5-1
  404  Not Found [IP: 2600:3404:200:237::2 80]
Err:3 http://ftp.us.debian.org/debian stretch/main amd64 libavcodec57 amd64 7:3.2.5-1
  404  Not Found [IP: 2600:3404:200:237::2 80]
Err:4 http://ftp.us.debian.org/debian stretch/main amd64 libopenmpt0 amd64 0.2.7386~beta20.3-3
  404  Not Found [IP: 2600:3404:200:237::2 80]
Err:5 http://ftp.us.debian.org/debian stretch/main amd64 libavformat57 amd64 7:3.2.5-1
  404  Not Found [IP: 2600:3404:200:237::2 80]
Err:6 http://ftp.us.debian.org/debian stretch/main amd64 libraw15 amd64 0.17.2-6+b1
  404  Not Found [IP: 2600:3404:200:237::2 80]
Err:7 http://ftp.us.debian.org/debian stretch/main amd64 libswscale4 amd64 7:3.2.5-1
  404  Not Found [IP: 2600:3404:200:237::2 80]
E: Failed to fetch http://ftp.us.debian.org/debian/pool/main/f/ffmpeg/libavutil55_3.2.5-1_amd64.deb  404  Not Found [IP: 2600:3404:200:237::2 80]
E: Failed to fetch http://ftp.us.debian.org/debian/pool/main/f/ffmpeg/libswresample2_3.2.5-1_amd64.deb  404  Not Found [IP: 2600:3404:200:237::2 80]
E: Failed to fetch http://ftp.us.debian.org/debian/pool/main/f/ffmpeg/libavcodec57_3.2.5-1_amd64.deb  404  Not Found [IP: 2600:3404:200:237::2 80]
E: Failed to fetch http://ftp.us.debian.org/debian/pool/main/libo/libopenmpt/libopenmpt0_0.2.7386~beta20.3-3_amd64.deb  404  Not Found [IP: 2600:3404:200:237::2 80]
E: Failed to fetch http://ftp.us.debian.org/debian/pool/main/f/ffmpeg/libavformat57_3.2.5-1_amd64.deb  404  Not Found [IP: 2600:3404:200:237::2 80]
E: Failed to fetch http://ftp.us.debian.org/debian/pool/main/libr/libraw/libraw15_0.17.2-6+b1_amd64.deb  404  Not Found [IP: 2600:3404:200:237::2 80]
E: Failed to fetch http://ftp.us.debian.org/debian/pool/main/f/ffmpeg/libswscale4_3.2.5-1_amd64.deb  404  Not Found [IP: 2600:3404:200:237::2 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
#

The packages it tried to install are not only for Gimp. Are probably for all things installed before as broken packages.

1. What should I do to fix that?

Now, to make a second related question. I found a thread otherwhere about Ubuntu saying this:

Quote:

Ask Ubuntu question #37753:

apt-get now supports a 'mirror' method that will automatically select a good mirror based on your location. Putting:

deb mirror://mirrors.ubuntu.com/mirrors.txt precise
main restricted universe multiverse
deb mirror://mirrors.ubuntu.com/mirrors.txt precise-updates main restricted
universe multiverse
deb mirror://mirrors.ubuntu.com/mirrors.txt precise-backports main restricted
universe multiverse
deb mirror://mirrors.ubuntu.com/mirrors.txt precise-security main restricted
universe multiverse

on the top in your /etc/apt/sources.list file should be all that is needed to make it automatically pick a mirror for you based on your geographical location.

Lucid (10.04), Maverick (10.10), Natty (11.04), And Oneiric (11.10) users can replace precise with the appropriate name.
2. Is this something I should do in Debian? Is it possible? But it will not fix my problem, will it?

Edit: note that the 404 errors are *not* for all files. Most of them were downloaded normally. Only a few packages that were dependencies for the last few programs installed were not being found there.

jlinkels 11-15-2017 05:56 PM

It should not give 404 errors. You can try to replace the mirror in your sources.list with http://httpredir.debian.org/debian/. This will select a suitable mirror for you.

There are also a number of packages pulled in by --fixed-missing which are dependencies for other programs. Once a dependency is not satisfied, apt will try to fix this every time you run apt. So it does not have anything to do with Gimp.

Now these packages are from the main pool. However, if you are not super concerned that everything is GPL-ed according to Debian, add contrib and non-free to your all deb lines in sources.list. For example:
Code:

deb http://httpredir.debian.org/debian/ stretch main contrib non-free
These two corrections might or might not solve your problems. It simply should not happen. If you only gave the main pool in your sources.list, apt should report that packages are not available. Not that mirrors cannot be reached.

jlinkels

norobro 11-15-2017 06:34 PM

Have you performed an update lately? "apt-get update" or "aptitude update"

Seems it is looking for old versions of the libraries. For example:
Code:

.../main amd64 libavutil55 amd64 7:3.2.5-1
The version in the repo is "7:3.2.8-1~deb9u1" https://packages.debian.org/stretch/libavutil55

dedec0 11-15-2017 07:25 PM

Quote:

Originally Posted by norobro (Post 5781153)
Have you performed an update lately? "apt-get update" or "aptitude update"

Seems it is looking for old versions of the libraries. For example:
Code:

.../main amd64 libavutil55 amd64 7:3.2.5-1
The version in the repo is "7:3.2.8-1~deb9u1" https://packages.debian.org/stretch/libavutil55

No, I have never updated with those commands, nor with something inside Synaptic (which I also use a lot).

The error I showed has something to give a hint about "apt-get update" is needed?

After changing the mirror used, but not touching the lines with security.debian.org, the result was the same (I expected that it would be). Then I did the 'apt-get update'.

After that, I tried to install (history helped, haha) a package and (of course) it complained about the broken things. But 'apt --fix-broken install' ended well this time.

Thank you both very much! (I still expect an answer to the question I did before in this post)

dedec0 11-15-2017 07:31 PM

Just curious: how did you find that URL?
 
Quote:

Originally Posted by jlinkels (Post 5781136)
(...) You can try to replace the mirror in your sources.list with http://httpredir.debian.org/debian/. This will select a suitable mirror for you.

(...)

Just curious: how did you find that URL?

So the "Debian equivalent" of that Ask Ubuntu question is using that URL?

jlinkels 11-15-2017 07:51 PM

Quote:

Originally Posted by dedec0 (Post 5781163)
Just curious: how did you find that URL?

I have no idea, honestly. I think I read it somewhere in some article in the time I had problems selecting an appropriate mirror years ago. I use it since then. There are several utilities to find the best mirror, but those are obsolete by now as it seems. I tried to find a Debian page for you mentioning the use of httpredir and I can't even find it. There are some articles mentioning this site. But you only find them if you know that you have to look for httpredir.

Quote:

Originally Posted by dedec0 (Post 5781163)
So the "Debian equivalent" of that Ask Ubuntu question is using that URL?

I think so. But the repositories for Debian and Unbuntu are quite different.

jlinkels

dedec0 11-15-2017 08:48 PM

Strange that you could not find. Searching directly for the URL, with quotes added to force better results, I found a few. A few Debian wiki pages mention it, and mailing lists too.

But I do not understand everything these things say.

First discover, very clear: httpredir.debian.org now redirects to deb.debian.org. I will change my sources.list file to that submain, instead. It may be needed in the future, anyway. This change is mentioned in https://wiki.debian.org/DebianGeoMirror.

There is also https://lists.debian.org/debian-mirr.../msg00000.html message which mentions your URL, and something about it.

Debian Wiki: SourcesList now gives an example which is the exact sources.list I would make now. Good thing, right? The only "differences" mine would have is that the two security lines are in the end - no difference, I assume - and the comments I keep.

Just another message that mentions these URLs is: https://lists.debian.org/debian-user.../msg01047.html

seasons 11-15-2017 08:55 PM

I had the same issue on sid.

https://unix.stackexchange.com/a/100887

Try to force IPv4. If that fixes the issue, I would either make the change persistent as the link shows, or try to use backup IPv6 DNS, like Google:
2001:4860:4860::8888
2001:4860:4860::8844

Timothy Miller 11-15-2017 09:02 PM

From what I understand, httpredir is deprecated (although it does still work) in Stretch. The debian redirector as of Stretch is deb.debian.org

dedec0 11-15-2017 09:18 PM

seasons, the issue does not seem the same. The 404 errors were for just a few files. Most worked normally. And the issue was fixed with the 'apt-get update'. The changes I did to source.list file were just something extra.

Timothy, if that is all there was to understand, then it was clear enough for everyone, I assume. (: As jlinkels said before, I just miss a Debian page about what should be used.

Thank you all again

dedec0 11-15-2017 09:23 PM

Edited the first post to say that the 404 errors were not for everything or for the server itself. They were just for a few "lucky" packages or dependencies.

Timothy Miller 11-15-2017 09:40 PM

Quote:

Originally Posted by dedec0 (Post 5781193)
seasons, the issue does not seem the same. The 404 errors were for just a few files. Most worked normally. And the issue was fixed with the 'apt-get update'. The changes I did to source.list file were just something extra.

Timothy, if that is all there was to understand, then it was clear enough for everyone, I assume. (: As jlinkels said before, I just miss a Debian page about what should be used.

Thank you all again

https://deb.debian.org/ explains what it is.

dedec0 11-15-2017 11:36 PM

I meant an easier documentation, not the purely technical things that are not much useful to me, for example. I did read deb.debian.org but it does not ring anything explicit to me. If I had read there just as an eventual Debian page, I would not think about changing anything in the machine I use.


All times are GMT -5. The time now is 01:21 PM.