LinuxQuestions.org
Register a domain and help support LQ
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
 
Search this Thread
Old 12-28-2008, 09:21 AM   #1
bgoodr
Member
 
Registered: Dec 2006
Location: Oregon
Distribution: RHEL[45] {x86,x86_64}, Debian "testing" {x86,x86_64}
Posts: 219

Rep: Reputation: 36
Automatic removal of kernel headers package when kernel packages are removed


As a follow-on to something Telemachos said in another post:

Quote:
Originally Posted by Telemachos View Post
You can see what kernels you have installed - to check if you have a virtual kernel and to clean up - by running this command:
Code:
aptitude search ~ilinux-image
If you've been installing kernel-headers along with the kernels (say to build modules for graphics or wireless), you should remove those when you remove the corresponding kernel. The command to search for those is parallel:
Code:
aptitude search ~ilinux-headers
Hope this helps.
I would have thought that removing a given kernel package would trigger the removal of the older kernel headers. Can someone confirm that is, or is not, the behavior? I ask this because it seemed to me that the older kernel header packages were indeed removed when I removed some older kernel packages. For example, the linux kernels I have installed are:

Code:
dpkg-query --show --showformat='${Package}\n' linux-image-\*
linux-image-2.6
linux-image-2.6-amd64
linux-image-2.6.18-5-amd64
linux-image-2.6.18-6-amd64
linux-image-2.6.25-2-amd64
linux-image-2.6.26-1-amd64
Also, the linux-headers packages I have installed are:

Code:
dpkg-query --show --showformat='${Package}\n' linux-headers\*
linux-headers
linux-headers-2.6
linux-headers-2.6.25-2-amd64
linux-headers-2.6.25-2-common
linux-headers-2.6.26-1-amd64
linux-headers-2.6.26-1-common
So, when I get around to removing the linux-image-2.6.25-2-amd64 package like this:

Code:
apt-get remove linux-image-2.6.25-2-amd64
I would expect apt-get to automatically also remove linux-headers-2.6.25-2-amd64 and linux-headers-2.6.25-2-common. Is that what will happen, or do I need to explicitly state all three packages on the apt-get remove command?

Thanks,
bgoodr
 
Old 12-28-2008, 11:19 AM   #2
the trooper
Senior Member
 
Registered: Jun 2006
Location: England
Distribution: Debian Testing/Unstable Amd64
Posts: 1,476

Rep: Reputation: Disabled
You will need to specify apt to remove the kernel headers as well.
Also for removing files,i tend to use the purge option rather than remove.
I would do it like this:

Code:
aptitude purge linux-image-2.6.25-2-amd64 linux-headers-2.6.25-2-amd64
This will remove all the files you want.
However if you use apt-get insteadof aptitude you will need to specify all dependencies you want to remove.

Code:
apt-get --purge remove linux-image-2.6.25-2-amd64 linux-headers-2.6.25-2-amd64  linux-headers-2.6.25-2-common
This is why i prefer to use aptitude instead of apt-get,because i find aptitude does a better job of removing dependencies.
Please note that this just my opinion,i am not trying to start an apt-get vs aptitude flame war.Use whichever works best for you.

Regards.
The trooper.

Last edited by the trooper; 12-28-2008 at 11:53 AM.
 
Old 12-28-2008, 11:51 AM   #3
Telemachos
Member
 
Registered: May 2007
Distribution: Debian
Posts: 754

Rep: Reputation: 59
Just to follow up on one other thing from the other thread. The first two linux-image packages (copied below) are not kernels: they're the virtual/dummy packages I talked about in my previous thread. If you don't want kernels to automatically update, remove them.
Code:
linux-image-2.6
linux-image-2.6-amd64
 
Old 12-30-2008, 08:14 PM   #4
bgoodr
Member
 
Registered: Dec 2006
Location: Oregon
Distribution: RHEL[45] {x86,x86_64}, Debian "testing" {x86,x86_64}
Posts: 219

Original Poster
Rep: Reputation: 36
Thanks to the both of you for your help!

bgoodr
 
  


Reply

Tags
apt, apt-get, aptitude, kernel


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
If I install the kernel source package, do I need the headers? TSquaredF Slackware 12 09-12-2006 10:08 AM
I need the kernel headers package for 2.6.13-7smp Thaidog Linux - General 2 06-25-2006 02:24 PM
do kernel headers come with kernel-source package? janos Linux - Kernel 1 05-30-2006 09:38 AM
kernel-headers package? mike2265 Linux - Newbie 1 03-17-2005 04:02 PM
send packets with kernel routing and without kernel messing with headers bassdemon Programming 5 02-08-2005 06:29 PM


All times are GMT -5. The time now is 08:49 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 Google+: linuxquestions
Open Source Consulting | Domain Registration