How to reset the Ubuntu repositories and its derivatives, or another check if they fail from Spain

Reset to Ubuntu repositories

If I have to be honest I dont know what has happened (I've already found out) but it has happened to me. In fact, it has happened to me in Kubuntu 19.10 (Eoan Ermine), Ubuntu 19.10 and in Ubuntu 20.04 (Focal Fossa), the last two in virtualbox: suddenly, they have decided that it could not be updated from the official repositories, always offering the same error. For that reason, I have decided reset the repositories of my three versions of Ubuntu and, in case it happened to someone else, share the information with you.

The bug was appearing to me in all the official repositories, but not in the KDE Backports, for example. It gave an error and could not install or update software from the Eoan Ermine or Focal Fossa repositories. After about 24 hours seeing the error in Discover (Plasma) and in Software Update (Ubuntu), I have decided to do a reset to the repositories, starting from scratch and finally backtrack, but making a small modification to the file sources.list original. Below you have explained the simple process.

Repositories error

Check before doing the reset

This article is about doing a reset to the Ubuntu repositories, but doing so there will be a little problem: the archive sources.list it will be practically empty, without all the information that the default file offers. For this reason, it is the responsibility of each one to do it or not. What is certain is that before resetting the repositories we have to know what is happening. What was happening to me is a bug in the repositories for Spain. For example, if we are to http://security.ubuntu.com/ubuntu (URL of the security directory) we will see that it can be entered without problems, but right now the same will not happen if we try to enter http://es.security.ubuntu.com/ubuntu. In other words, it seems that the "mirror" for Spain is the one that is presenting problems. If this is the case, to solve it we will only have to choose "Main" in "Software and updates" of our Ubuntu-based system.

What you will see next is how to reset the repositories. I think it is important to insist that, if you are experiencing problems at the time of writing this article and in Spain, the failure is likely to be generalized, but it can be solved either by waiting for it to work again or changing the server from where you will download the software. This is much faster and safer, but it will be worth returning to the Spanish mirror in the future, or at least if we experience slower downloads.

Reset the repositories in a few steps

There are other ways to do a reset to the Ubuntu repositories and other Linux distributions, but we will achieve the safest way by following these steps:

  1. We open a terminal.
  2. We make a backup copy of the file where the repositories are stored, so that can happen. To do this, we write the following to move sources.list to our personal folder:
sudo mv /etc/apt/sources.list ~/
  1. Next, we do the reset with this other command:
sudo touch /etc/apt/sources.list
  1. The next step will be different depending on the operating system we are using. In Ubuntu, we will directly open "Software and updates". In systems with a Plasma graphical environment, we have to open Discover, go to Sources and at the top right enter "Software sources".
  2. Once inside, we will see that the boxes of the first tab (Ubuntu Software) and third tab (Updates) are unchecked. We just have to re-mark them. In this article we explain what each repository contains. In the "Updates" tab, we will activate the ones that interest us, but at least we have to activate the important ones.
  3. Then we click Close.
  4. It will ask us if we want it to refresh the repositories. We say yes.
  5. Finally, we check that Discover, Ubuntu Software or the command "sudo apt update" no longer gives us any errors.

As I was saying, I don't know if what happened to me has happened to more people. If so, or you needed to reset the repositories for any other reason, I hope I have helped you.


Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   Charles O said

    It happened to me twice in the previous month and it gave me an error when installing updates. I saw that the repositories I had were very slow so I changed them to faster ones from the "update management" window in Linux Mint and it allowed me to update but soon after it gave me the same problem and I had to repeat the operation ...
    Not only some Spaniards were down but also some French and Germans ...

  2.   MacFC said

    Thanks for the help. In my case, I edited the sources.list file, and changed the servers from Spain (es.) To those from Finland (fi.). Problem solved.

  3.   dmaeztu said

    Hello

    Yes, it is widespread. I have temporarily changed the repositories to the main ones. I will wait a couple of days and return to the Spanish to see if it is already solved.

    But thanks for the tutorial! It helps to know another way to fix it.

  4.   Carlos said

    The same thing happened to me, the solution was to change the server from Spain to the main one. I use kubuntu 18.4 LTS.
    regards

  5.   Cristian said

    The problem I found was with 'Software and Updates': the system did not finish doing the cache update. The solution I came up with was to reset the repositories and I found and followed the steps presented in this guide. It was very useful: it worked very well. Thanks.

  6.   dannypatagonia said

    ohhhh! Thank you! I upgraded from 16 to 18 a few weeks ago and the whole system had been screwed up, any program that was running began to throw error messages and could not update anything ... holy remedy

  7.   Jesus Flores said

    Great it worked perfectly for me, I had days wanting to update to 20.04

  8.   Sebastián said

    Step 7 fails me. I say yes, it starts to "update cache" and it fails, it tells me that I don't have an internet connection, which is not true, obviously. I have ubuntu 16 .. lts