I am relatively new to Linux/Unix and I have a Debian Jessie 8 distribution installed in my laptop. I tried to install tex-live following the instructions in this TeX.stackexchange.com post

At some point it says the following

Finalising the installation

If the installation completes successfully you will want to make sure your operating system can find it. This can be done by creating a symbolic link:

mkdir -p /opt sudo ln -s /usr/local/texlive/2015/bin/* /opt/texbin (Note: there should only be one subdirectory in /usr/local/texlive/2015/bin.)

Now you'll have to add /opt/texbin to your $PATH variable. This can be done by editing /etc/environment:

gksudo gedit /etc/environment (It is said that /etc/login.defs is the equivalent of /etc/environment, in debian systems. You may want to keep this in mind if you are a debian user.)

You'll see something like:

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games" You can change this to:


which I did, and unfortunately, it didn't work, so then I continued in trying to edit /etc/profile in the same way because I read that it is the one that sets globally the Environment Path.

I commented all the existing commands for the paths in both files, put mine and rebooted. Debian starts, it asks for password and when I give it, it tries to login but it returns back to password prompt after some seconds.

I then rebooted in recovery mode and deleted my lines in both files and uncommented the ones that existed, hopefully reaching the default state but the problems persists.

I even tried to boot adding in grub the option init=/bin/bash rw and then modify the files, trying to put them in their initial state, but nothing happens.

In /etc/login.defs the environment path now is set to

ENV_PATH PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
ENV_SUPATH PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

and in /etc/profile

if ["`id -u`" -eq 0 ]; then

export PATH

Since I changed the files back to their original state, it should work, but it doesn't. What can I do?

  • How did you revert it to its original state?
    – phk
    Jun 26, 2016 at 17:29
  • I had commented the lines of the files that set the path. So when I saw that it led to this login loop, I deleted the lines I added and uncommented the existing ones.
    – uknown
    Jun 26, 2016 at 17:48
  • Just to be clear, are you referring to logging in through some graphical display manager, or directly at a console / virtual terminal? Jun 26, 2016 at 18:37
  • graphical display manager, I am stuck in the log in interface where it asks for my user password. I also changed my sudo password by rebooting with init=/bin/bash rw option, but I realised it was not the problem. It accepts my user password and displays an incorrect password message if not correct, but while trying to log in, the screen goes black, then returns to the same log in graphical display.
    – uknown
    Jun 26, 2016 at 19:03
  • 1
    In that case I suspect something only tangentially related to the changes you made - such as your user's home directory or ~/.Xauthority having become unwriteable (perhaps because of file ownership issues) Jun 27, 2016 at 0:19

1 Answer 1


I finally managed to add a new user in a virtual terminal (Ctrl+Alt+F1) as su

# adduser donald
# su - donald
$ startx

logged in that one, added it to superusers, and ran as su

sudo chown -hR username:username /home/username/

where username is old user name. It worked, I think it's done.

You must log in to answer this question.

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