"Repository does not have a release file" error [closed]
Asked Answered
M

11

139

I'm trying to install ROS on Ubuntu. I'm getting this error:

   sudo apt-get update
Hit:1 http://pk.archive.ubuntu.com/ubuntu cosmic InRelease
    Hit:2 http://pk.archive.ubuntu.com/ubuntu cosmic-updates InRelease
    Hit:3 http://pk.archive.ubuntu.com/ubuntu cosmic-backports InRelease
    Get:4 http://security.ubuntu.com/ubuntu cosmic-security InRelease [83.2 kB]
    Ign:5 http://packages.ros.org/ros/ubuntu cosmic InRelease Err:6 http://packages.ros.org/ros/ubuntu cosmic Release 404 Not Found [IP: 64.50.236.52 80] Reading package lists... Done
    E: The repository 'http://packages.ros.org/ros/ubuntu cosmic Release' does not have a Release file. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details.
Morion answered 16/12, 2018 at 6:50 Comment(0)
T
94

You need to update your repository targets to the Focal Fossa (20.04) release of Ubuntu. This can be done like so:

sudo sed -i -e 's|disco|focal|g' /etc/apt/sources.list
sudo apt update
Tooley answered 21/4, 2020 at 3:55 Comment(8)
Thanks. This now becomes sudo sed -i -e 's|eoan|focal|g' /etc/apt/sources.listGlanti
Is there a way to do that automatically for any X version to current version?Hewe
Thanks null - your comment solved it for me. Can anyone explain why this problem happened at all? Suddenly my machine wouldn't update anymore because of this.Rosaleerosaleen
@Rosaleerosaleen it's because Ubuntu 19.10 "Eoan" is now deprecated, this command switch your repository targets to the new Ubuntu 20.04 "Focal"Contrapuntist
@JoãoPimentelFerreira sudo sed -i -e 's|X|$(lsb_release -cs)|g' /etc/apt/sources.listOur
Though my problem is different but the solution show me right pathZitvaa
now sudo sed -i -e 's|impish|jammy|g' /etc/apt/sources.listSol
For me only this solution worked: askubuntu.com/questions/1385440/…Male
P
79

As described here, you need to edit (as root) the file /etc/apt/sources.list (the easiest way to do this is to type sudo gedit /etc/apt/sources.list). On the line that mentions http://packages.ros.org/ros/ubuntu you need to add [trusted=yes] after the word deb (you might need to add it as a separate word). Then save the file and try again.

Priceless answered 16/12, 2018 at 10:50 Comment(6)
i am facing same issue with 'ppa.launchpad.net/gencfsm/ppa/ubuntu' ; i am on ubuntu eoan 19.10 but when I search for the ppa on >>sources.list it doesn't have it. pls helpShippee
It might be in a file in /etc/apt/sources.list.d. Look in that directory.Priceless
what if this happens with your CI build agent?Sealey
@Sealey if you are managing to run sudo commands on your CI agent, I don't see the problem - you can do anything. Anyway, that question isn't really specific to this question.Priceless
what I mean is that it's really hard to edit a file with commands, unless you start doing some sed juggling and whatnot; I wonder how to fix this problem easilySealey
@Sealey if you have a file with the wrong configuration in /etc/apt/sources.list.d on your CI agent, then someone has set up your CI agent incorrectly, or (but this is less likely) your OS distribution has shipped an incorrect config file. Fix that problem, ideally.Priceless
P
76

#For Unable to 'apt update' my Ubuntu 19.04

The repositories for older releases that are not supported (like 11.04, 11.10 and 13.04) get moved to an archive server. There are repositories available at http://old-releases.ubuntu.com.

first break up this file

cp  /etc/apt/sources.list /etc/apt/sources.list.bak
sudo sed -i -re 's/([a-z]{2}\.)?archive.ubuntu.com|security.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list

then

