前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Ubuntu下Postgresql卸载出错的解决办法

Ubuntu下Postgresql卸载出错的解决办法

作者头像
卡尔曼和玻尔兹曼谁曼
发布2019-01-22 11:21:47
9990
发布2019-01-22 11:21:47
举报
文章被收录于专栏:给永远比拿愉快

出错输出:

代码语言:javascript
复制
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)

使用下面的命令:

代码语言:javascript
复制
sudo rm -r /var/lib/dpkg/info/postgresq*

然后是

代码语言:javascript
复制
sudo apt-get autoremove postgresql*

最后可以看到:

代码语言:javascript
复制
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没有安装,然后提示卸载成功了。

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2015年09月28日,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档