Need help?

Our experts have had an average response time of 11.7 minutes in August 2021 to fix urgent issues.

We will keep your servers stable, secure, and fast at all times for one fixed price.

Some index files failed to download: Ubuntu – How to fix

by | Mar 9, 2021

Stuck with the error ‘Some index files failed to download’? We can help you.

At times Ubuntu users come across the error “W: Some index files failed to download” usually while updating the system.

Here at Bobcares, we often get requests from our customers to fix this error as a part of our Server Management Services.

Today let’s see how our Support Techs fix this error for our customers.

Methods to fix ‘Some index files failed to download’ error

The error message usually looks like the ones given below:

W: Failed to fetch Unable to connect to
W: Some index files failed to download. They have been ignored, or old ones used instead.

From the first line, the error indicates a mirror that is down or unavailable. In this case, the mirror is unavailable for some reason.

Generally, this means that some repositories activated don’t exist anymore, at least on the mirror we are using.

This error will be gone once the mirror is back online. However, since we cannot be certain how long it will take for the mirror to become available once again, the best method is to switch to a different mirror.

The following are some methods that our Support Engineers follow to fix this error.

1. Reverting to the Original Ubuntu Mirror

Firstly we can try to switch back to the original mirror when we encounter this error.

This involves creating a new sources list file from the sample source list file in /usr/share/doc/apt/examples/sources.list path.

We need to make a backup copy of the sources list using the following command:

$ sudo mv /etc/apt/sources.list{,.backup}

$ sudo mv /etc/apt/sources.list.d{,.backup}

Next, we can create a new sources list file from the sample sources list file using the following commands:

$ sudo mkdir /etc/apt/sources.list.d
$ sudo cp /usr/share/doc/apt/examples/sources.list /etc/apt/sources.list

Finally, update the repositories.

$ sudo apt update

This will restore all the mirrors and enable the ‘Main‘ repository.

To install community-supported software packages, proprietary packages, and packages not available under a completely free license, we might consider enabling the following repositories:

Universe – Community-maintained free and open-source software.
Restricted – Proprietary drivers for devices.
Multiverse – Software restricted by copyright or legal issues.

To enable these repositories, we can use the following commands:

$ sudo add-apt-repository restricted
$ sudo add-apt-repository multiverse
$ sudo add-apt-repository universe

After that, we will update the package lists using the following command:

$ sudo apt update

2. Selecting the Nearest Mirror from Official Ubuntu Mirrors

Alternatively, we can try switching to the nearest mirror. This often happens to be the fastest mirror and relative to our geographical location.

The easiest approach is to ensure that the mirror defined within the sources list file includes the country code relative to our country of residence.

For example, the Official United States mirror provided in /etc/apt/sources.list is:

deb focal main restricted

We can replace the country code with the appropriate country code.

deb focal main restricted

Finally, update the sources list using the following command:

$ sudo apt update

3. Copying Sources List Contents from a Well Functioning System

Another way to resolve this error is to copy the contents of the sources list file from another functional Ubuntu system and paste them into the system’s sources list file. This is by far the easiest method of fixing this error.

4. Finding the best Ubuntu APT repository mirror

We can also fix this issue by finding the best working APT archive mirror for our location and update /etc/apt/sources.list file accordingly.

The mirrors may not always be the closest to our location but offer the best possible download rate and update status.

Firstly, we will backup the existing sources.list file:

$ sudo cp /etc/apt/sources.list{,.backup}

Next, we can check the APT archive mirror. We can do this either in the GUI way or CLI way.

Here, let us see the graphical way:

The steps to follow are given below:

1. First, open the “Software & updates” window.

2. And choose “Other” in the “Download from” drop-down box

3.Then choose the “Select Best Server” option.

A series of tests will be performed to find a mirror that gives the best download speed for our location. It will take just a few seconds.

4. Once the best mirror is found, click on the “Choose Server” option.

5. Now close the Software & Updates window.

Finally, click on the “Reload” button to update the repository lists.

5. Updating the system

Just open synaptic manager, install/reinstall ubuntu-extras-keyring, and then (in terminal) type the following command:

sudo apt-get update

 [Still, stuck with the error? – We can help you]


To conclude, we saw some of the methods which our Support Techs follow to fix the ‘Some index files failed to download’ error.


Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.


var google_conversion_label = "owonCMyG5nEQ0aD71QM";


Submit a Comment

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

Privacy Preference Center


Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]


Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid


Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie


These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.