Software & AppsOperating SystemLinux

How To Fix “Failed to Download Package Files” Error in Ubuntu Update Manager

Ubuntu 18

When using Ubuntu, you might occasionally encounter an error message stating “Failed to Download Package Files” when trying to update your system. This problem can be frustrating, but don’t worry, it’s usually quite straightforward to resolve. In this article, we’ll guide you through several methods to fix this issue and get your Ubuntu Update Manager back on track.

Quick Answer

To fix the "Failed to Download Package Files" error in Ubuntu Update Manager, you can try changing the download location in the Software & Updates settings, resetting the package lists, cleaning the apt-get and GPG cache and keys, following the Package Manager Troubleshooting Procedure, or disabling problematic repositories.

Changing the Download Location

The first method you can try is to change the download location in the Software & Updates settings. Here’s how to do it:

  1. Press Alt + F2 on your keyboard. This will open the Run Application dialog box.
  2. Type software-properties-gtk and press Enter. This will open the Software & Updates window.
  3. In the “Download from” dropdown, change the server to Main Server or another server that’s geographically close to you.

After making this change, go back to the terminal and run sudo apt-get update. This command updates your package list from the repositories defined in /etc/apt/sources.list and /etc/apt/sources.list.d.

Resetting the Package Lists

If changing the download location doesn’t solve the problem, you can try resetting the package lists. To do this, open a terminal and run the following commands:

cd /var/lib/apt
sudo mv lists lists.old
sudo mkdir -p lists/partial
sudo apt-get update

Here’s what these commands do:

  • cd /var/lib/apt: This command changes the current directory to /var/lib/apt, where the package lists are stored.
  • sudo mv lists lists.old: This command renames the current lists directory to lists.old.
  • sudo mkdir -p lists/partial: This command creates a new lists directory and a partial subdirectory within it.
  • sudo apt-get update: This command updates the package lists.

Cleaning the apt-get and GPG Cache and Keys

Another method to try is to clean the apt-get cache and GPG keys. Run the following command:

sudo apt-get clean && sudo apt-get autoclean && sudo apt-get autoremove

This command performs three operations:

  • sudo apt-get clean: This command cleans the apt cache.
  • sudo apt-get autoclean: This command removes .deb files for packages that are no longer installed on your system.
  • sudo apt-get autoremove: This command removes packages that were automatically installed to satisfy dependencies for other packages and are now no longer needed.

If the issue persists, you can also try the command mentioned in this command.

Following the Package Manager Troubleshooting Procedure

If none of the above methods work, you can follow the Package Manager Troubleshooting Procedure. This is a step-by-step guide provided by the Ubuntu community to troubleshoot and resolve package manager issues. Start with steps 1-4 of the procedure, and if the problem persists, continue with the other steps.

Disabling Problematic Repositories

In some cases, a single enabled repository might be causing the issue. If you suspect this is the case, you can disable the problematic repository. Here’s how:

  1. Open the Software & Updates window as explained in the first method.
  2. Go to the Other Software tab.
  3. Uncheck the problematic repository.

After disabling the repository, run sudo apt-get update again.

Conclusion

The “Failed to Download Package Files” error in Ubuntu can be frustrating, but it’s often easy to resolve. By changing the download location, resetting the package lists, cleaning the apt-get and GPG cache and keys, following the Package Manager Troubleshooting Procedure, or disabling problematic repositories, you should be able to resolve the issue and get your Ubuntu Update Manager back on track.

How do I open the Software & Updates window?

To open the Software & Updates window, press Alt + F2 on your keyboard to open the Run Application dialog box. Then, type software-properties-gtk and press Enter.

How do I reset the package lists?

To reset the package lists, open a terminal and run the following commands:

cd /var/lib/apt
sudo mv lists lists.old
sudo mkdir -p lists/partial
sudo apt-get update
How do I clean the apt-get cache and GPG keys?

To clean the apt-get cache and GPG keys, run the following command:

sudo apt-get clean && sudo apt-get autoclean && sudo apt-get autoremove
What should I do if none of the above methods work?

If none of the above methods work, you can follow the Package Manager Troubleshooting Procedure provided by the Ubuntu community. Start with steps 1-4 of the procedure and continue with the other steps if the problem persists.

Leave a Comment

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