Trying to install Trac on CentOS 5

26 views
Skip to first unread message

James Lampert

unread,
Jul 10, 2017, 2:27:20 PM7/10/17
to Trac Users
I have a CentOS 5 development box, that I'm attempting to install SVN and Trac on, in preparation for eventually migrating our existing SVN/Trac server from WinDoze to Linux (probably CentOS, possibly a more recent CentOS).


Last week, I was able to figure out how to get SVN up and running, first through Apache, and eventually through svnserve.


But now that I've turned my attention to Trac, I'm a bit stymied. Yum couldn't find it, and I couldn't make head or tail of the instructions for registering RPMforge (which appears to be deprecated anyway). I then found instructions for doing it with "easy_install," and got as far as installing easy_install itself, but it blew up when I tried to install TRAC (and unfortunately, what I know about Python wouldn't buy you a cup of coffee):

[root@localhost ~]# easy_install Trac

Searching for Trac

Reading http://pypi.python.org/simple/Trac/

Best match: Trac 1.2.2

Downloading https://pypi.python.org/packages/57/b5/fe5784c5f9aeccec0790c3c7c90082838c886e27747f0e12bb424dc33140/Trac-1.2.2.tar.gz#md5=38cb5480c35616d8ecb3f0968e454536

Processing Trac-1.2.2.tar.gz

Running Trac-1.2.2/setup.py -q bdist_egg --dist-dir /tmp/easy_install-W5NDRI/Trac-1.2.2/egg-dist-tmp-ysJdMQ

Traceback (most recent call last):

 File "/usr/bin/easy_install", line 7, in ?

   sys.exit(

 File "/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/setuptools/command/easy_install.py", line 1712, in main

   with_ei_usage(lambda:

 File "/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/setuptools/command/easy_install.py", line 1700, in with_ei_usage

   return f()

 File "/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/setuptools/command/easy_install.py", line 1716, in <lambda>

   distclass=DistributionWithoutHelpCommands, **kw

 File "/usr/lib/python2.4/distutils/core.py", line 149, in setup

   dist.run_commands()

 File "/usr/lib/python2.4/distutils/dist.py", line 946, in run_commands

   self.run_command(cmd)

 File "/usr/lib/python2.4/distutils/dist.py", line 966, in run_command

   cmd_obj.run()

 File "/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/setuptools/command/easy_install.py", line 211, in run

   self.easy_install(spec, not self.no_deps)

 File "/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/setuptools/command/easy_install.py", line 446, in easy_install

   return self.install_item(spec, dist.location, tmpdir, deps)

 File "/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/setuptools/command/easy_install.py", line 476, in install_item

   dists = self.install_eggs(spec, download, tmpdir)

 File "/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/setuptools/command/easy_install.py", line 655, in install_eggs

   return self.build_and_install(setup_script, setup_base)

 File "/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/setuptools/command/easy_install.py", line 930, in build_and_install

   self.run_setup(setup_script, setup_base, args)

 File "/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/setuptools/command/easy_install.py", line 919, in run_setup

   run_setup(setup_script, args)

 File "/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/setuptools/sandbox.py", line 61, in run_setup

   DirectorySandbox(setup_dir).run(

 File "/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/setuptools/sandbox.py", line 105, in run

   return func()

 File "/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg/setuptools/sandbox.py", line 64, in <lambda>

   {'__file__':setup_script, '__name__':'__main__'}

 File "setup.py", line 44

   with open('README.rst') as f:

           ^

SyntaxError: invalid syntax


As I said, what I know about Python (or easy_install, for that matter) wouldn't buy you a cup of coffee. To quote a line from a certain David Hedison movie, "Helllllpppppp meeeeeeee!!!!"

--
James H. H. Lampert

Benjamin Lau

unread,
Jul 10, 2017, 2:32:59 PM7/10/17
to trac-...@googlegroups.com
Centos5's default python is very old. If you can do this on something newer you'll have a much easier time of it. Pretty sure Trac past 1.0 requires at least python 2.7.

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscribe@googlegroups.com.
To post to this group, send email to trac-...@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.

RjOllos

unread,
Jul 10, 2017, 2:34:44 PM7/10/17
to Trac Users


On Monday, July 10, 2017 at 2:32:59 PM UTC-4, netjunki wrote:
Centos5's default python is very old. If you can do this on something newer you'll have a much easier time of it. Pretty sure Trac past 1.0 requires at least python 2.7.

That's right. Looks like he's trying to install in Python 2.4. You'll have to use Trac 0.12.x for Python 2.4.

Trac 1.2.x supports Python 2.6 and 2.7. I highly suggest using Python 2.7 and Trac 1.2.x for new installs.

- Ryan

RjOllos

unread,
Jul 10, 2017, 2:40:28 PM7/10/17
to Trac Users

Also the error message should be better, but looks like a recent change is giving unexpected behavior when installing into an unsupported Python version:

https://trac.edgewall.org/ticket/12578#comment:21

- Ryan

James Lampert

unread,
Jul 10, 2017, 3:08:08 PM7/10/17
to Trac Users
That's a roger on the current Python being 2.4. Specifically 2.4.3.

As soon as I read that, I started looking up how to install Python 2.7 on CentOS 5.11, and found two things:
  1. Simply replacing the system Python breaks Yum, and probably breaks a few other things.
  2. There's a whole bunch of subtly different procedures for getting Python 2.7 onto CentOS 2.7 side-by-side with the existing 2.4.3.
 
Any recommendations on how to proceed?

Ryan Ollos

unread,
Jul 10, 2017, 3:18:27 PM7/10/17
to Trac Users
CentOS 5 is rather old. Can you use CentOS 7?

- Ryan 

James Lampert

unread,
Jul 10, 2017, 3:20:52 PM7/10/17
to Trac Users, rjo...@gmail.com
On Monday, July 10, 2017 at 12:18:27 PM UTC-7, RjOllos wrote:
CentOS 5 is rather old. Can you use CentOS 7?

For the scratch-install of the current WinDoze box, probably.

For this box, no.
--
JHHL 

Ryan Ollos

unread,
Jul 10, 2017, 3:23:33 PM7/10/17
to James Lampert, Trac Users, rjo...@gmail.com
In that case, consider creating a new virtual machine to run the Trac instance.

If you must install on CentOS 5, I'd install Python but don't make it the default installation. Install to a path such a /opt/python27. Then, use a virtual environment that points to the 2.7 install for your Trac installation.

- Ryan

Greg Earle

unread,
Jul 10, 2017, 3:56:59 PM7/10/17
to Trac Users
On 10 Jul 2017, at 12:23, Ryan Ollos wrote:

> If you must install on CentOS 5, I'd install Python but don't make it
> the default installation. Install to a path such a /opt/python27.
> Then, use a virtual environment that points to the 2.7 install for
> your Trac installation.

On our RHEL 5.x boxes we used the IUS repo to install their python27
RPMS, they didn't interfere/overlap with the system Python. They worked
fine for us.

Unfortunately IUS migrated their RHEL 5 repo to their Archives so the
setup isn't so straightforward now. They have an "ius-release" RPM for
RHEL 5 in the Archives but the mirror list doesn't work, so you have to
hand-hack it after installing it.

If James installs the following:

https://dl.iuscommunity.org/pub/ius/archive/Redhat/5/$basearch/ius-release-1.0-15.ius.el5.noarch.rpm

(Substitute "i386" or "x86_64" for $basearch first, obvs.)

then you can go into "/etc/yum.repos.d" and massage the
"ius-archive.repo" file it installs - enable "baseurl" and comment out
"mirrorlist". It should end up looking like this:

--
[ius-archive]
name=IUS Community Packages for Enterprise Linux 5 - $basearch - Archive
baseurl=http://dl.iuscommunity.org/pub/ius/archive/Redhat/5/$basearch
#mirrorlist=http://dmirr.iuscommunity.org/mirrorlist/?repo=ius-el5-archive&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/IUS-COMMUNITY-GPG-KEY

[ius-archive-debuginfo]
name=IUS Community Packages for Enterprise Linux 5 - $basearch - Archive
Debug
baseurl=http://dl.iuscommunity.org/pub/ius/archive/Redhat/5/$basearch/debuginfo
#mirrorlist=http://dmirr.iuscommunity.org/mirrorlist/?repo=ius-el5-archive-debuginfo&arch=$basearch
failovermethod=priority
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/IUS-COMMUNITY-GPG-KEY

[ius-archive-source]
name=IUS Community Packages for Enterprise Linux 5 - $basearch - Archive
Source
baseurl=http://dl.iuscommunity.org/pub/ius/archive/Redhat/5/SRPMS
#mirrorlist=http://dmirr.iuscommunity.org/mirrorlist/?repo=ius-el5-archive-source&arch=source
failovermethod=priority
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/IUS-COMMUNITY-GPG-KEY
--

At that point you should be able to do a "yum list python27" and install
it from there. (They also have python31 RPMs for 3.1 as well.)

James Lampert

unread,
Jul 10, 2017, 5:09:38 PM7/10/17
to Trac Users, ea...@isolar.dyndns.org


On Monday, July 10, 2017 at 12:56:59 PM UTC-7, Greg Earle wrote:
If James installs the following:

https://dl.iuscommunity.org/pub/ius/archive/Redhat/5/$basearch/ius-release-1.0-15.ius.el5.noarch.rpm

(Substitute "i386" or "x86_64" for $basearch first, obvs.)

then you can go into "/etc/yum.repos.d" and massage the
"ius-archive.repo" file it installs - enable "baseurl" and comment out
"mirrorlist".  It should end up looking like this:
. . .

I had to do something like what you describe with "basurl" and "mirrorlist" lines (and then some), just to get the already-recognized repositories to work, when installing  SVN.

Forgive the newbie question, but how do I install the URL you gave me? Is it a yum subcommand? Something else?

--
JHHL
 
 

Greg Earle

unread,
Jul 10, 2017, 5:40:45 PM7/10/17
to Trac Users
On 10 Jul 2017, at 14:09, James Lampert wrote:

> On Monday, July 10, 2017 at 12:56:59 PM UTC-7, Greg Earle wrote:
>
>> If James installs the following: 
>
> [https://dl.iuscommunity.org/pub/ius/archive/Redhat/5/$basearch/ius-release-1.0-15.ius.el5.noarch.rpm](<https://dl.iuscommunity.org/pub/ius/archive/Redhat/5/$basearch/ius-release-1.0-15.ius.el5.noarch.rpm>) 
>
> (Substitute "i386" or "x86_64" for $basearch first, obvs.) 
>
> then you can go into "/etc/yum.repos.d" and massage the 
> "ius-archive.repo" file it installs - enable "baseurl" and comment
> out 
> "mirrorlist".  It should end up looking like this: 
>
> . . .
>
> I had to do something like what you describe with "basurl" and
> "mirrorlist" lines (and then some), just to get the already-recognized
> repositories to work, when installing SVN.
>
> Forgive the newbie question, but how do I install the URL you gave me?
> Is it a yum subcommand? Something else?

If you have your own local yum repo (recommended), download the file(s)
to that, update your repo and install it from there.

If not, use "rpm" directly:

rpm -ivh
https://dl.iuscommunity.org/pub/ius/archive/Redhat/5/i386/ius-release-1.0-15.ius.el5.noarch.rpm

or

rpm -ivh
https://dl.iuscommunity.org/pub/ius/archive/Redhat/5/x86_64/ius-release-1.0-15.ius.el5.noarch.rpm

whichever is appropriate for your architecture (or both).

If you have further issues we should probably take this off-line.

- Greg
Reply all
Reply to author
Forward
0 new messages