1

Suddenly, I am getting into very serious problem with the following error in the image.

I shut down my PC and when I started it again suddenly after login, it went into login loop and could not enter into the desktop. Then I logged in using tty3 Ctrl + Alt + F3and after login I see the following error.

error image

I tried all the approaches over the internet but it didn't work. Note: Form tty3 startx command works

Following are the paths set in the System:

echo $PATH /home/muzamil/anaconda3/bin:/bin:/condabin:/usr/local/hadoop/bin:/usr/local/hadoop/sbin

and

cat /etc/environment PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:$PATH" JAVA_HOME=/opt/jdk/jdk1.8.0_261 JRE_HOME=/opt/jdk/jdk1.8.0_261/jre

Thanks

Solution:

It looks weird but somehow I managed to fix this issue. It seems that paths from ~/.profile and /etc/environment could not read. I tried to set paths from ~/.profile and /etc/environment into ~/.bashrc manually and run source ~/.bashrc, it set the path permanently but could bot read when I login to the system (same loop).

After hours of search I found out this hack, Hence setting the paths at the top in ~/.bashrc file before following line

# If not running interactively, don't do anything
[ -z "$PS1" ] && return

worked for me. It looks like bash interactive mode could not run and could not read paths from ~/.profile.

muzamil
  • 111

1 Answers1

1

From the error you're getting it sounds like there is something wrong with your user's PATH environment variable (the value doesn't contain /usr/bin and /bin).

Would it be possible for you to run the following command (from your tty3) and post the output:

echo $PATH

This will print your current path environment variable.

It is also possible that your system-wide path environment variable is somehow mis-configured. You can check that by running:

cat /etc/environment

See also this answer