简体   繁体   中英

How to reinstall broken packages of python

dpkg: error processing package python-cairo (--configure):

package is in a very bad inconsistent state; you should
 reinstall it before attempting configuration

There is a broken package in the python. Whenever i try installing a package, it throws this error.

Please help me to solve this out ! Thanks !

sudo dpkg --remove --force-remove-reinstreq python-cairo
sudo apt-get install python-cairo

Try the below code. It works

sudo mv /var/lib/dpkg/info/<packagename>.* /tmp/
sudo dpkg --remove --force-remove-reinstreq <packagename>
sudo apt-get remove <packagename>
sudo apt-get autoremove && sudo apt-get autoclean

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM