Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15

Thread: List of kernels

  1. #11
    Join Date
    Feb 2011
    Location
    Coquitlam, B.C. Canada
    Beans
    2,963
    Distro
    Ubuntu Development Release

    Re: List of kernels

    Quote Originally Posted by deadflowr View Post
    DougS also found another option he posted here about: https://ubuntuforums.org/showthread....4#post14003294.
    I think he posted a better more thorough description somewhere else, but I'm not gonna dig for it.
    Yes, I really like that kernel management tool, and recommend it. I'll have to dig around also to find if I did a better description of it somewhere else, ha ha. Perhaps the overview page. The problem for some would be that it is a git download. For reasons already covered herein, I do not like to use "autoremove". I pretty much only ever use the --choose option, to select what I want it to do. However, I recently got into some kernel troubles that then prevented updates due to configuration and dependency issues, even this tool with --choose gave up. But using the --fix option instead worked fine, and thereafter I could go back to the --choose option.

    EDIT: I had a screen shot and example run here.
    Last edited by Doug S; May 5th, 2021 at 04:05 PM.
    Any follow-up information on your issue would be appreciated. Please have the courtesy to report back.

  2. #12
    Join Date
    Apr 2011
    Location
    Mystletainn Kick!
    Beans
    12,169
    Distro
    Ubuntu

    Re: List of kernels

    EDIT: I had a screen shot and example run here.
    What's funny is I remember you posted in that thread. What I forgot was that I did too.
    Splat Double Splat Triple Splat
    Earn Your Keep
    Don't mind me, I'm only passing through.
    Once in a blue moon, I'm actually helpful
    .

  3. #13
    Join Date
    Dec 2020
    Beans
    28

    Re: List of kernels

    Thank you guys for all the anwers and help!

    I have learnt a lot

    I've got two more questions:

    1. I did
    Code:
    dpkg -l | awk '/^rc/{print $2}' | xargs sudo apt purge -y
    but that command left some old kernel folders in /lib/modules.

    I dig the folder and found that in some I have got Build folders , and in the others there are some external drivers for my ethernet cards (I installed external dkms driver for my eth card)
    I assume that these files are old, so may I safety delete all of these files?
    (I am talking about removed kernels folders, not the installed one of course!)

    2. I do like linux-purge software. Anyone could provide me a faq how to install from git or where I may read about such process?

  4. #14
    Join Date
    Feb 2011
    Location
    Coquitlam, B.C. Canada
    Beans
    2,963
    Distro
    Ubuntu Development Release

    Re: List of kernels

    Quote Originally Posted by linerman View Post
    2. I do like linux-purge software. Anyone could provide me a faq how to install from git or where I may read about such process?
    I think you would just have to install the git package. Then use the command listed on the linux-purge code page to create a copy. Then run it. Example:

    Code:
    doug@s19:~/ubuntu-forums-example$ git clone https://git.launchpad.net/linux-purge
    Cloning into 'linux-purge'...
    remote: Enumerating objects: 676, done.
    remote: Counting objects: 100% (676/676), done.
    remote: Compressing objects: 100% (484/484), done.
    remote: Total 676 (delta 270), reused 213 (delta 41)
    Receiving objects: 100% (676/676), 101.84 KiB | 318.00 KiB/s, done.
    Resolving deltas: 100% (270/270), done.
    doug@s19:~/ubuntu-forums-example$ cd linux-purge
    doug@s19:~/ubuntu-forums-example/linux-purge$ sudo ./linux-purge --choose
    [sudo] password for doug:
    And I'll end up here (older screen shot, re-used here):
    Attached Images Attached Images
    Any follow-up information on your issue would be appreciated. Please have the courtesy to report back.

  5. #15
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: List of kernels

    Today, I did a few commands to clean up the last remaining 4.15 kernels, modules, headers on my systems. They are all running a 5.4 kernel now, except 1 which will have the OS upgraded tonight (in theory).

    Code:
    dpkg -l 'linux-*-4.15*'
    provides a list.
    Code:
    sudo apt purge 'linux-*-4.15*'
    purges all the related kernels, headers, and modules for v4.15 kernels.

    Clearly, you are expected to look at the list to be purged before answering 'y'.

    Both dpkg and apt support package name globbing similar to what bash supports.

    Right now, there are some old 5.4.0.x kernels, headers, modules leaving traces behind, so I'll be a little more selective about the globbing.

    Code:
    $ dpkg -l 'linux-*-5*'
    Desired=Unknown/Install/Remove/Purge/Hold
    | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
    |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
    ||/ Name             Version       Architecture  Description
    +++-================-=============-=============-=====================================
    un  linux-headers-5. <none>        <none>        (no description available)
    ii  linux-headers-5. 5.4.0-72.80~1 amd64         Linux kernel headers for version 5.4.
    ii  linux-headers-5. 5.4.0-73.82~1 amd64         Linux kernel headers for version 5.4.
    un  linux-hwe-5.4-do <none>        <none>        (no description available)
    ii  linux-hwe-5.4-he 5.4.0-72.80~1 all           Header files related to Linux kernel 
    ii  linux-hwe-5.4-he 5.4.0-73.82~1 all           Header files related to Linux kernel 
    un  linux-hwe-5.4-im <none>        <none>        (no description available)
    un  linux-hwe-5.4-so <none>        <none>        (no description available)
    un  linux-hwe-5.4-to <none>        <none>        (no description available)
    rc  linux-image-5.4. 5.4.0-70.78~1 amd64         Signed kernel image generic
    ii  linux-image-5.4. 5.4.0-72.80~1 amd64         Signed kernel image generic
    ii  linux-image-5.4. 5.4.0-73.82~1 amd64         Signed kernel image generic
    un  linux-image-unsi <none>        <none>        (no description available)
    un  linux-image-unsi <none>        <none>        (no description available)
    un  linux-image-unsi <none>        <none>        (no description available)
    rc  linux-modules-5. 5.4.0-70.78~1 amd64         Linux kernel extra modules for versio
    ii  linux-modules-5. 5.4.0-72.80~1 amd64         Linux kernel extra modules for versio
    ii  linux-modules-5. 5.4.0-73.82~1 amd64         Linux kernel extra modules for versio
    rc  linux-modules-ex 5.4.0-70.78~1 amd64         Linux kernel extra modules for versio
    ii  linux-modules-ex 5.4.0-72.80~1 amd64         Linux kernel extra modules for versio
    ii  linux-modules-ex 5.4.0-73.82~1 amd64         Linux kernel extra modules for versio
    See all the lines that don't start with '^ii', those are the ones I want to purge, but only the specific versions, not metapackages. Let's check if a little more specific globbing will work:
    Code:
    $ dpkg -l 'linux-*5.4.0-70*'
    Desired=Unknown/Install/Remove/Purge/Hold
    | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
    |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
    ||/ Name             Version       Architecture  Description
    +++-================-=============-=============-=====================================
    un  linux-headers-5. <none>        <none>        (no description available)
    rc  linux-image-5.4. 5.4.0-70.78~1 amd64         Signed kernel image generic
    un  linux-image-unsi <none>        <none>        (no description available)
    rc  linux-modules-5. 5.4.0-70.78~1 amd64         Linux kernel extra modules for versio
    rc  linux-modules-ex 5.4.0-70.78~1 amd64         Linux kernel extra modules for versio
    Nice. It found what we want, but nothing we don't want. Time to purge ...
    Code:
    $ sudo apt purge  'linux-*5.4.0-70*'
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    ... {lots of packages not on the system listed here}
    The following packages will be REMOVED:
      linux-image-5.4.0-70-generic* linux-modules-5.4.0-70-generic*
      linux-modules-extra-5.4.0-70-generic*
    0 upgraded, 0 newly installed, 3 to remove and 0 not upgraded.
    After this operation, 0 B of additional disk space will be used.
    Do you want to continue? [Y/n] 
    (Reading database ... 180288 files and directories currently installed.)
    Purging configuration files for linux-modules-extra-5.4.0-70-generic (5.4.0-70.78~18.04.1) ...
    Purging configuration files for linux-modules-5.4.0-70-generic (5.4.0-70.78~18.04.1) ...
    dpkg: warning: while removing linux-modules-5.4.0-70-generic, directory '/lib/modules/5.4.0-70-generic' not empty so not removed
    Purging configuration files for linux-image-5.4.0-70-generic (5.4.0-70.78~18.04.1) ...
    And to check things before rebooting, re-run the initial dpkg cmd. Checking ... all good. There are a few meta-packages left (doc, source, tools) in the list along with the installed kernel, headers, and modules needed for a working system. If too many kernels were removed, I'd need to re-install them before rebooting. Always check your efforts.

    I suppose the key point is that name globbing on Unix is much more capable than what we learned on MS-DOS. We can put wildcards in places that MS-DOS/Windows cannot handle. Also, don't think that a '.' means anything special in Unix. It is just another character, unlike on Windows where it is the beginning of a special "extension." Unix doesn't have extensions. Humans find them useful, but the OS doesn't care.
    Last edited by TheFu; May 15th, 2021 at 10:25 PM.

Page 2 of 2 FirstFirst 12

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •