Thanks much. Indeed. You are right again. That's why using "env" vs "sudo env" already makes a difference. ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐ On Wednesday, January 27, 2021 6:38 PM, Jonathan Wakely <jwakely.gcc@xxxxxxxxx> wrote: > On Wed, 27 Jan 2021 at 16:25, lordmund lordmund@xxxxxxxxxxxxxx wrote: > > > Hi Jonathan / Hi All, > > Thank you very much for the very prompt reply and hint. > > You are right! That was rather a general Ubuntu related question. I'm sorry for that. > > So then this is the wrong mailing list. > > > I took the N.B. on PATH for the rest of my life. Thanks much. > > Back to the previous topic. The truth is that the directory "/usr/local/gcc-6.3/bin" was already correctly added to PATH after editing ".bashrc". I've just checked it now. > > You also need to relogin, or do ". ~/.bashrc" for the new PATH to be set. > > > How I can see now, the reasons for throwing a "sudo: gcc-6: command not" found output after "sudo gcc-6 --version" command are two fold: > > (1) the name of the file in that specific folder "usr/local/gcc-6.3/bin" is not "gcc-6" but "gcc-6.3" in my case; > > (2) with the "sudo" prefix it does not work only without it. cf. below. > > Because you've added it to your user's path, but when you use sudo to > run a command as root it uses root's path.