views:

3458

answers:

5

I am building python2.6 from source on Debian Lenny.

( ./configure make make altinstall )

I don't want it to conflict with anything existing, but I want it to be in the default search path for bash.

Suggestions?

(ps, I'm using a vm, so I can trash it and rebuild.)

+1  A: 

I would recommend to fetch the source package from testing or unstable and to rebuild it locally so that you get a .deb instead. Doesn't backports.org have it?

Edit: Debian has python2.6 only in experimental, see here. You could also take the source package from Ubuntu.

Dirk Eddelbuettel
Python 2.6 is still in experimental, so it isn't available for a backport.
jamessan
Ack. AFAIK backports are mostly one-off anyway.
Dirk Eddelbuettel
backports.com does not have python2.6There are dependency problems on debian stable. Working through these now.
Christopher Mahan
+9  A: 

That's the purpose of /usr/local according to the FHS.

The /usr/local hierarchy is for use by the system administrator when installing software locally.

I think configure typically defaults to /usr/local unless told otherwise, but to be sure you could run ./configure --prefix=/usr/local ....

jamessan
http://www.debian.org/doc/maint-guide/ch-modify.en.html says to go to /urs/binI think this is a Debianism.
Christopher Mahan
No, `/usr/local` on Debian as well. That documentation is for maintainers.
Jed Smith
That guide is about the work that maintainers do when they build packages which are uploaded to Debian. That's completely irrelevant for a sysadmin compiling and installing software on their own unless they're building a Debian package to install.
jamessan
Christopher Mahan
+2  A: 

I strongly recommend you do one of these two options.

  • Build a .deb package, and then install the .deb package; the installed then go in the usual places (/usr/bin/python26 for the main interpreter).

  • Build from source, and install from source into /usr/local/bin.

I think it is a very bad idea to start putting files in the usual places, but not known or understood by the package manager. If you built it by hand and installed it by hand, it should be confined in the /usr/local tree.

steveha
Yes. I'm looking at using checkinstall
Christopher Mahan
/usr/local is reserved in debian. per http://www.debian.org/doc/maint-guide/ch-modify.en.html
Christopher Mahan
Yes, exactly: /usr/local is reserved in Debian for exactly the specific use I am recommending. That link you provided says that Debian packages must not put things in /usr/local, because it is reserved for the system administrator to put things there. This is exactly what I said: if you want the files in "the usual places" such as /usr/bin, then build *packages* that put the files there; if you don't want to build the packages, and you want to install by hand, then *only* install in /usr/local.
steveha
It is reserver for _local installations like the one you are contemplating_. In short: '/usr' is for packages, '/usr/local' is where packages will never install (apart from stubs as eg /usr/local/lib/python2.$Version/ so that you can use these directories).
Dirk Eddelbuettel
@ Dirk: Thanks!
Christopher Mahan
+1  A: 

Your safest bet is to put Python 2.6 in /opt (./configure --prefix=/opt), and modify /etc/profile so that /opt/bin is searched first.

swampmallard
Ah, interesting. Thanks!
Christopher Mahan
The FHS standard does allow for using /opt or /usr/local. However, I have seen vendors provide Debian packages that install into /opt; so I have a preference for using /usr/local. But either is permitted. http://www.pathname.com/fhs/pub/fhs-2.3.html
steveha
steveha: Those vendors are idiots.
hillu
A: 

It has already been mentioned, but I'll run through it anyway...

Add experimental to the bottom of your /etc/apt/sources.list

apt-get update

aptitude -t experimental install python2.6 python2.6-dev

It will pull the requisite updates from experimental into stable (so the dependency chain) and then install python2.6.

Failing that, if you run a standard 'make install' the binary will know where to find its build, and the binary will be dropped into a system path.

Swixel
I realize this, but as much as possible I want to minimize the impact on "stable", so I want to limit dependencies.
Christopher Mahan
Fair enough. There is a link I had bookmarked for some reason or other which deals with it:http://projectdaenney.org/2009/building-python2-6-for-debian-lennyNot a lot should have changed, but I prefer to keep my debs from the main tree. It should also give you an idea of what will change (read: what he installs manually into Lenny before building should/will probably update).
Swixel
Ah, very good. I'll take a look!
Christopher Mahan
Mixing packages from experimental with stable is a bad idea.
hillu
Mixing packages in a VM tells you what it wants to upgrade, and I didn't see a mention of 'production'. Debian's marking 2.6 as experimental when Ubuntu has pushed it into Karmic sort of suggests that the files in use aren't as unstable/experimental as some might wish to believe.Either way, as he said before, he can wipe it if things go wrong. Personally I stand by compiling it into play if it's at all possible in an 'optimal' Debian Stable install.Just so you know, I use a compiled version of Python 3.1 on Debian stable, but I used experimental to tell me what was being tweaked.
Swixel