Troubleshooting Tips

Recovery mode

In case we edited some file and messed up and cant boot into ubuntu, go to recovery mode.

To start recovery mode:

  1. Boot ur computer and go into “Boot Menu” with a special key (Please check the special key because it will be different in difference brand computer)
  2. Once you reach the boot menu, select Ubuntu (or ur linux distro) with Enter while holding Esc key
  3. If you smash your Esc key hard enough you will get into the grub terminal. Type normal go to Ubuntu menu to choose recovery mode

Then

  • Start up Ubuntu in recovery mode.
  • Choose "Drop To Root Shell Prompt’
  • By default, this will allow you to access the file system in read-only mode.
  • Switch to read/write mode by executing following code:
1
mount -o remount,rw /

Then we can edit files in terminal.
After finished editing, Simply type reboot, and hit Enter to reboot ubuntu.

Another way

If it is black screen but it is not freezed, we can press alt + f2 to go into terminal.
First we need to login with username and password.

Then you can mess with the terminal and fix problems.

Example: Purge CUDA

Example: Ubuntu stuck in boot because Nvidia Driver is fxxked.
Usually, the case for me is that Nvidia driver fxxked up. So in that case I will purge my CUDA and reinstall after reboot.

1
2
3
4
5
6
7
8
# Remove existing CuDA versions
sudo apt --purge remove "cublas*" "cuda*"
sudo apt --purge remove "nvidia*"
sudo rm -rf /usr/local/cuda*
sudo apt-get autoremove && sudo apt-get autoclean

# Reboot to remove cached files
reboot