How to fix “Package operation failed” Error in Ubuntu

Lately, I was trying to update the Oracle VirtualBox to its latest version. But, It didn’t co-operate with me and end up with following error.

Package operation failed 
The installation or removal of a software package failed.

Software Updater_001

It wasn’t the first time I got this kind of error. I have had this error so many times, and I have fixed it too by searching on the Ubuntu forums and Google. But this time I forgot how I solved it in the past. So, I decided to document the procedure, so that someone can use if they have the same issue.

Well, let me show you how I did it.

I opened the Terminal and ran the following commands one by one.

sudo apt-get update
sudo apt-get clean
sudo apt-get autoremove
sudo apt-get update && sudo apt-get upgrade
sudo dpkg --configure -a
sudo apt-get install -f

When I executed the last command, I got the following error.

E: Sub-process /usr/bin/dpkg returned an error code (1)

sk@sk: ~_002

Oops! Again??

However, I opened the Software Updater from the Menu. This time it displayed a message: The update has already been already downloaded.

Software Updater_003

Cool then. I just hit the Install now button. The installation went good and completed without any issues.

Software Updater_004

Hurrah!! I made it. I updated the Oracle VirtualBox successfully.

That’s all for now. Hope you find it useful.

Thanks for stopping by. See you again with another interesting article soon.

  • Neil

    Hi, I’m glad I found your site, I was looking for a way to track down the double file entries on my hard drives. On your suggestion I installed dupeGuru, thank you. I have a question though, I can’t make the program look at my other hard drives. Is this normal or did I do something wrong? Hope you have an answer. Keep up the good work. Thanks

    • Hi you have to partition the other hard drive and mount it to the current system where you installed the dupeGuru. Then, scan the mounted partition using dupeGuru.