我在網上嘗試了多種方法來解決這個問題,例如運行sudo apt-get -f install
和sudo apt-get clean
這是我嘗試使用軟體更新程式更新時得到的結果:
Check if you are using third party repositories. If so disable them, since they are a common source of problems.
Furthermore run the following command in a Terminal: apt-get install -f
Transaction failed: The package system is broken
The following packages have unmet dependencies:
libpam-modules: PreDepends: libaudit1 (>= 1:2.2.1) but 1:2.8.5-2ubuntu6 is installed
PreDepends: libc6 (>= 2.27) but 2.31-0ubuntu9.2 is installed
PreDepends: libcrypt1 (>= 1:4.1.0) but 1:4.4.10-10ubuntu4 is installed
PreDepends: libselinux1 (>= 2.1.9) but 3.0-1build2 is installed
PreDepends: libpam-modules-bin (= 1.3.1-5ubuntu4.2) but 1.3.1-5ubuntu4.3 is installed
我嘗試遵循本指南的答案。但這沒有幫助:加入 PPA 後如何解決未滿足的依賴關係?
結果sudo apt-get update
:
E: The repository 'http://ppa.launchpad.net/nathan-renniewaldock/flux/ubuntu focal Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
順便說一句,我運行的是 20.04 版本。我是菜鳥,所以我不確定我在做什麼,我只需要解決這個問題
編輯:結果sudo get update
:
Hit:1 http://archive.canonical.com/ubuntu focal InRelease
Get:2 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]
Hit:3 http://de.archive.ubuntu.com/ubuntu focal InRelease
Hit:4 http://de.archive.ubuntu.com/ubuntu focal-updates InRelease
Get:5 http://de.archive.ubuntu.com/ubuntu focal-backports InRelease [101 kB]
Get:6 http://security.ubuntu.com/ubuntu focal-security/main amd64 DEP-11 Metadata [29,0 kB]
Get:7 http://security.ubuntu.com/ubuntu focal-security/universe amd64 DEP-11 Metadata [63,7 kB]
Get:8 http://security.ubuntu.com/ubuntu focal-security/multiverse amd64 DEP-11 Metadata [2.464 B]
Fetched 310 kB in 2s (148 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
58 packages can be upgraded. Run 'apt list --upgradable' to see them.
結果sudo get upgrade
:
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
libpam-modules : PreDepends: libpam-modules-bin (= 1.3.1-5ubuntu4.2)
Recommends: update-motd but it is not installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
結果apt --fix-broken install
apt --fix-broken install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
libgsoap-2.8.91 libllvm11 liblzf1 libvncserver1 shim virtualbox-dkms
Use 'apt autoremove' to remove them.
The following additional packages will be installed:
libpam-modules
Recommended packages:
update-motd
The following packages will be upgraded:
libpam-modules
1 upgraded, 0 newly installed, 0 to remove and 57 not upgraded.
Need to get 0 B/260 kB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable
(Reading database ... 258871 files and directories currently installed.)
Preparing to unpack .../libpam-modules_1.3.1-5ubuntu4.3_amd64.deb ...
debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable
dpkg: error processing archive /var/cache/apt/archives/libpam-modules_1.3.1-5ubuntu4.3_amd64.deb (--unpack):
new libpam-modules:amd64 package pre-installation script subprocess returned error exit status 1
Errors were encountered while processing:
/var/cache/apt/archives/libpam-modules_1.3.1-5ubuntu4.3_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
結果sudo apt autoremove
sudo apt autoremove
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
libpam-modules : PreDepends: libpam-modules-bin (= 1.3.1-5ubuntu4.2)
Recommends: update-motd but it is not installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
的輸出apt policy libpam-modules
libpam-modules:
Installed: 1.3.1-5ubuntu4.2
Candidate: 1.3.1-5ubuntu4.3
Version table:
1.3.1-5ubuntu4.3 500
500 http://de.archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages
*** 1.3.1-5ubuntu4.2 100
100 /var/lib/dpkg/status
1.3.1-5ubuntu4 500
500 http://de.archive.ubuntu.com/ubuntu focal/main amd64 Packages
我無法安裝 Synaptic Package Manager,因為我無法安裝任何程式
答案1
步驟 1 是從來源清單中刪除損壞的儲存庫。它不適用於 20.04 Focal。
您可以透過開啟「軟體和更新」工具,按一下「其他軟體」選項卡,然後取消選取儲存庫旁的方塊,或sudo add-apt-repository -r ppa:nathan-renniewaldock/flux
在終端機中鍵入即可執行此操作。
如果您執行了後一個流程,請執行sudo apt update
.
好吧,之後還是有問題。
步驟2修改
apt policy libpam-modules
查看---的輸出
該軟體包有一個孤立版本,1.3.1-5ubuntu4.2
已安裝。它不是來自正常的儲存庫。看起來您新增了一個 ppa,從中安裝了軟體包,然後刪除了該 ppa。或以其他非標準方式安裝它。
我會嘗試使用 Synaptic Package Manager 強制安裝1.3.1-5ubuntu4.3
。如果它讓你在一個損壞的系統上。但在接受建議的更改之前仔細檢查它們