In addition to @João Pinto's answer, you cannot use text editors like gedit or Kate. For the terminal or console, use text-based editors like
The full steps needed to make changes to the
- Press Ctrl + Alt + F1 to switch to a text console
- Login with your username or password
$PATH variable by restoring the environment so you can run
nano without specifying the full path:
~/.profile file by running:
Use Arrow keys, Page up or Page down to move the cursor. As with text editors like Kate, you can use Backspace or Delete to delete text before or after the cursor and insert text by typing it.
- After making the changes, save the changes and quit the
nano editor by pressing Ctrl + X, followed by Y to answer yes on saving changes. Finally, press Enter to confirm the filename.
- You can now logout from the console by pressing Ctrl + D (or by executing
- Switch back to the graphical login by pressing Ctrl + Alt + F7 or Ctrl + Alt + F8 if F7 did not work.
If this does not work out-of-the-box for whatever reason, then we can always revert to karthick87's answer which Jasper added as an answer below: using a LiveCD to make changes.