Fix brocken packages by following List Of Commands

21:11

Fix broken packages

on Ubuntu and Kali Linux with various methods please follow the list of commands and remove all the broken packages. If you still face any error or remaining broken packages let me know in the comment box. I'll help you to delete that :)
Fix broken packages on Uubuntu various mathords
Update and fix missing packages
sudo apt-get update –fix-missing
Force to install
sudo apt-get install -f 
Fix installation pkg itself
sudo dpkg –configure -a
List all the installed packages
sudo dpkg --list
Search for problematic package
sudo dpkg -l | grep ^..r
You can also remove a package by its name
sudo apt-get purge "file-name"
Clean all the downloaded files for installing a package or multiple
sudo apt clean
Update the terminal
sudo apt update
It removes the lock in the list directory
sudo rm /var/lib/apt/lists/lock
It removes the lock-in archives directory
sudo rm /var/cache/apt/archives/lock
Remove automatically installed packages no longer required
sudo apt-get autoremove
Update the packages
sudo apt-get update
Upgrade the packages
sudo apt-get upgrade
Update and upgrade in a single command
sudo apt update && sudo apt upgrade
Reboot required after fixing broken packages
reboot
Mathord 2
List packages
sudo dpkg --list
Search for packages using its name
sudo dpkg --list|grep pkgname
Force to remove the package using ints name
sudo dpkg --remove -force --force-remove-reinstreq PACKAGE_NAME_GOES_HERE
Fix installation pkg itself
sudo apt-get --fix-broken install
Clean all the downloaded files during package installation
sudo apt-get clean
Install forcefully
sudo apt-get install -f
Fix installation pkg itself
sudo dpkg --configure -a
Update terminal
sudo apt-get update
Remove lock files
sudo rm /var/lib/apt/lists/* -vf
Update
sudo apt-get update
Clean downloaded file during installation
sudo apt-get clean
Free up some more space by removing apt-get files, not in use
sudo apt-get autoclean
Remove packages automatically installed at the time of downloading pkg files
sudo apt-get autoremove
Fix installation pkg itself
sudo dpkg --configure -a
Update system
sudo apt-get update
Kali Linux
sudo apt-get update --fix-missing
sudo apt-get install -f
sudo apt-get update
sudo apt-get clean
sudo apt-get autoremove
sudo dpkg --remove -force --force-remove-reinstreq Package_Name
sudo dpkg --configure -a
apt-get remove package_name
sudo apt-get clean
sudo apt-get update
sudo rm /var/lib/apt/lists/lock
sudo rm /var/lib/dpkg/lock
sudo rm /var/lib/dpkg/lock-frontend
sudo dpkg --configure -a
sudo apt clean
udo apt update --fix-missing
sudo apt install -f
sudo dpkg --configure -a
sudo apt upgrade
sudo apt dist-upgrade
sudo reboot