<?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/"
	xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule"
>
<channel>
	<title>G-Loaded Journal &#187; DEB</title>
	<atom:link href="http://www.g-loaded.eu/tag/deb/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.g-loaded.eu</link>
	<description>An open-source software and technology related journal</description>
	<lastBuildDate>Mon, 05 Dec 2011 19:55:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
		<item>
		<title>How to extract RPM or DEB packages</title>
		<link>http://www.g-loaded.eu/2008/01/28/how-to-extract-rpm-or-deb-packages/</link>
		<comments>http://www.g-loaded.eu/2008/01/28/how-to-extract-rpm-or-deb-packages/#comments</comments>
		<pubDate>Mon, 28 Jan 2008 00:30:32 +0000</pubDate>
		<dc:creator>George Notaras</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Backup]]></category>
		<category><![CDATA[DEB]]></category>
		<category><![CDATA[HOWTO]]></category>
		<category><![CDATA[Packaging]]></category>
		<category><![CDATA[RPM]]></category>
		<category><![CDATA[Shell]]></category>
		<guid isPermaLink="false">http://www.g-loaded.eu/2008/01/28/how-to-extract-rpm-or-deb-packages/</guid>
		<description><![CDATA[RPM and DEB packages are both containers for other files. An RPM is some sort of cpio archive. On the other hand, a DEB file is a pure ar archive. So, it should be possible to unpack their contents using standard archiving tools, regardless of your distribution&#8217;s package format. Under normal conditions, you should use [...]]]></description>
			<content:encoded><![CDATA[<p>RPM and DEB packages are both containers for other files. An RPM is some sort of <strong>cpio</strong> archive. On the other hand, a DEB file is a pure <strong>ar</strong> archive. So, it should be possible to unpack their contents using standard archiving tools, regardless of your distribution&#8217;s package format. Under normal conditions, you should use your distribution&#8217;s standard package manager, <strong>rpm</strong> or <strong>dpkg</strong> and their frontends, to manage those files. But, if you need to be more generic, here is how to do it.<br />
<span id="more-482"></span></p>
<h4>RPM</h4>
<p>For RPMs you need two command line utilities, <strong>rpm2cpio</strong> and <strong>cpio</strong>. Extracting the contents of the RPM package is a <em>one step</em> process:</p>
<pre class="console">rpm2cpio mypackage.rpm | cpio -vid</pre>
<p>If you just need to list the contents of the package without extracting them, use the following:</p>
<pre class="console">rpm2cpio mypackage.rpm | cpio -vt</pre>
<p>The <strong>-v</strong> option is used in order to get verbose output to the stdout. If you don&#8217;t need it, you can safely omit this switch. For more information about the <code>cpio</code> options, please refer to the <code>cpio(1)</code> manual page.</p>
<h4>DEB</h4>
<p>DEB files are <em>ar archives</em>, which contain three files:</p>
<ul>
<li>debian-binary</li>
<li>control.tar.gz</li>
<li>data.tar.gz</li>
</ul>
<p>As you might have already guessed, the needed archived files exist in <code>data.tar.gz</code>. It is also obvious that unpacking this file is a <em>two-step</em> process.</p>
<p>First, extract the aforementioned three files from the DEB file (<strong>ar</strong> archive):</p>
<pre class="console">ar vx mypackage.deb</pre>
<p>Then extract the contents of <code>data.tar.gz</code> using <strong>tar</strong>:</p>
<pre class="console">tar -xzvf data.tar.gz</pre>
<p>Or, if you just need to get a <em>listing</em> of the files:</p>
<pre class="console">tar -tzvf data.tar.gz</pre>
<p>Again the <strong>-v</strong> option in both <strong>ar</strong> and <strong>tar</strong> is used in order to get verbose output. It is safe not to use it. For more information, read the man pages: <code>tar(1)</code> and <code>ar(1)</code>.</p>
<p><strike>If anyone knows a <em>one step process</em> to extract the contents of the <code>data.tar.gz</code>, I&#8217;d be very interested in it!</strike></p>
<p><strong>Update</strong></p>
<p>As Jon <a href="http://www.g-loaded.eu/2008/01/28/how-to-extract-rpm-or-deb-packages/comment-page-1/#comment-11671">suggested</a> in the comment area, the contents of data.tar.gz can be extracted from the DEB package in a one step process as shown below:</p>
<pre class="console">
ar p mypackage.deb data.tar.gz | tar zx
</pre>
<p>That will do it.</p>
<div class="cc-block"><em><a href="http://www.g-loaded.eu/2008/01/28/how-to-extract-rpm-or-deb-packages/">How to extract RPM or DEB packages</a></em>, unless otherwise expressly stated, is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License</a>. Terms and conditions beyond the scope of this license may be available at <a href="http://www.g-loaded.eu/about/disclaimer-and-license/">www.g-loaded.eu</a>.</div>
<h4>Related Articles</h4>
<ul><li><a href="http://www.g-loaded.eu/2007/12/01/choosing-a-format-for-data-backups-tar-vs-cpio/" rel="bookmark">Choosing a format for data backups &#8211; tar vs cpio</a></li>
<li><a href="http://www.g-loaded.eu/2006/04/05/how-to-build-rpm-packages-on-fedora/" rel="bookmark">How To Build RPM Packages on Fedora</a></li>
<li><a href="http://www.g-loaded.eu/2007/12/01/veritar-verify-checksums-of-files-within-a-tar-archive/" rel="bookmark">VeriTAR &#8211; Verify checksums of files within a TAR archive</a></li>
<li><a href="http://www.g-loaded.eu/2006/10/07/verify-a-burned-cddvd-image-on-linux/" rel="bookmark">Verify a burned CD/DVD image on Linux</a></li>
<li><a href="http://www.g-loaded.eu/2006/04/08/linux-tips-pack-i/" rel="bookmark">Linux Tips &#8211; Pack I</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.g-loaded.eu/2008/01/28/how-to-extract-rpm-or-deb-packages/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
	</item>
	</channel>
</rss>

