前言

最近在卸载PostgreSQL数据库的出错了,无奈只能一步步的进行排查分析解决,下面将解决的过程分享出来,给同样遇到这个问题的朋友们参考学习,下面话不多说了,来一起看看详细的介绍吧。

出错输出:

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-functions
dpkg: error processing package postgresql-9.1 (--remove):
 子进程 已安装 pre-removal 脚本 返回了错误号 2
dpkg: postgresql-client-9.1: dependency problems, but removing anyway as you requested:
 postgresql-9.1 依赖于 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-functions
dpkg: error processing package postgresql-client-9.1 (--remove):
 子进程 已安装 pre-removal 脚本 返回了错误号 2
/var/lib/dpkg/info/postgresql-client-9.1.postinst: 7: .: Can't open /usr/share/postgresql-common/maintscripts-functions
dpkg:清理时出错:
 子进程 已安装 post-installation 脚本 返回了错误号 2
在处理时有错误发生:
 postgresql-9.1
 postgresql-client-9.1
E: Sub-process /usr/bin/dpkg returned an error code (1)

解决过程

使用下面的命令:

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

然后是

sudo apt-get autoremove postgresql*

最后可以看到:

dpkg:警告:files list file for package 'postgresql-9.1' missing; assuming package has no files currently installed
dpkg:警告:files list file for package 'postgresql-client-9.1' missing; assuming package has no files currently installed
(正在读取数据库 ... 系统当前共安装有 146453 个文件和目录。)
Removing postgresql-9.1 (9.1.18-0ubuntu0.12.04) ...
Removing postgresql-client-9.1 (9.1.18-0ubuntu0.12.04) ...

其实感觉是第一个命令删除了dpkg关于postgresql的元数据信息,然后使用autoremove命令的时候,dpkg以为postgresql没有安装,然后提示卸载成功了。

总结

以上就是这篇文章的全部内容了,希望本文的内容对大家的学习或者工作能带来一定的帮助,如果有疑问大家可以留言交流,谢谢大家对的支持。

标签:
ubuntu卸载postgresql,postgresql,ubuntu,postgresql,卸载

免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
狼山资源网 Copyright www.pvsay.com

评论“Ubuntu中卸载Postgresql出错的解决方法”

暂无“Ubuntu中卸载Postgresql出错的解决方法”评论...

P70系列延期,华为新旗舰将在下月发布

3月20日消息,近期博主@数码闲聊站 透露,原定三月份发布的华为新旗舰P70系列延期发布,预计4月份上市。

而博主@定焦数码 爆料,华为的P70系列在定位上已经超过了Mate60,成为了重要的旗舰系列之一。它肩负着重返影像领域顶尖的使命。那么这次P70会带来哪些令人惊艳的创新呢?

根据目前爆料的消息来看,华为P70系列将推出三个版本,其中P70和P70 Pro采用了三角形的摄像头模组设计,而P70 Art则采用了与上一代P60 Art相似的不规则形状设计。这样的外观是否好看见仁见智,但辨识度绝对拉满。