Quantcast
Channel: Active questions tagged windows-subsystem-for-linux - Ask Ubuntu
Viewing all articles
Browse latest Browse all 2797

How to add a directory to PATH in Linux ? I am using Windows Subsystem for Linux - Ubuntu

$
0
0

I am new at Linux and I am facing a problem. I am trying to add the bin directory to the PATH in the Linux executing the command below:

$ export PATH="/opt/gcc-arm/bin:$PATH"

However, when I try to execute a command it returns me it was not found

Command 'arm-none-eabi-gcc' not found, but can be installed with:
sudo apt install gcc-arm-none-eabi

How could I add this directory to Linux PATH or there is a way to access the User variables from Windows using the Linux?

Edit1: I just run $PATH and I got this:

bash: /opt/gcc-arm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/mnt/c/Program:

The Path to the file that I created is there (/opt/gcc-arm/bin), but I do not understand why the system cannot recognize it.

Edit2: I executed the command suggested by @steeldriver

what is the result of file /opt/gcc-arm/bin/arm-none-eabi-gcc run

The result is: /opt/gcc-arm/bin/arm-none-eabi-gcc: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/l, for GNU/Linux 2.6.24, BuildID[sha1]=7af6e16f1d030393cdf4a6e6007a0e554470f126, stripped. But I have no idea what it means.

Edit3: Now the things start to work, first I use the command sudo -s and then

$ export PATH="/opt/gcc-arm/bin:$PATH".

After doing that I was able to run the commands from that PATH, however, when I close the Linux env and open again, it can not recognize those commands, so I have to include the PATH again. Is there some solution to avoid entering the PATH every time when I reopen the Linux?

Edit4: I followed this tutorial from Youtube Linux: Permanently set environment variables, now my PATH is permanent.

I hope this can help someone else that face this same problem


Viewing all articles
Browse latest Browse all 2797

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>