How to prevent updating of a specific package?
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?
updates package-management
add a comment |
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?
updates package-management
@hhlp: But this question is asking about a package that was never installed.
– Nathan Osman
Oct 26 '11 at 18:17
1
@George Edison - There is also package holding, which allows you to not update the package. so Holding a package basically means you're telling the package manager to keep the current version no matter what. This is useful if more recent version of a currently working program breaks after an update. (you can't hold a package that was never installed also see my question is the same).... i tested that right now - see he saiddisable packages from the auto-update
– hhlp
Oct 26 '11 at 18:41
add a comment |
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?
updates package-management
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?
updates package-management
updates package-management
edited May 4 '14 at 13:20
Braiam
52.2k20136222
52.2k20136222
asked Dec 23 '10 at 17:29
IvanIvan
21.4k59130197
21.4k59130197
@hhlp: But this question is asking about a package that was never installed.
– Nathan Osman
Oct 26 '11 at 18:17
1
@George Edison - There is also package holding, which allows you to not update the package. so Holding a package basically means you're telling the package manager to keep the current version no matter what. This is useful if more recent version of a currently working program breaks after an update. (you can't hold a package that was never installed also see my question is the same).... i tested that right now - see he saiddisable packages from the auto-update
– hhlp
Oct 26 '11 at 18:41
add a comment |
@hhlp: But this question is asking about a package that was never installed.
– Nathan Osman
Oct 26 '11 at 18:17
1
@George Edison - There is also package holding, which allows you to not update the package. so Holding a package basically means you're telling the package manager to keep the current version no matter what. This is useful if more recent version of a currently working program breaks after an update. (you can't hold a package that was never installed also see my question is the same).... i tested that right now - see he saiddisable packages from the auto-update
– hhlp
Oct 26 '11 at 18:41
@hhlp: But this question is asking about a package that was never installed.
– Nathan Osman
Oct 26 '11 at 18:17
@hhlp: But this question is asking about a package that was never installed.
– Nathan Osman
Oct 26 '11 at 18:17
1
1
@George Edison - There is also package holding, which allows you to not update the package. so Holding a package basically means you're telling the package manager to keep the current version no matter what. This is useful if more recent version of a currently working program breaks after an update. (you can't hold a package that was never installed also see my question is the same).... i tested that right now - see he said
disable packages from the auto-update
– hhlp
Oct 26 '11 at 18:41
@George Edison - There is also package holding, which allows you to not update the package. so Holding a package basically means you're telling the package manager to keep the current version no matter what. This is useful if more recent version of a currently working program breaks after an update. (you can't hold a package that was never installed also see my question is the same).... i tested that right now - see he said
disable packages from the auto-update
– hhlp
Oct 26 '11 at 18:41
add a comment |
12 Answers
12
active
oldest
votes
Holding
There are four ways of holding back packages: with dpkg, apt, aptitude or dselect.
dpkg
Put a package on hold:
echo "<package-name> hold" | sudo dpkg --set-selections
Remove the hold:
echo "<package-name> install" | sudo dpkg --set-selections
Display the status of your packages:
dpkg --get-selections
Display the status of a single package:
dpkg --get-selections | grep "<package-name>"
apt
Hold a package:
sudo apt-mark hold <package-name>
Remove the hold:
sudo apt-mark unhold <package-name>
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:
sudo aptitude hold <package-name>
Remove the hold:
sudo aptitude unhold <package-name>
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.
4
This also works to prevent a package from being installed. When installingdevscripts
, a lot packaged are pulled as Recommended packages. As I don't need a mailserver (postfix), I could disable the installation of it by runningecho postfix hold | sudo dpkg --set-selections
before runningsudo apt-get install devscripts
. This hold action persists only for this installation, after the installation the selections are reset.
– Lekensteyn
Aug 20 '11 at 10:47
3
Also worth pointing out, package holds do break upgrades and patches sometimes by creating a situation where there is no legal solution apt can calculate to a dependency. If package foo has a == < or <= dependency on libbar, then apt will refuse to upgrade libbar as well as foo. Over time, these cascading dependencies may grow to block a large number of updates, including important security updates. You'll need to either remove the hold and let the upgrade happen, or rebuild the packages you are holding against newer versions of its dependencies if this happens.
– Stephanie
Aug 2 '12 at 5:22
2
Just a note:apt-mark
doesn't supporthold
in version 0.7.25 (Ubuntu Lucid)
– Joril
Apr 2 '13 at 7:30
1
This is especially useful when trying to hold back graphics drivers. For ATI users,apt-mark hold fglrx fglrx-amdcccle fglrx-dev && aptitude hold fglrx fglrx-amdcccle fglrx-dev
.
– earthmeLon
Apr 18 '13 at 20:41
7
Currently synaptic and aptitude only lock packages within those programs. "Anything else that does package upgrades (read: Update Manager, apt-get, aptitude, etc) ignores this." From this question.
– holocronweaver
Jul 18 '14 at 12:16
|
show 5 more comments
To put a package "foo" on hold:
echo "foo hold" | dpkg --set-selections
In your case we are going to put wine on hold:
sudo -i
echo "wine hold" | dpkg --set-selections
To remove the hold:
sudo -i
echo "wine install" | dpkg --set-selections
Also note that while a package is on hold, you can install a specific version viaapt-get install wine=1.2.3
. Being on hold preventsapt-get (dist-)upgrade
from changing it.
– rcoup
Jan 6 '15 at 2:24
@rcoup If you have an old version on hold, and then you manually upgrade to a new version without removing the hold as you describe, will the old version be kept in the cache so that you can go back to it?
– cxrodgers
Aug 24 '18 at 14:40
1
@cxrodgers the local cache (typically/var/cache/apt/archives
) is independent of holds & upgrades & stuff, so all the versions you've downloaded will be there until you runapt-get [auto]clean
– rcoup
Aug 27 '18 at 12:31
add a comment |
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:
Package: compiz-plugins-main
Pin: version 1:0.9.7.0~bzr19-0ubuntu10.1
Pin-Priority: -1
This goes into the /etc/apt/preferences file.
7
This is a much better way than preventing updates indefinitely
– Eero Aaltonen
Sep 30 '13 at 10:31
With this method, I think, chances are bigger to prevent ubuntu 'adware' like ubuntu one or the amazon icon from being reinstalled with the next release upgrade...
– Daniel Alder
Jan 10 '14 at 21:29
add a comment |
Install synaptic
using sudo 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.
7
Please look at "Lock version is not as clever as it sounds. It's supposed to do what it says on the tin, lock the version... But it only locks it within Synaptic. Anything else that does package upgrades (read: Update Manager, apt-get, aptitude, etc) ignores this. This is probably buggy behaviour so I would expect this to be fixed in time." from askubuntu.com/questions/9607/what-does-lock-version-do. What is the current state? If something is locked in Synaptic, will other package managers "honor" the lock?
– user25656
Dec 22 '11 at 12:09
2
vasa1: As of version 0.75.13, still no :( Same problem with aptitude.
– syockit
Nov 17 '12 at 7:25
add a comment |
Preventing a package from being installed is called "package holding" and it is very simple to do:
echo package_name hold | dpkg --set-selections
...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.
Perfect this was the answer. Thank you.
– asoundmove
Feb 5 '11 at 3:38
s/sudo su/sudo -s/g
(orsudo -i
). (-i
will give a login shell,-s
will not).
– derobert
Jun 11 '15 at 19:57
add a comment |
Since some time apt-get
is replaced by apt
, 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
sudo apt-mark hold firefox firefox-locale-*
If you should deside to unhold them later, that would be the command:
sudo apt-mark unhold firefox firefox-locale-*
add a comment |
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
add a comment |
Everything you ever wanted to know about "holding" and "pinning" packages to specific versions: https://help.ubuntu.com/community/PinningHowto
add a comment |
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
add a comment |
If you have Synaptic installed you can select the package and use the menu Package -> Lock Version to prevent it being updated.
You can install Synaptic with sudo apt-get install synaptic. I personally find it more useful than the Software Center... then again, I'm fairly old school. :)
add a comment |
You can use on aptitude the "specific override", like this:
aptitude reinstall ~i oracle-java8-jre:
This is a one time only use of (not stored for future reinstalls), keep specific override, to reinstall all packages in your system but not oracle-java8-jre.
If you use a keep specific override, the package will momentarily be in a state of keep an aptitude will not try to install it.
A very good thing if you think your system was compromised some how.
add a comment |
Occasionally one might want to hold back all the packages currently installed. Here's how.
First save the current state, so you can undo:
dpkg --get-selections > current_selections.txt
Then, to hold back all the packages:
dpkg --get-selections | sed -r "s/tinstall/hold/" |dpkg --set-selections
Finally, when you want to revert back to the previous state:
dpkg --set-selections < current_selections.txt
One use case for this might be when creating a VM or Amazon AMI snapshot to migrate from a QA to production environment.
add a comment |
protected by heemayl Mar 14 '18 at 7:31
Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?
12 Answers
12
active
oldest
votes
12 Answers
12
active
oldest
votes
active
oldest
votes
active
oldest
votes
Holding
There are four ways of holding back packages: with dpkg, apt, aptitude or dselect.
dpkg
Put a package on hold:
echo "<package-name> hold" | sudo dpkg --set-selections
Remove the hold:
echo "<package-name> install" | sudo dpkg --set-selections
Display the status of your packages:
dpkg --get-selections
Display the status of a single package:
dpkg --get-selections | grep "<package-name>"
apt
Hold a package:
sudo apt-mark hold <package-name>
Remove the hold:
sudo apt-mark unhold <package-name>
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:
sudo aptitude hold <package-name>
Remove the hold:
sudo aptitude unhold <package-name>
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.
4
This also works to prevent a package from being installed. When installingdevscripts
, a lot packaged are pulled as Recommended packages. As I don't need a mailserver (postfix), I could disable the installation of it by runningecho postfix hold | sudo dpkg --set-selections
before runningsudo apt-get install devscripts
. This hold action persists only for this installation, after the installation the selections are reset.
– Lekensteyn
Aug 20 '11 at 10:47
3
Also worth pointing out, package holds do break upgrades and patches sometimes by creating a situation where there is no legal solution apt can calculate to a dependency. If package foo has a == < or <= dependency on libbar, then apt will refuse to upgrade libbar as well as foo. Over time, these cascading dependencies may grow to block a large number of updates, including important security updates. You'll need to either remove the hold and let the upgrade happen, or rebuild the packages you are holding against newer versions of its dependencies if this happens.
– Stephanie
Aug 2 '12 at 5:22
2
Just a note:apt-mark
doesn't supporthold
in version 0.7.25 (Ubuntu Lucid)
– Joril
Apr 2 '13 at 7:30
1
This is especially useful when trying to hold back graphics drivers. For ATI users,apt-mark hold fglrx fglrx-amdcccle fglrx-dev && aptitude hold fglrx fglrx-amdcccle fglrx-dev
.
– earthmeLon
Apr 18 '13 at 20:41
7
Currently synaptic and aptitude only lock packages within those programs. "Anything else that does package upgrades (read: Update Manager, apt-get, aptitude, etc) ignores this." From this question.
– holocronweaver
Jul 18 '14 at 12:16
|
show 5 more comments
Holding
There are four ways of holding back packages: with dpkg, apt, aptitude or dselect.
dpkg
Put a package on hold:
echo "<package-name> hold" | sudo dpkg --set-selections
Remove the hold:
echo "<package-name> install" | sudo dpkg --set-selections
Display the status of your packages:
dpkg --get-selections
Display the status of a single package:
dpkg --get-selections | grep "<package-name>"
apt
Hold a package:
sudo apt-mark hold <package-name>
Remove the hold:
sudo apt-mark unhold <package-name>
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:
sudo aptitude hold <package-name>
Remove the hold:
sudo aptitude unhold <package-name>
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.
4
This also works to prevent a package from being installed. When installingdevscripts
, a lot packaged are pulled as Recommended packages. As I don't need a mailserver (postfix), I could disable the installation of it by runningecho postfix hold | sudo dpkg --set-selections
before runningsudo apt-get install devscripts
. This hold action persists only for this installation, after the installation the selections are reset.
– Lekensteyn
Aug 20 '11 at 10:47
3
Also worth pointing out, package holds do break upgrades and patches sometimes by creating a situation where there is no legal solution apt can calculate to a dependency. If package foo has a == < or <= dependency on libbar, then apt will refuse to upgrade libbar as well as foo. Over time, these cascading dependencies may grow to block a large number of updates, including important security updates. You'll need to either remove the hold and let the upgrade happen, or rebuild the packages you are holding against newer versions of its dependencies if this happens.
– Stephanie
Aug 2 '12 at 5:22
2
Just a note:apt-mark
doesn't supporthold
in version 0.7.25 (Ubuntu Lucid)
– Joril
Apr 2 '13 at 7:30
1
This is especially useful when trying to hold back graphics drivers. For ATI users,apt-mark hold fglrx fglrx-amdcccle fglrx-dev && aptitude hold fglrx fglrx-amdcccle fglrx-dev
.
– earthmeLon
Apr 18 '13 at 20:41
7
Currently synaptic and aptitude only lock packages within those programs. "Anything else that does package upgrades (read: Update Manager, apt-get, aptitude, etc) ignores this." From this question.
– holocronweaver
Jul 18 '14 at 12:16
|
show 5 more comments
Holding
There are four ways of holding back packages: with dpkg, apt, aptitude or dselect.
dpkg
Put a package on hold:
echo "<package-name> hold" | sudo dpkg --set-selections
Remove the hold:
echo "<package-name> install" | sudo dpkg --set-selections
Display the status of your packages:
dpkg --get-selections
Display the status of a single package:
dpkg --get-selections | grep "<package-name>"
apt
Hold a package:
sudo apt-mark hold <package-name>
Remove the hold:
sudo apt-mark unhold <package-name>
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:
sudo aptitude hold <package-name>
Remove the hold:
sudo aptitude unhold <package-name>
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.
Holding
There are four ways of holding back packages: with dpkg, apt, aptitude or dselect.
dpkg
Put a package on hold:
echo "<package-name> hold" | sudo dpkg --set-selections
Remove the hold:
echo "<package-name> install" | sudo dpkg --set-selections
Display the status of your packages:
dpkg --get-selections
Display the status of a single package:
dpkg --get-selections | grep "<package-name>"
apt
Hold a package:
sudo apt-mark hold <package-name>
Remove the hold:
sudo apt-mark unhold <package-name>
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:
sudo aptitude hold <package-name>
Remove the hold:
sudo aptitude unhold <package-name>
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.
edited Feb 9 '18 at 6:04
muru
1
1
answered Dec 23 '10 at 18:04
hhlphhlp
32.6k1478131
32.6k1478131
4
This also works to prevent a package from being installed. When installingdevscripts
, a lot packaged are pulled as Recommended packages. As I don't need a mailserver (postfix), I could disable the installation of it by runningecho postfix hold | sudo dpkg --set-selections
before runningsudo apt-get install devscripts
. This hold action persists only for this installation, after the installation the selections are reset.
– Lekensteyn
Aug 20 '11 at 10:47
3
Also worth pointing out, package holds do break upgrades and patches sometimes by creating a situation where there is no legal solution apt can calculate to a dependency. If package foo has a == < or <= dependency on libbar, then apt will refuse to upgrade libbar as well as foo. Over time, these cascading dependencies may grow to block a large number of updates, including important security updates. You'll need to either remove the hold and let the upgrade happen, or rebuild the packages you are holding against newer versions of its dependencies if this happens.
– Stephanie
Aug 2 '12 at 5:22
2
Just a note:apt-mark
doesn't supporthold
in version 0.7.25 (Ubuntu Lucid)
– Joril
Apr 2 '13 at 7:30
1
This is especially useful when trying to hold back graphics drivers. For ATI users,apt-mark hold fglrx fglrx-amdcccle fglrx-dev && aptitude hold fglrx fglrx-amdcccle fglrx-dev
.
– earthmeLon
Apr 18 '13 at 20:41
7
Currently synaptic and aptitude only lock packages within those programs. "Anything else that does package upgrades (read: Update Manager, apt-get, aptitude, etc) ignores this." From this question.
– holocronweaver
Jul 18 '14 at 12:16
|
show 5 more comments
4
This also works to prevent a package from being installed. When installingdevscripts
, a lot packaged are pulled as Recommended packages. As I don't need a mailserver (postfix), I could disable the installation of it by runningecho postfix hold | sudo dpkg --set-selections
before runningsudo apt-get install devscripts
. This hold action persists only for this installation, after the installation the selections are reset.
– Lekensteyn
Aug 20 '11 at 10:47
3
Also worth pointing out, package holds do break upgrades and patches sometimes by creating a situation where there is no legal solution apt can calculate to a dependency. If package foo has a == < or <= dependency on libbar, then apt will refuse to upgrade libbar as well as foo. Over time, these cascading dependencies may grow to block a large number of updates, including important security updates. You'll need to either remove the hold and let the upgrade happen, or rebuild the packages you are holding against newer versions of its dependencies if this happens.
– Stephanie
Aug 2 '12 at 5:22
2
Just a note:apt-mark
doesn't supporthold
in version 0.7.25 (Ubuntu Lucid)
– Joril
Apr 2 '13 at 7:30
1
This is especially useful when trying to hold back graphics drivers. For ATI users,apt-mark hold fglrx fglrx-amdcccle fglrx-dev && aptitude hold fglrx fglrx-amdcccle fglrx-dev
.
– earthmeLon
Apr 18 '13 at 20:41
7
Currently synaptic and aptitude only lock packages within those programs. "Anything else that does package upgrades (read: Update Manager, apt-get, aptitude, etc) ignores this." From this question.
– holocronweaver
Jul 18 '14 at 12:16
4
4
This also works to prevent a package from being installed. When installing
devscripts
, a lot packaged are pulled as Recommended packages. As I don't need a mailserver (postfix), I could disable the installation of it by running echo postfix hold | sudo dpkg --set-selections
before running sudo apt-get install devscripts
. This hold action persists only for this installation, after the installation the selections are reset.– Lekensteyn
Aug 20 '11 at 10:47
This also works to prevent a package from being installed. When installing
devscripts
, a lot packaged are pulled as Recommended packages. As I don't need a mailserver (postfix), I could disable the installation of it by running echo postfix hold | sudo dpkg --set-selections
before running sudo apt-get install devscripts
. This hold action persists only for this installation, after the installation the selections are reset.– Lekensteyn
Aug 20 '11 at 10:47
3
3
Also worth pointing out, package holds do break upgrades and patches sometimes by creating a situation where there is no legal solution apt can calculate to a dependency. If package foo has a == < or <= dependency on libbar, then apt will refuse to upgrade libbar as well as foo. Over time, these cascading dependencies may grow to block a large number of updates, including important security updates. You'll need to either remove the hold and let the upgrade happen, or rebuild the packages you are holding against newer versions of its dependencies if this happens.
– Stephanie
Aug 2 '12 at 5:22
Also worth pointing out, package holds do break upgrades and patches sometimes by creating a situation where there is no legal solution apt can calculate to a dependency. If package foo has a == < or <= dependency on libbar, then apt will refuse to upgrade libbar as well as foo. Over time, these cascading dependencies may grow to block a large number of updates, including important security updates. You'll need to either remove the hold and let the upgrade happen, or rebuild the packages you are holding against newer versions of its dependencies if this happens.
– Stephanie
Aug 2 '12 at 5:22
2
2
Just a note:
apt-mark
doesn't support hold
in version 0.7.25 (Ubuntu Lucid)– Joril
Apr 2 '13 at 7:30
Just a note:
apt-mark
doesn't support hold
in version 0.7.25 (Ubuntu Lucid)– Joril
Apr 2 '13 at 7:30
1
1
This is especially useful when trying to hold back graphics drivers. For ATI users,
apt-mark hold fglrx fglrx-amdcccle fglrx-dev && aptitude hold fglrx fglrx-amdcccle fglrx-dev
.– earthmeLon
Apr 18 '13 at 20:41
This is especially useful when trying to hold back graphics drivers. For ATI users,
apt-mark hold fglrx fglrx-amdcccle fglrx-dev && aptitude hold fglrx fglrx-amdcccle fglrx-dev
.– earthmeLon
Apr 18 '13 at 20:41
7
7
Currently synaptic and aptitude only lock packages within those programs. "Anything else that does package upgrades (read: Update Manager, apt-get, aptitude, etc) ignores this." From this question.
– holocronweaver
Jul 18 '14 at 12:16
Currently synaptic and aptitude only lock packages within those programs. "Anything else that does package upgrades (read: Update Manager, apt-get, aptitude, etc) ignores this." From this question.
– holocronweaver
Jul 18 '14 at 12:16
|
show 5 more comments
To put a package "foo" on hold:
echo "foo hold" | dpkg --set-selections
In your case we are going to put wine on hold:
sudo -i
echo "wine hold" | dpkg --set-selections
To remove the hold:
sudo -i
echo "wine install" | dpkg --set-selections
Also note that while a package is on hold, you can install a specific version viaapt-get install wine=1.2.3
. Being on hold preventsapt-get (dist-)upgrade
from changing it.
– rcoup
Jan 6 '15 at 2:24
@rcoup If you have an old version on hold, and then you manually upgrade to a new version without removing the hold as you describe, will the old version be kept in the cache so that you can go back to it?
– cxrodgers
Aug 24 '18 at 14:40
1
@cxrodgers the local cache (typically/var/cache/apt/archives
) is independent of holds & upgrades & stuff, so all the versions you've downloaded will be there until you runapt-get [auto]clean
– rcoup
Aug 27 '18 at 12:31
add a comment |
To put a package "foo" on hold:
echo "foo hold" | dpkg --set-selections
In your case we are going to put wine on hold:
sudo -i
echo "wine hold" | dpkg --set-selections
To remove the hold:
sudo -i
echo "wine install" | dpkg --set-selections
Also note that while a package is on hold, you can install a specific version viaapt-get install wine=1.2.3
. Being on hold preventsapt-get (dist-)upgrade
from changing it.
– rcoup
Jan 6 '15 at 2:24
@rcoup If you have an old version on hold, and then you manually upgrade to a new version without removing the hold as you describe, will the old version be kept in the cache so that you can go back to it?
– cxrodgers
Aug 24 '18 at 14:40
1
@cxrodgers the local cache (typically/var/cache/apt/archives
) is independent of holds & upgrades & stuff, so all the versions you've downloaded will be there until you runapt-get [auto]clean
– rcoup
Aug 27 '18 at 12:31
add a comment |
To put a package "foo" on hold:
echo "foo hold" | dpkg --set-selections
In your case we are going to put wine on hold:
sudo -i
echo "wine hold" | dpkg --set-selections
To remove the hold:
sudo -i
echo "wine install" | dpkg --set-selections
To put a package "foo" on hold:
echo "foo hold" | dpkg --set-selections
In your case we are going to put wine on hold:
sudo -i
echo "wine hold" | dpkg --set-selections
To remove the hold:
sudo -i
echo "wine install" | dpkg --set-selections
edited May 25 '16 at 0:13
David Oliver
172113
172113
answered Dec 8 '11 at 20:15
PantherPanther
79.3k14157259
79.3k14157259
Also note that while a package is on hold, you can install a specific version viaapt-get install wine=1.2.3
. Being on hold preventsapt-get (dist-)upgrade
from changing it.
– rcoup
Jan 6 '15 at 2:24
@rcoup If you have an old version on hold, and then you manually upgrade to a new version without removing the hold as you describe, will the old version be kept in the cache so that you can go back to it?
– cxrodgers
Aug 24 '18 at 14:40
1
@cxrodgers the local cache (typically/var/cache/apt/archives
) is independent of holds & upgrades & stuff, so all the versions you've downloaded will be there until you runapt-get [auto]clean
– rcoup
Aug 27 '18 at 12:31
add a comment |
Also note that while a package is on hold, you can install a specific version viaapt-get install wine=1.2.3
. Being on hold preventsapt-get (dist-)upgrade
from changing it.
– rcoup
Jan 6 '15 at 2:24
@rcoup If you have an old version on hold, and then you manually upgrade to a new version without removing the hold as you describe, will the old version be kept in the cache so that you can go back to it?
– cxrodgers
Aug 24 '18 at 14:40
1
@cxrodgers the local cache (typically/var/cache/apt/archives
) is independent of holds & upgrades & stuff, so all the versions you've downloaded will be there until you runapt-get [auto]clean
– rcoup
Aug 27 '18 at 12:31
Also note that while a package is on hold, you can install a specific version via
apt-get install wine=1.2.3
. Being on hold prevents apt-get (dist-)upgrade
from changing it.– rcoup
Jan 6 '15 at 2:24
Also note that while a package is on hold, you can install a specific version via
apt-get install wine=1.2.3
. Being on hold prevents apt-get (dist-)upgrade
from changing it.– rcoup
Jan 6 '15 at 2:24
@rcoup If you have an old version on hold, and then you manually upgrade to a new version without removing the hold as you describe, will the old version be kept in the cache so that you can go back to it?
– cxrodgers
Aug 24 '18 at 14:40
@rcoup If you have an old version on hold, and then you manually upgrade to a new version without removing the hold as you describe, will the old version be kept in the cache so that you can go back to it?
– cxrodgers
Aug 24 '18 at 14:40
1
1
@cxrodgers the local cache (typically
/var/cache/apt/archives
) is independent of holds & upgrades & stuff, so all the versions you've downloaded will be there until you run apt-get [auto]clean
– rcoup
Aug 27 '18 at 12:31
@cxrodgers the local cache (typically
/var/cache/apt/archives
) is independent of holds & upgrades & stuff, so all the versions you've downloaded will be there until you run apt-get [auto]clean
– rcoup
Aug 27 '18 at 12:31
add a comment |
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:
Package: compiz-plugins-main
Pin: version 1:0.9.7.0~bzr19-0ubuntu10.1
Pin-Priority: -1
This goes into the /etc/apt/preferences file.
7
This is a much better way than preventing updates indefinitely
– Eero Aaltonen
Sep 30 '13 at 10:31
With this method, I think, chances are bigger to prevent ubuntu 'adware' like ubuntu one or the amazon icon from being reinstalled with the next release upgrade...
– Daniel Alder
Jan 10 '14 at 21:29
add a comment |
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:
Package: compiz-plugins-main
Pin: version 1:0.9.7.0~bzr19-0ubuntu10.1
Pin-Priority: -1
This goes into the /etc/apt/preferences file.
7
This is a much better way than preventing updates indefinitely
– Eero Aaltonen
Sep 30 '13 at 10:31
With this method, I think, chances are bigger to prevent ubuntu 'adware' like ubuntu one or the amazon icon from being reinstalled with the next release upgrade...
– Daniel Alder
Jan 10 '14 at 21:29
add a comment |
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:
Package: compiz-plugins-main
Pin: version 1:0.9.7.0~bzr19-0ubuntu10.1
Pin-Priority: -1
This goes into the /etc/apt/preferences file.
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:
Package: compiz-plugins-main
Pin: version 1:0.9.7.0~bzr19-0ubuntu10.1
Pin-Priority: -1
This goes into the /etc/apt/preferences file.
answered Jul 22 '13 at 11:13
sogersoger
43144
43144
7
This is a much better way than preventing updates indefinitely
– Eero Aaltonen
Sep 30 '13 at 10:31
With this method, I think, chances are bigger to prevent ubuntu 'adware' like ubuntu one or the amazon icon from being reinstalled with the next release upgrade...
– Daniel Alder
Jan 10 '14 at 21:29
add a comment |
7
This is a much better way than preventing updates indefinitely
– Eero Aaltonen
Sep 30 '13 at 10:31
With this method, I think, chances are bigger to prevent ubuntu 'adware' like ubuntu one or the amazon icon from being reinstalled with the next release upgrade...
– Daniel Alder
Jan 10 '14 at 21:29
7
7
This is a much better way than preventing updates indefinitely
– Eero Aaltonen
Sep 30 '13 at 10:31
This is a much better way than preventing updates indefinitely
– Eero Aaltonen
Sep 30 '13 at 10:31
With this method, I think, chances are bigger to prevent ubuntu 'adware' like ubuntu one or the amazon icon from being reinstalled with the next release upgrade...
– Daniel Alder
Jan 10 '14 at 21:29
With this method, I think, chances are bigger to prevent ubuntu 'adware' like ubuntu one or the amazon icon from being reinstalled with the next release upgrade...
– Daniel Alder
Jan 10 '14 at 21:29
add a comment |
Install synaptic
using sudo 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.
7
Please look at "Lock version is not as clever as it sounds. It's supposed to do what it says on the tin, lock the version... But it only locks it within Synaptic. Anything else that does package upgrades (read: Update Manager, apt-get, aptitude, etc) ignores this. This is probably buggy behaviour so I would expect this to be fixed in time." from askubuntu.com/questions/9607/what-does-lock-version-do. What is the current state? If something is locked in Synaptic, will other package managers "honor" the lock?
– user25656
Dec 22 '11 at 12:09
2
vasa1: As of version 0.75.13, still no :( Same problem with aptitude.
– syockit
Nov 17 '12 at 7:25
add a comment |
Install synaptic
using sudo 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.
7
Please look at "Lock version is not as clever as it sounds. It's supposed to do what it says on the tin, lock the version... But it only locks it within Synaptic. Anything else that does package upgrades (read: Update Manager, apt-get, aptitude, etc) ignores this. This is probably buggy behaviour so I would expect this to be fixed in time." from askubuntu.com/questions/9607/what-does-lock-version-do. What is the current state? If something is locked in Synaptic, will other package managers "honor" the lock?
– user25656
Dec 22 '11 at 12:09
2
vasa1: As of version 0.75.13, still no :( Same problem with aptitude.
– syockit
Nov 17 '12 at 7:25
add a comment |
Install synaptic
using sudo 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.
Install synaptic
using sudo 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.
answered Dec 8 '11 at 20:06
Bruno PereiraBruno Pereira
60.3k26179208
60.3k26179208
7
Please look at "Lock version is not as clever as it sounds. It's supposed to do what it says on the tin, lock the version... But it only locks it within Synaptic. Anything else that does package upgrades (read: Update Manager, apt-get, aptitude, etc) ignores this. This is probably buggy behaviour so I would expect this to be fixed in time." from askubuntu.com/questions/9607/what-does-lock-version-do. What is the current state? If something is locked in Synaptic, will other package managers "honor" the lock?
– user25656
Dec 22 '11 at 12:09
2
vasa1: As of version 0.75.13, still no :( Same problem with aptitude.
– syockit
Nov 17 '12 at 7:25
add a comment |
7
Please look at "Lock version is not as clever as it sounds. It's supposed to do what it says on the tin, lock the version... But it only locks it within Synaptic. Anything else that does package upgrades (read: Update Manager, apt-get, aptitude, etc) ignores this. This is probably buggy behaviour so I would expect this to be fixed in time." from askubuntu.com/questions/9607/what-does-lock-version-do. What is the current state? If something is locked in Synaptic, will other package managers "honor" the lock?
– user25656
Dec 22 '11 at 12:09
2
vasa1: As of version 0.75.13, still no :( Same problem with aptitude.
– syockit
Nov 17 '12 at 7:25
7
7
Please look at "Lock version is not as clever as it sounds. It's supposed to do what it says on the tin, lock the version... But it only locks it within Synaptic. Anything else that does package upgrades (read: Update Manager, apt-get, aptitude, etc) ignores this. This is probably buggy behaviour so I would expect this to be fixed in time." from askubuntu.com/questions/9607/what-does-lock-version-do. What is the current state? If something is locked in Synaptic, will other package managers "honor" the lock?
– user25656
Dec 22 '11 at 12:09
Please look at "Lock version is not as clever as it sounds. It's supposed to do what it says on the tin, lock the version... But it only locks it within Synaptic. Anything else that does package upgrades (read: Update Manager, apt-get, aptitude, etc) ignores this. This is probably buggy behaviour so I would expect this to be fixed in time." from askubuntu.com/questions/9607/what-does-lock-version-do. What is the current state? If something is locked in Synaptic, will other package managers "honor" the lock?
– user25656
Dec 22 '11 at 12:09
2
2
vasa1: As of version 0.75.13, still no :( Same problem with aptitude.
– syockit
Nov 17 '12 at 7:25
vasa1: As of version 0.75.13, still no :( Same problem with aptitude.
– syockit
Nov 17 '12 at 7:25
add a comment |
Preventing a package from being installed is called "package holding" and it is very simple to do:
echo package_name hold | dpkg --set-selections
...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.
Perfect this was the answer. Thank you.
– asoundmove
Feb 5 '11 at 3:38
s/sudo su/sudo -s/g
(orsudo -i
). (-i
will give a login shell,-s
will not).
– derobert
Jun 11 '15 at 19:57
add a comment |
Preventing a package from being installed is called "package holding" and it is very simple to do:
echo package_name hold | dpkg --set-selections
...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.
Perfect this was the answer. Thank you.
– asoundmove
Feb 5 '11 at 3:38
s/sudo su/sudo -s/g
(orsudo -i
). (-i
will give a login shell,-s
will not).
– derobert
Jun 11 '15 at 19:57
add a comment |
Preventing a package from being installed is called "package holding" and it is very simple to do:
echo package_name hold | dpkg --set-selections
...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.
Preventing a package from being installed is called "package holding" and it is very simple to do:
echo package_name hold | dpkg --set-selections
...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.
edited Oct 26 '11 at 18:12
Nathan Osman
21k32144237
21k32144237
answered Feb 5 '11 at 1:18
RobotHumansRobotHumans
23.1k363104
23.1k363104
Perfect this was the answer. Thank you.
– asoundmove
Feb 5 '11 at 3:38
s/sudo su/sudo -s/g
(orsudo -i
). (-i
will give a login shell,-s
will not).
– derobert
Jun 11 '15 at 19:57
add a comment |
Perfect this was the answer. Thank you.
– asoundmove
Feb 5 '11 at 3:38
s/sudo su/sudo -s/g
(orsudo -i
). (-i
will give a login shell,-s
will not).
– derobert
Jun 11 '15 at 19:57
Perfect this was the answer. Thank you.
– asoundmove
Feb 5 '11 at 3:38
Perfect this was the answer. Thank you.
– asoundmove
Feb 5 '11 at 3:38
s/sudo su/sudo -s/g
(or sudo -i
). (-i
will give a login shell, -s
will not).– derobert
Jun 11 '15 at 19:57
s/sudo su/sudo -s/g
(or sudo -i
). (-i
will give a login shell, -s
will not).– derobert
Jun 11 '15 at 19:57
add a comment |
Since some time apt-get
is replaced by apt
, 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
sudo apt-mark hold firefox firefox-locale-*
If you should deside to unhold them later, that would be the command:
sudo apt-mark unhold firefox firefox-locale-*
add a comment |
Since some time apt-get
is replaced by apt
, 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
sudo apt-mark hold firefox firefox-locale-*
If you should deside to unhold them later, that would be the command:
sudo apt-mark unhold firefox firefox-locale-*
add a comment |
Since some time apt-get
is replaced by apt
, 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
sudo apt-mark hold firefox firefox-locale-*
If you should deside to unhold them later, that would be the command:
sudo apt-mark unhold firefox firefox-locale-*
Since some time apt-get
is replaced by apt
, 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
sudo apt-mark hold firefox firefox-locale-*
If you should deside to unhold them later, that would be the command:
sudo apt-mark unhold firefox firefox-locale-*
edited Nov 19 '17 at 8:49
answered Nov 19 '17 at 7:45
rubo77rubo77
15.1k3195201
15.1k3195201
add a comment |
add a comment |
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
add a comment |
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
add a comment |
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
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
edited Apr 13 '17 at 12:25
Community♦
1
1
answered Dec 23 '10 at 17:35
AllanAllan
10.2k43250
10.2k43250
add a comment |
add a comment |
Everything you ever wanted to know about "holding" and "pinning" packages to specific versions: https://help.ubuntu.com/community/PinningHowto
add a comment |
Everything you ever wanted to know about "holding" and "pinning" packages to specific versions: https://help.ubuntu.com/community/PinningHowto
add a comment |
Everything you ever wanted to know about "holding" and "pinning" packages to specific versions: https://help.ubuntu.com/community/PinningHowto
Everything you ever wanted to know about "holding" and "pinning" packages to specific versions: https://help.ubuntu.com/community/PinningHowto
answered Dec 23 '10 at 21:09
Jeff FerlandJeff Ferland
1404
1404
add a comment |
add a comment |
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
add a comment |
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
add a comment |
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
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
edited May 19 '16 at 22:32
notpeter
57248
57248
answered Nov 26 '12 at 7:24
jasperjasper
311
311
add a comment |
add a comment |
If you have Synaptic installed you can select the package and use the menu Package -> Lock Version to prevent it being updated.
You can install Synaptic with sudo apt-get install synaptic. I personally find it more useful than the Software Center... then again, I'm fairly old school. :)
add a comment |
If you have Synaptic installed you can select the package and use the menu Package -> Lock Version to prevent it being updated.
You can install Synaptic with sudo apt-get install synaptic. I personally find it more useful than the Software Center... then again, I'm fairly old school. :)
add a comment |
If you have Synaptic installed you can select the package and use the menu Package -> Lock Version to prevent it being updated.
You can install Synaptic with sudo apt-get install synaptic. I personally find it more useful than the Software Center... then again, I'm fairly old school. :)
If you have Synaptic installed you can select the package and use the menu Package -> Lock Version to prevent it being updated.
You can install Synaptic with sudo apt-get install synaptic. I personally find it more useful than the Software Center... then again, I'm fairly old school. :)
answered Dec 8 '11 at 20:06
dinchamiondinchamion
1669
1669
add a comment |
add a comment |
You can use on aptitude the "specific override", like this:
aptitude reinstall ~i oracle-java8-jre:
This is a one time only use of (not stored for future reinstalls), keep specific override, to reinstall all packages in your system but not oracle-java8-jre.
If you use a keep specific override, the package will momentarily be in a state of keep an aptitude will not try to install it.
A very good thing if you think your system was compromised some how.
add a comment |
You can use on aptitude the "specific override", like this:
aptitude reinstall ~i oracle-java8-jre:
This is a one time only use of (not stored for future reinstalls), keep specific override, to reinstall all packages in your system but not oracle-java8-jre.
If you use a keep specific override, the package will momentarily be in a state of keep an aptitude will not try to install it.
A very good thing if you think your system was compromised some how.
add a comment |
You can use on aptitude the "specific override", like this:
aptitude reinstall ~i oracle-java8-jre:
This is a one time only use of (not stored for future reinstalls), keep specific override, to reinstall all packages in your system but not oracle-java8-jre.
If you use a keep specific override, the package will momentarily be in a state of keep an aptitude will not try to install it.
A very good thing if you think your system was compromised some how.
You can use on aptitude the "specific override", like this:
aptitude reinstall ~i oracle-java8-jre:
This is a one time only use of (not stored for future reinstalls), keep specific override, to reinstall all packages in your system but not oracle-java8-jre.
If you use a keep specific override, the package will momentarily be in a state of keep an aptitude will not try to install it.
A very good thing if you think your system was compromised some how.
edited May 18 '17 at 16:29
muru
1
1
answered May 18 '17 at 16:27
cabonamigocabonamigo
112
112
add a comment |
add a comment |
Occasionally one might want to hold back all the packages currently installed. Here's how.
First save the current state, so you can undo:
dpkg --get-selections > current_selections.txt
Then, to hold back all the packages:
dpkg --get-selections | sed -r "s/tinstall/hold/" |dpkg --set-selections
Finally, when you want to revert back to the previous state:
dpkg --set-selections < current_selections.txt
One use case for this might be when creating a VM or Amazon AMI snapshot to migrate from a QA to production environment.
add a comment |
Occasionally one might want to hold back all the packages currently installed. Here's how.
First save the current state, so you can undo:
dpkg --get-selections > current_selections.txt
Then, to hold back all the packages:
dpkg --get-selections | sed -r "s/tinstall/hold/" |dpkg --set-selections
Finally, when you want to revert back to the previous state:
dpkg --set-selections < current_selections.txt
One use case for this might be when creating a VM or Amazon AMI snapshot to migrate from a QA to production environment.
add a comment |
Occasionally one might want to hold back all the packages currently installed. Here's how.
First save the current state, so you can undo:
dpkg --get-selections > current_selections.txt
Then, to hold back all the packages:
dpkg --get-selections | sed -r "s/tinstall/hold/" |dpkg --set-selections
Finally, when you want to revert back to the previous state:
dpkg --set-selections < current_selections.txt
One use case for this might be when creating a VM or Amazon AMI snapshot to migrate from a QA to production environment.
Occasionally one might want to hold back all the packages currently installed. Here's how.
First save the current state, so you can undo:
dpkg --get-selections > current_selections.txt
Then, to hold back all the packages:
dpkg --get-selections | sed -r "s/tinstall/hold/" |dpkg --set-selections
Finally, when you want to revert back to the previous state:
dpkg --set-selections < current_selections.txt
One use case for this might be when creating a VM or Amazon AMI snapshot to migrate from a QA to production environment.
answered Jan 14 '15 at 19:46
JVWJVW
1
1
add a comment |
add a comment |
protected by heemayl Mar 14 '18 at 7:31
Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?
@hhlp: But this question is asking about a package that was never installed.
– Nathan Osman
Oct 26 '11 at 18:17
1
@George Edison - There is also package holding, which allows you to not update the package. so Holding a package basically means you're telling the package manager to keep the current version no matter what. This is useful if more recent version of a currently working program breaks after an update. (you can't hold a package that was never installed also see my question is the same).... i tested that right now - see he said
disable packages from the auto-update
– hhlp
Oct 26 '11 at 18:41