LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Grub2-mkconfig command not found (https://www.linuxquestions.org/questions/linux-general-1/grub2-mkconfig-command-not-found-4175640318/)

avihuh 10-13-2018 03:59 PM

Grub2-mkconfig command not found
 
Hi guys,
I’ve RHEL 7.4 and I did some changes in /etc/default/grub.cfg and want to update with grub2-mkconfig, when I’m ruining the command I’m getting command not found, I tried also grub-mkconfig
Please advise

jsbjsb001 10-13-2018 04:09 PM

Quote:

Originally Posted by avihuh (Post 5914436)
Hi guys,
I’ve RHEL 7.4 and I did some changes in /etc/default/grub.cfg and want to update with grub2-mkconfig, when I’m ruining the command I’m getting command not found, I tried also grub-mkconfig
Please advise

While you really should be asking Red Hat this since it's a subscription based distribution;

The reason grub-mkconfig doesn't work is because there is no such command. But, the grub2-mkconfig should work given that's the command you need. Given CentOS is basically the free version of RHEL and I can see it on my system; are you trying to to run it as root ?

If so, post the output of the following command;

Code:

ls -la /usr/sbin/grub2-mkconfig

yancek 10-13-2018 05:37 PM

Quote:

I’ve RHEL 7.4 and I did some changes in /etc/default/grub.cfg
It would be useful if you posted the actual changes you made. Also, the actual file you made the changes to as there is no grub.cfg file in /etc/default but there is a grub file. Which did you edit and what did you edit?

ondoho 10-14-2018 06:55 AM

as superuser, just enter
Code:

grub<Tab><Tab>
and the shell shouild show you which executables are available.
failing that, it could also be
Code:

update<Tab><Tab>
(update-grub)

jsbjsb001 10-14-2018 07:44 AM

Quote:

Originally Posted by ondoho (Post 5914586)
...
Code:

update<Tab><Tab>
(update-grub)

The "update-grub" script does **NOT** exist in CentOS/RHEL - I've already given the command they need to use in post #2.

I've also already told them how to check if the command they do need is present on their system or not. Furthermore, CentOS/RHEL do not use sudo by default.

ondoho 10-14-2018 07:49 AM

Quote:

Originally Posted by jsbjsb001 (Post 5914599)
Furthermore, CentOS/RHEL do not use sudo by default.

does it use su?

jsbjsb001 10-14-2018 07:50 AM

Quote:

Originally Posted by ondoho (Post 5914602)
does it use su?

Yes.

ondoho 10-14-2018 07:53 AM

so could that possibly mean "superuser"?

jsbjsb001 10-14-2018 07:55 AM

Quote:

Originally Posted by ondoho (Post 5914604)
so could that possibly mean "superuser"?

The "su" command stands for "switch user", not "superuser".

From the man page;

Quote:

su - run a command with substitute user and group ID

ondoho 10-14-2018 08:01 AM

i think it's fair to say that "superuser" is a term that does not point to sudo in any way.
as also the rest of my post #4 had merit.

When the command is used without specifying the new user id as a command line argument, it defaults to using the superuser account (user id 0) of the system.

and here we go again, going into a wildly ot argument.
i wonder who you're going to blame this time?

jsbjsb001 10-14-2018 08:08 AM

I made the point about sudo for the OP's benefit (and anyone else that reads this thread). So, yes, here we go again, because you decided to just assume that because other distributions use the "update-grub" script, that means that CentOS/RHEL also do.

The "root user" and sudo are not one of the same thing, although yes, you would obliviously use sudo to get root permissions. You can use the "su" command to switch to any user, although, yes, it's correct to my way of thinking to assume that it's usually the "root user" that you would "switch to" with the "su" command. And what I use to be root on my system - I'm not saying you're wrong about that particular point - but it doesn't have to be root though.

onebuck 10-14-2018 11:41 AM

Moderator response
 
I am sure that the OP appreciates the finite comments by everyone but I feel it could be better addressed by everyone;
Quote:

From LQ Rules Challenge others' points of view and opinions, but do so respectfully and thoughtfully ... without insult and personal attack. Differing opinions is one of the things that make this site great.
So please get along!

onebuck 10-14-2018 11:47 AM

Member response
 
Hi,

My two cents;
Quote:

From 'man sudo'

sudo, sudoedit — execute a command as another user

SYNOPSIS
sudo -h | -K | -k | -V
sudo -v [-AknS] [-a type] [-g group] [-h host] [-p prompt] [-u user]
sudo -l [-AknS] [-a type] [-g group] [-h host] [-p prompt] [-U user] [-u user] [command]
sudo [-AbEHnPS] [-a type] [-C num] [-c class] [-g group] [-h host] [-p prompt] [-r role] [-t type] [-T timeout] [-u user] [VAR=value] [-i | -s] [command]
sudoedit [-AknS] [-a type] [-C num] [-c class] [-g group] [-h host] [-p prompt] [-T timeout] [-u user] file ...

DESCRIPTION
sudo allows a permitted user to execute a command as the superuser or another user, as specified by the security policy. The invoking user's real (not effec‐
tive) user ID is used to determine the user name with which to query the security policy.


sudo supports a plugin architecture for security policies and input/output logging. Third parties can develop and distribute their own policy and I/O logging
plugins to work seamlessly with the sudo front end. The default security policy is sudoers, which is configured via the file /etc/sudoers, or via LDAP. See the
Plugins section for more information.
And
Quote:

From 'man su'


su - change user ID or become superuser

SYNOPSIS
su [options] [username]

DESCRIPTION
The su command is used to become another user during a login session. Invoked without a username, su defaults to becoming the superuser. The optional argument
- may be used to provide an environment similar to what the user would expect had the user logged in directly.

Additional arguments may be provided after the username, in which case they are supplied to the user's login shell. In particular, an argument of -c will cause
the next argument to be treated as a command by most command interpreters. The command will be executed by the shell specified in /etc/passwd for the target
user.

You can use the -- argument to separate su options from the arguments supplied to the shell.

The user will be prompted for a password, if appropriate. Invalid passwords will produce an error message. All attempts, both valid and invalid, are logged to
detect abuse of the system.

The current environment is passed to the new shell. The value of $PATH is reset to /bin:/usr/bin for normal users, or /sbin:/bin:/usr/sbin:/usr/bin for the
superuser. This may be changed with the ENV_PATH and ENV_SUPATH definitions in /etc/login.defs.

A subsystem login is indicated by the presence of a "*" as the first character of the login shell. The given home directory will be used as the root of a new
file system which the user is actually logged into.
My suggestion to the OP is to learn to use the 'man command' to understand usage.
Everyone please note the underlined text above.

Hope this helps.
Have fun & enjoy!
:hattip:

ARCHON_YOONITZ?!?! 05-08-2020 03:21 AM

my too cents
 
I just had to :rolleyes:

su refers to switch "switch user" whereas sudo stands for "switch user and do", more specifically, "switch user, refer to sudoers file to check what can be done with this user then do the command if is allowed"

in other words, the sudo system (the sudo command and the sudoer file) is an evolved form of su as an attempt to provide a tool to administer the chaos of allowing users to become other users for tasks inside the system:scratch:

no source, you will have to believe me :eek: :banghead:

:twocents::hattip:


All times are GMT -5. The time now is 10:57 AM.