T
T
TCloud2021-09-01 21:24:14
linux
TCloud, 2021-09-01 21:24:14

How to solve $PATH export problem?

Hello!
Such a case:
- I turn on the PC;
- I see the login screen, select the user, enter the password (correct password, checked 10k times);
- The login screen restarts, without any messages (if you enter the wrong password, an error will be visible).

Now the solution:
- From the login screen I press Ctrl + Alt + F1;
- In the terminal I enter the login, then the password. A message is displayed that I am logged in and everything is OK;
- Further, with any command, for example, "sudo" an error is displayed from the opera:

Command 'sudo' is available in the following places * /bin/sudo * /usr/bin/sudo 
The command could not be located because '/usr/bin:/bin' is not included in the PATH environment variable. sudo: command not found

- I solve it with the command export PATH="/usr/bin:$PATH";
- I launch startxand my desktop opens in a graph. shell.

And now the problem:
when you restart the PC, you must again register export PATH="/usr/bin:$PATH".

Can you tell me how to solve the problem with the export of the PATH variable, so that when the OS starts, this variable is immediately exported to child processes?

OS: linux mint ulyssa 20.1
Terminal: df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            3,8G     0  3,8G   0% /dev
tmpfs           786M  1,8M  784M   1% /run
/dev/sdb2       292G   40G  238G  15% /
tmpfs           3,9G   59M  3,8G   2% /dev/shm
tmpfs           5,0M  4,0K  5,0M   1% /run/lock
tmpfs           3,9G     0  3,9G   0% /sys/fs/cgroup
/dev/sdb1       511M  8,0M  504M   2% /boot/efi
tmpfs           786M  4,0K  786M   1% /run/user/120
tmpfs           786M   36K  786M   1% /run/user/1000

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
BorLaze, 2021-09-01
@OTCloud

Check /etc/environment
it out for me:

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question