<?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>Make Tech Easier &#187; tarball</title>
	<atom:link href="http://maketecheasier.com/tag/tarball/feed" rel="self" type="application/rss+xml" />
	<link>http://maketecheasier.com</link>
	<description>Uncomplicating the complicated, making life easier</description>
	<lastBuildDate>Fri, 20 Nov 2009 13:39:29 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How to Install Software from a Tarball in Linux</title>
		<link>http://maketecheasier.com/install-software-from-a-tarball-in-linux/2009/06/25</link>
		<comments>http://maketecheasier.com/install-software-from-a-tarball-in-linux/2009/06/25#comments</comments>
		<pubDate>Thu, 25 Jun 2009 15:30:17 +0000</pubDate>
		<dc:creator>Joshua Price</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[installation guide]]></category>
		<category><![CDATA[tarball]]></category>

		<guid isPermaLink="false">http://maketecheasier.com/?p=5505</guid>
		<description><![CDATA[Most of the time, installing software in Linux is a breeze.  Package management utilities like Apt, Portage, and Yum have made software installation in Linux even easier than it is in Windows (in my opinion at least).  If you know what you want, you simply tell your package manager that you want it, [...]<p><strong><a href="http://maketecheasier.com/install-software-from-a-tarball-in-linux/2009/06/25">How to Install Software from a Tarball in Linux</a></strong> originally published on <a href="http://maketecheasier.com">Make Tech Easier</a> (<a href="http://feedproxy.google.com/MakeTechEasier">RSS</a>)</p>



Related posts:<ol><li><a href='http://maketecheasier.com/run-32-bit-apps-in-64-bit-linux/2009/08/10' rel='bookmark' title='Permanent Link: How to Run 32-bit Apps in 64-bit Linux'>How to Run 32-bit Apps in 64-bit Linux</a></li><li><a href='http://maketecheasier.com/install-adobe-air-for-linux-in-ubuntu-intrepid/2008/12/19' rel='bookmark' title='Permanent Link: Install Adobe Air For Linux In Ubuntu Intrepid'>Install Adobe Air For Linux In Ubuntu Intrepid</a></li><li><a href='http://maketecheasier.com/making-the-linux-command-line-a-little-friendlier/2009/03/19' rel='bookmark' title='Permanent Link: Making The Linux Command Line A Little Friendlier'>Making The Linux Command Line A Little Friendlier</a></li><li><a href='http://maketecheasier.com/basic-bash-command-for-new-linux-users/2008/01/22' rel='bookmark' title='Permanent Link: Basic Bash Command For New Linux Users'>Basic Bash Command For New Linux Users</a></li><li><a href='http://maketecheasier.com/backup-instal-your-linux-applications-with-aptoncd/2009/06/13' rel='bookmark' title='Permanent Link: How to Backup And Install Your Linux Applications With AptOnCD'>How to Backup And Install Your Linux Applications With AptOnCD</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-5540" src="http://images.maketecheasier.com/2009/06/tarballs-tux.jpg" alt="tarballs-tux" width="150" height="147" />Most of the time, installing software in Linux is a breeze.  Package management utilities like Apt, Portage, and Yum have made software installation in Linux even easier than it is in Windows (in my opinion at least).  If you know what you want, you simply tell your package manager that you want it, and it&#8217;ll find, download, install, and configure your new package for you.</p>
<p>Sometimes, however, the package doesn&#8217;t exist in your distribution&#8217;s repositories.  Often, in cases like that, your only option is to download a tarball (usually <em>.tar.gz</em>, <em>.tar.bz</em>, or <em>.tgz</em>) which contains the source code for the program that you have to compile yourself.  While it may be a little intimidating at first, compiling from source is normally a quick and easy process.  Today, we&#8217;ll learn how.</p>
<p>First off, I should note that not all tarballs are the same.  This guide will be assuming that the program you&#8217;re trying to install is a normal GNU-style source code collection.  Most require all the steps noted below, but many skip one step or another.  For the purposes of the tutorial I&#8217;ll be compiling the source code package of Python 3.0.1 from the <a href="http://python.org/ftp/python/3.0.1/Python-3.0.1.tgz">Python homepage</a>.</p>
<h3>Step 1:  Extract the tarball</h3>
<p>For those new to Linux, <em>tarball</em> is a term commonly used to refer to a file which contains other files.  It&#8217;s a lot like a ZIP or RAR file in Windows, except that the <em>tar</em> program, on its own, does not compress the files.  Tar works with a compression program like gzip to actually compress the files, which is why you commonly see two extensions (.tar and .gz).  This is sometimes abbreviated to just <em>.tgz</em>.</p>
<p>Fortunately, we don&#8217;t need to run two separate programs to extract the files, we just tell tar to run the files through gzip to decompress.  You can use a graphical utility to extract those files by simply double clicking the tarball from your file manager, or you can do it from the command line with:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">-zxvf</span> mytarball.tar.gz</pre></div></div>

<p>The options we gave <em>tar</em> are as follows:</p>
<ul>
<li>-z to tell tar to run this file through gzip to decompress (use -j for bzip files)</li>
<li>-x to extract the files</li>
<li>-v for &#8220;verbose&#8221;, so we can see a list of the files it&#8217;s extracting</li>
<li>-f to tell tar that we&#8217;re working with a file</li>
</ul>
<p><em>For easier unzipping, see the <em>Tips</em> section at the bottom of this page </em></p>
<h3>Configure</h3>
<p>Once the files are extracted, open a command terminal and go to the directory where the files have been unzipped.  Before we can compile, we need to run the configure script.  The job of the configure script is to check your system for all the software necessary to compile the program from source code into a usable binary program.  It looks for things like gcc version and other tools needed to build the software.  So once you&#8217;re in the directory with all the files that were unpacked from the tarball, type in</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">.<span style="color: #000000; font-weight: bold;">/</span>configure</pre></div></div>

<p>If all goes well it&#8217;ll go through a check of various parts of your system, then drop you back to the command line like below:</p>
<p><img class="aligncenter size-full wp-image-5529" src="http://images.maketecheasier.com/2009/06/tarballs-configure.jpg" alt="Running the configure script" width="560" height="369" /></p>
<p>The most common cause of errors in this step is a missing dependency.  Look closely at any errors you may get to determine what package is missing.</p>
<h3>Make</h3>
<p>This is the real meat of the process &#8211; where we compile the source code into a runnable program.  This is normally the easiest step, only requiring a single command.  If the configure step completed without errors, simply type in</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">make</span></pre></div></div>

<p>On a large program, this step might take a few minutes.  Once done, you&#8217;ll be dropped back to the shell prompt as shown here.</p>
<p><img class="aligncenter size-full wp-image-5533" src="http://images.maketecheasier.com/2009/06/tarballs-make.jpg" alt="Compilation stage" width="560" height="369" /></p>
<p>Technically, your program is now ready to use.  Under most circumstances, however, you&#8217;ll want to run one more step so that she program can be fully installed into the correct locations for it to be run from anywhere.</p>
<h3>Make install</h3>
<p>All this really does is copy the now-compiled program into the system directories like /usr/bin so that it can be run from any directory without having to specify a path to the files.  Since it&#8217;s copying to a directory outside your home, you&#8217;ll probably need root privileges.  If the make step completed without errors, simply run</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span></pre></div></div>

<p>to copy the files.  At this point, you&#8217;re all done!  Your new program can be used like any other.</p>
<h3>Tips</h3>
<p>Chances are, you&#8217;ll be compiling from source more than once in your life.  In fact, for those who like to use the latest and greatest software, this can be very common.  To make it a little easier, open your <em>.bashrc</em> file from your home directory, and add the following aliases to the end:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #007800;">ungz</span>=<span style="color: #ff0000;">&quot;tar -zxvf&quot;</span>
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #007800;">unbz</span>=<span style="color: #ff0000;">&quot;tar -jxvf&quot;</span>
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #007800;">cmi</span>=<span style="color: #ff0000;">&quot;./configure &amp;&amp; make &amp;&amp; sudo make install&quot;</span></pre></div></div>

<p><p><script type="text/javascript"><!--
google_ad_client = "pub-8765285789552883";
/* MTE body ad300x250, created 5/17/09 */
google_ad_slot = "3980792036";
google_ad_width = 300;
google_ad_height = 250;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</p></p>
<p><strong><a href="http://maketecheasier.com/install-software-from-a-tarball-in-linux/2009/06/25">How to Install Software from a Tarball in Linux</a></strong> originally published on <a href="http://maketecheasier.com">Make Tech Easier</a> (<a href="http://feedproxy.google.com/MakeTechEasier">RSS</a>)</p>


<p>Related posts:<ol><li><a href='http://maketecheasier.com/run-32-bit-apps-in-64-bit-linux/2009/08/10' rel='bookmark' title='Permanent Link: How to Run 32-bit Apps in 64-bit Linux'>How to Run 32-bit Apps in 64-bit Linux</a></li><li><a href='http://maketecheasier.com/install-adobe-air-for-linux-in-ubuntu-intrepid/2008/12/19' rel='bookmark' title='Permanent Link: Install Adobe Air For Linux In Ubuntu Intrepid'>Install Adobe Air For Linux In Ubuntu Intrepid</a></li><li><a href='http://maketecheasier.com/making-the-linux-command-line-a-little-friendlier/2009/03/19' rel='bookmark' title='Permanent Link: Making The Linux Command Line A Little Friendlier'>Making The Linux Command Line A Little Friendlier</a></li><li><a href='http://maketecheasier.com/basic-bash-command-for-new-linux-users/2008/01/22' rel='bookmark' title='Permanent Link: Basic Bash Command For New Linux Users'>Basic Bash Command For New Linux Users</a></li><li><a href='http://maketecheasier.com/backup-instal-your-linux-applications-with-aptoncd/2009/06/13' rel='bookmark' title='Permanent Link: How to Backup And Install Your Linux Applications With AptOnCD'>How to Backup And Install Your Linux Applications With AptOnCD</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://maketecheasier.com/install-software-from-a-tarball-in-linux/2009/06/25/feed</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
	</channel>
</rss>
