Gentoo: I unmerged python. Now what?

First of all; DO NOT PANIC.

Of course what you did is terribly stupid but it is fixable. Some history (if you are in panic jump to the next paragraph. If you are not sit back kick off your shoes and enjoy the melodies (c) offspring ). What you did is terribly stupid because python is the heart of gentoo package manager (yeah I know who could think of choosing python for such a critical task but hey! someone did). The python is long gone and with it the whole package management. No more emerge :-) or maybe not? Take a look at how the packages builders are designed for gentoo and then you might have understood what your mistake was. And I insist pointing that out.

Well some quick words of advice for the faint in heart in a step by step basis;

  1. Download a gentoo python distribution eg Python 2.4.4. You download it with #wget ftp://ftp.ntua.gr/pub/linux/gentoo/distfiles/Python-2.4.4.tar.bz2
  2. Unbzip it with #tar jxvf Python-2.4.4.tar.bz2
  3. Enter the flattened directory; #cd Python-2.4.4
  4. Configure the Python distribution with : # ./configure –with-fpectl –infodir=/usr/share/info/ –mandir=/usr/share/man
  5. build the distribution with # make
  6. and then install it to the system with: # make install prefix=/usr
  7. now if you are lucky the emerge should work: # emerge python

If the above step by step tutorial works you have to consider yourself VERY lucky. If it doesn’t try w-getting another Python version and cross your fingers. If you like me thinking of trying the above for educational purposes (gentoo without python at all) ONLY then I have to say that this is NOT a good idea. In fact it is a terrible moronic idea and yours, mine and everyone’s picture that even thinks about it should be in the vocabulary next to the word STUPID, even if that person did it just to check out a gentoo without python!

7 comments so far

Thanks for writing this up… it really saved me. I sat down tonight at a Gentoo system that had been powered off for the last 3 months, booted it up, and it said that Python was blocking something else. So, in my tired state and sitting down at a Gentoo system for the first time in many months, my first instinct was to remove python and then emerge it again… except after I unmerged python, emerge no longer worked. I immediately realized the severity of what I had done. I still had the last installed python package on the drive, so I could easily re-install it from that, using your step-by-step. Thank you for the guide… it really helped!

rtm
August 20th, 2008 at 7:23 am

Another thanks ! I`m usually a RedHat Admin but we have one Gentoo system that hosts our Asterisk PBX. I tried to update portage, it complained about python - i thought “hmmm, asterisk doesn`t need python anyway so lets just remove and reinstall later” … a few seconds later i found out that python is crucial for portage …

Very helpful ! Worked for me too :)

eLcHi
October 21st, 2008 at 3:47 pm

Thanks for help! I’ve done that stupid thing. Tutorial saved a lot of time.

konstantin
November 6th, 2008 at 10:35 am

Here I am 2:49 in the morning.. Ya go ahead unmerge python.. GREAT IDEA!

Thanks for reminding me that i can still compile things from source!

dumbass
April 6th, 2009 at 8:51 am

You saved my live… Thank you

Me
June 4th, 2009 at 3:36 pm

Whenever I use emerge command, I get following error:

File “/usr/bin/emerge”, line 41
except PermissionDenied, e;
^
SyntaxError: invalid syntax

Please help me :),

Jnaneshwar
October 23rd, 2009 at 2:23 pm

I have a “bleeding edge” box which uses ~x86 and routinely dep-cleans itself ( I know not a great idea, but hey it is not a production box). I was away, not paying attention and on one fine friday night it emerged python 3.1 and depcleaned 2.4 breaking portage. Your post saved me a lot of time .. thanks!

Emek Demir
October 24th, 2009 at 10:03 pm

Leave a Comment

Name (required)

Mail (will not be published) (required)

Website

Comment