Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm sure this question will make many laugh, but certainly not me.

I were trying to install some packages for python earlier today and also trying to change pydev compiler in AptanaStudio, and something was not working out. So I decided to completely remove python from the computer (I ran Fedora 10) by running

sudo yum erase python  

I definitely should have not done this. Even the message that 788 packages would be removed didn't stop me. As a result, I seem to have erased the whole Fedora interface. After a lot of pain, I managed to copy all the important stuff to external hard drive (apparently the hard drive of the computer remained intact), but Fedora doesn't want to start. So here's what I'd like to find out:

  1. What exactly happened and why?

  2. Is it possible to restore the interface somehow?

share|improve this question

migrated from stackoverflow.com Jul 31 '12 at 10:28

This question came from our site for professional and enthusiast programmers.

    
many RedHat basic components depends on Python (including RPM, I think). –  Paulo Scardine Jul 31 '12 at 10:15
1  
@PauloScardine RPM probably not, but yum. –  glglgl Jul 31 '12 at 10:27
    
@glglgl: I don't use RPM-based distros since last century... :-) –  Paulo Scardine Jul 31 '12 at 10:33
    
Does but Fedora doesn't want to start means that the whole OS fails to boot (quite unexpected), or that you get dropped to a text shell rather than a graphical interface? –  Hennes Jul 31 '12 at 12:13
    
@Hennes: that's right, I get the message it is being loaded but nothing happens –  Alex Aug 1 '12 at 0:48

3 Answers 3

up vote 5 down vote accepted

As Kimvas has noted, you can get a list of all removed packages from /var/log/yum.log. Re-installing them with yum is unlikely to work though because yum is a python script and python was removed from your system.

What you can try though is downloading removed rpm's from Fedora mirrors then booting from some Fedora bootable disk, chroot'ing to the system partition and installing those rpm's using rpm.

It is a good idea to keep /home and system / partitions separate, so that when / gets wiped or reinstalled all your data in /home stays intact.

share|improve this answer
    
why need to reboot? Can't he just wget and rpm -Uvh the packages yum and it's dependencies? –  Kimvais Jul 31 '12 at 11:36
    
He mentions that Fedora "doesn't start". –  Maxim Yegorushkin Jul 31 '12 at 12:09
    
Oh right, I assumed that he meant Gnome by "Fedora" there. –  Kimvais Jul 31 '12 at 12:11
    
Yep, not clear whether it doesn't boot or can't start the desktop environment. –  Maxim Yegorushkin Jul 31 '12 at 12:36
    
downloading removed rps's: you mean all 788 or so of them? –  Alex Aug 1 '12 at 0:51

You deleted GNOME GUI among other things. If you recreate the list of packages you deleted and then use yum to install them you should be able to restore you distro to its former glory.

david@david-AOA150:~$ sudo apt-get remove python
[sudo] password for david: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libssl-dev libssl-doc zlib1g-dev libexpat1-dev python2.7-dev
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  libpython3.2 python3 python3-minimal python3-uno python3.2 python3.2-minimal
Suggested packages:
  python3-doc python3-tk python3.2-doc
