Announcement

Collapse
No announcement yet.

Old kernels won't uninstall

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [SOLVED] Old kernels won't uninstall

    I've got about SIX kernels installed on my Neon system and I cannot get rid of the old ones. Since the machine is running 5.19.X there is really no need to have the 5.15.X kernels hanging around.

    The Mainline Kernel app goes through the motions of removing them but they are still there! What am I doing wrong?

    Fedora used to let you set how many kernels to keep, pity I can't do that in *Buntu!

    I'm feeling a bit tired today so I'm also confused as to which is the latest kernel that's installed!
    Attached Files
    Constant change is here to stay!

    #2
    Perhaps this might help?
    https://forum.kde.org/viewtopic.php%...&t=169067.html

    If the reason is not the wrong marking as "manual" and therefore sudo apt autoremove --purge not working for those kernels, you could just purge any 5.15 kernel with APT (there don't seem to be that many…).
    Last edited by Schwarzer Kater; Jun 28, 2023, 09:18 PM.
    Debian KDE & LXQt • Kubuntu & Lubuntu • openSUSE KDE • Windows • macOS X
    Desktop: Lenovo ThinkCentre M75s • Laptop: Apple MacBook Pro 13" • and others

    get rid of Snap script (20.04 +)reinstall Snap for release-upgrade script (20.04 +)
    install traditional Firefox script (22.04 +)​ • install traditional Thunderbird script (24.04)

    Comment


      #3
      Originally posted by Beerislife View Post
      The Mainline Kernel app goes through the motions of removing them but they are still there! What am I doing wrong?
      That tool is for mainline kernels , not for normally installed ones. It probably can't remove non-manual kernel installs.

      Originally posted by Beerislife View Post
      pity I can't do that in *Buntu!
      Sure, you can (ummm..maybe not as much, see my edit below). The default is three, iirc, but that holds for each series, so yes, it can get messy, maybe.



      Being an LTS, neon is using the same stock HWE kernel stack, which essentially is an addon to the original 'GA' kernels.

      You have two kernel meta-packages installed, linux-image-generic (the 5.1.5 'GA' kernels) and linux-image-hwe-22.04 (the current backported kernel, 5.19, soon to be replaced with the 6.2 from Lunar)
      You essentially need to uninstall two meta-package, and then autoremove.
      If you have any stray -image or -headers packages lying around, you can manually remove them.

      Code:
      sudo apt remove linux-{image,headers}-generic

      EDIT

      Ok, you can't easily configure the number of kernels to keep via a config edit like you used to. Debian integrated this logic into apt itself, and I have no clue how this would be properly overriden, and don't feel like doing a deep dive. I thought Ubuntu were supposed to be the bad guys all the time?

      Comment


        #4
        I'll look at this later, right now I'm totally out of it. It must be the heat and humidity!
        Constant change is here to stay!

        Comment


          #5
          OK. So now I'm seeing this...
          Attached Files
          Constant change is here to stay!

          Comment


            #6
            And...

            Code:
            sudo apt remove linux-image-5.15.0-76-generic
            Reading package lists... Done
            Building dependency tree... Done
            Reading state information... Done
            Starting pkgProblemResolver with broken count: 3
            Starting 2 pkgProblemResolver with broken count: 3
            Investigating (0) linux-modules-extra-5.15.0-76-generic:amd64 < 5.15.0-76.83 @pi K Ib >
            Broken linux-modules-extra-5.15.0-76-generic:amd64 Depends on linux-image-5.15.0-76-generic:amd64 < 5.15.0-76.83 @pi pR >
            Considering linux-image-5.15.0-76-generic:amd64 10003 as a solution to linux-modules-extra-5.15.0-76-generic:amd64 2
            Broken linux-modules-extra-5.15.0-76-generic:amd64 Depends on linux-image-unsigned-5.15.0-76-generic:amd64 < none | 5.15.0-76.83 @un uH >
            Considering linux-image-unsigned-5.15.0-76-generic:amd64 2 as a solution to linux-modules-extra-5.15.0-76-generic:amd64 2
            Try Installing linux-image-unsigned-5.15.0-76-generic:amd64 < none | 5.15.0-76.83 @un uH > before changing linux-modules-extra-5.15.0-76-generic:amd64
            Or group remove for linux-modules-extra-5.15.0-76-generic:amd64
            Investigating (0) linux-image-generic:amd64 < 5.15.0.76.74 @pi K Ib >
            Broken linux-image-generic:amd64 Depends on linux-image-5.15.0-76-generic:amd64 < 5.15.0-76.83 @pi pR >
            Considering linux-image-5.15.0-76-generic:amd64 10003 as a solution to linux-image-generic:amd64 1
            Removing linux-image-generic:amd64 rather than change linux-image-5.15.0-76-generic:amd64
            Investigating (0) linux-generic:amd64 < 5.15.0.76.74 @ii K Ib >
            Broken linux-generic:amd64 Depends on linux-image-generic:amd64 < 5.15.0.76.74 @pi R > (= 5.15.0.76.74)
            Considering linux-image-generic:amd64 1 as a solution to linux-generic:amd64 0
            Removing linux-generic:amd64 rather than change linux-image-generic:amd64
            Done
            The following packages were automatically installed and are no longer required:
            linux-hwe-5.19-headers-5.19.0-42 linux-hwe-5.19-headers-5.19.0-45
            Use 'sudo apt autoremove' to remove them.
            The following additional packages will be installed:
            linux-image-unsigned-5.15.0-76-generic
            Suggested packages:
            fdutils linux-doc | linux-source-5.15.0 linux-tools
            linux-modules-extra-5.15.0-76-generic
            The following packages will be REMOVED
            linux-generic linux-image-5.15.0-76-generic linux-image-generic
            linux-modules-extra-5.15.0-76-generic
            The following NEW packages will be installed
            linux-image-unsigned-5.15.0-76-generic
            0 to upgrade, 1 to newly install, 4 to remove and 1 not to upgrade.
            Need to get 11.7 MB of archives.
            After this operation, 355 MB disk space will be freed.
            Do you want to continue? [Y/n]
            Constant change is here to stay!

            Comment


              #7
              Use the exact command I gave, you need to uninstall the meta-packages, as these depend on the individual kernel packages. Then do an auto remove. Dpkg isn't always the best tool as it isn't designed to handle dependency resolution so much.

              It probably isn't helping that there are kernel updates in last night's updates.

              I tested this last night before posting the command, just to be sure, though I have done this in the past.

              Comment


                #8
                I know may people don't like it but I use ubuntu-cleaner to remove older kernels and if your careful it does not cause problems.
                you can install it by following the instructions here.
                https://www.omgubuntu.co.uk/2016/12/...er-janitor-app
                Dave Kubuntu 20.04 Registered Linux User #462608

                Wireless Script: http://ubuntuforums.org/showthread.p...5#post12350385

                Comment


                  #9
                  Thanks. I ran the command you supplied and I'm now down from six to five kernels! I still have one 5.15.X installed that I'd like to nuke!

                  Edit: It's now gone too and I'm down to four!
                  Last edited by Beerislife; Jun 30, 2023, 02:39 AM.
                  Constant change is here to stay!

                  Comment


                    #10
                    Originally posted by Beerislife View Post
                    Edit: It's now gone too and I'm down to four!
                    Which one do you boot to? Form the image in your OP, you are/were on the second most recent kernel, maybe the logic in apt is keeping the running kernel plus the previous 2? The newer one may not be being counted?
                    On top of that, the newest kernel package build version (5.19.0-46.47~22.04.21) is not the current official kernel. I don't know where that one is coming from.

                    Code:
                    $ apt policy linux-image-5.19.0-46-generic
                    linux-image-5.19.0-46-generic:
                    Installed: 5.19.0-46.47~22.04.1
                    Candidate: 5.19.0-46.47~22.04.1
                    Version table:
                    *** 5.19.0-46.47~22.04.1 500
                    500 http://security.ubuntu.com/ubuntu jammy-security/main amd64 Packages
                    500 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages
                    100 /var/lib/dpkg/status

                    What does yours show? Do you know where this one came from?
                    5.19.0-46.47~22.04.1 is the current official kernel kernel in Jammy.

                    Comment


                      #11
                      I have no idea where that kernel came from. I have no kernel PPAs on this system! I'll see if I can nuke it if it shouldn't be there!
                      Constant change is here to stay!

                      Comment


                        #12
                        actually, it is a bug in the application. I just installed it on a hunch. It shows the same two 5.19.0.46.47 packages, one with ~22.04.21​ and the other with ~22.04.1

                        I most definitely do NOT have two 5.19 kernels installed here.

                        So you are actually down to the normal 3 kernels

                        Comment


                          #13
                          Now things are sorted out I'm going to purge Mainline...
                          Constant change is here to stay!

                          Comment


                            #14
                            And now I'm down to the running kernel, the previous kernel, and the phantom kernel!

                            I think I can safely say I've achieved my goal!
                            Constant change is here to stay!

                            Comment

                            Working...
                            X