0

I was having problem with "broken packages" error. I tried few solution but they went in vain. Then I tried one:

removing source.list from /etc/apt/

I thought rebuilding source.list will fix the issue.

and then did an

sudo apt-get autoremove

which I reckon, removed major components as well.

Now, After reboot I login using a terminal and cannot install any program for example: ubuntu-desktop using apt.

Please advise how to recover the system or install desktop environment in this state.

omer
  • 198

1 Answers1

2

You can always reinstall the same Ubuntu version without reformatting the system directory. In that case, all you user files and settings will stay in place. At most, you may need to reinstall some applications you installed yourself.

To recover your system this way, boot up an installation medium of the same Ubuntu version. In the Installer, on the "Installation type" dialog, select "Something else". Indicate your current system partition as the partition to be used as root ("/") and uncheck the "format" checkbox. If you had a home folder or any other part of the system on another partition, reassign the same partitions, making sure "format" is unchecked.

This will repair your system while leaving your setup largely in place, except from some applications you may need to reinstall. After reinstall, also these applications will continue to be configured as before, because your user preferences are still in place.

Needless to say, even if this preserves all your date, make sure that the back up of all your personal user data is updated before proceeding.

vanadium
  • 97,564