Ubuntu中卸載Postgresql出錯(cuò)的解決方法
前言
最近在卸載PostgreSQL數(shù)據(jù)庫(kù)的出錯(cuò)了,無(wú)奈只能一步步的進(jìn)行排查分析解決,下面將解決的過(guò)程分享出來(lái),給同樣遇到這個(gè)問(wèn)題的朋友們參考學(xué)習(xí),下面話不多說(shuō)了,來(lái)一起看看詳細(xì)的介紹吧。
出錯(cuò)輸出:
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): 子進(jìn)程 已安裝 pre-removal 腳本 返回了錯(cuò)誤號(hào) 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): 子進(jìn)程 已安裝 pre-removal 腳本 返回了錯(cuò)誤號(hào) 2 /var/lib/dpkg/info/postgresql-client-9.1.postinst: 7: .: Can't open /usr/share/postgresql-common/maintscripts-functions dpkg:清理時(shí)出錯(cuò): 子進(jìn)程 已安裝 post-installation 腳本 返回了錯(cuò)誤號(hào) 2 在處理時(shí)有錯(cuò)誤發(fā)生: postgresql-9.1 postgresql-client-9.1 E: Sub-process /usr/bin/dpkg returned an error code (1)
解決過(guò)程
使用下面的命令:
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ù)庫(kù) ... 系統(tǒng)當(dāng)前共安裝有 146453 個(gè)文件和目錄。) Removing postgresql-9.1 (9.1.18-0ubuntu0.12.04) ... Removing postgresql-client-9.1 (9.1.18-0ubuntu0.12.04) ...
其實(shí)感覺(jué)是第一個(gè)命令刪除了dpkg關(guān)于postgresql的元數(shù)據(jù)信息,然后使用autoremove命令的時(shí)候,dpkg以為postgresql沒(méi)有安裝,然后提示卸載成功了。
總結(jié)
以上就是這篇文章的全部?jī)?nèi)容了,希望本文的內(nèi)容對(duì)大家的學(xué)習(xí)或者工作能帶來(lái)一定的幫助,如果有疑問(wèn)大家可以留言交流,謝謝大家對(duì)腳本之家的支持。
相關(guān)文章
Navicat設(shè)置PostgreSQL數(shù)據(jù)庫(kù)的表主鍵ID自增的方法
這篇文章主要介紹了Navicat設(shè)置PostgreSQL數(shù)據(jù)庫(kù)的表主鍵ID自增的方法,文章通過(guò)圖文結(jié)合的形式給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2024-06-06
PostgreSQL中ON?CONFLICT的使用及一些擴(kuò)展用法
Postgres?ON?CONFLICT是PostgreSQL數(shù)據(jù)庫(kù)中的一個(gè)功能,用于處理插入或更新數(shù)據(jù)時(shí)的沖突情況,下面這篇文章主要給大家介紹了關(guān)于PostgreSQL中ON?CONFLICT的使用及一些擴(kuò)展用法的相關(guān)資料,需要的朋友可以參考下2024-06-06
PostgreSQL與MySQL的鎖與隔離級(jí)別操作方法
文章詳細(xì)介紹了PostgreSQL和MySQL在鎖機(jī)制上的區(qū)別,包括鎖的粒度、實(shí)現(xiàn)方式、核心鎖類型、死鎖處理方式、實(shí)際使用場(chǎng)景、鎖監(jiān)控和診斷以及性能影響,文章還比較了兩種數(shù)據(jù)庫(kù)在不同場(chǎng)景下的適用性,并給出了選擇建議,感興趣的朋友跟隨小編一起看看吧2025-11-11
PostgreSQL數(shù)據(jù)庫(kù)備份的幾種實(shí)現(xiàn)方法
本文主要介紹了PostgreSQL數(shù)據(jù)庫(kù)備份的幾種實(shí)現(xiàn)方法,包括pg_dump和pg_dumpall是PostgreSQL備份工具,前者備份單數(shù)據(jù)庫(kù),后者備份整個(gè)集群,感興趣的可以了解一下2025-06-06
postgresql 實(shí)現(xiàn)獲取所有表名,字段名,字段類型,注釋
這篇文章主要介紹了postgresql 實(shí)現(xiàn)獲取所有表名,字段名,字段類型,注釋操作,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧2021-01-01
PostgreSQL的upsert實(shí)例操作(insert on conflict do)
這篇文章主要介紹了PostgreSQL的upsert實(shí)例操作(insert on conflict do),具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧2021-01-01
在postgresql中結(jié)束掉正在執(zhí)行的SQL語(yǔ)句操作
這篇文章主要介紹了在postgresql中結(jié)束掉正在執(zhí)行的SQL語(yǔ)句操作,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧2020-12-12
postgres array_to_string和array的用法講解
這篇文章主要介紹了postgres array_to_string和array的用法講解,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧2021-01-01

