Update error in Ubuntu are pretty common. One of the errors you will see while updating Ubuntu is failed to download package files. In this quick tip we shall see how to fix this error.
Failed to download package files error
This error is not limited to Ubuntu only. Other distributions based on Ubuntu too have this error every now and then. In fact, I encountered this issue in Elementary OS but since the fix is common to all, I put Ubuntu in title so that it could reach more people.
Let’s try to understand the error first. I ran the Update Manager and I saw ‘failed to download package files error’:
Looking at the details of the error, I found that it could not get a specific package from the URL it was trying to access. I copied the URL and tried to access it via web browser. As expected, files was not there:
To further check, I tried to look for all the available versions of the same package only to find that specific version which Update Manager was looking for was missing:
Now, this is amusing. Why would the Update Manager try to get the version which is not on the server?
Fixing ‘failed to download package files’ error
The reason for this error is that Update Manager is using a server which doesn’t have that specific package version, not yet. If you do not know already, when you install Ubuntu or any other Linux OS, the software sources are set by default to the server mirror near your location. This is to ensure that software downloads (and updates) are at good speed.
But it could happen that the server your system is using, has not been updated from the main server yet. This could happen for several reasons. What you can do to fix the error is to change the server to Main Server and you can continue with the updates smoothly.
Let’s see how to fix it.
Go to Software Source:
In Ubuntu Software tab, change server to Main server.
Save your change. It will update the software cache. Run the Update Manager again. The update should work just fine now.
A similar update error is failed to download repository information which can be fixed easily as well. I hope this tutorial helped you to fix the failed to download package files error in Ubuntu. Any questions or suggestions are always welcomed.