LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > antiX / MX Linux
User Name
Password
antiX / MX Linux This forum is for the discussion of antiX and MX Linux.

Notices


Reply
  Search this Thread
Old 11-14-2020, 04:30 AM   #1
LinWinux
Member
 
Registered: May 2019
Location: Germany
Distribution: MX Linux & Linux Mint XFCE
Posts: 299

Rep: Reputation: Disabled
Removing obsolete, unwanted grub items ... how?


Hi everyone.
Well, the grub configuration seems to have changed a lot during the past 5+ years ...
Utilizing MX Linux which has been updated & upgraded multiple times now, I can no longer figure out precisely where I can go in order to remove obsolete entries. There seem to be several locations with grub related files. Currently I have 8 entries for the previous 4 kernels. I would like to simply remove the oldest two entries, since it annoys me to have the startup screen cluttered with things that I don't want to see.

Perhaps an automated process, to delete older kernel entries automatically?
Any helpful thoughts would be appreciated. Thanks.
 
Old 11-14-2020, 04:38 AM   #2
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,499
Blog Entries: 19

Rep: Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410
The best way to modify GRUB is to use the update-grub script. First uninstall the kernels you don't want. Check them in synaptic and you'll probably find them listed as autoremovable. Then run update-grub.
 
Old 11-14-2020, 05:32 AM   #3
LinWinux
Member
 
Registered: May 2019
Location: Germany
Distribution: MX Linux & Linux Mint XFCE
Posts: 299

Original Poster
Rep: Reputation: Disabled
Thank you for that fast response. I'm not familiar with an update-grub script. Where do I find this?
 
Old 11-14-2020, 05:37 AM   #4
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,499
Blog Entries: 19

Rep: Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410
Just open a terminal and type sudo update-grub.
 
Old 11-14-2020, 05:48 AM   #5
LinWinux
Member
 
Registered: May 2019
Location: Germany
Distribution: MX Linux & Linux Mint XFCE
Posts: 299

Original Poster
Rep: Reputation: Disabled
Sorry, I thought you meant some different script somewhere.
Utilizing sudo update-grub doesn't change anything on the startup (grub) screen.
And when I use the MX Tools Grub Menu, I can't remove any grub entries from there.
I think there is or used to be a grub-customizer tool that I'd used in the past. Don't have it now though.
 
Old 11-14-2020, 06:05 AM   #6
captain_sensible
Member
 
Registered: Apr 2010
Posts: 352

Rep: Reputation: 145Reputation: 145
is that a UEFI PC ?

i never did fully understand uefi, efi partition but if i run
# efibootmgr

i see entries like:

