How to fix Ubuntu update errors

In this article, you will learn how to fix some common update errors that occur frequently when you try to update your Ubuntu version.

Ubuntu is a popular and reliable operating system, but occasionally updates can fail or produce errors. These errors can range from minor issues that can be easily resolved, to more serious problems that may require more extensive troubleshooting. In this tutorial, we will discuss some common methods for fixing Ubuntu update errors, including an introduction to some of the tools and techniques that you can use to troubleshoot and resolve update issues.

Before diving into the specific steps for fixing update errors, it is important to understand a few key concepts and tools that will be useful in troubleshooting and resolving update issues on Ubuntu. These include:

The “apt” package manager: Ubuntu uses the “apt” package manager to install, update, and manage packages on the system. Apt is a powerful and flexible tool, but can also be a source of update errors if there are issues with the package repository or with the packages themselves.

The “apt-get” command: The “apt-get” command is a command-line tool for interacting with the apt package manager. You can use apt-get to install, update, and remove packages, as well as to troubleshoot and resolve update issues.

The “apt-cache” command: The “apt-cache” command is a command-line tool that allows you to view information about packages in the package repository, such as their dependencies, files, and descriptions. You can use apt-cache to investigate issues with specific packages and their dependencies.

The “apt-config” command: The “apt-config” command is a command-line tool that allows you to view and modify the configuration options for the apt package manager. You can use apt-config to investigate issues with the package repository or with the configuration of apt itself.

With these concepts and tools in mind, we can now move on to discussing some common methods for fixing update errors on Ubuntu.

Error with “Hash sum Mismatch” :

When checking for updates, you might end up getting a “Failed To Download Repository Information” error.

This problem affects particularly rapidly changing repositories, such as the development release.
In order to fix this issue, you would just need to remove all the content of the directory /var/lib/apt/lists. Run the following command in the terminal :

sudo rm -rf /var/lib/apt/lists/*

then run:

sudo apt-get update

Read: What you need to do to secure Ubuntu

Problem with MergeList error :

It is one of the most frequently occurring errors during an Ubuntu update (sudo apt-get update not working|sudo apt update not working for instance ). It can happen when using both the sudo apt-get update in terminal and Ubuntu Update Manager. The error text might look similar to the following:

E:Encountered a section with no Package: header,
E:Problem with MergeList /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_precise_universe_binary-i386_Packages,

E:The package lists or status file could not be parsed or opened.

Issue the following commands to fix the problem:

sudo rm -r /var/lib/apt/lists/*

sudo apt-get clean && sudo apt-get update

“Failed to Download Repository Information” Error :

This is a rather generic error that can pop up for any kind of error during an Ubuntu update. You might have added a PPA which is not responding or is no longer available. It might look like the following :

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

If this a PPA problem, you would just need to identify the PPA that is failing and remove it from sources file.

Read: How to speed up Linux

To fix this, just issue the commands below like you did above:

sudo rm -rf /var/lib/apt/lists/*

then run:

sudo apt-get update

Error “Failed to download package files error”

This can be solved easily by modifying the software sources to Main server.

Read: How to install and uninstall applications in Ubuntu ? A Beginner’s guide

It’s simple: just open : Software & Updates, go to download from and change download server to main server .

This change will make future downloads slightly slower, due to the fact the main server is busier than a local server. This should provide more stability and a longer up-time.

Could not get lock /var/cache/apt/archives/lock

This error occurs when APT is being used by another program. In case an installation from Ubuntu Software Center is ongoing and at the same time you are running apt in the terminal, this error can pop up and might look similar to the output below:

E: Could not get lock /var/cache/apt/archives/lock – open (11: Resource temporarily unavailable)
E: Unable to lock directory /var/cache/apt/archives/

Since you can close the software update once it completed so that the lock gets released. If the problem persists however, issue the following commands:

sudo rm /var/lib/apt/lists/lock

Read: How to fix ‘E: Could not get lock /var/lib/dpkg/lock’ Error in Ubuntu

If the command above did not solve this problem, try the command:

sudo killall apt-get

Partial upgrade error

When installing updates in the terminal, you might encounter this upgrade error :

You may want to execute the command below to try to fix this error:

sudo apt-get install -f

Error while loading shared libraries

This is rather an installation error and not an update error. In case you are trying to install a program directly from the source code, this error might pop up:

Read: How to fix high memory usage in Linux

error while loading shared libraries:

cannot open shared object file: No such file or directory

To fix this issue, try to issue the following command:

sudo /sbin/ldconfig -v

GPG error: The following signatures couldn’t be verified

This isn’t much of an error but rather a small configuration issue. It used to occur quite frequently with IGD( Intel Graphics Drivers ) when trying to add the PPA. The error might look similar to the output below :

W: GPG error: saucy InRelease: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY 68980A0EA10B4DE8

The solution would be is to look up the public key that was not available from the remote server. Copy the key from the message and run the following command:

sudo apt-key adv –keyserver –recv-keys 68980A0EA10B4DE8

Once the key has been retrieved and added, issue an update again and you should be good to go.

Read: How to use the APT command on Ubuntu/Debian Linux systems

BADSIG error

The BADSIG error might resemble the output below :

W: GPG error: lucid Release: The following signatures were invalid: BADSIG 54422A4B98AB5139 Oracle Corporation (VirtualBox archive signing key)

To fix this error, run the following commands in the terminal:

sudo apt-get clean

cd /var/lib/apt

sudo mv lists oldlist

sudo mkdir -p lists/partial

sudo apt-get clean

sudo apt-get update

If the issue occurs again however, open Nautilus as root and navigate to var/lib/apt then delete the “lists.old” directory. Afterwards, open the “lists” folder and remove the “partial” directory. Finally, run the above commands again.

If this does not work, copy the character shown in bold in the error message above and then issue the command below like you did in the previous section :

sudo apt-key adv –recv-keys –keyserver 54422A4B98AB5139

Another simpler way to fix the BADSIG GPG errors is via Y PPA manager.

First you would need to install it via the following commands :

sudo add-apt-repository ppa:webupd8team/y-ppa-manager

sudo apt-get update

sudo apt-get install y-ppa-manager

Then open it up by invoking :

And click on Advanced and then select Fix all GPG Badsig errors:

If you like the content, we would appreciate your support by buying us a coffee. Thank you so much for your visit and support.


Nikolaus Oosterhof

Nikolaus holds a degree in software development and has a strong passion for all things tech-related, especially gadgets with screens. Though he is nostalgic for older phone models, he's a retired gamer and continues to enjoy programming in open-source environments. Additionally, Nikolaus enjoys writing about Linux, macOS and Windows and has experience designing web pages.

Leave a Reply