Installing tools and other using command line in Ubuntu 18.04 with sudo works perfectly.
example: sudo apt install ...
works perfectly.
Running tools and programs via the command line as sudo doesn't work at all.
Running the same programs and tools as normal user works perfectly.
Example: start gtkwave
as normal user makes the gtkwave GUI pop up.
Start gtkwave as sudo, asks for password and then ends in:
sudo: gtkwave: command not found
.
I must say that some tools invoked on the command line as sudo work flawlessly, for example I can start Atom from the command line as a normal user and as sudo.
Is this maybe because the tools/programs not running as sudo are not installed in the common Linux folders like /bin
or /usr/bin
but as programs under /opt
(these are added to the path and have necessary environments set)?
Does anybody have any idea why this happens?