+12 votes
1.2k views
in Linux by (12.2k points)

How to troubleshoot the Install or Update Packages on Ubuntu or Linux Mint

2 Answers

+13 votes
by (201k points)

Sometimes when making a failed installation or interrupt an update accidentally, we can cause problems in Ubuntu or Linux Mint (or any Debian based distribution) and it happens that the package system stops working and when trying to update or install any other packages you can stop working and just tell us a message that is sometimes not so descritptivo to know how to fix it

 

 
 
To solve this problem one must run the following command: 
 
 
sudo dpkg -configure -a 
 
 
This command tells the system to finish the pending packages installation. If you still showing the problem you can delete some files to make any configuration or file that could be wrong is not maintained. For this go to the following folder and removes .portrm and .list files, you can do it with the following commands: 
 
 
1. Delete files: 
 
 
sudo rm /var/lib/dpkg/info/*.postrm 
 
sudo rm /var/lib/dpkg/info/*.list 
 
 
2. Removes package cache and updates the system 
 
 
sudo apt-get clean all 
 
sudo apt-get update 
 
sudo apt-get upgrade 
 
 
With this system we clean our packs and prepared to continue to work smoothly and to install or upgrade without problems
+8 votes
by (201k points)
Error: repository is not updated and the previous index files will be used 
 
 
If it happens that it shows a message like this: "An error occurred during the signature verification. The repository is not updated and the old index files will be used "a problem has occurred with the package list and can not be accessed, in this case it is better to delete them and download everything again, for this run these commands.: 
 
 
sudo rm / var / lib / apt / lists / * 
 
sudo rm / var / lib / apt / lists / partial / * 
 
sudo apt-get update 
 
 
Usually you should be able to install any package or upgrade the system packages that require using the command 
 
 
sudo apt-get upgrade 
 
 
Error: something went wrong, run "sudo apt-get install f" 
 
 
Another common error with the package manager is telling you that there is a problem with the update manager or software center and the error message tells you that you run a command like this: 
 
 
sudo apt-get install f 
 
 
I recommend you do it as the problem of incomplete installation or an update resolves, once this is done you can run the following command again: 
 
 
sudo apt-get update 
 
sudo apt-get upgrade 
 
 
Error: Reading package lists! 
 
 
This error is common when it is interrupted downloading the package list and have not processed all the files in the list, you just have to fix that ejecuar these commands 
 
 
sudo rm / var / lib / apt / lists / * -vf 
 
sudo apt-get update 
 
 
With this all listings shall be eliminated and downloaded the most current and you can continue installing the packages you need or upgrading your system. 
And that's it.
Ask a Question
Welcome to WikiTechSolutions where you can ask questions and receive answers from other members of the community.

You can ask a question without registration.

Categories

...