E:无法纠正问题,您持有损坏的软件包 Ubuntu Ubuntu 20.04.3 LTS

问题描述 投票:0回答:1
user@computer:~$ sudo apt-get install idle3
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
idle3 : Depends: idle (>= 3.6.5-3) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

为了解决这个问题我尝试过:

sudo dpkg --configure -a
sudo apt-get clean && sudo apt-get update
sudo apt-get 升级
sudo apt-get dist-upgrade
须藤apt更新
sudo apt 全面升级
sudo apt-get autoremove
sudo aptitude install libssl-dev zliblg-dev=1:1.2.8.dfsg-1ubuntu1

重新启动我的电脑并修复损坏的软件包后
sudo apt-get install -f

user@computer:~$ sudo apt install -f
[sudo] password for user: 
Waiting for cache lock: Could not get lock /var/lib/dpkg/lock-frontend. It is heWaiting for cache lock: Could not get lock /var/lib/dpkg/lock-frontend. It is heWaiting for cache lock: Could not get lock /var/lib/dpkg/lock-frontend. It is heWaiting for cache lock: Could not get lock /var/lib/dpkg/lock-frontend. It is heWaiting for cache lock: Could not get lock /var/lib/dpkg/lock-frontend. It is heWaiting for cache lock: Could not get lock /var/liWaiting for cache lock: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 6747 (synaptic)... 37s (synaptic)... 7saptic)... 6s
Waiting for cache lock: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 6747 (synaptic)... 86s
^Citing for cache lock: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 6747 (synaptic)... 133  

sudo apt autoclean
sudo apt clean
sudo apt-get install 空闲
sudo apt --修复损坏的安装
apt-mark showhold

安装 aptitude 也失败

ubuntu terminal apt apt-get
1个回答
0
投票

首先,如果你有这样的事情

It is held by process 6747 (synaptic)

你的突触是开放的。您应该将其关闭,然后再次尝试更新系统。如果你无法关闭它,因为它没有打开的窗口,你可以通过

杀死它
sudo kill -9 6747

6747数字是错误消息中的进程号。或者您可以尝试杀死与 apt 相关的所有进程

sudo killall apt apt-get

然后再试一次。

如果这也不起作用,您可以通过执行以下操作来删除与此错误相关的存档:

sudo rm -f /var/lib/dpkg/lock-frontend

系统将要求您输入 root 密码,文件将被删除,当命令提示符返回时,重试,系统应该能够再次升级。

如果这不起作用,只需通过执行以下操作来清理所有

lock
文件

sudo rm -f /var/lib/apt/lists/lock
sudo rm -f /var/cache/apt/archives/lock
sudo rm -f /var/lib/dpkg/lock*

删除这些文件后,告诉

dpkg
将所有内容放回原来的位置

sudo dpkg --configure -a

然后,再次尝试更新系统

sudo apt-get update -y

这对我有用,但是,页面中有一个注释,告诉每个人要小心这个命令,因为如果你不小心,你可能会导致系统损坏。

  • 对不起我的英语。
  • 努力做一个好人。
  • 唯一无法解决的就是死亡。
© www.soinside.com 2019 - 2024. All rights reserved.