9

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?

Giacomo1968
  • 25,759
  • 11
  • 71
  • 103
Phillipus
  • 91
  • 1
  • 1
  • 2
  • Good question. Wrong place to post it. – Giacomo1968 Sep 30 '14 at 21:32
  • Hi Phillipus, this is a better question for http://unix.stackexchange.com/. I think the moderators can move it over for you, but I'm not sure. Alternatively, the Arch linux IRC chat channel https://wiki.archlinux.org/index.php/IRC_channel) would probably be able to help as well, a bit more promptly. They'd be better able to answer any follow up questions as well. – Marshall Conover Sep 30 '14 at 21:39

2 Answers2

18

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

pacman -S sudo

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

Clock ZHONG
  • 875
  • 9
  • 23
mobal
  • 342
  • 2
  • 10
  • I would suggest to use `visudo` then , uncomment the group wheel line `%wheel ALL=(ALL) ALL` . finally add the user to the wheel group `usermod -aG wheel your_user` – pdem May 05 '20 at 10:05
  • In my case it was recognizing sudo but the password no! by installing it with pacman it worked thank you so much. btw I had to type sudo, log-in and then install it; running sudo command for me was not working. – Aspiiire Jul 07 '22 at 12:43
2

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