How to resolve "Failed to download repository information"?

Whenever I try to install anything with the Ubuntu Software Center, the following error appears.

Failed to download repository information

Check your Internet connection.

E:Unable to parse package file /var/lib/apt/lists/partial/archive.ubuntu.com_ubuntu_dists_precise_multiverse_i18n_Index (1)


Solution 1:

Try cleaning up your apt-cache and running any updates

sudo apt-get clean
sudo apt-get update
sudo apt-get upgrade

If you still have issues, then change your repo mirror: Open Update Manager or Software Updater, then click Settings > Ubuntu Software tab, then select Other from the Download From menu and click the Select Best Server button. Once finished, the best server will show up selected (highlighted), so just click the Choose Server button. Now try updating/upgrading again.

Solution 2:

"Software Updater" will give same error message for issues like:

W: Failed to fetch http://ppa.launchpad.net/crass/ufraw/ubuntu/dists/raring/main/binary-amd64/Packages  404  Not Found

Solution: Settings -> Software & Updates -> Other Software -> Click on offending entry and hit Remove (OR simply un-check so its ignored yet visible for later)

Another way to un-check the bad entries is to

/etc/apt
grep -r some_string 

for example

grep -r ufraw /etc/apt

which will return the file containing string ufraw so then edit that file and comment out the line mentioning string ufraw

This shuts off updates to the package linked to this file ... the symptom will go away ... problem often due to using a package not yet customized for the version of OS you are on

Solution 3:

This is the same issue I'm also facing with Ubuntu 20.04 LTS. My device is connected to a 'metered connection'(I'm thinking the issue is because I have set this connection as metered. Not sure though). But I have found a way to update even after this error.

  1. Click on the 'settings' option below that error message and it will open the 'software & Updates'.
  2. Now just close the 'Software & Updates' window and you will see the updates are available for download and installing.

I don't know the reason behind this error. If someone could add upon this it will be helpful. But this definitely works. I have done this for more than two weeks.

Hope it helps you!

Solution 4:

Assure cdrom is unchecked then cut and paste entire set of below commands

sudo apt-get clean
cd /var/lib/apt
sudo mv lists lists.old_`date '+%Y%m%d_%H%M%S'`  
sudo mkdir -p lists/partial
sudo apt-get clean 
sudo apt-get update