LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   Locating Installed Kernels in Debian (https://www.linuxquestions.org/questions/debian-26/locating-installed-kernels-in-debian-654880/)

carlosinfl 07-10-2008 10:53 AM

Locating Installed Kernels in Debian
 
I was looking into trying to find out what the proper way is to determine all / any installed kernels (old & present) on my Debian machine:

I was told by someone I can simply run the following command:

Code:

tunafish:~# dpkg --get-selections | grep "linux-image"
linux-image-2.6.22-3-686-bigmem                        install
linux-image-2.6.24-1-686-bigmem                        install

Is this correct? I am not sure if this is the correct way to see the total installed kernels on the system.

farslayer 07-10-2008 11:45 AM

I would use aptitude since it's my tool of choice..

Each line that begins with i is an installed package.
Code:

it-etch:/# aptitude search linux-image
v  linux-image                                          -                                                               
v  linux-image-2.6                                      -                                                               
p  linux-image-2.6-486                                  - Linux 2.6 image on x86                                         
p  linux-image-2.6-686                                  - Linux 2.6 image on PPro/Celeron/PII/PIII/P4                   
p  linux-image-2.6-686-bigmem                            - Linux 2.6 image on PPro/Celeron/PII/PIII/P4                   
p  linux-image-2.6-amd64                                - Linux 2.6 image on AMD64                                       
p  linux-image-2.6-k7                                    - Linux 2.6 image on AMD K7 - transition package                 
p  linux-image-2.6-xen-686                              - Linux 2.6 image on i686                                       
i  linux-image-2.6.18-6-686                              - Linux 2.6.18 image on PPro/Celeron/PII/PIII/P4                 
p  linux-image-2.6.22-3-486                              - Linux 2.6.22 image on x86                                     
p  linux-image-2.6.22-3-686                              - Linux 2.6.22 image on PPro/Celeron/PII/PIII/P4                 
p  linux-image-2.6.22-3-686-bigmem                      - Linux 2.6.22 image on PPro/Celeron/PII/PIII/P4                 
p  linux-image-2.6.22-3-amd64                            - Linux 2.6.22 image on AMD64                                   
p  linux-image-2.6.22-3-k7                              - Linux 2.6.22 image on AMD K7                                   
p  linux-image-2.6.22-3-vserver-686                      - Linux 2.6.22 image on PPro/Celeron/PII/PIII/P4                 
p  linux-image-2.6.22-3-vserver-k7                      - Linux 2.6.22 image on AMD K7                                   
p  linux-image-2.6.24-1-486                              - Linux 2.6.24 image on x86                                     
i  linux-image-2.6.24-1-686                              - Linux 2.6.24 image on PPro/Celeron/PII/PIII/P4                 
p  linux-image-2.6.24-1-686-bigmem                      - Linux 2.6.24 image on PPro/Celeron/PII/PIII/P4                 
p  linux-image-2.6.24-1-amd64                            - Linux 2.6.24 image on AMD64                                   
p  linux-image-2.6.24-1-xen-686                          - Linux 2.6.24 image on i686                                     
i  linux-image-2.6.25-2-686                              - Linux 2.6.25 image on PPro/Celeron/PII/PIII/P4                 
p  linux-image-486                                      - Linux image on x86                                             
p  linux-image-686                                      - Linux image on PPro/Celeron/PII/PIII/P4                       
p  linux-image-686-bigmem                                - Linux image on PPro/Celeron/PII/PIII/P4                       
p  linux-image-amd64                                    - Linux image on AMD64                                           
p  linux-image-k7                                        - Linux image on AMD K7 - transition package                     
p  linux-image-xen-686                                  - Linux image on i686

although the solution provided to you is a much cleaner output..

Code:

it-etch:/# dpkg --get-selections | grep "linux-image"
linux-image-2.6.18-6-686                        install
linux-image-2.6.24-1-686                        install
linux-image-2.6.25-2-686                        install

and if for some reason you don't believe either of those you can just look in the /boot directory..

Code:

er@it-etch:~$ ls /boot
boot.0800            initrd.img-2.6.18-6-686      System.map-2.6.18-6-686
coffee.bmp          initrd.img-2.6.18-6-686.bak  System.map-2.6.24-1-686
config-2.6.18-6-686  initrd.img-2.6.24-1-686      System.map-2.6.25-2-686
config-2.6.24-1-686  initrd.img-2.6.25-2-686      vmlinuz-2.6.18-6-686
config-2.6.25-2-686  initrd.img-2.6.25-2-686.bak  vmlinuz-2.6.24-1-686
debian.bmp          map                          vmlinuz-2.6.25-2-686
debianlilo.bmp      sarge.bmp
grub                sid.bmp


makuyl 07-10-2008 12:13 PM

Or for short: dpkg -l|grep linux-image

carlosinfl 07-10-2008 02:22 PM

Quote:

Originally Posted by makuyl (Post 3210248)
Or for short: dpkg -l|grep linux-image

Why are my results different with this command?

Code:

tunafish:~# dpkg -l | grep "linux-image"
ii  linux-image-2.6.22-3-686-bigmem      2.6.22-6.lenny1                  Linux 2.6.22 image on PPro/Celeron/PII/PIII/P4
ii  linux-image-2.6.24-1-686-bigmem      2.6.24-7                        Linux 2.6.24 image on PPro/Celeron/PII/PIII/P4


makuyl 07-10-2008 03:57 PM

Different how?
Aren't those the same kernels as in your first post?

carlosinfl 07-10-2008 05:39 PM

2.6.22-6 & 2.6.24-7

Where did those come from?

lurko 07-10-2008 07:26 PM

Those are the (current) versions of the linux-source packages for 2.6.22 and 2.6.24. I suspect a recent update to apt is why they're appearing there, I'm getting similar output when I run that command (and apt was among a bunch of updates I installed earlier today). Is the 2.6.24-1 linux-image package built from the 2.6.24-7 source package?

Telemachos 07-10-2008 08:59 PM

Code:

aptitude search "~nlinux-image ~i"
That searches for the phrase linux-image and restricts the results to installed pacakges.

For more minimal output,
Code:

aptitude search "~nlinux-image ~i" -F %p
The -F flag allows you to control the format of the output, and %p says "package name." So that tells Aptitude to run the same search, but only show the name of the installed packages.

farslayer 07-10-2008 11:40 PM

apt-cache policy linux-image-2.6.22-3-686-bigmem

The first is the package name the second is something like the build version which will change as security updates are added.. sorry I don't know the proper terminology but that's why the version number is different/higher.
Code:

debianetch:~# apt-cache policy linux-image-2.6.18-6-686
linux-image-2.6.18-6-686:
  Installed: 2.6.18.dfsg.1-18etch6
  Candidate: 2.6.18.dfsg.1-18etch6
  Version table:
*** 2.6.18.dfsg.1-18etch6 0
        500 http://security.debian.org etch/updates/main Packages

        100 /var/lib/dpkg/status
    2.6.18.dfsg.1-18etch1 0
        500 http://ftp.uwsg.indiana.edu etch/main Packages

see how the kernel version in main is older than the installed version from the security repository ?

carlosinfl 07-11-2008 07:11 AM

Thanks all!


All times are GMT -5. The time now is 02:52 AM.