1

I tryied to set the JAVA_HOME environmet variable in the ~/.profile file and I made a mistake

    JAVA_HOME="/usr/lib/jvm/jdk1.6.0_37"
    PATH=$JAVA_HOME:PATH

the error is in the PATH referencing. I put PATH rather than $PATH. this prevents me from login.

I tried to edit the file using the recovery mode but it says that the file system is read only. so any suggestions how to deal with this issue.

thanks

Jorge Castro
  • 71,754
nafaa
  • 33
  • 2

2 Answers2

0

Boot a live CD, mount the partition and edit the file (use sudo if you have to -- no password required).

belacqua
  • 23,120
Dazed_75
  • 417
0

Log in as another user that can sudo, or failing that start back up in resuce more, then before you edit the file remount the partition read write

mount / -o remount -w should work just fine.

Take a look at this question for more information on remounting.

coteyr
  • 18,288
  • Also X doesn't run .profile (I think) and you can start another shell via ssh or use sftp to rename/edit the file is ssh is enabled. – coteyr Nov 15 '12 at 23:58
  • I see the following as safer and hopefuly without a typo as above: mount DEVICE -t FSTYPE -o remount -rw MOUNT_POINT (whith DEVICE = e.g. /dev/sdb2 and FSTYPE = e.g. ext4). Does its job on my Debian Wheezy (when forgetting the t FSTYPE would give a mount: / not mounted or bad option). – tuk0z May 06 '16 at 17:59