Score:2

Ubuntu sudo apt get update 404 Not Found problem

cl flag

I am using ubuntu 20.04.3 LTS on my system . I've an error for 2 days. I couldnt update-upgrade or package install on my system I get below errors:

Hit:1 http://packages.microsoft.com/repos/code stable InRelease                                                                   
Hit:2 http://archive.canonical.com/ubuntu focal InRelease                                                                         
Hit:3 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu focal InRelease                                                              
Hit:4 http://dl.google.com/linux/chrome/deb stable InRelease                                                                      
Ign:5 http://old-releases.ubuntu.com/ubuntu focal InRelease                                                                       
Ign:6 http://old-releases.ubuntu.com/ubuntu focal-updates InRelease                                                               
Hit:7 http://ppa.launchpad.net/kicad/kicad-5.1-releases/ubuntu focal InRelease                                                    
Hit:8 https://deb.opera.com/opera-stable stable InRelease                                                                         
Hit:9 https://packages.microsoft.com/repos/vscode stable InRelease                                                                
Ign:10 http://old-releases.ubuntu.com/ubuntu focal-backports InRelease                                                            
Ign:11 http://ppa.launchpad.net/team-gcc-arm-embedded/ppa/ubuntu focal InRelease                                           
Ign:12 http://old-releases.ubuntu.com/ubuntu focal-security InRelease                                                      
Err:14 http://old-releases.ubuntu.com/ubuntu focal Release                                                                        
  404  Not Found [IP: 91.189.88.247 80]
Err:15 http://ppa.launchpad.net/team-gcc-arm-embedded/ppa/ubuntu focal Release                                                    
  404  Not Found [IP: 91.189.95.85 80]
Err:16 http://old-releases.ubuntu.com/ubuntu focal-updates Release                                                           
  404  Not Found [IP: 91.189.88.247 80]
Hit:17 https://linux-clients.seafile.com/seafile-deb/focal stable InRelease                
Err:18 http://old-releases.ubuntu.com/ubuntu focal-backports Release 
  404  Not Found [IP: 91.189.88.247 80]
Err:19 http://old-releases.ubuntu.com/ubuntu focal-security Release  
  404  Not Found [IP: 91.189.88.247 80]
Ign:13 https://launchpad.net/~terry.guo/+archive/gcc-arm-embedded focal InRelease
Err:20 https://launchpad.net/~terry.guo/+archive/gcc-arm-embedded focal Release
  404  Not Found [IP: 91.189.89.222 443]
Reading package lists... Done

How can I solve this ?

Ajouve avatar
cn flag
You can use http://old-releases.ubuntu.com/ubuntu for older versions
in flag
Why do you have `old-releases` in your sources? Focal is hardly an "old release" ...
cocomac avatar
cn flag
Does this answer your question? [How do I restore the default repositories?](https://askubuntu.com/questions/124017/how-do-i-restore-the-default-repositories) Your sources.list is messed up. Just reset them, and then re-add any repos your really need after, like for VS Code
gogogo avatar
cl flag
@cocomac No, I try every step but it doesnt work.
gogogo avatar
cl flag
@matigo I dont know :/ how can I solve this?
in flag
If @cocomac's solution did not work, then you will need to open your `/etc/apt/sources.list` file and fix the issue manually. Focal Fossa is not at all an "old release", so the URL naturally 404s. You will need to replace `old-releases.ubuntu.com` with something logical, like `archive.ubuntu.com` (or the one for your geographical region)
Someone avatar
my flag
@gogogo Will you mind, if my answer remove all your PPAs?
N0rbert avatar
zw flag
Does this answer your question? [\*Error\* for Sudo apt-get update on ubuntu 20.04](https://askubuntu.com/questions/1372928/error-for-sudo-apt-get-update-on-ubuntu-20-04)
N0rbert avatar
zw flag
Do you remember who and why changed "archive" to "old-releases" for supported 20.04 LTS (focal) release? Both team-gcc-arm-embedded and ~terry.guo do not provide packages for 20.04, you have to disable them.
Someone avatar
my flag
@N0rbert It's clear that they've updated from an old release to 20.04 using the `sed` command. So, maybe they were on 17.04 and replaced the codename to focal in their sources.list.
gogogo avatar
cl flag
I dont know but my friends have same issue although they have different ubuntu versions (16.04, 18.0 , 20.04). Is this problem cause of the region?
Someone avatar
my flag
@gogogo Did you try my answer? What is the result of `apt update` now?
gogogo avatar
cl flag
I did all things I get below lines output: Hit:1 http://archive.ubuntu.com/ubuntu focal InRelease Hit:2 http://archive.ubuntu.com/ubuntu focal-updates InRelease Hit:3 http://archive.ubuntu.com/ubuntu focal-security InRelease Hit:4 http://archive.canonical.com/ubuntu focal InRelease Hit:5 http://archive.ubuntu.com/ubuntu focal-backports InRelease Reading package lists... Done
Someone avatar
my flag
@gogogo Great! Seems the problem is solved. You can run `sudo apt update` to look for upgradeable packages.
muru avatar
us flag
Does this answer your question? [How can I fix a 404 Error when using a PPA or updating my package lists?](https://askubuntu.com/questions/65911/how-can-i-fix-a-404-error-when-using-a-ppa-or-updating-my-package-lists)
Score:5
my flag

Most of the repositories and PPAs in your sources.list are no longer available and are throwing errors. I'd recommend restoring the default repositories.

  1. First, restore the default focal repositories using these commands:

    mkdir ~/solution
    cd ~/solution/
    wget https://gist.githubusercontent.com/ishad0w/788555191c7037e249a439542c53e170/raw/3822ba49241e6fd851ca1c1cbcc4d7e87382f484/sources.list
    sudo rm -r /etc/apt/sources.list
    sudo cp -r ~/solution/sources.list /etc/apt/sources.list
    
  2. Remove all the PPAs in your system:

    sudo mv /etc/apt/sources.list.d/* ~/solution
    
  3. Update the repositories:

    sudo apt update
    

Now there should be no errors.
Good Luck!

CVDE avatar
ec flag
god bless you :))
gogogo avatar
cl flag
thank you for your help, it works !
Someone avatar
my flag
@gogogo I'm happy to help :-)
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.