How to solve an error in uninstalling Postgresql in Ubuntu: ubuntupostgresql

Source: Internet
Author: User
Tags postgresql

How to solve an error in uninstalling Postgresql in Ubuntu: ubuntupostgresql

Preface

An error occurred while uninstalling the PostgreSQL database recently. Instead, you can troubleshoot and solve the problem step by step. Here we will share the solution process and learn from friends who have encountered this problem, I won't talk much about it below. Let's take a look at the detailed introduction.

Error output:

Removing postgresql-9.1 (9.1.18-0ubuntu0. 12.04 )... /var/lib/dpkg/info/postgresql-9.1.prerm: 9 :.: Can't open/usr/share/postgresql-common/maintscripts-functionsdpkg: error processing package postgresql-9.1 (-- remove ): the sub-process has installed the pre-removal script and returns the error code 2 dpkg: postgresql-client-9.1: dependency problems, but removing anyway as you requested: postgresql-9.1 depends on the postgresql-client-9.1.Removing postgresql-client-9.1 (9.1.18-0ubuntu0. 12.04 )... /var/lib/dpkg/info/postgresql-client-9.1.prerm: 10 :.: Can't open/usr/share/postgresql-common/maintscripts-functionsdpkg: error processing package postgresql-client-9.1 (-- remove ): the sub-process has installed the pre-removal script and Returns Error Code 2/var/lib/dpkg/info/postgresql-client-9.1.postinst: 7 :.: Can't open/usr/share/postgresql-common/maintscripts-functionsdpkg: An error occurred while cleaning: the Sub-process installed post-installation script returns error number 2 errors occurred during processing: postgresql-9.1 postgresql-client-9.1E: Sub-process/usr/bin/dpkg returned an error code (1)

Solution Process

Run the following command:

sudo rm -r /var/lib/dpkg/info/postgresq*

Then

sudo apt-get autoremove postgresql*

Finally, you can see:

Dpkg: Warning: files list file for package 'postgresql-100' missing; assuming package has no files currently installeddpkg: Warning: files list file for package 'postgresql-client-100' missing; assuming package has no files currently installed (Reading database... the system currently has 146453 files and directories installed .) Removing postgresql-9.1 (9.1.18-0ubuntu0. 12.04)... Removing postgresql-client-9.1 (9.1.18-0ubuntu0. 12.04 )...

In fact, it seems that the First Command deletes the metadata information of dpkg about postgresql. When you use the autoremove command, dpkg assumes that postgresql is not installed and then prompts that the uninstall is successful.

Summary

The above is all the content of this article. I hope the content of this article will help you in your study or work. If you have any questions, please leave a message, thank you for your support.

Related Article

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.