bash-5.0# efibootmgr
BootCurrent: 0003
Timeout: 0 seconds
BootOrder: 0003,0000,9999
Boot0000* Slackware HD(1,GPT,192a9aa1-9848-4329-8171-9253ffc0f920,0x800,0x32

The laptop was originally Windows 10; i installed Slackware but i noticed when running efibootmgr entry for Windows was still there, even though it was wiped when i installed slackware. I did remove that using
efibootmgr. The entries should be listed somethting like:


Boot0001

..
Boot005

etc you use those to delete , something like:


# efibootmgr -B Boot005
 
Old 11-14-2020, 06:22 AM   #7
LinWinux
Member
 
Registered: May 2019
Location: Germany
Distribution: MX Linux & Linux Mint XFCE
Posts: 299

Original Poster
Rep: Reputation: Disabled
Thanks, but that's not what I'm looking for.
I just utilized the grub-customizer tool, followed by saving the new configuration.
Then installed the saved configuration into the master boot record ... but oddly no changes occurred during a reboot.
During system start, right now the screen still displays the same eight grub / kernel entries.

What I'm looking for is the actual grub.cnfg script or whatever it's called these days, which contains all the entries that show up during boot. In the past this used to be a single file with a single backup file. But now the grub menu has been split into several files which are combined ??? during the boot process. I just want those obsolete entries that I'm never going to use ... to go away ... visually.
I don't care if the kernels still exist on the system, I just don't want to see the entries ...
 
Old 11-14-2020, 06:54 AM   #8
captain_sensible
Member
 
Registered: Apr 2010
Posts: 352

Rep: Reputation: 145Reputation: 145
might be an idea to confirm which grub using:

grub-install --version


mine is:
grub-install (GRUB) 2.04
bash-5.0#
 
Old 11-14-2020, 07:06 AM   #9
LinWinux
Member
 
Registered: May 2019
Location: Germany
Distribution: MX Linux & Linux Mint XFCE
Posts: 299

Original Poster
Rep: Reputation: Disabled
Well, utilizing version, terminal shows me ...

grub-install (GRUB) 2.02~beta3-5deb9u2

I don't see how that can help me any further. I don't understand why I can't locate a single file to edit anymore. Even looking at this link was was the closest that I could find for what I'm looking to do, the grub folder names & file locations in the link don't match up what I have ... even though it's based on Debian as is MX Linux ... ??? https://olinux.net/change-grub-boot-order-linux/
 
Old 11-14-2020, 07:20 AM   #10
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,499
Blog Entries: 19

Rep: Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410
Quote:
Originally Posted by LinWinux View Post
I don't understand why I can't locate a single file to edit anymore.
The reason why is that they have made GRUB2 insanely complicated compared with the original GRUB (now called grub-legacy). That's why I really hate it. The way it works now is something like this:

1) When GRUB runs, it creates its menu from /boot/grub.d/grub.cfg, which is a actually a script written in the GRUB shell language.
2) The grub.cfg file is created by grub-mkconfig, which is conveniently wrapped up as update-grub. These are both ordinary shell scripts.
3) grub-mkconfig uses information in a set of files in /etc/default/grub. At least, that's how it's done in the Debian family.

Did you actually uninstall the kernels you don't want any more before running update-grub? If you did and that didn't work, then I think you will need to look at the files in /etc/default/grub, find the one that contains the unwanted kernels and edit them out. Good luck with that!

I don't think you need to bother about efibootmgr. That's a red herring in your case. The uefi (if you have one) is booting GRUB correctly; it's GRUB that's misbehaving.
 
1 members found this post helpful.
Old 11-14-2020, 07:49 AM   #11
LinWinux
Member
 
Registered: May 2019
Location: Germany
Distribution: MX Linux & Linux Mint XFCE
Posts: 299

Original Poster
Rep: Reputation: Disabled
I agree, this is complete insanity. Who the heck over thought of this madness ???
Looking at your recommended path/file of ... /etc/default/grub ... doesn't yield the required information either. Same as a few others that I found, at the top of the file it just says ... if you make changes to this file, yada yada yada.
This is truly maddening, and one would think that these entries would be easier to adjust. Anyone who plays around with their own grub configuration obviously knows that they're doing so at their own risk, so why make such a minor adjustment intentionally more difficult and more confusing?

You're right, the laptop that I'm working with doesn't have a UEFI boot.

No, I didn't actually uninstall the kernels because when I looked at the kernels in the MX package manager ... Kernels ... there were only 5 items listed. Two of them with Antix, one Debian, one Liceurix (or something like that) and one Kernel file for the 4.19 Kernel that I'm currently on. Stable Repository shows me a list of "gazillion" image/kernel files, none of which are greyed out which would indicate to me that any of them are installed. And when I look for Kernels within Debian Backports, there are still a (fewer) number of Kernel related files, also none of which are greyed out to indicate that any of them have been installed.

I have never used boot repair tool or any other grub repair method on this system. To my knowledge it's pretty much all stock, with updates & dist-upgrades during the past 2 to 3 years.
 
Old 11-14-2020, 08:29 AM   #12
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,330

