apt-get update returns 404 errors for Debian repository on Ubuntu 14.04
That repository does no longer serve packages for Debian 7. But they have a repo for Ubuntu 14.04 specifically, so you should use that instead of any Debian version anyway.
Referring to the installation instructions here, to fix your issue, the simplest way is:
-
Find the list file where this "bareos" repository is configured. It might be something like
/etc/apt/sources.list.d/bareos.list
. If you have trouble, try this command to search for matching lines in all relevant files:grep bareos /etc/apt/sources.list{,.d/*.list}
-
You will find a line like this in that file:
deb http://download.bareos.org/bareos/release/latest/Debian_7.0 /
For Ubuntu 14.04, replace this with the following instead:
deb http://download.bareos.org/bareos/release/latest/xUbuntu_14.04 /
-
It could be that you might need to install the new repository's key, but probably they use the same key for all of their current and past repos, so you should have it already. If you get an error that the repository key is missing, it can be downloaded from the same new URL as above and added with:
curl http://download.bareos.org/bareos/release/latest/xUbuntu_14.04/Release.key | sudo apt-key add -
-
Update your package lists and install any available upgrades, as usual.
sudo apt-get update sudo apt-get upgrade
About the three questions you specifically asked in your post:
What happens if I run
apt-get upgrade
without attempting to resolve that 404?
Nothing special. You just would not be able to install or upgrade any packages from that broken repository. All others continue to work.
However, you would be stuck with a potentially outdated, unsupported version of your application, which could imply all kinds of problems, including security threats.
If I replace domains in
/etc/apt/sources.list
and get the previous release of Debian, willapt-get update
continue to use theold-releases
in the future?
Not sure what you mean. There is no repository for any "previous release of Debian" either. Only Debian 8 and newer, but even using those makes no real sense when there are specific Ubuntu repositories for your appropriate system release version. I also don't quite understand what you mean by old-releases
.
Are the possible solutions I mention above relevant here?
apt-get dist-upgrade
is completely unrelated and won't have any effect on the issue here. This command just upgrades your installed packages (with the extra power to uninstall stuff if necessary, in contrast to justapt-get upgrade
) to the latest versions it knows of, which are described in the package lists you update using theapt-get update
command. A missing repository server can not be fixed with local package upgrades of any kind.old-releases.ubuntu.com
hosts the former official repositories of no longer supported Ubuntu versions. Your Ubuntu version has not yet reached end of life though, so you won't find anything for it on there. And the broken repository in question is not even an official Ubuntu repository but hosted by a completely unrelated third party. You will never find their packages on there.Deleting
/var/lib/apt/lists/*
can be helpful if your downloaded package lists are corrupt somehow, as it forcesapt-get
to completely download everything again when you runapt-get update
. However, as your problem is that your configured repository does no longer exist on the server, it can not be fixed by deleting your local cached copy of the package lists and trying to download them again. They're still no longer available on the server.
Related videos on Youtube
Jeramiah Harland
Updated on September 18, 2022Comments
-
Jeramiah Harland over 1 year
Before posting I read through several questions with a similar subject. Still, since I couldn't find any that specifically mention the repository I'm having trouble with, I didn't feel confident moving forward. Please forgive the potential duplicate question.
I've inherited a server running Ubuntu 14.04.5 LTS, Trusty Tahr that has about 30 websites on it. Managing the server is new for me, but it's definitely been exciting to learn.
Recently, I ran
apt-get update
, which ended with:W: Failed to fetch http://download.bareos.org/bareos/release/latest/Debian_7.0/Packages 404 Not Found [IP: 185.170.114.121 80]
Possible solutions I've noted but haven't tried:
- Running
apt-get dist-upgrade
, and then tryingapt-get update
again - Replacing domains in
/etc/apt/sources.list
withold-releases.ubuntu.com
- Running
sudo rm -rf /var/lib/apt/lists/*
and thenapt-get update
I've been reluctant to try anything without having a good grip on what the risks are.
My question(s):
- What happens if I run
apt-get upgrade
without attempting to resolve that 404? - If I replace domains in
/etc/apt/sources.list
and get the previous release of Debian, willapt-get update
continue to use theold-releases
in the future? - Are the possible solutions I mention above relevant here?
I appreciate any help!
-
Admin over 5 yearsLots of things wrong here. Ubuntu is not Debian. Do not add Debian repositories to Ubuntu. Bareos has repositories specifically for Ubuntu with packages for Ubuntu. The other problem is Ubuntu 14.04 is almost End of Life. Your main concern now should be planning the upgrade to a supported release, either the next LTS 16.04 or the current 18.04.
-
guiverc over 5 yearsUbuntu 14.04 LTS is from 2014.April (yy.mm is format of releases) which came with 5 years of free supported life which as @GabrielaGarcia noted is nearing EOL. You can opt to convert it to 14.04 ESM to extend life - but that's a paid support, and ESM like EOL releases are off-topic here so you'll be paying for support (I'm providing another alternative). Mixing debian sources can temporarily solve a problem, but leave minefields in your system to trip you later if you're not careful, don't test & weigh up costs each upgrade. But yes you can upgrade with the 404, but I'd suggest removing it
-
Jeramiah Harland over 5 yearsI appreciate the comments. I'm definitely beginner level here.
- Running
-
Jeramiah Harland over 5 yearsThank you for taking the time to write this up, it has definitely helped. Regarding the "old-releases" question: While looking for solutions, I read to update the package repository URLs with
old-releases.ubuntu.com
. I was wondering if I did that, would it always be looking atold-releases.ubuntu.com
when I ranapt-get update
. -
Byte Commander over 5 yearsYeah, the config in /etc/apt/sources.list etc is static. When you configure a specific URL there, that will not change back on its own. You should not have any old-releases.ubuntu.com links in there though as of now, as 14.04 isn't an old release yet. And once it reaches EOL (in a few months) you should rather upgrade to a still supported version than to convert to old-releases repositories.