Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have been using Ubuntu for 2 months and it work fine. Yesterday I tried to make my Texlive Manager (tlmgr) running by inserting a PATH in /etc/profile.d.

Today when I wanted to login as usual, I cannot login.

I tried the Ctrl-Alt-F1 and login through tty1. Yes, I could login. The shell is there. However, when I wanted to open the /etc/profile.d to delete whatever I inserted, I could not open the file. I tried gedit command but the error is like this:

gedit is available in /usr/bin/gedit
gedit : command not found.

Can anyone help me. There are so many questions regarding this matter but I do not know which answer is relevant with my problem. Thank you.

share|improve this question

First of all profile.d is a directory, and you can't edit a directory. The file that you edited is inside that directory.

So try this. When you do Ctrl+Alt+F1, and log in, do:


When the editor opens, do Ctrl+R, and type the path like this:

share|improve this answer
Thank you. After login, the output is as below: – wahidah hashim May 9 '13 at 12:54
I think that you have forgotten to included the output:) – Mitch May 9 '13 at 12:59
Thank you. After login, the output is -bash: groups: command not found Command 'uname' is available in '/bin/uname' The command could not be located because '/bin' is not included in the PATH environment variable......etc....and finally appeared wahidahusm@wahidah:~$ When I type nano, the output is: Command 'nano' is available in the following place */bin/nano and */usr/bin/nano The command could not be located because '/usr/bin:/bin' is not included in the PATH environment variable. Why is this happened? – wahidah hashim May 9 '13 at 13:01
It happened because its not in your path statement. You can use full path as so: /usr/bin/nano, and you should be OK. – Mitch May 9 '13 at 13:09

Okay, first, login through tty1 (Ctrl+Alt+F1), then type this at the prompt:

sudo /usr/bin/vi ~/.bashrc

When it opens up, press i. Press enter to insert a line, then press up to go to the empty line. In this empty line you just inserted, type in the following:

export PATH='/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/texlive/2011/bin/x86_64_linux'

After you type it, press Esc, then press Shift+Z+Z (capital Z twice). This should close and save the file, and bring you back to the tty prompt.

Restart your machine.

share|improve this answer
Hi! Tq. I found the file and edited already but it seems not affecting the login through GUI. Now I found an answer from other link, I would like to try the sudo rm ./.Xauthority Is it possible? – wahidah hashim May 9 '13 at 15:17
Yeah, I guess you could go ahead. I found two other questions that have the same answer, which is to sudo rm ~/.Xauthority (the two questions are and – Alaa Ali May 9 '13 at 15:36
Hi AlaaAli. I tried the above recommendation. Unfortunately..failed to login as usual...Thank you for your support. – wahidah hashim May 10 '13 at 11:58

In tty1 you cannot to edit a file with gedit. Use vi for example:

sudo vi /etc/profile.d/[file]

where [file] is the name of the file that you edited (it cannot be /etc/profile.d because this is a directory).

And I think that you should reset your PATH to default (because of gedit : command not found.):

export PATH='/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games'

Other thing that you can do is when you are in tty1 to run this:

sudo chown -R $USER:$USER /home/$USER/

You can replace $USER with your actual username.

Try logging in again.

share|improve this answer
Thank you. I cannot run the vi command either. Even ls command too. But I didn't try to do the export PATH....Let me try first. – wahidah hashim May 9 '13 at 13:04
@wahidahhashim Reset your PATH and after it will work. – Radu Rădeanu May 9 '13 at 13:07
Follow the above command is it? OK..I'll do it now..TQ – wahidah hashim May 9 '13 at 13:08
OK...I can open my nano :) but..I couldn't find the file that I want to open. Yesterday, I would like to make my tlmgr working. So, I followed an instruction to insert PATH=/usr/local/texlive/2011/bin/x86_64_linux:$PATH but now I couldn't remember where I inserted it. – wahidah hashim May 9 '13 at 13:33
@wahidahhashim Most probably could be .profile file (/home/$USER/.profile ) – Radu Rădeanu May 9 '13 at 13:55

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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