When programming or developing systems with Bash on Linux computers/servers, you may encounter the “the repository does not have a release file” error with apt or apt-get commands.
There are various causes for errors with apt, but if you just want to make the error go away, the quickest way is to find and delete the corresponding entry from the list files.
The following is an error that appeared as a result of trying to install docker incorrectly.
Reading package lists... Done
E: Failed to fetch http://get.docker.io/ubuntu/dists/docker/InRelease 403 Forbidden [IP: 99.86.199.99 443]
E: The repository 'http://get.docker.io/ubuntu docker InRelease' is not signed.
To resolve this, find the file that contains http://get.docker.io/ubuntu, delete that part, and then run sudo apt update.
Move to /etc/apt where the list files are gathered, and search the entire folder with ag or similar.
yuis@yuis:/etc/apt$ ag "get.docker.io"
sources.list.d/docker.list
1:deb http://get.docker.io/ubuntu docker main
sources.list.d/docker.list.save
1:deb http://get.docker.io/ubuntu docker main
yuis@yuis:/etc/apt$ cat sources.list.d/docker.list*
deb http://get.docker.io/ubuntu docker main
deb http://get.docker.io/ubuntu docker main
I confirmed it’s written in the sources.list.d/docker.list file. This file is dedicated to docker installation, so you could delete the line, but it’s troublesome, so this time I’ll delete the entire file.
[Caution] Be careful not to delete sources.list. (I previously deleted this and had to reinstall the OS. If you’re going to do it, make a backup)
yuis@yuis:/etc/apt$ sudo rm sources.list.d/docker.list*
Update the list files.
sudo apt update
If it went well, the error should no longer appear.
By the way, if the repository is in sources.list and you can’t delete the entire file, you can delete the line number based on ag’s output.
sudo sed -Ei '59s/.*//' sources.list sources.list.save
The repository ’…’ does not have a Release file. | DigitalOcean