The following packages will be REMOVED:
  activity-log-manager-control-center aisleriot apparmor apport apport-gtk
  apt-xapian-index aptdaemon apturl apturl-common bluez bluez-alsa
  bluez-gstreamer checkbox checkbox-qt command-not-found compiz compiz-gnome
  compiz-plugins-main-default compizconfig-backend-gconf deja-dup duplicity
  evolution-data-server firefox firefox-globalmenu firefox-gnome-support
  foomatic-db-compressed-ppds gcj-4.6-jre-lib gconf2 gedit
  gir1.2-ubuntuoneui-3.0 gksu gnome-bluetooth gnome-control-center gnome-media
  gnome-menus gnome-orca gnome-sudoku gnome-terminal gnome-terminal-data
  gnome-user-share gstreamer0.10-gconf gwibber gwibber-service
  gwibber-service-facebook gwibber-service-identica gwibber-service-twitter
  hplip hplip-data ibus ibus-pinyin ibus-table indicator-datetime
  indicator-power jockey-common jockey-gtk landscape-client-ui-install
  language-selector-common language-selector-gnome launchpad-integration
  libbonoboui2-0 libcanberra-gtk-module libcanberra-gtk3-module
  libcompizconfig0 libdb5.1-java-gcj libfolks-eds25 libgcj-bc libgcj-common
  libgcj12 libgksu2-0 libgnome-media-profiles-3.0-0 libgnome2-0
  libgnome2-common libgnomeui-0 libgnomevfs2-0 libgnomevfs2-common
  libgweather-3-0 libgweather-common libgwibber-gtk2 libgwibber2
  libmetacity-private0 libpurple-bin libreoffice-gnome libswt-gnome-gtk-3-jni
  libsyncdaemon-1.0-1 libubuntuoneui-3.0-1 light-themes lsb-release metacity
  metacity-common nautilus-dropbox nautilus-share network-manager-gnome
  nvidia-common onboard oneconf openprinting-ppds printer-driver-foo2zjs
  printer-driver-postscript-hp printer-driver-ptouch printer-driver-pxljr
  printer-driver-sag-gdi printer-driver-splix python python-appindicator
  python-apport python-apt python-apt-common python-aptdaemon
  python-aptdaemon.gtk3widgets python-aptdaemon.pkcompat python-brlapi
  python-cairo python-chardet python-configglue python-crypto python-cups
  python-cupshelpers python-dateutil python-dbus python-debian
  python-debtagshw python-defer python-dev python-dirspec
  python-egenix-mxdatetime python-egenix-mxtools python-gconf python-gdata
  python-gdbm python-gi python-gi-cairo python-gnomekeyring
  python-gnupginterface python-gobject python-gobject-2 python-gpgme
  python-gst0.10 python-gtk2 python-httplib2 python-ibus python-imaging
  python-keyring python-launchpadlib python-lazr.restfulclient python-lazr.uri
  python-libproxy python-libxml2 python-louis python-mako python-markupsafe
  python-notify python-oauth python-openssl python-packagekit python-pam
  python-pexpect python-pip python-piston-mini-client python-pkg-resources
  python-problem-report python-protobuf python-pyatspi2 python-pycurl
  python-pyinotify python-pypcap python-renderpm python-reportlab
  python-reportlab-accel python-serial python-setuptools python-simplejson
  python-smbc python-software-properties python-speechd python-support
  python-twisted-bin python-twisted-core python-twisted-names
  python-twisted-web python-ubuntu-sso-client python-ubuntuone-client
  python-ubuntuone-control-panel python-ubuntuone-storageprotocol python-uno
  python-virtkey python-wadllib python-xapian python-xdg python-xkit
  python-zeitgeist python-zope.interface rhythmbox rhythmbox-mozilla
  rhythmbox-plugin-cdrecorder rhythmbox-plugin-magnatune
  rhythmbox-plugin-zeitgeist rhythmbox-plugins rhythmbox-ubuntuone
  sessioninstaller software-center software-center-aptdaemon-plugins
  software-properties-common software-properties-gtk
  system-config-printer-common system-config-printer-gnome
  system-config-printer-udev totem totem-mozilla totem-plugins ubuntu-artwork
  ubuntu-desktop ubuntu-minimal ubuntu-sso-client ubuntu-sso-client-gtk
  ubuntu-standard ubuntu-system-service ubuntuone-client
  ubuntuone-client-gnome ubuntuone-control-panel ubuntuone-couch
  ubuntuone-installer ufw unattended-upgrades unity unity-2d unity-common
  unity-lens-applications unity-lens-video unity-scope-musicstores
  unity-scope-video-remote update-manager update-manager-core update-notifier
  update-notifier-common usb-creator-common usb-creator-gtk xdiagnose
  xul-ext-ubufox zeitgeist zeitgeist-core zeitgeist-datahub
The following NEW packages will be installed:
  libpython3.2 python3 python3-minimal python3-uno python3.2 python3.2-minimal
0 upgraded, 6 newly installed, 241 to remove and 0 not upgraded.
Need to get 5,701 kB of archives.
After this operation, 240 MB disk space will be freed.
Do you want to continue [Y/n]? n
Abort.

I am running ubuntu 12.04, but it looks like I would have done the same thing

share|improve this answer

I think your best bet is to reinstall the whole system bearing the following points in mind:

  1. back up your /etc/ directory - the reinstall will overwrite any leftover configuration files.
  2. Collect the list of packages you accidentally removed as instructed below before doing the re-installation (as the log file will be overwritten)
  3. Do NOT format / initialize / mkfs any file systems when doing the re-install
  4. After doing a minimal system reinstall, reinstall the removed packages you collected from the yum log.
  5. lastly, replace the default configurations from your installed packages from your /etc/ backup. You might need to do some steps by hand, such as re-creation of user accounts and groups.

To see what you have unistalled, see the file /var/log/yum.log e.g. sudo cat /var/log/yum.log | grep Erased to list all the packages that have been unistalled (since the creation of that log file!)

To try to re-install everything, you could try something like sudo cat /var/log/yum.log | grep Erased | awk '{print $5}'|xargs sudo yum install

share|improve this answer
3  
Except that yum is dependent on Python, and so is no longer installed. –  Ignacio Vazquez-Abrams Jul 31 '12 at 10:26
    
worse than that, fedora doesn't want to launch. –  Alex Aug 1 '12 at 0:47

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.