Debian, ubuntu Recovery mistakenly deleted (or re-installed)/var/lib/dpkg

Source: Internet
Author: User

In the use of Ubuntu, it is possible to encounter dpkg hanging off, the universal solution on the Web, if it does not work:

1,

sudo dpkg--configure-a resolves this issue

2,

sudo rm /var/lib/dpkg/updates/*sudo apt-get updatesudo apt-get upgrade

And so on, if according to the above method, can not solve, simply reload dpkg (first dpkg directory to kill: sudo rm-rf/var/lib/dpkg), and then reload?

> Terminal: sudo mkdir-p/var/lib/dpkg/{alternatives,info,parts,triggers,updates}

Create a dpkg directory and its subfolders

> Terminal: sudo cp/var/backups/dpkg.status.0/var/lib/dpkg/status

Copy a status from the backup directory.

>sudo Apt-get Install dpkg

>sudo apt-get Update

Debian, ubuntu Recovery mistakenly deleted (or re-installed)/var/lib/dpkg

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.