While following a tutorial from Stack Overflow, I set the Java path as instructed, but in the process I got an error. Now I cannot login, as usr/bin:/usr
is not found.
-
1At what moment did you get this error ? Can you show what happened in your terminal– SaxtheowlOct 3, 2019 at 14:32
-
askubuntu.com/questions/19697/…– yesnoOct 3, 2019 at 14:40
Add a comment
|
1 Answer
A quick search will find existing answers like this one: how-to-restore-path-environment-variable and many more.
There are a few options... you can boot to single user, passwordless login (if you have physical access) and then restore:
/etc/environment:PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"
/etc/login.defs:ENV_SUPATH PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
/etc/login.defs:ENV_PATH PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
etc. for all users, or if you only wiped your local user, then consider restoring settings via (on Ubuntu 18.04):
cp /etc/skel/.profile /home/<user>/
If you only have remote access, you can login as another user, and then restore.