Rep: Reputation: 1579Reputation: 1579Reputation: 1579Reputation: 1579Reputation: 1579Reputation: 1579Reputation: 1579Reputation: 1579Reputation: 1579Reputation: 1579Reputation: 1579
If you don't want to keep the older kernels, remove them. There are several how-to's of different ways to do this on the net.

Last edited by colorpurple21859; 11-14-2020 at 08:30 AM.
 
Old 11-14-2020, 09:23 AM   #13
captain_sensible
Member
 
Registered: Apr 2010
Posts: 352

Rep: Reputation: 145Reputation: 145
@hazel
Quote:
insanely complicated
true this might help some: https://www.dedoimedo.com/computers/grub-2.html
 
Old 11-14-2020, 09:45 AM   #14
LinWinux
Member
 
Registered: May 2019
Location: Germany
Distribution: MX Linux & Linux Mint XFCE
Posts: 299

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by colorpurple21859 View Post
If you don't want to keep the older kernels, remove them. There are several how-to's of different ways to do this on the net.
As so often in the past, your comments are of no help whatsoever. I've been looking Online for hours and can't find anything which would resolve the excessive grub entries. Really, I wish you would just stay away from my posts. Every time that you comment, it's without any useful information whatsoever. Someone who responds with comments designed to pad their stats. Ridiculous. Do you really believe that I don't know how to use the internet or how to look for solutions there? Going to a forum is always my *LAST* stop, only after I couldn't find the correct solution on my own.

@hazel
@captain_sensible
My apologies, but I have seen this the above users comments literally hundreds of times on this forum already, where instead of help there's nothing but a blank or criticism. It's ridiculous, as if there's nothing better to do than to leave useless remarks (see my signature too).

Anyway, I'm afraid that I'll have to give up on this for now. As I've already explained previously, I can't find the older installed kernels within Synaptic, MX Packager Manager Stable, or MX Package Manager Debian Backports. So if I can't find something, then obviously I can't delete it either.

As far as grub is concerned, I found grub, grub config, and grub backup files in no less than 4 different locations. Altogether within their folders/sub-folders probably a dozen of them. But I can't find a single file that would account for the eight kernel entries that I'm seeing upon startup. I'll be checking out the dedoimedo link sometime in the next few days.

Last but not least, I also installed/re-installed everything grub and grub-customizer related. Nothing that I tried made any difference. Grub customizer displays the correct grub menu as it should appear during startup, but for some reason that's not what I get on the screen. No matter what I try with the grub-customizer as a last resort, even though changes take place without errors as they're applied, those same changes do not remain present when the machine is started up again.

On a positive note ... no matter what I edited, re-installed, or -reconfigured, the system didn't get borked. At least that's something.
 
Old 11-14-2020, 10:29 AM   #15
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,499
Blog Entries: 19

Rep: Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410
I wonder, did you ever install any kernels by hand? For example, you say you have a liquorix kernel. They certainly aren't standard, though I remember them being very fashionable a few years ago. Anything that gets installed independently of the apt system can't be uninstalled by the apt system.

Also you shouldn't have such a lot of grub files, only the ones in the two directories I mentioned and the original installation files which are in the lib tree somewhere.

I can't help you with grub-customiser. I never heard of that before.

Last edited by hazel; 11-14-2020 at 11:09 AM.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Infinite Grub Loop: GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB... beeblequix MEPIS 2 11-02-2013 10:56 PM
Rpmbuild spec file for virtual rpm - removing obsolete packages - CentOS/RHEL 5.3 DrLove73 Linux - Software 3 10-10-2009 10:22 AM
Removing obsolete backup files and containing directory franjo124 Linux - Newbie 2 03-30-2009 07:05 AM
removing obsolete files in APT m_yates Debian 1 11-15-2003 06:57 PM
Removing Obsolete Software JHuizingh Linux - General 4 02-26-2002 02:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > antiX / MX Linux

All times are GMT -5. The time now is 07:51 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration