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 stop
orsudo lightdm stop
- Enter runlevel 3 by typing
sudo init 3
- Do whatever you need to do
- You might be required to reboot when the installation finishes. If not, run
sudo service lightdm start
orsudo start lightdm
to start your X server again.