Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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

share|improve this question
    
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 –  NikTh Aug 26 '13 at 12:57
add comment

4 Answers

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.

share|improve this answer
    
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 '13 at 18:01
add comment

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

share|improve this answer
    
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. –  FireAndIce Aug 24 '13 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. –  steeldriver Aug 24 '13 at 19:23
add comment

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.

share|improve this answer
    
Welcome to Ask Ubuntu! Where did you the change? Please answer (if you want to help) more verbose. –  Danatela Sep 9 '13 at 15:37
add comment

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...

share|improve this answer
add comment

protected by Community Jan 5 at 21:32

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.