Last Updated on
In this tutorial post, we will help you to fix broken packages in Ubuntu 18.04 LTS.
How To Fix Broken Packages In Ubuntu 18.04 LTS
Before jumping into the command line, you have to make sure about the specific broken package. Open your terminal and execute the following commands to fix broken packages in Ubuntu operating system.
sudo dpkg --remove -force --force-remove-reinstreq PACKAGE_NAME_GOES_HERE
In the worst case scenario where you have no clue about the name of the Packages then follow the commands given below:
sudo apt-get --fix-broken install
Or If an installation fails due to the dependencies issues then run the following command
sudo apt-get clean sudo apt-get install -f sudo dpkg --configure -a sudo apt-get update
If a problem is related to MergeList, or displaying a missing “Package: header” error:
E: Encountered a section with no Package: header
E: Problem with MergeList…
E: The package lists or status file could not be parsed or opened.
Then execute the following commands to remove the package lists and recreate:
sudo rm /var/lib/apt/lists/* -vf sudo apt-get update
If a problem occurs with a lock on the apt cache, you need to delete the locks:
sudo fuser -cuk /var/lib/dpkg/lock sudo rm -f /var/lib/dpkg/lock sudo fuser -cuk /var/cache/apt/archives/lock sudo rm -f /var/cache/apt/archives/lock