sudo apt-get update && sudo apt-get dist-upgrade
Paralipomena answered 15/12, 2020 at 7:58 Comment(3)
This helped me, thank you! I'd still recommend to create a backup before running the sed though: sudo cp /etc/apt/sources.list /etc/apt/sources.list.bakPuiia
I have no idea what I am doing but this helped on 21.04 after a while of not using my Ubuntu, cheerios.Buoyage
For me this solution worked: askubuntu.com/questions/1385440/…Male
R
13

Make sure your /etc/apt/sources.list has http://old-releases.ubuntu.com instead of in.archive

Redneck answered 26/2, 2020 at 10:16 Comment(0)
S
13

I opened up my Software & Updates program and switched from my country to the main servers like so:
Software & Updates screen

After I done this and run the sudo apt update commando again, my problems where gone.

Swanee answered 10/3, 2020 at 7:23 Comment(1)
On mine, this lead to a message about an internal error, with a prompt to send details to developers, and it got stuck once I pressed send. I didn't record exactly what package was the issue, but gtk was included in the name. I don't have time for now to record more details. I will leave it for now but if this comment gets votes then between all of us we can look into it further.Chlordane
K
7

In my case the cause was Ubuntu version no longer supported by Canonical. I was able to upgrade to still supported LTS with 2 steps:

1) Manually update repo links from "in.ubuntu" to "old-releases.ubuntu". 1.1) Installed all outstanding updates 2) do-release-upgrade was able to take from this point and do actual upgrade

IMHO, this is safer method then just updating repositories to next supported ubuntu, since do-release-upgrade have chance to prevent upgrade that could fail, and may be able to diagnose a problem for you.

Kulsrud answered 6/5, 2020 at 10:31 Comment(0)
T
4

If a sudo apt-get update did not do it for you, it might be that some packages have failed to updated to repository-related errors.

For me all of those happened to reside in (Software Updates --> Other Software). You could remove them with "Remove", the cache will be refreshed successfully. Otherwise

sudo apt-get clean
apt-get autoremove 

is something to try.

Trstram answered 25/6, 2020 at 0:58 Comment(0)
W
3

im use this code to and suggest you:

1) sudo sed -i -e 's|disco|eoan|g' /etc/apt/sources.list
2) sudo apt update
Wrathful answered 24/5, 2020 at 13:51 Comment(1)
The same answer has been given before.Our
W
1

I have been having this issue for a couple of weeks and finally decided to sit down and try and fix it. I have no interest in config file editing as I'm primarily a Windows user.

In a fit of "clickyness" I noticed that the ubuntu server location was set "for United kingdom". I switched this over to "Main Server" and hey presto... it all stared updating.

So, it seems like the regionalised server (for the UK at least) has a very limited support window so if you are an infrequent user it is likely it will not have a valid upgrade path from your current version to the latest.

Edit: I only just noticted the previous reply, after posting. 100% agree.

Windowpane answered 10/5, 2020 at 13:6 Comment(0)
F
0

If You are facing an issue with a new "EC2 Instance" or "Ubuntu instance"

Then first do this sudo apt-get upgrade and then try again to install any thing in same way as mentioned in documentation.

Fern answered 8/10, 2021 at 17:15 Comment(1)
apt upgrade -y helped while any ` sed source list ` above did NOT helpThrombo
P
-3

This problem is probably from your /etc/apt/sources.list as others mentioned but there is chance that the problem is with your hard disk. I solved the same issue by cleaning up some space.

When you don't have enough space on your hard disk, updating your machine won't occur until you delete some files.

Proctoscope answered 7/3, 2020 at 4:49 Comment(2)
A 404 error is never a disk space related issue. It's that the request is being sent to a place that doesn't exists.Dauphine
I had the exact same issue in Ubuntu with the exact same error on the screen. As I mentioned the problem is likely for sources.list file but if it wasn't the issue, check your hard disk as well. @DauphineProctoscope

© 2022 - 2024 — McMap. All rights reserved.