前言
最近在卸載PostgreSQL數(shù)據(jù)庫的出錯了,無奈只能一步步的進行排查分析解決,下面將解決的過程分享出來,給同樣遇到這個問題的朋友們參考學(xué)習(xí),下面話不多說了,來一起看看詳細的介紹吧。
出錯輸出:
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)當(dāng)前共安裝有 146453 個文件和目錄。) Removing postgresql-9.1 (9.1.18-0ubuntu0.12.04) ... Removing postgresql-client-9.1 (9.1.18-0ubuntu0.12.04) ...
其實感覺是第一個命令刪除了dpkg關(guān)于postgresql的元數(shù)據(jù)信息,然后使用autoremove命令的時候,dpkg以為postgresql沒有安裝,然后提示卸載成功了。
總結(jié)
以上就是這篇文章的全部內(nèi)容了,希望本文的內(nèi)容對大家的學(xué)習(xí)或者工作能帶來一定的幫助,如果有疑問大家可以留言交流,謝謝大家對腳本之家的支持。
標(biāo)簽:呼倫貝爾 池州 黃石 舟山 楚雄 白山 安順 菏澤
巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《Ubuntu中卸載Postgresql出錯的解決方法》,本文關(guān)鍵詞 Ubuntu,中,卸載,Postgresql,出,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請?zhí)峁┫嚓P(guān)信息告之我們,我們將及時溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。