Saturday, January 4, 2014

How to Fix Ubuntu Update Errors

It happens quite often that we encounter errors while trying to run an update in Ubuntu. There are several type of errors and in this post we will see how to solve some of the most common errors encountered during update of packages in Ubuntu.

Sometimes running the updates in the Update Manger results in the following error:
Could not initialize the package information.
An unresolvable problem occurred while initializing the package information.
Please report this bug against the ‘update-manager’ package and include the following error message:
‘E:Encountered a section with no Package: header, E: Problem with MergeList /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_natty_main_binary-amd64_Packages, E:The package lists or status file could not be parsed or opened.’
A similar error occurs while running the apt-get update command in terminal:
Reading package lists… Error!
E: Encountered a section with no Package: header
E: Problem with MergeList /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_natty_main_binary-amd64_Packages
E: The package lists or status file could not be parsed or opened.
There is a one shot solution to the above errors. Open the terminal and run the following commands in the given order:
sudo rm -rf /var/lib/apt/lists/* 
sudo apt-get clean 
sudo apt-get update
Hope that solves the above mentioned problems. Now lets move on to another type of error.
A very common error while installing an application or updating a package is following:
E: Could not get lock /var/lib/dpkg/lock – open (11: Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
The reason is quite obvious from the error itself “another process using it”. Which means another process is already using the mentioned directory (necessary for the application to be installed) through Synaptic Package Manager, Update Manger, terminal or Ubuntu Software Center.
The idea would be to look for another application which is being installed or update it. Wait for it to finish the installation or cancel it. If you cannot see the application then try running this command in the terminal to solve this error:
sudo rm /var/lib/apt/lists/lock
I faced a strange situation today when I ran the Update Manager in Ubuntu. It showed me a number of updates to be installed and when I clicked on Install Updates it showed me the following error:
The action would require the installation of packages from not authenticated sources
ubuntu-require-untrusted-packages
There could be several reason for this error:
  • Software is restricted by copyright or legal issues
  • The Software is from Canonical Partner and has not been added to Source List
  • The application has been installed form its source code
  • Missing public key of the application
If you do not know which is the root cause of error, then follow the instructions for each of them and then you can find it out. Lets see how to tackle these problem one by one:

(i) Software is restricted by copyright or legal issues

Run the Update Manager. And go to Settings as shown in the pic below:
ubuntu-update-manger-settings
Now here, go to the Ubuntu Software tab and make sure that Software is restricted by copyright or legal issues field is checked. Close the settings and install updates now.
ubuntu-synaptic-multiverse

(ii) The Software is from Canonical Partner and has not been added to Source List

In the Update Manager Settings, go to Ubuntu Software tab and include the Source Code for updates like in the pic below:
ubuntu-synaptic-canonical-settings

(iii) The application has been installed form its source code

In the Update Manger Settings, go to Ubuntu Software tab and check the Source Code option:
ubuntu-synaptic-source

(iv) Missing public key of the application

Open the terminal (Ctrl+Alt+T) and run the following command:
sudo apt-get update
Now wait till it finishes and see if you see something like this:
W: GPG error: http:/something.something Release: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY XXXXXXXXXXXXXXXX
Note down the numbers you see after NO_PUBKEY. This error is because the application’s public key has not been added. To solve the error use the following command in the terminal:
sudo apt-key adv --recv-key --keyserver keyserver.ubuntu.com XXXXXXXXXXXXXXXX
After adding the missing public key run the following command (again):
sudo apt-get update
I hope it helps solve your problem. Do provide us your feedback and if you are facing errors other than this do let us know. Comments section is all yours. Enjoy :)

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.