Ubuntu Recovery Tools

At times when something is wrong with your Ubuntu installation like for example broken packages, file system errors, etc., you got plenty of options to recover your PC. Earlier, I published a article on how to reinstall Ubuntu, keeping your data unaffected. But that guide is the last resort to recovery. If you are able to boot into GRUB bootloader, then you should try the Ubuntu Advanced Recovery first. Here is how.

Using Bootloader Recovery Tools in Ubuntu

Ubuntu comes built-in with some powerful recovery tools, which often resolves the issues in typical cases. To boot into Ubuntu Recovery tools, you must first boot into GRUB. Depending on your system configuration, your GRUB bootloader may be different. If you only have Ubuntu installed in your computer, then you may not be seeing GRUB at all. Ubuntu hides it as it is redundant unnecessary step when there is no other OS to boot into. In such case, you should press and hold <shift> key just as the PC boots.

1. Automatically Fix Broken Packages

GRUB Bootloader

Step 1) In the GRUB bootloader, use up/down arrow keys and select “Advanced Options for Ubuntu”.

Step 2) Select “Ubuntu, with Linux xxxxx-generic (recovery mode)”, and press <enter>. The version number xxxxx may be different in your case. That’s just Linux Kernel version.

GRUB Advanced Options
GRUB Advanced Options

Step 3) Use arrow keys to navigate, and select “dpkg”. Press <enter>.

dpkg - Broken Packages Recovery
dpkg – Broken Packages Recovery

Step 4) Ubuntu will prompt you that in order to continue, the file system should be loaded in Read-write mode. Select “Yes” (default selected), and press <enter>key.

ALSO READ  How to install Webmin with Let's Encrypt SSL on Ubuntu 18.04 LTS

Step 5) Ubuntu will show you how many packages are to be upgraded/fixed. Your PC need to be connected to downloaded packages. When ready, enter ‘y’.

Broken Packages Fix and Upgrade Report
Broken Packages Fix and Upgrade Report

Broken packages should be fixed.

2. Check All File Systems for Errors

Check File System Errors

Next thing to do is check if there are file system errors in any of the partitions in your PC.

Step 1) In the Recovery Menu, select “fsck – Check all file systems” and press <enter>.

Step 2) If you remember, the file system got changed to ‘Read/Write’ mode in previous section of this article when you were using ‘dpkg’. Hence you may see a prompt that File system need to be in ‘Read-only’ mode for scan to happen.

File System Read-Write Mode Error
File System Read-Write Mode Error

Therefore, you should go back to main Recovery menu again and come back so that you see ‘read-only’ filesystem state.

fsck read-only file system mode
fsck read-only file system mode
File System Check
File System Check

Ubuntu will give the scan report on if swap, root, and kernel systems are OK or not, and also fix the errors if found.

That’s all what Ubuntu’s Recovery tool can do to fix your PC. If you still see issues, then resetting Ubuntu is what I suggest you to do.

Previous articleHow to reinstall Ubuntu, and keep your data safe in event of system failure!
Next articleCheck if a Linux PC is 64-bit or 32-bit by command-line
Hi there! I'm Kiran Kumar, founder of FOSSLinux.com. I'm an avid Linux lover and enjoy hands-on with new promising distros. Currently, I'm using Ubuntu as a daily driver and run several other distros such as Fedora, Solus, Manjaro, Debian, and some new ones on my test PC and virtual machines. I have a day job as an Engineer, and this website is one of my favorite past time activities especially during Winter ;). When I'm not writing for FOSSLinux, I'm seen biking and hiking on scenic trails. Hope you enjoy using this website as much as I do writing for it. Feedback from readers is something that inspires me to do more, and spread Linux love!. If you find a time, drop me an email or feedback from the 'Contact' page. Or simply leave a comment below if you found this article useful. Have a good day!

Leave a Reply

1 Comment threads
0 Thread replies
Most reacted comment
Hottest comment thread
1 Comment authors
Richard Samson Recent comment authors
newest oldest most voted
Notify of
Richard Samson
Richard Samson

That was a great help, Kiran. Thanks!