Sudo apt install 不起作用。我的软件包已损坏

Sudo apt install 不起作用。我的软件包已损坏

我目前正在使用 Ubuntu 20.04 LTS。我的电脑现在出了太多问题,但我首先要尝试修复我的 WiFi。所以我尝试安装 net-tools,但后来发生了这种情况。

    patrick@patrick-Swift-SF315-51G:~$ sudo apt install net-tools
[sudo] password for patrick: 
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:
 libc6-dbg : Depends: libc6 (= 2.31-0ubuntu9.2) but 2.31-0ubuntu9.1 is to be installed
 libc6-dev : Depends: libc6 (= 2.31-0ubuntu9.2) but 2.31-0ubuntu9.1 is to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

我尝试了这个:apt --fix-broken install 和 apt-get -f install - 得到了相同的答案。

patrick@patrick-Swift-SF315-51G:~$ apt --fix-broken install
E: Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission denied)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?

我还收到了来自我的包管理器的通知: 包装系统已损坏

检查您是否正在使用第三方存储库。如果是,请禁用它们,因为它们是问题的常见来源。此外,在终端中运行以下命令:apt-get install -f

以下软件包具有未满足的依赖关系:

  libc6-dbg: Depends: libc6 (= 2.31-0ubuntu9.2) but 2.31-0ubuntu9.1 is installed
    libc6-dev: Depends: libc6 (= 2.31-0ubuntu9.2) but 2.31-0ubuntu9.1 is installed
               Depends: libc-dev-bin (= 2.31-0ubuntu9.2) but 2.31-0ubuntu9.2 is installed

所以我的问题是,我该如何修复损坏的软件包并再次使用 Sudo apt-get install?

感谢您的时间。

编辑:我尝试了 sudo apt-get clean 和 sudo apt-get update 然后我尝试了 Sudo apt-get -f install,结果相同。

    Errors were encountered while processing:
 /var/cache/apt/archives/libc6_2.31-0ubuntu9.2_amd64.deb
 /var/cache/apt/archives/libc6_2.31-0ubuntu9.2_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

我也尝试了 sudo dpkg --configure -a; 并收到了此

dpkg: dependency problems prevent configuration of libc6-dbg:amd64:
 libc6-dbg:amd64 depends on libc6 (= 2.31-0ubuntu9.2); however:
  Version of libc6:amd64 on system is 2.31-0ubuntu9.1.

dpkg: error processing package libc6-dbg:amd64 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libc6-dev:amd64:
 libc6-dev:amd64 depends on libc6 (= 2.31-0ubuntu9.2); however:
  Version of libc6:amd64 on system is 2.31-0ubuntu9.1.

dpkg: error processing package libc6-dev:amd64 (--configure):
 dependency problems - leaving unconfigured
Processing triggers for libc-bin (2.31-0ubuntu9.1) ...
Errors were encountered while processing:
 libc6-dbg:amd64
 libc6-dev:amd64

答案1

尝试以下工作流程

sudo apt-get clean

sudo apt-get 更新

sudo apt-get -f 安装

sudo dpkg--configure-a

相关内容