Connect with us

Hi, what are you looking for?

Linux

How to Fix Broken Packages on Ubuntu 16.04

How to Fix Broken Packages on Ubuntu 16.04 / Debian 9. When a Linux user or sysadmin performs package management on Ubuntu / Debian most of them preferred apt-get or dpkg as a package management utility to install and upgrade the new packages. This types of errors occurs periodically where installation is done in mean time when user faces broken packages issues due to various reasons including improper package management, incorrect packages installation, incorrect installation of packages from source files, installation of unwanted packages, installation of in-compatible packages, etc. This tutorial explains how to fix those broken packages in mean time by integrating given tips and tricks on your Ubuntu / Debian distribution.

Pre-Steps-1 (Remove the apt-get package locks)
$ sudo rm -rf /var/lib/apt/lists/lock /var/cache/apt/archives/lock /var/lib/dpkg/lock
Pre-Steps-2 (Restart your Ubuntu / Debian distribution)
$ sudo init 6
Step-1 (Remove the repository cache using apt-get package manager)
$ sudo apt-get clean all
Step-2 (Update the repository cache using given commands)
$ sudo apt-get update
Step-3 (Upgrade the packages to upgrade the distributions)
$ sudo apt-get upgrade
Step-4 (Now run distribution upgrade command to update the packages)
$ sudo apt-get dist-upgrade
Step-5 (Find broken packages list to fix)
$ sudo dpkg -l | grep ^..r

Note: After the above command it shows the list of broken packages and you need to note all the broken packages name to remove it one by one using given commands.

Step-6 (Force removal of broken packages using given commands)
$ sudo apt-get remove package-name

Note: You must change the package-name with the broken-packages-name that you have noted earlier.If above commands won’t works then given command is necessary to remove it forcefully.

$ sudo dpkg --force-all --remove package-name

Conclusion

Finally you have fixed above broken packages using above apt-get and dpkg package mangers using above commands. Above fix is useful to fix those broken packages and If you have some issues then you need to use the comment section below for more help and support.

Comments
Advertisement
Advertisement
Advertisement

You May Also Like

Windows

How to auto upgrade JioFi firmware for JioFi 2 / JioFi 3 / JioFi 4 / JioFi 5 / JioFi 6 and other JioFi...

Windows

Internet is the most important public network for connecting to the WEB. For internet connection requirement the ISP is required as well as it...

Windows

How to download and install the Mobile Intel 4 Series Express Chipset Graphics Drivers for Windows 10.  Windows 10 is the one of the...

Windows

How to Install and Configure PCSX2 on Windows 10. The Windows 10 is the most recommended operating system for the Games. In stream platform...