<?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>linsec.ca blog &#187; urpmi</title>
	<atom:link href="http://linsec.ca/blog/tag/urpmi/feed/" rel="self" type="application/rss+xml" />
	<link>http://linsec.ca/blog</link>
	<description>You can have it right, or you can have it now.  But you can&#039;t have it right now.</description>
	<lastBuildDate>Mon, 23 Jan 2012 23:38:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Converting new rpm databases to old format</title>
		<link>http://linsec.ca/blog/2009/01/30/converting-new-rpm-databases-to-old-format/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=converting-new-rpm-databases-to-old-format</link>
		<comments>http://linsec.ca/blog/2009/01/30/converting-new-rpm-databases-to-old-format/#comments</comments>
		<pubDate>Fri, 30 Jan 2009 20:33:43 +0000</pubDate>
		<dc:creator>vdanen</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[rpm]]></category>
		<category><![CDATA[urpmi]]></category>

		<guid isPermaLink="false">http://linsec.ca/blog/?p=393</guid>
		<description><![CDATA[I better post this before I forget about it. One of the issues I had today was getting corp3/x86_64 installed in a chroot with Mandriva 2009.0 as the host. Of course, the db4 version had changed, so I had to take advantage of some conversion tools. urpmi is supposed to do this magically, but it [...]]]></description>
			<content:encoded><![CDATA[<p>I better post this before I forget about it.  One of the issues I had today was getting corp3/x86_64 installed in a chroot with Mandriva 2009.0 as the host.  Of course, the db4 version had changed, so I had to take advantage of some conversion tools.  urpmi is supposed to do this magically, but it doesn&#8217;t seem consistent.  Anyways, the problem lies with 2009.0&#8242;s rpm using a newer version of the database than the older version.  For instance:</p>
<pre>
# file /var/lib/rpm/Packages
/var/lib/rpm/Packages: Berkeley DB (Hash, version 9, native byte-order)
# file /chroots/64/cs3/var/lib/rpm/Packages
/chroots/64/cs3/var/lib/rpm/Packages: Berkeley DB (Hash, version 8, native byte-order)
</pre>
<p>So the trick is to convert them from the new format to the old format, which is easy enough to do once you know <i>what</i> to do.  On the host (Mandriva 2009 in this case), make sure you have db46_utils and db42_utils installed:</p>
<pre>
# rpm -qa|grep "db.*\-utils"
db46-utils-4.6.21-9mdv2009.0
db42-utils-4.2.52-24mdv2009.0
</pre>
<p>Then you can use this rough-n-dirty script I wrote to convert them:</p>
<pre>
#!/bin/sh
#
# script to dump and reload the rpm db to convert from hash format 9 to format 8
# for older distribs (think cs3)

for i in $(ls -1); do
    if [ "`file ${i} | grep 9`" != "" ]; then
        db_dump ${i} >${i}.db46
        db42_load ${i}.db42 < ${i}.db46
        mv -f ${i} ${i}.org
        mv -f ${i}.db42 ${i}
    fi
done
</pre>
<p>That should fix the errors you would see in the chroot, plus make it so that rpm -qa and friends actually work.  </p>
]]></content:encoded>
			<wfw:commentRss>http://linsec.ca/blog/2009/01/30/converting-new-rpm-databases-to-old-format/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>urpmi tricks</title>
		<link>http://linsec.ca/blog/2008/12/01/urpmi-tricks/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=urpmi-tricks</link>
		<comments>http://linsec.ca/blog/2008/12/01/urpmi-tricks/#comments</comments>
		<pubDate>Mon, 01 Dec 2008 21:53:12 +0000</pubDate>
		<dc:creator>vdanen</dc:creator>
				<category><![CDATA[Mandriva]]></category>
		<category><![CDATA[urpmi]]></category>

		<guid isPermaLink="false">http://linsec.ca/blog/?p=332</guid>
		<description><![CDATA[Some lesser-known urpmi tricks I&#8217;ve had to figure out today. The situation is that the machine that had my mirrored files has been moved somewhere else in order to ease up on rsync being an absolute bandwidth pig (great for downloading, bad when it&#8217;s throwing nagios checks into fits). Anyways, I&#8217;ve setup both a private [...]]]></description>
			<content:encoded><![CDATA[<p>Some lesser-known urpmi tricks I&#8217;ve had to figure out today.  The situation is that the machine that had my mirrored files has been moved somewhere else in order to ease up on rsync being an absolute bandwidth pig (great for downloading, bad when it&#8217;s throwing nagios checks into fits).</p>
<p>Anyways, I&#8217;ve setup both a private rsync repository to get stuff from and an IP-restricted anonymous FTP.  Both instances didn&#8217;t work &#8220;out of the box&#8221; with urpmi.  For one, with rsync it wasn&#8217;t possible to use the password transparently.  That can be fixed with the $RSYNC_PASSWORD environment variable but it&#8217;s fugly.  With curl, I&#8217;m behind a firewall and so is the remote system, and when it dropped into PASSV mode, it was using the remote&#8217;s internal 192.* IP address rather than it&#8217;s external IP, which was causing curl to do a whole lot of nothing.</p>
<p>The rsync fix consisted of writing the rsync password for the user into /root/.rsyncpw (only root calls urpmi anyways), then putting at the top of /etc/urpmi/urpmi.cfg this:</p>
<p><code><br />
{<br />
rsync-options: --password-file /root/.rsyncpw<br />
}<br />
</code></p>
<p>Thanks, Pixel, for that.  Which led me to figuring out the curl issue.  At first I set &#8220;ftp-skip-pasv-ip&#8221; into ~/.curlrc and then realized (when it didn&#8217;t work) that urpmi calls curl with &#8220;-q&#8221; which basically tells curl to completely ignore any config files.  Aaarg!  So back to /etc/urpmi/urpmi.cfg to set:</p>
<p><code><br />
{<br />
curl-options: --ftp-skip-passv-ip<br />
}<br />
</code></p>
<p>And now everything works peachy (if you need both, like me, then you&#8217;d have both options defined, one per line, in between the initial &#8220;{ &#8230; }&#8221; of the file.  A comment in there indicating that&#8217;s for custom configuration would be nice.  =)</p>
<p>Anyways, this may help a few people out there&#8230; googling for this led me nowhere.</p>
]]></content:encoded>
			<wfw:commentRss>http://linsec.ca/blog/2008/12/01/urpmi-tricks/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

