Google Plus

Reinstall Ubuntu with one command

Written by Mel Kham on . Posted in Linux tutorials

There is a very simple command that reinstalls all the distribution packages and reconfigures them automatically. This is particularly helpful when you have done a partial upgrade and eventually have broken the system dependencies tree.




sudo dpkg-reconfigure -phigh -a

since this command would take a lot of time to process (~1 hour) depending on your hardware in case you have a minor dependency problem you can fix it via

sudo apt-get install -f

Thanks to aldeby for this command.

Code:
sudo dpkg-reconfigure -phigh -a

As I watched, every single package was stopped, reconfigured, and restarted. This process took the better part of an hour and a half, since it was effectively the same as re-installing but using packages that already existed. It finally completed and dumped my back to a command line. I rebooted into recovery mode, selected “try to fix X”, rebooted, and, to my untter amazement, Ubuntu had repaired itself! I was restored to a completely functioning desktop with the upgrade installed!

My point, is, if something gets broken during an upgrade, it looks like there is not too much that this command cannot fix. So, before you give up and reinstall (like I was about to do), give it a shot! It might work for you, too.

For questions please refer to our Q/A forum at : http://ask.unixmen.com

Mel Kham

Founder of Unixmen, Living in Amsterdam. Am working in my free time to help people to understand the Opensource and to explain them in easy way how to make the fist steps to the the light. Working day and night with my Co-founder Zinovsky to keep this website live even with less resources.
  • http://fosslib.tsakf.net tsakf

    Very useful for many people, added article to my library.
    [url]http://fosslib.tsakf.net/record/307[/url]

  • Jujubeeks

    This doesn’t work if you delete usr/lib, which is what I did :D

  • asd haha

    you are stupid if you deleted that folder -_-

Like us on Facebook

This week Top Posts

Write for us

Recent Comments

nombre apellido

|

Great tool. Thanks a lot

sobriquet

|

use the ‘browse’ option to select the startupconky.sh file from its location.

Snake

|

Wow, great. That’s what i’m waiting for too. I want to make DC with LDAP ( Active Directory alternative) and SAMBA on Ubuntu. :-)

Blawer

|

Thanks!!!!!!!!!!!!!!!!!! you rules!!! all the other “help” in google are useless… yours was very helpful. Thanks again

piCool

|

Great ! we have another another master trick :-)

 
IDG Tech Network
Copyright © 2008-2013 Unixmen.com .
Maintained by Anblik .