Results 1 to 2 of 2

Thread: messed up with /etc/environment, reboot, can't log in

Hybrid View

  1. #1
    Join Date
    Aug 2007
    Beans
    8

    messed up with /etc/environment, reboot, can't log in

    I have tried to add some system variables on my ubuntu 9.04. So I edited /etc/environment like this:

    export JAVA_HOME=/usr/local/java
    expott GRAILS_HOME=/home/adella/grails
    PATH="/usr/bin:..."
    export PATH=$PATH:$JAVA_HOME:$GRAILS_HOME/bin

    But it didn't work, didn't pick grails on the path. So I figure a reboot may help. It turned out to be a big mistake. I can't even log in, I think it might be this faulty /etc/environment messed up the shell.

    I tried to repair with CD but it didn't find there is anything wrong.

    Please help me! What do I do to fix it?

    THanks

  2. #2
    Join Date
    Oct 2009
    Location
    Elgin, IL USA
    Beans
    3,363
    Distro
    Ubuntu 16.10 Yakkety Yak

    Re: messed up with /etc/environment, reboot, can't log in

    Did you really spell it "expott"? You should not change the whole system environment for something in your home directory, since that path may not have permission for other users. Did you actually try to put those "commands" in /etc/environment (it is not a script)?

    From a live CD, mount your system and using sudu nano (or gksu gedit) edit the etc/environment on that system back like it was. Mine is:

    PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"

    You should edit your ~/.profile instead, which is a script that runs when you login. It is not necessary to "export" from there, just set the variables, since that will set it in your login shell and any sub-shells:

    JAVA_HOME=/usr/local/java
    GRAILS_HOME=/home/adella/grails
    PATH=$PATH:$JAVA_HOME:$GRAILS_HOME/bin

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •