Because of bug #693758 I'd like to prevent apt-get upgrade
and Update Manager from updating the "libgtk2.0-0" package.
How can this be achieved?
Because of bug #693758 I'd like to prevent apt-get upgrade
and Update Manager from updating the "libgtk2.0-0" package.
How can this be achieved?
Holding
There are different ways of holding back packages: with
dpkg
,apt
,dselect
,aptitude
or Synaptic.dpkg
Put a package on hold:
Remove the hold:
Display the status of all your packages:
Display the status of a single package:
Show all packages on hold:
apt
Hold a package:
Remove the hold:
Show all packages on hold:
dselect
With dselect, enter the [S]elect screen, find the package you wish to hold in its present state and press = or H. The changes will take effect immediately after exiting the [S]elect screen.
The following approaches are limited in that locking/holding a package within aptitude or synaptic doesn't affect apt-get/apt.
aptitude
Hold a package:
Remove the hold:
Locking with Synaptic Package Manager
Go to Synaptic Package Manager (System > Administration > Synaptic Package Manager).
Click the search button and type the package name.
When you find the package, select it and go to the Package menu and select Lock Version.
That package will now not show in the update manager and will not be updated.
I was looking for the same thing and after a lot of research I found that using the following syntax you can forbid one specific version but allow the next update:
This goes into the
/etc/apt/preferences
file.To put a package "foo" on hold:
In your case we are going to put wine on hold:
To remove the hold:
Install
synaptic
usingsudo apt-get install synaptic
.Run using
gksudo synaptic
and on the search box locate the package you want to lock, ie:gedit
From the package menu select Lock version:
And that is all, the version currently installed at the time of the lock will stay installed even during upgrades.
Preventing a package from being installed is called "package holding" and it is very simple to do:
...where *package_name* is the name of the package you want to prevent from installation.
Note: the above command assumes root privileges. In other words, you will probably need to type
sudo su
before running it.Since some time
apt-get
is replaced byapt
, so for example I want to prevent Firefox from updating to version above 56, because a lot of add-ons, like "Tab Groups" don't work any more with the new Firefox 57 (see "WebExtensions Update").It is possible to hold more than one packages with one command and use wildcards.
Prevent Firefox from updating
If you should deside to unhold them later, that would be the command:
Everything you ever wanted to know about "holding" and "pinning" packages to specific versions: https://help.ubuntu.com/community/PinningHowto
I synaptic you can freeze the version of a specific package I'm not a 100% sure as to whether this will amend apt-get but it will definately stop update manager.
To freeze a package select it in synaptic then open the package menu and select freeze version.
Hope this helps
edit: This question 16668 deals with a similar situation
Adding details to @soger's comments relative to Ubuntu 16.04.
Ubuntu 16.04 does not have an existing /etc/apt/preferences file by default. If you don't have one currently, just create a new file and populate it with a stanza as @soger describes above to exclude the given package and its dependencies from updates.
Afterwards, run
apt update
and you're GTG. :0)For example, I have an Ubuntu 16.04.5 LTS server with embedded Intel video card and an NVidia card. The NVidia card is the only one used. The server also uses CUDA drivers. I had a problem where
apt
kept insisting(Intel drivers) required an update, but it could not determine which version to install. This was driving me nuts, and I didn't need the Intel drivers anyway. I entered this text into the preferences file and flushed apt, problem solved.
See bugs #75332, #158981 and #72806.
The summary is that hold at apt-get / aptitude level is not triggering hold status in dpkg (see bug 72806 especially) and update-manager reads status from dpkg.
workaround is run as root:
echo "package hold" | dpkg --set-selections