0

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.

2

1 Answer 1

0

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .