This article explains how to restore a corrupt Ubuntu installation. If your computer's Ubuntu operating system doesn't boot or doesn't work properly, you can fix the problem using the command line. If using the "Terminal" window the problem is not solved, you can boot the system in "recovery" mode to repair all the corrupted packages. If even this solution does not solve the problem, you will have to reinstall the entire operating system.
Steps
Method 1 of 2: Using the Terminal Window
Step 1. Launch the "Terminal" app
It has a black icon with a command prompt in the upper left corner.
Step 2. Type the following command into the "Terminal" window and press the Enter key:
sudo su -c "apt-get update". This command checks for new updates for packages installed on Ubuntu.
Step 3. Type the next command in the "Terminal" window and hit the Enter key:
sudo su -c "dpkg --configure -a". This command is intended to correct all errors related to the Ubuntu package manager, "dpkg".
Step 4. Run the next command by typing it in the "Terminal" window and pressing the Enter key:
sudo su -c "apt-get -f install". This command is used to attempt to locate all corrupt dependencies existing between system files and restore them.
Step 5. Restart Ubuntu
After running all the given commands, try restarting your computer to check if the problem is resolved. Otherwise, continue reading the article.
Method 2 of 2: Use Recovery Mode
Step 1. Restart Ubuntu
In order to have access to the Ubuntu "GRUB" menu, you need to restart your computer. To restart the system, click on the gear icon in the upper right corner of the desktop and select the "Shutdown" option.
Step 2. Hold down the ⇧ Shift key while the computer restarts
This will display the special "GRUB" menu.
Step 3. Select the Advanced Options for Ubuntu item
It is the second option in the "GRUB" boot menu.
Step 4. Select Ubuntu, with Linux x.xx.x 32 generic (recovery mode)
This way the Ubuntu system will boot into "recovery" mode.
Step 5. Choose the dpkg Repair broken packages option
It is the third item in Ubuntu's recovery menu. The program will try to automatically repair all corrupt packages present in the system. It will also run a full scan of your hard drive for errors. Observe the result of the system driver scan. If any errors have been found, the problem may be with the computer's hard drive. If no errors were found and the problem persists, the solution may be to reinstall Ubuntu.