简体   繁体   中英

Arch Linux sudo: command not found

I recently installed Arch Linux on my Raspberry Pi and, after logging in as root and creating myself a user account I tried to use the sudo command. This was the result:

[phillipus@alarmpi home]$ sudo mkdir Public
bash: sudo: command not found

After searching for the problem, I logged in as root and executed pacman -S sudo . This was followed by a long output and a confirmation of installation. Following this, I retried to use sudo both as root and as my user, both times getting the same response. Following another solution to the problem, I tried to add myself to /etc/sudoers , only to find out that it didn't exist.

I am not very experienced with Linux, so could you please try to explain your responses fully?

First, you need to install the sudo package to use sudo :

pacman -S sudo

After you need to edit the sudoers file and add your username to it.

You can add yor user to the wheel group using usermod -G wheel yourusername and uncomment the %wheel ALL=(ALL) ALL line in the sudoers file. For more information, have a look at Sudo - ArchWiki

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM