93

I used synaptic to lock the version of pidgin-data - how can I change the status from hold back to normal, so that it gets upgraded properly?

The PinningHowto says that doing an apt-get install packagename should remove the hold, but running dpkg -l | grep ^h still shows it as held:

hi  pidgin-data                                                 1:2.10.6-0ubuntu1+pidgin1.12.04                            multi-protocol instant messaging client - data files

How can I properly undo the hold status?

David Fraser
  • 1,627
  • 1
  • 17
  • 21

7 Answers7

116

You can use sudo apt-mark unhold package_name. The package is unheld and it returns a confirmation: Canceled hold on package_name..

To unhold all held packages you can use sudo apt-mark unhold $(apt-mark showhold).

sturlabragason
  • 1,555
  • 1
  • 10
  • 14
  • 1
    Your `sudo` problem is probably because you wrote just `sudo echo "package_name install"|dpkg --set-selections`. This sudoes the `echo` but not the following pipe, hence the access error. Try this instead: `sudo -E -- sh -c 'echo "package_name install"|dpkg --set-selections'`. This sudoes a sub-shell whose command line is `echo "package_name install"|dpkg --set-selections`. – Urhixidur Sep 29 '14 at 14:24
  • 1
    My answer was somewhat related to the unedited version of the [answer](http://askubuntu.com/a/164589/82517) here below which previously included exactly the command I referenced. However the question specifically uses `apt-get` as an example and that is why I answered using `apt-mark` which is included in the [apt](https://launchpad.net/ubuntu/trusty/+package/apt) package. It is however very helpful to know exactly why the dpkg commands were not working. – sturlabragason Dec 16 '14 at 20:35
  • 1
    @DrA7 package_name was already not hold. What should I do now? – Dr.jacky Jan 30 '16 at 10:25
  • 1
    I had the same problem as @Dr.jacky, but when I try to `apt upgrade` it still tells me the same packages are being kept back! – Michael Oct 22 '20 at 23:52
18

To unhold all held packages, use this command:

apt-mark unhold $(apt-mark showhold)
Melebius
  • 11,121
  • 8
  • 50
  • 77
15

The correct way to remove the hold should be:

echo "package_name install"|sudo dpkg --set-selections
jasmines
  • 10,643
  • 16
  • 84
  • 108
3

You can unhold all APT packages with:

apt-mark showhold | awk '{ print $1, "install" }' | dpkg --set-selections
panticz
  • 1,588
  • 13
  • 14
2

Unhold a single package named $package_name:

echo $package_name install | dpkg --set-selections

Unhold all packages that are currently held:

dpkg --get-selections | grep hold | awk '{ print $1, "install" }' | dpkg --set-selections
Earl Ruby
  • 675
  • 5
  • 6
1

Run echo pidgin-data install | dpkg --set-selections (replace pidgin-data with the held package name) - this will change the package status to install rather than hold.

David Fraser
  • 1,627
  • 1
  • 17
  • 21
0

None of the answer worked for me, as the packages simply could not be upgraded because of unmet dependencies.

I had to remove some packages. I've followed this blog post instructions to figure out which one causes problems:

apt-get -o Debug::pkgProblemResolver=yes dist-upgrade
PeterM
  • 684
  • 1
  • 7
  • 22