Jules Oenicke.
Jules Oenicke.

Reputation: 39

E: Unable to correct problems, you have held broken packages Ubuntu Ubuntu 20.04.3 LTS

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.

To solve this problem Ive tried:

sudo dpkg --configure -a
sudo apt-get clean && sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
sudo apt update
sudo apt full-upgrade
sudo apt-get autoremove
sudo aptitude install libssl-dev zliblg-dev=1:1.2.8.dfsg-1ubuntu1

after restarting my pc and reparing broken packages
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 idle
sudo apt --fix-broken install
apt-mark showhold

also installing aptitude failed

Upvotes: 2

Views: 17361

Answers (2)

Khalid Nisar
Khalid Nisar

Reputation: 1

rpi ~$ cat /etc/apt/sources.list
deb http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
#deb-src http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi

rpi ~$ cat /etc/apt/sources.list.d/raspi.list
deb http://archive.raspberrypi.org/debian/ buster main
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
#deb-src http://archive.raspberrypi.org/debian/ buster main 

Upvotes: 0

Lazcol
Lazcol

Reputation: 19

First of all, if you have something like this

It is held by process 6747 (synaptic)

you have synaptic open. You should close it, and then try updating your system again. If you cannot close it, because it does not have a open window, you may kill it by

sudo kill -9 6747

the 6747 number is the number of process in the error message. Or you can try killing all processes in relation with apt

sudo killall apt apt-get

And try again.

If this doesn't work either, you may remove the archive involved in this error, by doing

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

you are going to be asked for your root password, the file is going to be erased, and when the command prompt is back, try again, the system should be able to upgrade again.

If this doesn't work, just clean all the lock files by doing

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

Once you erased those files, tell dpkg to put everything in it place

sudo dpkg --configure -a

And then, try updating the system again

sudo apt-get update -y

This worked for me, nevertheless, in the page was a NOTE telling everybody to be careful with this commands, because you may end with a broken system if you are careless.

  • Sorry for my english.
  • Try to be a nice person.
  • The only thing without solution is death.

Upvotes: -1

Related Questions