Pacman: command not found if use sudo

Hello together,
since today i’m not able to update my system with pacman if I use the command with sudo.
If I use pacman with su it is working.
What could be the problem?
Thank you!

~ >>> sudo pacman -Syu                                                         
[sudo] password for alexander: 
sudo: pacman: command not found
~ >>>
~ >>> su                                                                    [1]
Password: 
[TUF-Dev alexander]# pacman -Syu
:: Synchronizing package databases...
 core is up to date
 extra is up to date
 community is up to date
 multilib is up to date
:: Starting full system upgrade...
warning: gnome-shell-extension-nightthemeswitcher: local (52-1) is newer than community (51-2)
warning: gnome-shell-extension-unite: local (57-1) is newer than community (56-1)
warning: manjaro-hello: local (0.6.7-2) is newer than extra (0.6.6-9)
warning: zsh-theme-powerlevel10k: local (1.15.0+66+g3e515a7-1) is newer than community (1.15.0-2)
 there is nothing to do
[TUF-Dev alexander]# exit
exit

No sudo package? Check if is installed.

Sudo is installed:

 >>> sudo                                                                  [1]
usage: sudo -h | -K | -k | -V
usage: sudo -v [-ABknS] [-g group] [-h host] [-p prompt] [-u user]
usage: sudo -l [-ABknS] [-g group] [-h host] [-p prompt] [-U user] [-u user]
            [command]
usage: sudo [-ABbEHknPS] [-C num] [-D directory] [-g group] [-h host] [-p
            prompt] [-R directory] [-T timeout] [-u user] [VAR=value] [-i|-s]
            [<command>]
usage: sudo -e [-ABknS] [-C num] [-D directory] [-g group] [-h host] [-p
            prompt] [-R directory] [-T timeout] [-u user] file ...

But now I find out, that sudo can not find any command!?

sudo nano testx                                                          
[sudo] password for alexander: 
sudo: nano: command not found

Sorry it was my fault!
I modified two weeks ago /etc/sudoers and made there a fault.

Thank you!

You should always use visudo to edit the sudoers file (or to edit drop-in files at /etc/sudoers.d). It checks for syntax errors.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.