0

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.

Warren Hill
  • 22,412
  • 28
  • 70
  • 88

3 Answers3

0

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.

Radu Rădeanu
  • 174,089
  • 51
  • 332
  • 407
0

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:

nano

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

/etc/profile.d/file_name
Mitch
  • 109,787
0

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.

Alaa Ali
  • 32,213