3

I'm unable to login through GUI. On typing the correct password, I get a black screen and back to login screen. However, when tried with tty1 I was logged in. Then I tried reinstalling lightdm and xorg packages, but in vain. These are the contents of my xsession-errors

/usr/sbin/lightdm-session: 1: /etc/profile: id: not found
/usr/sbin/lightdm-session: 12: [: Illegal number:
/usr/sbin/lightdm-session: 36: /usr/sbin/lightdm-session: xrdb: not found
/usr/sbin/lightdm-session: 1: /usr/sbin/lightdm-session: ls: not found
/usr/sbin/lightdm-session: 98: exec: gnome-session: not found

How do I overcome this issue?

UPDATE 1: Image of my /etc/profile enter image description here

1
  • There is no need to add pictures. Add the results as they are in terminal. Copy-paste them here inside code sample. We will need additional info in order to locate the problem. cat /usr/sbin/lightdm-session; cat /etc/lighdm/lightdm.conf; cat /var/log/Xorg.0.log
    – NickTux
    Aug 26, 2013 at 12:57

4 Answers 4

2

The following lines (taken from /etc/profile on my Debian box) seem to be what you're missing:

if [ "`id -u`" -eq 0 ]; then
  PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
else
  PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games"
fi
export PATH

add them after the first two lines (the comments) and retry your log in.

1
  • Thanks! This fixed the same problem I had on 13.10, only I had to add /sbin to the user path (else clause).
    – kmarsh
    Dec 23, 2013 at 18:01
0

It sounds like there is a syntax error in your /etc/profile file - probably somewhere around this fragment

if [ "`id -u`" -eq 0 ]; then
  PS1='# '
else

Likely all the other errors are due to lightdm's environment not being properly set as a result of that (in particular, its PATH variable - so that the executables like 'ls' are not found)

If so, then try opening /etc/profile in the TTY virtual terminal using a command-line editor e.g.

sudo nano /etc/profile

and fixing the syntax

2
  • steeldriver, I tried to analyze /etc/profile, but could not find out what is wrong. I've added image of my profile file. Please check the update. Thanks. Aug 24, 2013 at 18:11
  • OK so it looks like I was wrong - I don't see anything wrong with your /etc/profile. It's possible that the /usr/sbin/lightdm-session script is the problem but that should have been replaced by reinstalling the lightdm package, I think. Sorry - I don't have any more ideas right now. Aug 24, 2013 at 19:23
0

I had the exact same problem, running 13.04. The error message "id: not found" made me think that some change or installation I did somehow does not make the command "id" available. I changed the line if [ "id -u" -eq 0 ]; then to if [ "/usr/bin/id -u" -eq 0 ]; then Using the full path to id solved the problem for me.

1
  • Welcome to Ask Ubuntu! Where did you the change? Please answer (if you want to help) more verbose.
    – Danatela
    Sep 9, 2013 at 15:37
0

maybe add a line to the top echo $PATH to see if your path variable is being set up correctly. If it is not you may want to add a line export PATH=$PATH:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games <-- that is my default path from ubuntu. This also keeps everything from your original path and adds onto it. It's weird that this would happen though...

You must log in to answer this question.

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