11

Does ubuntu 11.10 have a repair setup like windows that repairs the operating system files? Or do we have to do a whole new installation?

If not, is there a backup solution so I can re-install Ubuntu and just use the backup file to put all my programs back etc?

Organic Marble
  • 23,641
  • 15
  • 70
  • 122
  • 2
    You have the chance to boot ubuntu from the live-CD and mount the root and other partitions of your broken ubuntu system.Then you can use chroot to switch on the fly to a command shell in your broken system. From within there you can repair broken packets, e.g. using apt-get reinstall or purge and install or dpkg-reconfigure.However, you should know what to repair, best is, to tell us what you did, before your system broke and what does not work anymore. For reinstalling ubuntu you may want to use dpkg --get-selections and --set-selections. Also remastersys is a good way to backup. – Michael K Jan 11 '12 at 09:57

4 Answers4

9

There is a 'Recovery Mode' boot option on startup;

This mode just loads some basic services and drops you into command line mode. You are then logged in as root (the superuser) and can repair your system using command line tools.

Reference

Unlike a Windows recovery it will not automatically fix any errors - you will need to use command line tools and understand exactly what you are doing to repair your installation.

As Michael K suggested you can also use a live CD to recover an installation but once again you must know what you are doing and use command line tools to carry out the repair. There is a good Ubuntu Documentation page on Live CD Recovery that I recommend you have a read through to get a good understanding of what is required and how to use it.

A third option is to do a re-install of the operating system but do not format and just 'overwrite' your existing installation.

  • Boot to the install media and go through the install process as usual.
  • When you get to the partitioner to allocate drive space, depending on the version you are installing check the box marked 'Manually select partitions' or 'Something else' and click forward. Use the SAME user name and password as the existing account when setting up again.
  • Find your existing installation and you must UNCHECK all the 'format' boxes and mount the partitions in the same place they are now.

As long as no 'format' boxes are checked, no data will be lost in your home folder and the system files will be overwritten with the originals. You should then complete all system updates again.

Regardless of what option you choose to use to try and recover an installation you should regularly back up your important documents and files so that you can restore them if needed.

Read through the answers to Comparison of backup tools for a comprehensive list of recommendations.

Mark Rooney
  • 6,289
4

With Ubuntu 12.10, the third option given by Mark Rooney has been greatly simplified.

When you start the install process, once you get to the format wizard screen, a new option appears at the top if an existing installation is detected. It just asks if you would like to re-install the current installation, and will preserve your files and, where possible, your installed programs.

0

Restore Ubuntu without reinstalling:

  1. Boot to Ubuntu live USB.

  2. Click Try Ubuntu.

  3. Open the terminal.

  4. df -h (To find out the name of your partition that you want to restore. I have a section in the first/third list)

  5. sudo mount /dev/sda/mnt # where 'sda' is your section name, /dev/sd [a-z] - for SATA); /dev/hd [a-z] - for IDE

  6. sudo rm /dev/sda/var/lib/apt/lists/lock # where 'sda' is your section name

  7. sudo rm /dev/sda/var/lib/dpkg/lock # where 'sda' is your section name

  8. sudo rm /dev/sda/var/lib/dpkg/lock-frontend # where 'sda' is your section name

  9. Run the following commands:

     sudo dpkg --configure -a  
     sudo apt clean  
     sudo apt update --fix-missing   
     sudo apt install -f  
     sudo dpkg --configure -a  
     sudo apt update   
     sudo apt dist-upgrade  
     sudo reboot  
     apt list --upgradable # To check which packages have been updated, they are shown in green.  
    
  • 1
    I found a few errors when editing this answer, but I didn't correct them. Try running the code yourself, and you'll find out. I only changed the text formatting. – karel Jan 17 '20 at 02:49
0

I love how all these answers assume the people reading knows like 10 million things and they are totally incomplete explanations. Are all coding type nerds like this?

tim
  • 1