Make sure you are logged out first
- Hit Ctrl+Alt+F1 and login using your credentials.
- kill your current X server session by typing
sudo service lightdm stopor
sudo lightdm stop
- Enter runlevel 3 by typing
sudo init 3
- Do whatever you need to do in the terminal
- You might be required to reboot when the installation finishes. If not, run
sudo service lightdm startor
sudo start lightdmto start your X server again.