<\/span><\/h2>\r\n\r\n\r\n\r\nMore often than not, a broken package that broke after it was installed can be relatively easy to fix, thanks to a built-in tool inside of apt-get. Performing the following commands will try and fix any broken packages currently installed on your system:<\/p>\r\n\r\n\r\n\r\n
sudo apt-get update --fix-missing<\/pre>\r\n\r\n\r\n\r\nsudo apt-get install -f<\/pre>\r\n\r\n\r\n\r\n(the -f option is short for fix-broken.)<\/p>\r\n\r\n\r\n\r\n
Try and see if the first command fixes your problem before executing the second command. Give it a few moments to try and fix any errors that it may find. If it works, then try and use the package that was broken – it will likely be fixed now. \u00a0In case it still isn\u2019t fixed, proceed to the next solution below.<\/p>\r\n\r\n\r\n\r\n
<\/span>Method 2: Using dpkg and apt-get<\/span><\/h2>\r\n\r\n\r\n\r\nThis solution will help out if a software package broke while being installed. You can try using the previous method before continuing, as it may help. First, we clean apt-get and try using dpkg to configure any packages that need it:<\/p>\r\n\r\n\r\n\r\n
sudo dpkg --configure -a\r\n\r\nsudo apt-get clean\r\n\r\nsudo apt-get update<\/pre>\r\n\r\n\r\n\r\nAfter this, see if the package has been fixed. If it hasn\u2019t, you may need to delete the lock files. Lock files are used to keep resources available for certain programs – it helps prevent other programs from accessing files at the same time. This can be done by simply deleting the lockfile list:<\/p>\r\n\r\n\r\n\r\n
sudo rm \/var\/lib\/apt\/lists\/lock<\/pre>\r\n\r\n\r\n\r\nAfter this, try and run the above commands once more. From there, try and reinstall the package to see if it can now be successfully installed.<\/p>\r\n\r\n\r\n\r\n