<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>GrenadePod &#187; CentOS</title>
	<atom:link href="http://www.grenadepod.com/tag/centos/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.grenadepod.com</link>
	<description>Dispersing the Seeds</description>
	<lastBuildDate>Mon, 22 Feb 2010 20:30:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>Building python 2.6.4 RPM for CentOS 5.4</title>
		<link>http://www.grenadepod.com/2009/12/26/building-python-2-6-4-rpm-for-centos-5-4/</link>
		<comments>http://www.grenadepod.com/2009/12/26/building-python-2-6-4-rpm-for-centos-5-4/#comments</comments>
		<pubDate>Sat, 26 Dec 2009 10:37:25 +0000</pubDate>
		<dc:creator>pulegium</dc:creator>
				<category><![CDATA[IT Technology]]></category>
		<category><![CDATA[System administration]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://www.grenadepod.com/?p=655</guid>
		<description><![CDATA[CentOS is an enterprise linux distribution. And as such, it doesn&#8217;t really like anything new, unless it is a security patch. So it mostly contains older packages that are proven to be stable and secure. Any security patches and changes are backported to the older packages. This is all right for majority of the tools, [...]


Related posts:<ol><li><a href='http://www.grenadepod.com/2009/12/21/sorting-out-yum-repositories-on-centos-5-4/' rel='bookmark' title='Permanent Link: Sorting out YUM repositories on CentOS 5.4'>Sorting out YUM repositories on CentOS 5.4</a></li>
<li><a href='http://www.grenadepod.com/2009/11/23/use-ssh-to-upgrade-wordpress-plugins-automatically/' rel='bookmark' title='Permanent Link: Use SSH to upgrade WordPress plugins automatically'>Use SSH to upgrade WordPress plugins automatically</a></li>
<li><a href='http://www.grenadepod.com/2009/12/03/building-and-running-google-chrome-os-on-virtualbox/' rel='bookmark' title='Permanent Link: Building and running Google Chrome OS on VirtualBox'>Building and running Google Chrome OS on VirtualBox</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p id="top" />CentOS is an enterprise linux distribution. And as such, it doesn&#8217;t really like anything new, unless it is a security patch. So it mostly contains older packages that are proven to be stable and secure. Any security patches and changes are backported to the older packages. This is all right for majority of the tools, but some really needs upgrading. Python is a very good example. Python release, which is included in CentOS 5.4 is a rather old 2.4 branch. If you&#8217;re serious about python development, you really want to have 2.6. Unfortunately there is no CentOS RPM available. So here&#8217;s how to build your own.</p>
<p>First, you need to install RPM devtools:</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;"># yum install rpmdevtools</pre></div></div>

<p>Then setup your local RPM build tree:</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">$ rpmdev-setuptree</pre></div></div>

<p>This will create RPM build tree (~/rpmbuild/) in your home directory. Just a reminder &#8211; never, ever, under any circumstances, build RPMs as root user. Just a reminder. Obviously, you knew that already, right?</p>
<p>You also want to get and install additional header files and libraries, such as TCL/TK, expat, sqlite, etc, that are used to build some Python components:</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;"># yum install tk-devel tcl-devel expat-devel db4-devel gdbm-devel sqlite-devel</pre></div></div>

<p>Now we&#8217;re ready to start building an RPM. Get the RPM spec file from source build tree and copy it to your rpmbuild/SPECS directory, also copy the tarball to your build directory:</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">$ wget http://www.python.org/ftp/python/2.6.4/Python-2.6.4.tar.bz2
$ tar jxf Python-2.6.4.tar.bz2
$ cp Python-2.6.4/Misc/RPM/python-2.6.spec ~/rpmbuild/SPECS/
$ cp Python-2.6.4.tar.bz2 ~/rpmbuild/SOURCES/</pre></div></div>

<p>This spec file is slightly broken and if you try building an RPM with it, it most likely is going to fail. So you need to patch it. The <a href="http://bugs.python.org/issue5063" target="_blank">proposed patch</a> has been submitted to python bug tracking system in the days of 2.6.1 release, but hasn&#8217;t yet been implemented. This patch doesn&#8217;t seem to work with 2.6.4 release and needs changing as well.</p>
<p>I have modified original 2.6.1 patch file slightly so that it can be used to build 2.6.4 Python RPM. You <a href="http://www.grenadepod.com/wp-content/uploads/python-2.6.4.spec.diff">download it</a> and apply to the original .spec:</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">$ cd ~/rpmbuild/SPECS/
$ wget http://www.grenadepod.com/wp-content/uploads/python-2.6.4.spec.diff
$ patch python-2.6.spec python-2.6.4.spec.diff</pre></div></div>

<p>You should be OK to build the RPM now, but it&#8217;ll most likely fail with minor rpath-check errors, such as:</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">ERROR   0001: file '/usr/lib/python2.6/lib-dynload/_bsddb.so' contains a standard rpath '/usr/lib' in [/usr/lib]
ERROR   0001: file '/usr/lib/python2.6/lib-dynload/_sqlite3.so' contains a standard rpath '/usr/lib' in [/usr/lib]</pre></div></div>

<p>Which indicates that some components are using hardcoded library paths. It&#8217;s not a big issue and can be ignored. Run build command as this:</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">$ QA_RPATHS=$[ 0x0001|0x0010 ] rpmbuild -ba python-2.6.spec</pre></div></div>

<p>It should now build without any issues and the result is a set of python RPMs:</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">$ QA_RPATHS=$[ 0x0001|0x0010 ] rpmbuild -ba python-2.6.spec
...
Wrote: /home/pulegium/rpmbuild/SRPMS/python2.6-2.6.4-1gpod.src.rpm
Wrote: /home/pulegium/rpmbuild/RPMS/i386/python2.6-2.6.4-1gpod.i386.rpm
Wrote: /home/pulegium/rpmbuild/RPMS/i386/python2.6-devel-2.6.4-1gpod.i386.rpm
Wrote: /home/pulegium/rpmbuild/RPMS/i386/python2.6-tkinter-2.6.4-1gpod.i386.rpm
Wrote: /home/pulegium/rpmbuild/RPMS/i386/python2.6-tools-2.6.4-1gpod.i386.rpm
Wrote: /home/pulegium/rpmbuild/RPMS/i386/python2.6-debuginfo-2.6.4-1gpod.i386.rpm
...
$</pre></div></div>

<p>This is it&#8230; You now have python RPMs that you can install on your CentOS 5.x server.</p>
<p>I&#8217;m planning to create my little own repository, where I&#8217;ll put this (and other) packages. For now, you can download <a href="http://www.grenadepod.com/wp-content/uploads/python2.6-2.6.4-1gpod.src.rpm">python 2.6.4 source RPM</a> if you want to change something in the spec file and rebuild it yourself.</p>


<p>Related posts:<ol><li><a href='http://www.grenadepod.com/2009/12/21/sorting-out-yum-repositories-on-centos-5-4/' rel='bookmark' title='Permanent Link: Sorting out YUM repositories on CentOS 5.4'>Sorting out YUM repositories on CentOS 5.4</a></li>
<li><a href='http://www.grenadepod.com/2009/11/23/use-ssh-to-upgrade-wordpress-plugins-automatically/' rel='bookmark' title='Permanent Link: Use SSH to upgrade WordPress plugins automatically'>Use SSH to upgrade WordPress plugins automatically</a></li>
<li><a href='http://www.grenadepod.com/2009/12/03/building-and-running-google-chrome-os-on-virtualbox/' rel='bookmark' title='Permanent Link: Building and running Google Chrome OS on VirtualBox'>Building and running Google Chrome OS on VirtualBox</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.grenadepod.com/2009/12/26/building-python-2-6-4-rpm-for-centos-5-4/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Sorting out YUM repositories on CentOS 5.4</title>
		<link>http://www.grenadepod.com/2009/12/21/sorting-out-yum-repositories-on-centos-5-4/</link>
		<comments>http://www.grenadepod.com/2009/12/21/sorting-out-yum-repositories-on-centos-5-4/#comments</comments>
		<pubDate>Mon, 21 Dec 2009 19:01:45 +0000</pubDate>
		<dc:creator>pulegium</dc:creator>
				<category><![CDATA[IT Technology]]></category>
		<category><![CDATA[System administration]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[system administration]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.grenadepod.com/?p=647</guid>
		<description><![CDATA[&#8230; or any other CentOS 5.X flavour for that matter. By default, freshly installed CentOS 5.X has the following Yum repositories enabled: addons CentOS-5 - Addons base CentOS-5 - Base extras CentOS-5 - Extras updates CentOS-5 - Updates These are all defined in /etc/yum.repos.d/CentOS-Base.repo configuration file. Repositories enabled by default provide you with the core [...]


Related posts:<ol><li><a href='http://www.grenadepod.com/2009/12/26/building-python-2-6-4-rpm-for-centos-5-4/' rel='bookmark' title='Permanent Link: Building python 2.6.4 RPM for CentOS 5.4'>Building python 2.6.4 RPM for CentOS 5.4</a></li>
<li><a href='http://www.grenadepod.com/2009/12/03/building-and-running-google-chrome-os-on-virtualbox/' rel='bookmark' title='Permanent Link: Building and running Google Chrome OS on VirtualBox'>Building and running Google Chrome OS on VirtualBox</a></li>
<li><a href='http://www.grenadepod.com/2009/11/23/use-ssh-to-upgrade-wordpress-plugins-automatically/' rel='bookmark' title='Permanent Link: Use SSH to upgrade WordPress plugins automatically'>Use SSH to upgrade WordPress plugins automatically</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p id="top" />&#8230; or any other CentOS 5.X flavour for that matter.</p>
<p>By default, freshly installed CentOS 5.X has the following Yum repositories enabled:</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">addons                                             CentOS-5 - Addons
base                                               CentOS-5 - Base
extras                                             CentOS-5 - Extras
updates                                            CentOS-5 - Updates</pre></div></div>

<p>These are all defined in <em>/etc/yum.repos.d/CentOS-Base.repo</em> configuration file. Repositories enabled by default provide you with the core CentOS packages and updates for them. So you must have them enabled if you want your updates to work correctly. It is also important that these repositories take precedence over other repositories that you are going to use.</p>
<p>I will show later how to use Yum priorities package, just note that these are going to be priority one repositories</p>
<h3>Enable standard CentOS repositories</h3>
<p>There are two useful repositories defined in the configuration, but not enabled:</p>
<ul>
<li><strong>CentOS Plus</strong>. Packages in this repository contains upgraded versions of the software. If you enable this repository, after applying updates/upgrades your system will no longer be of the original version you have installed. Fear not though, all packages are tested by CentOS team and will no cause any issues. So unless you have really good reason to keep you installation at the same version level I&#8217;d recommend enabling this repository.</li>
<li><strong>Contrib</strong>. Packages supplied and maintained by CentOS users. These packages are not inspected by CentOS team, but they are not attempt to replace/modify core CentOS package set, so normally this repository should not cause any issues. Beware that some packages are not following mainstream CentOS very closely. I normally don&#8217;t have this enabled.</li>
</ul>
<p>These two repositories are going to get priority two setting. If you wish to enable them, edit default <em>/etc/yum.repos.d/CentOS-Base.repo</em> Yum repository configuration file and remove (or rather comment out) &#8220;<em>enabled=0</em>&#8221; line.</p>
<h3>Install and enable EPEL repository</h3>
<p>I must mention, that in this article I&#8217;m mostly talking about CentOS installation that is used for server environment. Therefore I&#8217;m not really interested in repositories that provide packages such as DVD or other multimedia decoders and players.</p>
<p>One of the most useful repositories for your server environment is <a href="http://fedoraproject.org/wiki/EPEL" target="_blank">EPEL repository</a> &#8211; Extra Packages for Enterprise Linux. This repository is maintained by Fedora project, and every effort is made to keep this repository as least  intrusive as possible, so in theory enabling and using this repository should not break or otherwise cause issues to your CentOS installation.</p>
<p>First of all, you need to install EPEL repository configuration files:</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">[root@centos54 ~]# rpm -ihv http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm
Retrieving http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm
warning: /var/tmp/rpm-xfer.RT5AzP: Header V3 DSA signature: NOKEY, key ID 217521f6
Preparing...                ########################################### [100%]
   1:epel-release           ########################################### [100%]
[root@centos54 ~]#</pre></div></div>

<p>This provides you with two configuration files: base and testing. Don&#8217;t worry about testing one and leave it disabled.</p>
<p>Main configuration comes with three sections:</p>
<ul>
<li><strong>Base packages</strong>. This is enabled by default.</li>
<li><strong>Debug packages</strong>. Disabled, and no need to enable unless you want to use debug packages.</li>
<li><strong>Source packages</strong>. Disabled. Enable only if you want to be able to install source RPMs from EPEL. Useful if you want to rebuild them to your specific needs. I&#8217;d recommend to leave it disabled and enable on yum command line only when you really need to install source RPMs.</li>
</ul>
<p>These should be getting priority 3 setting.</p>
<h3>Set priorities for Yum repositories</h3>
<p>So if you enabled repositories from the previous section and installed EPEL repository configuration, here&#8217;s what you should see in you repositories list:</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">addons                             CentOS-5 - Addons
base                               CentOS-5 - Base
centosplus                         CentOS-5 - Plus
epel                               Extra Packages for Enterprise Linux 5 - i386
extras                             CentOS-5 - Extras
updates                            CentOS-5 - Updates</pre></div></div>

<p>Now I need to set priorities for each repository. Install Yum priorities package:</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;"># yum install yum-priorities</pre></div></div>

<p>Make sure new plugin is enabled:</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">[root@centos54 ~]# cat /etc/yum/pluginconf.d/priorities.conf
[main]
enabled = 1
[root@centos54 ~]#</pre></div></div>

<p>Now you can set priorities for each repository. It&#8217;s done by adding &#8220;priority=X&#8221; for each repository section in repository configuration files. Here&#8217;s what I ended up with:</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">[base]
...
priority=1
&nbsp;
[updates]
...
priority=1
&nbsp;
[addons]
...
priority=1
&nbsp;
[extras]
...
priority=1
&nbsp;
[centosplus]
...
priority=2
&nbsp;
[contrib]
...
priority=2
&nbsp;
[epel]
...
priority=3</pre></div></div>

<p>Now you should be good to do upgrades and install packages as you see fit for your system.</p>


<p>Related posts:<ol><li><a href='http://www.grenadepod.com/2009/12/26/building-python-2-6-4-rpm-for-centos-5-4/' rel='bookmark' title='Permanent Link: Building python 2.6.4 RPM for CentOS 5.4'>Building python 2.6.4 RPM for CentOS 5.4</a></li>
<li><a href='http://www.grenadepod.com/2009/12/03/building-and-running-google-chrome-os-on-virtualbox/' rel='bookmark' title='Permanent Link: Building and running Google Chrome OS on VirtualBox'>Building and running Google Chrome OS on VirtualBox</a></li>
<li><a href='http://www.grenadepod.com/2009/11/23/use-ssh-to-upgrade-wordpress-plugins-automatically/' rel='bookmark' title='Permanent Link: Use SSH to upgrade WordPress plugins automatically'>Use SSH to upgrade WordPress plugins automatically</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.grenadepod.com/2009/12/21/sorting-out-yum-repositories-on-centos-5-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
