Ubuntu中卸載Postgresql出錯的解決方法
更新時間:2017年09月05日 10:54:00 作者:TheOneGIS
這篇文章主要給大家介紹了關于在Ubuntu中卸載Postgresql出錯的解決方法,文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友們下面隨著小編來一起學習學習吧。
前言
最近在卸載PostgreSQL數(shù)據(jù)庫的出錯了,無奈只能一步步的進行排查分析解決,下面將解決的過程分享出來,給同樣遇到這個問題的朋友們參考學習,下面話不多說了,來一起看看詳細的介紹吧。
出錯輸出:
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 在處理時有錯誤發(fā)生: 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 (正在讀取數(shù)據(jù)庫 ... 系統(tǒng)當前共安裝有 146453 個文件和目錄。) Removing postgresql-9.1 (9.1.18-0ubuntu0.12.04) ... Removing postgresql-client-9.1 (9.1.18-0ubuntu0.12.04) ...
其實感覺是第一個命令刪除了dpkg關于postgresql的元數(shù)據(jù)信息,然后使用autoremove命令的時候,dpkg以為postgresql沒有安裝,然后提示卸載成功了。
總結
以上就是這篇文章的全部內容了,希望本文的內容對大家的學習或者工作能帶來一定的幫助,如果有疑問大家可以留言交流,謝謝大家對腳本之家的支持。
相關文章
pg中replace和translate的用法說明(數(shù)據(jù)少的中文排序)
這篇文章主要介紹了pg中replace和translate的用法說明(數(shù)據(jù)少的中文排序),具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧2021-01-01postgresql 實現(xiàn)將字段為空的值替換為指定值
這篇文章主要介紹了postgresql 實現(xiàn)將字段為空的值替換為指定值,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧2021-01-01