LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-13-2018, 03:59 PM   #1
avihuh
LQ Newbie
 
Registered: Dec 2016
Posts: 19

Rep: Reputation: Disabled
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
 
Old 10-13-2018, 04:09 PM   #2
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth, unfortunately...
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881

Rep: Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063
Quote:
Originally Posted by avihuh View Post
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
 
Old 10-13-2018, 05:37 PM   #3
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,501

Rep: Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489
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?
 
Old 10-14-2018, 06:55 AM   #4
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
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)
 
Old 10-14-2018, 07:44 AM   #5
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth, unfortunately...
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881

Rep: Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063
Quote:
Originally Posted by ondoho View Post
...
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.
 
Old 10-14-2018, 07:49 AM   #6
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by jsbjsb001 View Post
Furthermore, CentOS/RHEL do not use sudo by default.
does it use su?
 
Old 10-14-2018, 07:50 AM   #7
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth, unfortunately...
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881

Rep: Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063
Quote:
Originally Posted by ondoho View Post
does it use su?
Yes.
 
Old 10-14-2018, 07:53 AM   #8
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
so could that possibly mean "superuser"?
 
Old 10-14-2018, 07:55 AM   #9
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth, unfortunately...
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881

Rep: Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063
Quote:
Originally Posted by ondoho View Post
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
 
Old 10-14-2018, 08:01 AM   #10
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
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?
 
Old 10-14-2018, 08:08 AM   #11
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth, unfortunately...
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881

Rep: Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063
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.

Last edited by jsbjsb001; 10-14-2018 at 08:09 AM. Reason: typo
 
Old 10-14-2018, 11:41 AM   #12
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: Slackware®
Posts: 13,925
Blog Entries: 44

Rep: Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159
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!
 
Old 10-14-2018, 11:47 AM   #13
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: Slackware®
Posts: 13,925
Blog Entries: 44

Rep: Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159
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!
 
Old 05-08-2020, 03:21 AM   #14
ARCHON_YOONITZ?!?!
LQ Newbie
 
Registered: May 2020
Location: montreal, quebec
Distribution: ubuntu, centos, debian, fedora coreos
Posts: 1

Rep: Reputation: Disabled
Talking my too cents

I just had to

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

no source, you will have to believe me


Last edited by ARCHON_YOONITZ?!?!; 05-08-2020 at 03:22 AM. Reason: spacing between emos xD
 
  


Reply



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
LXer: grub2-mkconfig Tutorial LXer Syndicated Linux News 0 09-30-2018 05:51 PM
[SOLVED] got back reinstall grub then ran grub-mkconfig --- not found oops BW-userx Slackware 2 01-17-2018 04:19 PM
SuSE's grub2-mkconfig finds only one of three kernels of fedora -- the oldest JZL240I-U Linux - Software 1 11-06-2012 04:26 AM
error: file '/grub2/locale/en.mo.gz' not found jshih Fedora - Installation 12 06-12-2012 01:11 AM
[SOLVED] serious Grub2 problem, symbol grub_env_export not found qrange Debian 1 05-05-2011 01:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:40 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