LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices

Reply
 
LinkBack Search this Thread
Old 01-30-2012, 06:56 PM   #1
cccc
Senior Member
 
Registered: Sep 2003
Distribution: Debian Squeeze / Wheezy
Posts: 1,435

Rep: Reputation: 38
exclude some packages from updating


hi

I have squeeze and normally I do:
Code:
# apt-get update
# apt-get dist-upgrade
to update my system.
Howto exclude some packages from updating, for example a linux-kernel?
 
Old 01-30-2012, 08:15 PM   #2
lugoteehalt
Senior Member
 
Registered: Sep 2003
Location: UK
Distribution: Debian
Posts: 1,190
Blog Entries: 2

Rep: Reputation: 49
Don't take my word but I think you do = next to the package in aptitude. By analogy to + or -.
 
Old 01-30-2012, 08:16 PM   #3
odiseo77
Member
 
Registered: Dec 2004
Location: Caracas, Venezuela
Distribution: Debian Sid
Posts: 611

Rep: Reputation: 76
I don't know if there's a way to do it with apt-get, but with aptitude, you just execute:

Code:
aptitude hold package_name
And, to revert this action, you execute:


Code:
aptitude unhold package_name
It can also be done from synaptic, by selecting the package, then going to the "Package" menu above, and selecting "Lock version" (or something like that, my system is set to Spanish).
 
Old 01-30-2012, 09:57 PM   #4
widget
Senior Member
 
Registered: Oct 2008
Location: S.E. Montana
Distribution: Debian Testing
Posts: 1,395

Rep: Reputation: 194Reputation: 194
You got me wondering about this. I went and took a look at "man apt-get".

As an apt-get fan it hurts me to say that I think you need to use aptitude. I believe the commands given by odiseo77 are just rignt for the job.

There are somethings that aptitude really does a nice job of. This looks like one of them.
 
Old 01-30-2012, 11:44 PM   #5
evo2
Senior Member
 
Registered: Jan 2009
Location: Japan
Distribution: Debian
Posts: 2,613

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
You've been given lots of info for aptitude, but you seem to be using apt-get. Unlike aptitude* apt-get will respect the holds placed by dpkg. So:

Code:
echo "packagename hold" | dpkg --set-selections
Then once you no longer want it on hold
Code:
echo "packagename install" | dpkg --set-selections
Cheers,

Evo2.

* at least, aptitude used to ignore dpkg hold states.
 
Old 01-30-2012, 11:58 PM   #6
k3lt01
Senior Member
 
Registered: Feb 2011
Location: Australia
Distribution: Debian Sid/Experimental
Posts: 1,320

Rep: Reputation: 195Reputation: 195
For those who also use Synaptic you can select the package by highlighting it and then go to the Package menu and select Lock Version. This will lock the selected package at the currently installed version.
 
Old 01-31-2012, 07:19 AM   #7
odiseo77
Member
 
Registered: Dec 2004
Location: Caracas, Venezuela
Distribution: Debian Sid
Posts: 611

Rep: Reputation: 76
Quote:
Originally Posted by widget View Post
There are somethings that aptitude really does a nice job of. This looks like one of them.
Indeed, aptitude has some really nice features and functions. I used to use apt-get before, but now I always use aptitude

Cheers.
 
Old 01-31-2012, 12:32 PM   #8
widget
Senior Member
 
Registered: Oct 2008
Location: S.E. Montana
Distribution: Debian Testing
Posts: 1,395

Rep: Reputation: 194Reputation: 194
Quote:
Originally Posted by evo2 View Post
You've been given lots of info for aptitude, but you seem to be using apt-get. Unlike aptitude* apt-get will respect the holds placed by dpkg. So:

Code:
echo "packagename hold" | dpkg --set-selections
Then once you no longer want it on hold
Code:
echo "packagename install" | dpkg --set-selections
Cheers,

Evo2.

* at least, aptitude used to ignore dpkg hold states.
I have been working on learning about package managment for a bit now. The more I learn the mor ignorant I become.

Been concentrating on apt-get and aptitude with side expeditions into dpkg. This is a new one for me. Even have a special file for it.

I thought that dpkg file was pretty complete. Ah the joys or ignorance.

Thanks a bunch.
 
Old 01-31-2012, 01:03 PM   #9
caravel
Member
 
Registered: Apr 2005
Distribution: Debian Sid
Posts: 470

Rep: Reputation: 121Reputation: 121
The easiest approach, though in my humble opinion not the cleanest, is "aptitude hold package-foo"

Or if it's just a particular version you don't want, i.e. a bugged version, but you want to upgrade to the version after that (usually only useful for testing and especially unstable users)

Code:
aptitude forbid-version package-foo=1.0.0-1
Where "package-foo" is whichever package it is you don't want to upgrade. Where "1.0.0-1" is the version you don't want to upgrade to. so package-foo_1.0.0-1 would never be installed, but once "package-foo_1.0.0-2" is available it will.

Needless to say apt-get will not respect these rules.

If you want to avoid holds and use apt-get then you will have to get into the realms apt pinning and actually pin a package permanently to a particular version.

e.g.

/etc/apt/preferences

Code:
Package: package-foo
Pin: version 1.0.0-0
Pin-Priority: 1001
This prevents any upgrades beyond version 1.0.0-0.

Finally you can also avoid some unwanted upgrades that offer to rip out half of your system by running
Code:
apt-get upgrade
or
Code:
aptitude update
instead of dist-upgrade/full-upgrade.

But as far as the kernel goes, that gets patched in the course of security updates - you should not put it on hold if you value security and stability.
 
Old 02-01-2012, 09:25 PM   #10
craigevil
Senior Member
 
Registered: Apr 2005
Location: OZ
Distribution: Debian Sid
Posts: 4,446
Blog Entries: 11

Rep: Reputation: 375Reputation: 375Reputation: 375Reputation: 375
From the package apt-dpkg-ref /usr/share/doc/apt-dpkg-ref/apt-dpkg-ref.html

echo ``<package> hold'' | dpkg --set-selections Put <package> on hold (command line method)

dpkg --get-selections ``<package>'' Get the current status of <package> (command line method)

Also see aptitude user's manual : http://algebraicthunk.net/~dburrows/...titude/doc/en/

Aptitude - Debian Wiki : http://wiki.debian.org/Aptitude

Chapter*2.*Debian package management : http://www.debian.org/doc/manuals/de...e/ch02.en.html
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
CVS Exclude : Exclude sub directories from check out On Linux from command line shajay12 Linux - Newbie 1 08-03-2009 12:36 AM
How can I exclude some packages from Yum updates ? alMubarmij Fedora 6 03-29-2009 01:05 AM
Exclude updating apps software using yum jojojo Linux - Newbie 1 06-12-2006 02:32 PM
apt question: exclude certain packages from upgrading? ice99 Linux - Software 1 09-21-2005 09:18 PM
Updating packages from redhat - insatlling *.hdr packages jomy Linux - Networking 1 01-18-2005 08:36 AM


All times are GMT -5. The time now is 10:39 PM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration