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 tryied to set the JAVA_HOME environmet variable in the ~/.profile file and I made a mistake


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.


share|improve this question
up vote 0 down vote accepted

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.

share|improve this answer
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). – lliseil May 6 at 17:59

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

share|improve this answer

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.