<?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>The HyRax Macrocosm &#187; Apt</title>
	<atom:link href="http://www.serenux.com/tag/apt/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.serenux.com</link>
	<description>Life, the Universe and Ubuntu.</description>
	<lastBuildDate>Mon, 21 Jun 2010 10:45:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>HowTo: Migrate an Apt-Mirror-generated Ubuntu archive to another mirror source or merge a foreign Apt-Mirror archive into yours</title>
		<link>http://www.serenux.com/2009/12/howto-migrate-an-apt-mirror-generated-ubuntu-archive-to-another-mirror-source-or-merge-a-foreign-apt-mirror-archive-into-yours/</link>
		<comments>http://www.serenux.com/2009/12/howto-migrate-an-apt-mirror-generated-ubuntu-archive-to-another-mirror-source-or-merge-a-foreign-apt-mirror-archive-into-yours/#comments</comments>
		<pubDate>Wed, 09 Dec 2009 11:39:11 +0000</pubDate>
		<dc:creator>HyRax</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Applications]]></category>
		<category><![CDATA[Apt]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Repository]]></category>
		<category><![CDATA[Storage]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.serenux.com/?p=651</guid>
		<description><![CDATA[So, you&#8217;ve gone and created your very own local Ubuntu mirror using Apt-Mirror, and you&#8217;ve come across a situation similar to: You&#8217;ve decided to change where you update your Apt-Mirror archive from (eg: you&#8217;ve changed ISP&#8217;s or feel that another source is more reliable than your current one to update from) You&#8217;re adding another large [...]]]></description>
			<content:encoded><![CDATA[<p>So, you&#8217;ve gone and <a title="HowTo: Create your own local Ubuntu mirror" href="http://www.serenux.com/2008/10/howto-setup-your-own-local-ubuntu-repository-mirror/" target="_blank">created your very own local Ubuntu mirror using Apt-Mirror</a>, and you&#8217;ve come across a situation similar to:</p>
<ul>
<li>You&#8217;ve decided to change where you update your Apt-Mirror archive from (eg: you&#8217;ve changed ISP&#8217;s or feel that another source is more reliable than your current one to update from)</li>
<li>You&#8217;re adding another large repository to your Apt-Mirror archive (such as the next version of Ubuntu) and don&#8217;t have the quota to download it, so you&#8217;re getting a friend to download it for you from their free server using Apt-Mirror (eg: iiNet and Internode customers can access their respective Ubuntu mirrors for free), so you need to be able to merge it with your own Apt-Mirror archive and have it update from your preferred source afterwards.</li>
</ul>
<p>So how do you do this? Read on.</p>
<p><span id="more-651"></span><span style="color: #0000ff;"><em><strong>Migrating your Apt-Mirror archive to update from a new source<br />
</strong></em></span></p>
<p>This one is really easy. Let&#8217;s say you are updating your Ubuntu mirror from Internode, but now want to get your updates from iiNet. To make this happen you need to change the following files:</p>
<ul>
<li>Your <em>/etc/apt/mirror.list</em> file needs to be updated to point to the new source, and</li>
<li>the Apt-Mirror&#8217;s record of downloaded files needs to be updated so that it doesn&#8217;t waste time trying to re-download the entire mirror again not realising that it&#8217;s already got 99% of all the files already, because Apt-Mirror tracks the files it has downloaded by the source URL and filename, not just the filenames themselves.</li>
</ul>
<p>So let&#8217;s go through this.</p>
<ol>
<li>Open a terminal load your <em>/etc/apt/mirror.list</em> file into your favourite text editor. In this case I will use the Nano text editor:
<pre><span style="color: #000080;">$ sudo nano /etc/apt/mirror.list</span></pre>
</li>
<li>In your <em>mirror.list</em> file, The lines for updating Ubuntu 32 and 64-bit versions plus source code from Internode can look similar to this:
<pre><span style="color: #000080;"># Ubuntu 9.10 Karmic Koala 32-bit
deb-i386 http://mirror.internode.on.net/pub/ubuntu/ubuntu karmic main restricted universe multiverse
deb-i386 http://mirror.internode.on.net/pub/ubuntu/ubuntu karmic-updates main restricted universe multiverse
deb-i386 http://mirror.internode.on.net/pub/ubuntu/ubuntu karmic-backports main restricted universe multiverse
deb-i386 http://mirror.internode.on.net/pub/ubuntu/ubuntu karmic-security main restricted universe multiverse
deb-i386 http://mirror.internode.on.net/pub/ubuntu/ubuntu karmic-proposed main restricted universe multiverse

</span><span style="color: #000080;"># Ubuntu 9.10 Karmic Koala 64-bit
deb-amd64 http://mirror.internode.on.net/pub/ubuntu/ubuntu karmic main restricted universe multiverse
deb-amd64 http://mirror.internode.on.net/pub/ubuntu/ubuntu karmic-updates main restricted universe multiverse
deb-amd64 http://mirror.internode.on.net/pub/ubuntu/ubuntu karmic-backports main restricted universe multiverse
deb-amd64 http://mirror.internode.on.net/pub/ubuntu/ubuntu karmic-security main restricted universe multiverse
deb-amd64 http://mirror.internode.on.net/pub/ubuntu/ubuntu karmic-proposed main restricted universe multiverse

# Ubuntu 9.10 Karmic Koala Source
deb-src http://mirror.internode.on.net/pub/ubuntu/ubuntu karmic main restricted universe multiverse
deb-src http://mirror.internode.on.net/pub/ubuntu/ubuntu karmic-updates main restricted universe multiverse
deb-src http://mirror.internode.on.net/pub/ubuntu/ubuntu karmic-backports main restricted universe multiverse
deb-src http://mirror.internode.on.net/pub/ubuntu/ubuntu karmic-security main restricted universe multiverse
deb-src http://mirror.internode.on.net/pub/ubuntu/ubuntu karmic-proposed main restricted universe multiverse</span></pre>
</li>
<li>We need to change the Internode URL to the iiNet URL, so bring up Nano&#8217;s search and replace function by pressing CTRL+Backslash (&#8220;\&#8221;).<br />
.</li>
<li>Now type in the text to replace, in this case:
<pre><span style="color: #000080;">http://mirror.internode.on.net/pub/ubuntu/ubuntu</span></pre>
</li>
<li>Press Enter and you&#8217;ll be prompted for the text to replace this with. In this case it&#8217;s:
<pre><span style="color: #000080;">http://ftp.iinet.net.au/pub/ubuntu/</span></pre>
</li>
<li>Press Enter and Nano will find the first occurrence of the Internode text string and highlight it for you. If the selection is correct, press &#8220;A&#8221; on the keyboard to automatically replace &#8220;all&#8221; occurrences.<br />
.</li>
<li>Once the update is done, manually go back and visually verify that all the entries were changed correctly.<br />
.</li>
<li>When you&#8217;re happy, save your changes by pressing CTRL+X, then &#8220;Y&#8221; and then Enter.<br />
.</li>
<li>Now we need to update the Apt-Mirror record of downloaded files. First, let&#8217;s take a backup of the index in case you stuff up. Type in:
<pre><span style="color: #000080;">$ sudo cp /var/spool/apt-mirror/var/ALL /var/spool/apt-mirror/var/ALL_Backup</span></pre>
<p><em>NOTE: the filename &#8220;ALL&#8221; must be in uppercase</em><br />
.</li>
<li>Now let&#8217;s bring up the original file into the Nano text editor.
<pre><span style="color: #000080;">$ sudo nano /var/spool/apt-mirror/var/ALL</span></pre>
</li>
<li>Depending how large your index file is, there may be a brief delay while Nano opens it up. Once it appears, do the same search and replace as you did in steps 3-6 again. <em>Note: If the editor comes up blank, then you have not opened up the index file &#8211; check your path spelling in Step 9 and try again.</em><br />
.</li>
<li>Save your changes by pressing CTRL+X, then &#8220;Y&#8221; and then Enter.<br />
.</li>
<li>Finally, we need to modify the Apt-Mirror&#8217;s cache of downloaded files so that its directory structure matches that of the new source. In the case of iiNet, you&#8217;ll notice it&#8217;s URL has one less <em>ubuntu</em> word in it compared to Internode&#8217;s URL, so we&#8217;ll need to move some directories to eliminate the extra <em>ubuntu</em> directory. At the terminal, move the <em>dists</em> and <em>pool</em> directories of the mirrored files one directory back using the commands:
<pre><span style="color: #000080;">$ sudo mv /var/spool/apt-mirror/mirror/mirror.internode.on.net/pub/ubuntu/ubuntu/dists /var/spool/apt-mirror/mirror/mirror.internode.on.net/pub/ubuntu
$ sudo mv /var/spool/apt-mirror/mirror/mirror.internode.on.net/pub/ubuntu/ubuntu/pool /var/spool/apt-mirror/mirror/mirror.internode.on.net/pub/ubuntu</span></pre>
</li>
<li>Now rename the <em>mirror.internode.on.net</em> directory to become the name of the iiNet server:
<pre><span style="color: #000080;">$ sudo mv /var/spool/apt-mirror/mirror/mirror.internode.on.net /var/spool/apt-mirror/mirror/ftp.iinet.net.au</span></pre>
</li>
<li>The directory structure now matches iiNet&#8217;s server and your <em>ALL</em> file is up to date, so now we can test your changes by launching Apt-Mirror. Launch it manually with:
<pre><span style="color: #000080;">$ apt-mirror</span></pre>
</li>
<li>Watch the output. First Apt-Mirror will download all the repository indexes from the new location and will compare the files presented in those indexes to your local index of downloaded files (the modified <em>ALL</em> file). It will skip all files already listed as being present and will only download new files not listed in your local mirror. You should find Apt-Mirror advises only a small subset of data to download, perhaps only a few megabytes or no more than a gigabyte or two since your last update under the old setup. If you see that Apt-Mirror wants to download some 30GB or more, then you have made an error in changing the URL in the ALL index file or you incorrectly renamed the mirror directories. Press CTRL+C to stop Apt-Mirror, and go check your configuration from Step 10.
<pre><span style="color: #000080;">$ apt-mirror
Downloading 1080 index files using 5 threads...
Begin time: Wed Dec  9 15:59:23 2009
[5]... [4]... [3]... [2]... [1]... [0]...
End time: Wed Dec  9 16:00:45 2009

Proceed indexes: [SSSSSSSSSSPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP]

1.7 GiB will be downloaded into archive.
Downloading 998 archive files using 5 threads...
Begin time: Wed Dec  9 16:02:31 2009
[5]... [4]... [3]... [2]... [1]... [0]...
End time: Wed Dec  9 16:54:15 2009

207.4 MiB in 256 files and 1 directories can be freed.
Run /var/spool/apt-mirror/var/clean.sh for this purpose.
$</span></pre>
</li>
<li>You&#8217;re done! Pat yourself on the back. <img src='http://www.serenux.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
</ol>
<p><span style="color: #0000ff;"><em><strong>Inserting a foreign Apt-Mirror archive into your own archive<br />
</strong></em></span></p>
<p>This one is slightly more involved, but is not difficult. In the case of a full Ubuntu Mirror, let&#8217;s say you were adding an Ubuntu Karmic mirror archive taken from iiNet&#8217;s mirror servers into your own local Apt-Mirror archive that featured only Intrepid and Jaunty, both of which you are updating from Internode&#8217;s mirror servers. There are some obstacles we need to overcome such as:</p>
<ul>
<li>Continuing to perform future updates for the Karmic repository from Internode rather than iiNet.</li>
<li>The foreign iiNet Karmic archive contains lots of files that you already have in your own archive &#8211; files that are common between all releases of Ubuntu. How do you filter those ones out and only copy the new files?</li>
<li>Finally, how do you update the Apt-Mirror index file with the potentially thousands of new entries from the foreign archive? How do you avoid duplicate lines potentially confusing Apt-Mirror?</li>
</ul>
<p>Follow these steps:</p>
<ol>
<li>First ensure that you have the full copy of the foreign Apt-Mirror archive supplied on a suitable storage medium. Aside from the mirror directory itself (usually under <em>/var/spool/apt-mirror/mirror</em>), you must have a copy of its <em>/var/spool/apt-mirror/var/ALL</em> file. It does not matter if the foreign mirror is not completely up to date, as Apt-Mirror will catch up with what is missing when you run the next update.<br />
.</li>
<li>Let&#8217;s prepare your local Apt-Mirror installation for grabbing Ubuntu Karmic from our preferred source first. We need to load up the <em>/etc/apt/mirror.list</em> file into your favourite text editor and add the entries relevant to our new repository that we are mirroring. I will use the Nano text editor for this, but you can use any text editor you like:
<pre><span style="color: #000080;">$ sudo nano /etc/apt/mirror.list</span></pre>
</li>
<li>Now we add the entries relevant to Ubuntu Karmic for Apt-Mirror to use. In this case, I am going to update Ubuntu Karmic from Internode and I will be grabbing both the 32-bit and 64-bit versions plus the source code (reflecting what is already included in the foreign archive on my storage medium, or Apt-Mirror will be doing a LOT of downloading the next time you run it), so I need to add the following entries:
<pre><span style="color: #000080;"># Ubuntu 9.10 Karmic Koala 32-bit
deb-i386 http://mirror.internode.on.net/pub/ubuntu/ubuntu karmic main restricted universe multiverse
deb-i386 http://mirror.internode.on.net/pub/ubuntu/ubuntu karmic-updates main restricted universe multiverse
deb-i386 http://mirror.internode.on.net/pub/ubuntu/ubuntu karmic-backports main restricted universe multiverse
deb-i386 http://mirror.internode.on.net/pub/ubuntu/ubuntu karmic-security main restricted universe multiverse
deb-i386 http://mirror.internode.on.net/pub/ubuntu/ubuntu karmic-proposed main restricted universe multiverse

# Ubuntu 9.10 Karmic Koala 64-bit
deb-amd64 http://mirror.internode.on.net/pub/ubuntu/ubuntu karmic main restricted universe multiverse
deb-amd64 http://mirror.internode.on.net/pub/ubuntu/ubuntu karmic-updates main restricted universe multiverse
deb-amd64 http://mirror.internode.on.net/pub/ubuntu/ubuntu karmic-backports main restricted universe multiverse
deb-amd64 http://mirror.internode.on.net/pub/ubuntu/ubuntu karmic-security main restricted universe multiverse
deb-amd64 http://mirror.internode.on.net/pub/ubuntu/ubuntu karmic-proposed main restricted universe multiverse

# Ubuntu 9.10 Karmic Koala Source
deb-src http://mirror.internode.on.net/pub/ubuntu/ubuntu karmic main restricted universe multiverse
deb-src http://mirror.internode.on.net/pub/ubuntu/ubuntu karmic-updates main restricted universe multiverse
deb-src http://mirror.internode.on.net/pub/ubuntu/ubuntu karmic-backports main restricted universe multiverse
deb-src http://mirror.internode.on.net/pub/ubuntu/ubuntu karmic-security main restricted universe multiverse
deb-src http://mirror.internode.on.net/pub/ubuntu/ubuntu karmic-proposed main restricted universe multiverse</span></pre>
</li>
<li>Save your changes and exit the editor using CTRL+X, then &#8220;Y&#8221; and then Enter.<br />
.</li>
<li>Make a backup copy of the foreign mirror&#8217;s <em>/var/spool/apt-mirror/var/ALL</em> file, so you can revert to it if you make a mistake. Call the copy something like <em>ALL_Backup</em>.<br />
.</li>
<li>Now open the foreign mirror&#8217;s original <em>/var/spool/apt-mirror/var/ALL</em> file into your favourite text editor.<br />
.</li>
<li>Use your text editor&#8217;s search and replace function (in Nano, press CTRL + Backslash &#8220;\&#8221;) to replace the URL of each entry in the foreign mirror&#8217;s <em>ALL</em> file to the URL of the mirror you will be performing your future updates from. In the case of changing iiNet URLs to Internode URLs, you would replace any occurrence of the text string:
<pre><span style="color: #000080;">http://ftp.iinet.net.au/pub/ubuntu</span></pre>
<p>&#8230;with&#8230;</p>
<pre><span style="color: #000080;">http://mirror.internode.on.net/pub/ubuntu/ubuntu</span></pre>
</li>
<li>Once updated, save your changes and close your text editor.<br />
.</li>
<li>Now we need to merge the modified foreign <em>ALL</em> file into the <em>ALL</em> file from your local Apt-Mirror setup. First up, rename the modified foreign <em>ALL</em> file so we don&#8217;t confuse it. For this tutorial, I will assume your foreign mirror is supplied on an external USB hard-drive called &#8220;myhdd&#8221; and is simply a copy of the foreign system&#8217;s <em>/var</em> directory in its entirety. The following will rename the file from <em>ALL</em> to <em>ALL_modified</em> in a terminal:
<pre><span style="color: #000080;">$ mv /media/myhdd/var/spool/apt-mirror/var/ALL /media/myhdd/var/spool/apt-mirror/var/ALL_modified
</span></pre>
</li>
<li>Now concatenate the original <em>ALL</em> file and the modified foreign mirror&#8217;s <em>ALL_modified</em> file into one new file called <em>ALL_new</em> in your local Apt-Mirror&#8217;s <em>var</em> directory. Concatenating alone <span style="text-decoration: underline;">will</span> result in duplicate lines and we need to sort the file so that any duplicate lines in both the local and foreign <em>ALL</em> files are brought together. We can sort the content of the concatenated files and remove duplicate lines in one hit with:
<pre><span style="color: #000080;">$ sudo cat /var/spool/apt-mirror/var/ALL /media/myhdd/var/spool/apt-mirror/var/ALL_modified | sort | uniq &gt; /var/spool/apt-mirror/var/ALL_new
</span></pre>
<p>The <em>cat</em> part of the command simply joins the content of <em>/var/spool/apt-mirror/var/ALL</em> and <em>/media/myhdd/var/spool/apt-mirror/var/ALL_modified</em> into one big file, but before it&#8217;s written to a physical file, the concatenated data is &#8220;piped&#8221; using the pipe symbol &#8220;|&#8221; into the <em>sort</em> command, which sorts the concatenated data into alphabetical order which will group duplicate lines together. But before that resultant output is written anywhere, the sorted data is then piped again into the <em>uniq</em> command which automagically removes all duplicate lines, leaving one unique copy of each line. Finally, we direct the output from <em>uniq</em> using the &#8220;&gt;&#8221; character into our physical destination file at <em>/var/spool/apt-mirror/var/ALL_new</em> at the end. The <em>sudo</em> command at the start is used simply because only the <em>root</em> and the <em>apt-mirror</em> users can actually write to the <em>/var/spool/apt-mirror/var</em> directory.</p>
<p>Alternatively, we can replace the &#8220;<em>| sort | uniq</em>&#8221; part with &#8220;<em>| sort -u</em>&#8221; which does the exact same thing, since the sort command does have it&#8217;s own &#8220;unique&#8221; functionality as well. I&#8217;ll leave it up to you which way you&#8217;d like to go.</li>
<li>Check your new <em>/var/spool/apt-mirror/var/ALL_new</em> file and you will find it now contains all your local and foreign mirror&#8217;s entries in alphabetical order and with no duplicate lines. If you&#8217;d like to see how this worked, re-work Step 10 without the <em>sort</em> and <em>uniq</em> commands or the pipe characters and see how it affects the output file. Try adding just the <em>sort</em> or just the <em>uniq</em> command too.<br />
.</li>
<li>Now rename your local mirror&#8217;s original <em>ALL</em> file because we&#8217;re about to replace it with the new one:
<pre><span style="color: #000080;">$ sudo mv /var/spool/apt-mirror/var/ALL /var/spool/apt-mirror/var/ALL_old</span></pre>
</li>
<li>Now rename the new <em>ALL</em>_new file to take the place of the old one:
<pre><span style="color: #000080;">$ sudo mv /var/spool/apt-mirror/var/ALL_new /var/spool/apt-mirror/var/ALL</span></pre>
</li>
<li>Right, that&#8217;s the index taken care of. We&#8217;re nearly done! Now we only have to merge the foreign mirror&#8217;s actual files into your local mirror. Once again, for the purposes of this tutorial I&#8217;m going to assume you have them stored on an external USB hard-drive called &#8220;myhdd&#8221; and is a copy of the foreign system&#8217;s entire <em>/var</em> directory, so the path to the foreign mirror&#8217;s files will be <em>/media/myhdd/var/spool/apt-mirror/mirror</em> &#8211; got that? Let&#8217;s change to that directory now in a terminal to save us having to type so much:
<pre><span style="color: #000080;">$ cd /media/myhdd/var/spool/apt-mirror/mirror</span></pre>
</li>
<li>Now, the observant of you may have noticed that Apt-Mirror stores its mirrored files using a directory structure that follows the path of the URL the data is obtained from, so in the case of a mirror from iiNet, there is a directory here called <em>ftp.iinet.net.au</em>. You can see it by using the <em>ls</em> command to list the directory contents:
<pre><span style="color: #000080;">$ ls -l
-rw-r--r--  1 apt-mirror apt-mirror   198599 2009-12-09 10:19 access.log
-rw-r--r--  1 apt-mirror apt-mirror   544373 2009-12-01 06:45 access.log.1
-rw-r--r--  1 apt-mirror apt-mirror  1863467 2009-11-03 06:44 access.log.2
-rw-r--r--  1 apt-mirror apt-mirror  1865334 2009-10-01 06:28 access.log.3
-rw-r--r--  1 apt-mirror apt-mirror 18152891 2009-09-01 06:42 access.log.4
-rw-r--r--  1 apt-mirror apt-mirror     6135 2009-12-09 06:46 error.log
-rw-r--r--  1 apt-mirror apt-mirror    33898 2009-12-01 06:45 error.log.1
-rw-r--r--  1 apt-mirror apt-mirror   124512 2009-11-03 06:44 error.log.2
-rw-r--r--  1 apt-mirror apt-mirror   554851 2009-10-01 06:28 error.log.3
-rw-r--r--  1 apt-mirror apt-mirror   831227 2009-09-01 06:42 error.log.4<strong>
drwxr-xr-x  3 apt-mirror apt-mirror     4096 2008-09-11 02:00 ftp.iinet.net.au</strong>
$</span></pre>
</li>
<li>We need to modify the foreign directory names and structure to exactly match that of the URL path your local mirror updates from. Starting with the obvious, we need to rename the <em>ftp.iinet.net.au</em> directory to be <em>mirror.internode.on.net</em> with:
<pre><span style="color: #000080;">$ sudo mv ftp.iinet.net.au mirror.internode.on.net</span></pre>
</li>
<li>Next we need to create an extra subdirectory called &#8220;ubuntu&#8221; because Internode&#8217;s URL path is <em>mirror.internode.on.net/pub/ubuntu/<strong>ubuntu/</strong></em> and iiNet&#8217;s path is <em>ftp.iinet.net.au/pub/ubuntu/</em> only:
<pre><span style="color: #000080;">$ sudo mkdir mirror.internode.on.net/pub/ubuntu/ubuntu</span></pre>
</li>
<li>Now we need to move the &#8220;dists&#8221; and &#8220;pool&#8221; directories under the first &#8220;ubuntu&#8221; directory to be under the second &#8220;ubuntu&#8221; directory:
<pre><span style="color: #000080;">$ sudo mv mirror.internode.on.net/pub/ubuntu/dists mirror.internode.on.net/pub/ubuntu/ubuntu
$ sudo mv mirror.internode.on.net/pub/ubuntu/pool mirror.internode.on.net/pub/ubuntu/ubuntu</span></pre>
</li>
<li>With the directory structure and directory names all amended, we are now ready to merge the foreign mirror&#8217;s files into your local mirror. We will do this using RSync. This tool traditionally is used to make backups and is indeed used to keep the official worldwide Ubuntu mirrors up to date 1:1 with the master archive, but in our case we are using it to add the &#8220;missing&#8221; files in the local mirror with the files from the foreign mirror whilst skipping the files that are already present, which means instead of copying around about 60GB worth of data from the foreign mirror, we&#8217;ll only copy a percentage of that instead, saving us time and drive space:
<pre><span style="color: #000080;">$ sudo rsync -avz --progress /media/myhdd/var/spool/apt-mirror/mirror/mirror.internode.on.net /var/spool/apt-mirror/mirror/</span></pre>
</li>
<li>The &#8220;&#8211;progress&#8221; parameter allows you to see which file is being copied over. You may see a large number of directory names whizz past because those directories don&#8217;t have any files that are different between your current Ubuntu Intrepid and Jaunty mirror and the Karmic mirror you are merging. Unfortunately rsync does not provide an all-over progress. It only provides a progress of the file it is currently working on. This procress can take several hours to complete depending on how much data needs to be copied and the speed of your storage medium containing the foreign mirror (which if on a USB HDD can take a looooong time).<br />
.</li>
<li>Once RSync has finished, it will give a summary of what was copied. If you were to run the rsync command in Step 16 again, you will see it finish rather quickly because there is no data that has changed or is missing anymore.<br />
.</li>
<li>Now we just quickly ensure that all the merged foreign files belong to the Apt-Mirror user with:
<pre><span style="color: #000080;">$ sudo chown apt-mirror:apt-mirror -R /var/spool/apt-mirror</span></pre>
</li>
<li>And now we are ready to try a manual update to see if it all worked. If you now execute the Apt-Mirror application manually, you should now see that it reads in the new repository entries you added into your /etc/apt/mirror.list file in Step 3 and will compare the files presented in those indexes to your local index of downloaded files (the newly modified <em>ALL</em> file). It will skip all files already present and will only download new files not present in your local mirror. You should find Apt-Mirror advises only a small subset of data to download, perhaps only a few megabytes or a gigabyte or two since your last update under the old setup and depending on how old the foreign archive was. If you see that Apt-Mirror wants to download about 30GB or more, then you have made an error in changing the URL in the <em>ALL</em> index file or the renaming of mirror directories. Press CTRL+C to stop Apt-Mirror, and go check your configuration from Step 5.
<pre><span style="color: #000080;">$ apt-mirror
Downloading 1080 index files using 5 threads...
Begin time: Wed Dec  9 15:59:23 2009
[5]... [4]... [3]... [2]... [1]... [0]...
End time: Wed Dec  9 16:00:45 2009

Proceed indexes: [SSSSSSSSSSPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP]

1.7 GiB will be downloaded into archive.
Downloading 998 archive files using 5 threads...
Begin time: Wed Dec  9 16:02:31 2009
[5]... [4]... [3]... [2]... [1]... [0]...
End time: Wed Dec  9 16:54:15 2009

207.4 MiB in 256 files and 1 directories can be freed.
Run /var/spool/apt-mirror/var/clean.sh for this purpose.
$</span></pre>
</li>
<li>If all is good, then pat yourself on the back. You&#8217;ve successfully merged the foreign repository and it will now update from your preferred ISP&#8217;s mirror from now on. <img src='http://www.serenux.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.serenux.com/2009/12/howto-migrate-an-apt-mirror-generated-ubuntu-archive-to-another-mirror-source-or-merge-a-foreign-apt-mirror-archive-into-yours/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HowTo: Restore the Windows Master Boot Record (without using a Windows CD) using Ubuntu Karmic.</title>
		<link>http://www.serenux.com/2009/10/howto-restore-the-windows-master-boot-record-mbr-without-using-a-windows-cd-using-ubuntu-karmic/</link>
		<comments>http://www.serenux.com/2009/10/howto-restore-the-windows-master-boot-record-mbr-without-using-a-windows-cd-using-ubuntu-karmic/#comments</comments>
		<pubDate>Thu, 29 Oct 2009 12:41:05 +0000</pubDate>
		<dc:creator>HyRax</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Apt]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Recovery]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.serenux.com/?p=634</guid>
		<description><![CDATA[You know how it is &#8211; you take a client&#8217;s Windows based machine, do a dual-boot installation of Ubuntu (which replaces the Windows Master Boot Record, or MBR, with GRUB and sets up an option to boot Ubuntu or Windows) so the client can evaluate Ubuntu, but then later on for whatever reason, Ubuntu is [...]]]></description>
			<content:encoded><![CDATA[<p>You know how it is &#8211; you take a client&#8217;s Windows based machine, do a dual-boot installation of Ubuntu (which replaces the Windows Master Boot Record, or MBR, with GRUB and sets up an option to boot Ubuntu or Windows) so the client can evaluate Ubuntu, but then later on for whatever reason, Ubuntu is no longer wanted. It&#8217;s removed and you need to restore the system&#8217;s ability to natively boot Windows directly without a GRUB menu.</p>
<p>You&#8217;re probably thinking &#8220;why the hell would anyone want to do that?!&#8221;&#8230; well, the fact of the matter is you sometimes come across a client who is just too mind-set and refuses to use anything but Windows, so yes &#8211; sometimes you need to restore the Windows MBR, but how do you do that when you don&#8217;t have a Windows CD handy?</p>
<p>Well, here&#8217;s how to do it using nothing but an Ubuntu 9.10 Karmic LiveCD.</p>
<p><span id="more-634"></span>It&#8217;s a little known fact that the Windows bootloader is nothing special. In fact it contains nothing proprietary to Windows at all. All the Windows bootloader does is simply look for the partition marked as &#8220;bootable&#8221; or &#8220;active&#8221; and transfer control of the boot process to it.</p>
<p>And would you know it? The Ubuntu LiveCD has a binary image of a generic open source bootloader that does just that!</p>
<ol>
<li> Boot your soon-to-be-Windows-only machine using the Ubuntu 9.10 Karmic LiveCD. Doesn&#8217;t matter if it&#8217;s the 32-bit or 64-bit version.<br />
.</li>
<li>Once booted on the LiveCD, open a terminal by going to the Applications menu and then choose Accessories and then Terminal.<br />
.</li>
<li>Find out what the designation of the Windows drive is (generally it will be the first drive, eg: /dev/sda or /dev/hda). If you are not sure, issue the command:
<pre><span style="color: #000080;">$ sudo fdisk -l
</span></pre>
<p>&#8230;and review the output, looking for your NTFS Windows partition. Make note of the <em>drive</em> that partition resides on (not the partition itself), eg: &#8220;/dev/sda&#8221;, <span style="text-decoration: underline;">not</span> &#8220;/dev/sda1&#8243;.</p>
<p><span style="color: #000080;"> </span></li>
<li>Now type in the following (remembering to substitute the correct drive device name for your setup in place of &#8220;/dev/sda&#8221;):
<pre><span style="color: #000080;">$ sudo dd if=/usr/lib/syslinux/mbr.bin of=/dev/sda</span></pre>
<p>&#8230;which will write the image of a standard MBR contained in the /usr/lib/syslinux directory of the LiveCD environment to the first hard-drive, overwriting GRUB. <span style="color: #ff0000;"><strong><em>WARNING: Do NOT use a partition designation, eg: &#8220;sda1&#8243; or &#8220;sda2&#8243;, etc. This will overwrite the start of that partition which will effectively destroy data. The MBR exists at the start of the drive only, so only specify &#8220;sda&#8221; with no number on the end.</em></strong></span></p>
<p><span style="color: #000080;"> </span></li>
<li>Shutdown and reboot. Windows should now start &#8220;natively&#8221; without GRUB appearing at all.<br />
.</li>
<li>Normally I&#8217;d say &#8220;pat yourself on the back&#8221; here, but it&#8217;s Windows&#8230; <img src='http://www.serenux.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.serenux.com/2009/10/howto-restore-the-windows-master-boot-record-mbr-without-using-a-windows-cd-using-ubuntu-karmic/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HowTo: Make use of Ubuntu PPA repositories</title>
		<link>http://www.serenux.com/2009/07/howto-make-use-of-ubuntu-ppa-repositories/</link>
		<comments>http://www.serenux.com/2009/07/howto-make-use-of-ubuntu-ppa-repositories/#comments</comments>
		<pubDate>Sat, 04 Jul 2009 04:58:07 +0000</pubDate>
		<dc:creator>HyRax</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Applications]]></category>
		<category><![CDATA[Apt]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Jaunty]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Repository]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.serenux.com/?p=509</guid>
		<description><![CDATA[What is a PPA repository? A PPA is a Personal Package Archive hosted by the ubuntu.com servers that contains binaries and/or source related to a project. The project can be anything from a new application to a backport of an existing one. A good example is the easy availability of OpenOffice.org 3.0.1 to Intrepid users [...]]]></description>
			<content:encoded><![CDATA[<p>What is a PPA repository?</p>
<p>A PPA is a <em>Personal Package Archive</em> hosted by the ubuntu.com servers that contains binaries and/or source related to a project. The project can be anything from a new application to a backport of an existing one. A good example is the easy availability of <a title="OpenOffice.org 3.0.1 for Intrepid users" href="http://www.serenux.com/?p=397" target="_blank">OpenOffice.org 3.0.1 to Intrepid users</a> before Jaunty came out rather than having to deal with the mess of packages from Sun&#8217;s own website.</p>
<p>PPA&#8217;s can be wholly personal to you or may be open to the public. In particular it is very useful for providing Ubuntu packaged versions of a given application instead of dealing with tarballs or converting RPM packages.</p>
<p>So how does one make use of a pre-defined PPA and are there any things to be wary about? Read on.</p>
<p><span id="more-509"></span>PPA&#8217;s are great for getting the latest versions of a given piece of software instead of waiting for the official Ubuntu repository versions to be updated, though you will of course open yourself to any potential bugs in that software. Classic examples include getting Pidgin&#8217;s 2.5.8 update with the included new authentication method for Yahoo Messenger, or getting the latest version of the Deluge BitTorrent client/daemon.</p>
<p>In this HowTo, we are going to grab the latest version of Deluge to install on an Ubuntu Jaunty 9.04 system using the unofficial Ubuntu PPA, but this guide should apply to just about any version of Ubuntu or other Debian-based distribution.</p>
<p><em>NOTE: Ubuntu has now further simplified the PPA process by introducing a new way of adding PPA repositories and the GPG key in one hit from Ubuntu Karmic 9.10 onwards. While you can still use the process outlined below, please see the note at the end of this article for the simplified way.</em></p>
<ol>
<li>First up, we need to create a sources.list file for the PPA repository we want to add to our system. In the case of Deluge, the PPA is at <a title="Deluge Ubuntu PPA" href="https://launchpad.net/~deluge-team/+archive/ppa" target="_blank">https://launchpad.net/~deluge-team/+archive/ppa</a> so go there first.</li>
<li>Under the &#8220;Install packages&#8221; section is a box with two lines in it:
<pre><span style="color: #000080;">deb http://ppa.launchpad.net/deluge-team/ppa/ubuntu jaunty main
deb-src http://ppa.launchpad.net/deluge-team/ppa/ubuntu jaunty main</span></pre>
</li>
<li>Highlight and copy these two lines to your clipboard.</li>
<li>Now open a terminal and create a new file in your favourite text editor (in this case, GEdit) by typing in:
<pre><span style="color: #000080;">$ sudo gedit /etc/apt/sources.list.d/deluge.list</span></pre>
</li>
<li>This creates a new file under /etc/apt/sources.list.d called deluge.list. You are presented with a blank page. Paste the content of the clipboard down so you have the two lines you copied earlier.</li>
<li>Save and close the file.</li>
<li>Now, in the terminal, type in:
<pre><span style="color: #000080;">$ sudo apt-get update</span></pre>
</li>
<li>When the update completes, you should see a warning error at the end similar to the following:
<pre><span style="color: #000080;">W: GPG error: http://ppa.launchpad.net jaunty Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY C5E6A5ED249AD24C
W: You may want to run apt-get update to correct these problems</span></pre>
</li>
<li>What this means is that apt-get has processed all your package lists and found that for the newly added Deluge source list, it does not have a GPG key to authenticate any of the files from it. This doesn&#8217;t stop you from installing Deluge or other files from it, but it does prevent Ubuntu from proving whether or not these files are untampered with, so it will pester you with warnings until you can provide it that GPG public key. Providing it is simple. Make note of the hexadecimal value provided after NO_PUBKEY and then type in the following:
<pre><span style="color: #000080;">$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C5E6A5ED249AD24C
Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --secret-keyring /etc/apt/secring.gpg --trustdb-name /etc/apt/trustdb.gpg --keyring /etc/apt/trusted.gpg --keyserver keyserver.ubuntu.com --recv-keys C5E6A5ED249AD24C
gpg: requesting key 249AD24C from hkp server keyserver.ubuntu.com
gpg: key 249AD24C: public key "Launchpad PPA for Deluge Team" imported
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)
$</span></pre>
</li>
<li>This fetches the GPG public key from the Keyserver at ubuntu.com and adds it to your GPG keyring. Now if you run:
<pre><span style="color: #000080;">$ sudo apt-get update</span></pre>
<p>&#8230;again, you will see no errors output this time, which means you can safely install applications from it now without Apt warning you about being unable to authenticate them.</li>
<li>To prove this, let&#8217;s try and install Deluge now:
<pre><span style="color: #000080;">$ sudo apt-get install deluge</span></pre>
<p>&#8230;and it should install like any other ordinary Ubuntu applications with no fuss, no worries and no error messages.</li>
<li>Pat yourself on the back.</li>
</ol>
<p><span style="text-decoration: underline;"><span style="color: #0000ff;"><em><strong>I get an &#8220;HTTP fetch&#8221; error when I try to import a GPG public key!</strong></em></span></span></p>
<p>If at step 9, you get the following error:</p>
<pre><span style="color: #000080;">$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C5E6A5ED249AD24C
Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --secret-keyring /etc/apt/secring.gpg --trustdb-name /etc/apt/trustdb.gpg --keyring /etc/apt/trusted.gpg --keyserver keyserver.ubuntu.com --recv-keys C5E6A5ED249AD24C
gpg: requesting key 249AD24C from hkp server keyserver.ubuntu.com
<strong>gpgkeys: HTTP fetch error 7: couldn't connect to host</strong>
gpg: no valid OpenPGP data found.
gpg: Total number processed: 0
$</span></pre>
<p>It is because your firewall is blocking access to the Keyserver. Keyservers use port 11371 to communicate, not port 80 which is the normal HTTP port, so open 11371 as an outbound port on your firewall and re-run the command and it will work fine.</p>
<p><span style="color: #0000ff;"><em><span style="text-decoration: underline;"><strong>The simplified way of adding PPA&#8217;s using Ubuntu Karmic 9.10 or later.<br />
</strong></span></em></span></p>
<p>Ubuntu 9.10 introduced a new, simpler way to add PPA&#8217;s to your system. Using the above Deluge example, you now only have to type in:</p>
<pre><span style="color: #000080;">$ sudo add-apt-repository ppa:deluge-team/ppa</span></pre>
<p>&#8230;and that&#8217;s it. This will do the whole sources.list creation and GPG key for you in one hit. That now simply leaves you to update your package lists with:</p>
<pre><span style="color: #000080;">$ sudo apt-get update</span></pre>
<p>&#8230;and then you can install Deluge with:</p>
<pre><span style="color: #000080;">$ sudo apt-get install deluge</span></pre>
<p>As you can see, it&#8217;s a far simpler method. You can, of course, still use the original method if you prefer.</p>
<p><span style="color: #0000ff;"><em><span style="text-decoration: underline;"><strong>Hey these PPA things are cool &#8211; can I create one of my own?</strong></span></em></span></p>
<p>You certainly can. Refer to the <a title="Ubuntu PPA Help Page" href="https://help.launchpad.net/Packaging/PPA" target="_blank">Personal Package Archives for Ubuntu Help Page</a> for everything you need to know, however please do not use a PPA as your own personal off-site backup for personal data. It is intended to help individuals and small groups who develop new software and do not have the resources to host their software for easy distribution by providing them a place where the masses can gain access to their project. To help curb the potential for abuse, PPA&#8217;s are limited to 1GB of storage and you are bound by the <a title="Ubuntu Community Code of Conduct" href="https://help.launchpad.net/BecomingAnUbuntero" target="_blank">Ubuntu Community Code of Conduct</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.serenux.com/2009/07/howto-make-use-of-ubuntu-ppa-repositories/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>HowTo: Upgrade Ubuntu to the next version without burning a physical CD.</title>
		<link>http://www.serenux.com/2009/03/howto-upgrade-ubuntu-to-the-next-version-without-burning-a-physical-cd/</link>
		<comments>http://www.serenux.com/2009/03/howto-upgrade-ubuntu-to-the-next-version-without-burning-a-physical-cd/#comments</comments>
		<pubDate>Mon, 16 Mar 2009 06:31:46 +0000</pubDate>
		<dc:creator>HyRax</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Apt]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.serenux.com/?p=456</guid>
		<description><![CDATA[As you are probably aware, Ubuntu has a regular six-month release cycle, and if you are someone like me, then you are probably regularly downloading all the Alpha and Beta versions as well as the final releases. The problem with such regularity is that this would use up an awful lot of blank CD&#8217;s that [...]]]></description>
			<content:encoded><![CDATA[<p>As you are probably aware, Ubuntu has a regular six-month release cycle, and if you are someone like me, then you are probably regularly downloading all the Alpha and Beta versions as well as the final releases. The problem with such regularity is that this would use up an awful lot of blank CD&#8217;s that you will probably only use a few times before discarding just to install these upgrades.</p>
<p>Fortunately, you don&#8217;t have to burn Ubuntu CD ISO images to a physical disc to upgrade your installation to the next version. Here&#8217;s how to do it using just the ISO image, or wholly via the Internet with no ISO image or CD at all.</p>
<p><span id="more-456"></span>There are three ways to upgrade Ubuntu from one version to the next:</p>
<ul>
<li>Wholly on-line via the graphical Update Manager application, or</li>
<li>Wholly on-line via command line Apt application, or</li>
<li> The quicker and more easily repeatable method of using an upgrade CD, especially if installing multiple machines (this process optionally will also retrieve additional updates from the Internet released since the CD&#8217;s initial release). I will outline all three methods here.</li>
</ul>
<p><span style="color: #ff0000;"><strong>NOTE: You <span style="text-decoration: underline;">cannot</span> upgrade one CPU architecture to another, ie: you cannot upgrade Ubuntu 8.04 x86 (32-bit Intel/AMD compatible) to Ubuntu 8.10 AMD64 (64-bit Intel/AMD compatible), etc. If you previously used the 32-bit version of Ubuntu and wish to upgrade to the 64-bit version, you will need to do a complete fresh installation from scratch.</strong></span></p>
<p><span style="color: #ff00ff;"><em><strong>Upgrading via the CD ISO image</strong></em></span></p>
<p>First up, you will need to download the <strong>Alternate Installer</strong> CD ISO image of the new version of Ubuntu you want as opposed to the Desktop Live CD version, which <span style="text-decoration: underline;">cannot</span> do upgrades. All Ubuntu Alternate discs are named in the format of <em>ubuntu-x.xx-alternate-yyyy.iso</em> where x.xx is the release version, eg: 8.10 or 9.04, and yyyy is the target architecture, eg: amd64 for 64-bit Intel-compatible platforms and i386 for 32-bit Intel-compatible platforms. Thus the Ubuntu Intrepid 8.10 64-bit version is called <em>ubuntu-810-alternate-amd64.iso</em> and when it&#8217;s eventually released, the Ubuntu Jaunty 9.04 64-bit version will be called <em>ubuntu-9.04-alternate-amd64.iso</em> accordingly.</p>
<p>Once you have the CD image downloaded, make a note of where you downloaded it to, eg: <em>/home/jbloggs/downloads/ubuntu-8.10-alternate-amd64.iso</em> and then jump into a terminal window.</p>
<p>Make sure that you do not have any actual physical CD&#8217;s inserted into your CD-ROM drive.</p>
<p>At the $ prompt type in:</p>
<pre><span style="color: #000080;">$ sudo mount -o loop /home/jbloggs/downloads/ubuntu-8.10-alternate-amd64.iso /media/cdrom</span></pre>
<p>&#8230;and hit Enter. If all is well, it should look as though nothing happened, however you will notice a CD icon appear on your desktop simply called &#8220;cdrom&#8221;.</p>
<p>Now start the upgrade process with the following command:</p>
<pre><span style="color: #000080;">$ gksu /media/cdrom/cdromupgrade</span></pre>
<p>&#8230;and then just follow the prompts. When you reboot after the upgrade, the CD image will no longer be mounted and you can use real CD&#8217;s again without any issue.</p>
<p><span style="color: #ff00ff;"><em><strong>Upgrading via the Internet only &#8211; GUI installation<br />
</strong></em></span></p>
<p>This method is possibly more convenient, but generally takes longer to do and is not the ideal way to upgrade multiple machines. Using this method, you don&#8217;t need the ISO image at all. Everything is handled by the Update Manager.</p>
<p>Open a terminal (or press ALT + F2 to bring up the Run Application dialog) and type in the following:</p>
<pre><span style="color: #000080;">gksu "update-manager -d" </span></pre>
<p>&#8230;and hit Enter. This will launch the familiar Update Manager. If you are not immediately advised of a newer version of Ubuntu to upgrade to, as illustrated below, then click on the &#8220;Check&#8221; button to update your system&#8217;s cache of available updates, then click on the &#8220;Upgrade&#8221; button that appears at the top.</p>
<p>Before Update Manager is aware of the next distribution version:</p>
<p><img class="aligncenter size-full wp-image-457" title="Update Manager now showing the Upgrade option" src="http://www.serenux.com/wp-content/uploads/2009/03/updatemanager-distupgrade1.jpg" alt="Update Manager now showing the Upgrade option" width="412" height="434" /><br />
.</p>
<p>And after Update Manager is made aware of the next distribution version by clicking on the &#8220;Check&#8221; button (note that the Upgrade option will NOT appear if you did not start Update Manager with the &#8220;-d&#8221; parameter):</p>
<p><img class="aligncenter size-full wp-image-458" title="Update Manager showing the Upgrade button" src="http://www.serenux.com/wp-content/uploads/2009/03/updatemanager-distupgrade2.jpg" alt="Update Manager showing the Upgrade button" width="425" height="434" /></p>
<p>Follow the prompts.</p>
<p><span style="color: #ff00ff;"><em><strong>Upgrading via the Internet only &#8211; Command Line installation</strong></em></span></p>
<p>This method is identical to the GUI Update Manager installation, except that it is done wholly via the command line using Apt.</p>
<p>First of all, make sure that Apt is fully up to speed with current updates by jumping into a terminal and type in at the $ prompt:</p>
<pre><span style="color: #000080;">$ sudo apt-get update &amp;&amp; sudo apt-get upgrade</span></pre>
<p>When that has finished, commence the upgrade to the next version of Ubuntu with:</p>
<pre><span style="color: #000080;">$ sudo do-release-upgrade</span></pre>
<p>Follow the prompts.</p>
<p>That&#8217;s it!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.serenux.com/2009/03/howto-upgrade-ubuntu-to-the-next-version-without-burning-a-physical-cd/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>HowTo: Uninstall software that makes Ubuntu&#8217;s boot process fail</title>
		<link>http://www.serenux.com/2009/02/howto-uninstall-software-that-makes-ubuntus-boot-process-fail/</link>
		<comments>http://www.serenux.com/2009/02/howto-uninstall-software-that-makes-ubuntus-boot-process-fail/#comments</comments>
		<pubDate>Tue, 24 Feb 2009 03:34:16 +0000</pubDate>
		<dc:creator>HyRax</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Applications]]></category>
		<category><![CDATA[Apt]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.serenux.com/?p=438</guid>
		<description><![CDATA[Whilst rebuilding a friend&#8217;s Medion laptop, in my attempt to get the Wireless LAN adapter working, I set about trying to use ndiswrapper and the Windows drivers. Unfortunately upon rebooting, the system failed to boot, always locking up when the boot process tried to load the Windows driver. It was so bad that I wasn&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p><a title="Getting sound to work on a Medion laptop" href="http://www.serenux.com/?p=435" target="_blank">Whilst rebuilding a friend&#8217;s Medion laptop</a>, in my attempt to get the Wireless LAN adapter working, I set about trying to use ndiswrapper and the Windows drivers. Unfortunately upon rebooting, the system failed to boot, always locking up when the boot process tried to load the Windows driver. It was so bad that I wasn&#8217;t even able to boot to a recovery prompt because it still attempts to load the hardware drivers before dropping you into a root shell.</p>
<p>The solution was simple &#8211; get rid of ndiswrapper and that will prevent the offending Windows driver loading which I can then delete afterwards, but how do you do this when you can&#8217;t even boot to a terminal?</p>
<p>With the assistance of an Ubuntu LiveCD (on USB stick in this case), I was able to remove ndiswrapper without needing to do a complete re-install of the system. Here&#8217;s how to do it.</p>
<p><span id="more-438"></span></p>
<ol>
<li>Shutdown your system, insert your Ubuntu LiveCD and turn on your system.<br />
.</li>
<li>Allow the system to boot to the LiveCD desktop and then open a terminal.<br />
.</li>
<li>Determine what your system&#8217;s root partition is called by getting a list of available drives and partitions with:
<pre><span style="color: #000080;">$ sudo fdisk -l</span></pre>
</li>
<li>In my case, this Medion lappy had Windows installed and a couple of other partitions too. The root Linux partition ultimately resided on sda8, so I need to mount this somewhere. First I need a mountpoint:
<pre><span style="color: #000080;">$ mkdir /dev/shm/medion</span></pre>
<p>&#8230;this creates a directory in the RAM disk called &#8220;medion&#8221; (but you can call it whatever you want).<br />
.</li>
<li>Now mount the partition to the mountpoint with:
<pre><span style="color: #000080;">$ sudo mount /dev/sda8 /dev/shm/medion</span></pre>
</li>
<li>Check that we can access the mounted drive with:
<pre><span style="color: #000080;">$ ls -l /dev/shm/medion</span></pre>
</li>
<li>If it contains the root filesystem of your lappy&#8217;s Ubuntu install, then you&#8217;ve done well so far. Now we need to change the system&#8217;s root filesystem from the LiveCD over to the hard-drive&#8217;s root filesystem so we can work on it. Type in:
<pre><span style="color: #000080;">$ sudo chroot /dev/shm/medion</span></pre>
</li>
<li>This will temporarily make the current session&#8217;s root filesystem the one that is on your hard-drive, as though we&#8217;d actually booted from it. From here, it&#8217;s now a simple case of removing the ndiswrapper application that was causing all my problems (notice that we are at a root prompt designated by the hash symbol):
<pre><span style="color: #000080;"># apt-get remove ndiswrapper-common</span></pre>
</li>
<li>A few warning messages popped up advising that it couldn&#8217;t find the log to write to, but that&#8217;s OK &#8211; the software still gets removed, and thus will prevent the Windows driver from killing the boot process. Once Apt had finished doing its thing, just type in:
<pre><span style="color: #000080;"># exit</span></pre>
<p>&#8230;and the root filesystem will revert back to the LiveCD&#8217;s root filesystem.<br />
.</li>
<li>Shutdown and reboot as normal without the LiveCD, and viola &#8211; the system boots without hanging this time!</li>
</ol>
<p>As you can see, the ability to change root filesystem can be very useful in trouble-shooting a non-booting installation but also has other uses too, one of the most common being creating custom LiveCD&#8217;s by modifying the squashfs filesystem on the LiveCD and burning to a new disc &#8211; thus allowing you to add or remove components from the default Ubuntu LiveCD environment.</p>
<div class='wp_likes' id='wp_likes_post-438'><a class='like' href="javascript:wp_likes.like(438);" title='' ><img src="http://www.serenux.com/wp-content/plugins/wp-likes/images/like.gif" alt='' border='0'/>Like</a><span class='text'></span>
<div class='unlike'><a href="javascript:wp_likes.unlike(438);">Unlike</a></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.serenux.com/2009/02/howto-uninstall-software-that-makes-ubuntus-boot-process-fail/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>HowTo: Make and simplify sources.list files</title>
		<link>http://www.serenux.com/2008/10/howto-make-and-simplify-sourceslist-files/</link>
		<comments>http://www.serenux.com/2008/10/howto-make-and-simplify-sourceslist-files/#comments</comments>
		<pubDate>Fri, 31 Oct 2008 01:01:38 +0000</pubDate>
		<dc:creator>HyRax</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Apt]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.serenux.com/?p=109</guid>
		<description><![CDATA[With Penguin-fans everywhere madly hitting Ubuntu mirrors worldwide today grabbing the Final Release of Ubuntu 8.10 Intrepid Ibex (including myself), people are discovering that using the official major country mirrors can be a bit slow. In the case of Australia, the official mirror is au.archive.ubuntu.com but it&#8217;s much slower than many of the other official [...]]]></description>
			<content:encoded><![CDATA[<p>With Penguin-fans everywhere madly hitting Ubuntu mirrors worldwide today grabbing the Final Release of Ubuntu 8.10 Intrepid Ibex (including myself), people are discovering that using the official major country mirrors can be a bit slow. In the case of Australia, the official mirror is au.archive.ubuntu.com but it&#8217;s much slower than many of the other official and unofficial Australian mirrors, especially if your local ISP keeps their own mirror.</p>
<p>It makes sense then, to change your setup to point to a faster mirror rather than rely on the primary.</p>
<p><span id="more-109"></span></p>
<p>There are a couple of ways to change your sources, including simply going to System-&gt;Administraion-&gt;Software Sources and changing the &#8220;Download from:&#8221; dropbox to another official mirror closer to you. One of my favourite speedy Australian mirrors is Internode. They are registered as an official Australian mirror and automatically appear in this drop-down list, but if your local ISP has their own unofficial mirror, or you have your own mirror at home, then you won&#8217;t be able to select it from this list, so you need to do some manual work instead.</p>
<p>Jump into a terminal and type in the following:</p>
<pre><span style="color: #000080;">$ sudo gedit /etc/apt/sources.list</span></pre>
<p>This will bring up the current sources.list into your text editor. Go through every line that doesn&#8217;t have a leading hash and add one, so that every single line is commented out, eg:</p>
<pre><span style="color: #000080;">This line is not commented
#This line IS commented out because of the leading hash</span></pre>
<p>Do that for all un-commented lines. This will totally disable your sources.list file. &#8220;Woah&#8221;, you say &#8220;Don&#8217;t I need that to update my system?&#8221; Yes you do, however there is method to my madness.</p>
<p>Save and exit your sources.list file and then type in the following:</p>
<pre><span style="color: #000080;">$ sudo gedit /etc/apt/sources.list.d/mynewsources.list</span></pre>
<p>This will create a new empty file in your text editor. Now type in the following:</p>
<pre><span style="color: #000080;"># Ubuntu Intrepid Binaries source.list
deb http://mirror.internode.on.net/pub/ubuntu/ubuntu intrepid main restricted universe multiverse
deb http://mirror.internode.on.net/pub/ubuntu/ubuntu intrepid-updates main restricted universe multiverse
</span><span><span style="color: #000080;">deb http://mirror.internode.on.net/pub/ubuntu/ubuntu intrepid-security main restricted universe multiverse
</span></span><span style="color: #000080;">#deb http://mirror.internode.on.net/pub/ubuntu/ubuntu intrepid-backports main restricted universe multiverse
#deb http://mirror.internode.on.net/pub/ubuntu/ubuntu intrepid-proposed main restricted universe multiverse
</span><span><span style="color: #000080;">
# Ubuntu Intrepid Source source.list</span></span>
<span style="color: #000080;">deb-src http://mirror.internode.on.net/pub/ubuntu/ubuntu intrepid main restricted universe multiverse
deb-src http://mirror.internode.on.net/pub/ubuntu/ubuntu intrepid-updates main restricted universe multiverse
</span><span style="color: #000080;">deb-src http://mirror.internode.on.net/pub/ubuntu/ubuntu intrepid-security main restricted universe multiverse</span>
<span style="color: #000080;">#deb-src http://mirror.internode.on.net/pub/ubuntu/ubuntu intrepid-backports main restricted universe multiverse
#deb-src http://mirror.internode.on.net/pub/ubuntu/ubuntu intrepid-proposed main restricted universe multiverse

</span></pre>
<p>(The Intrepid-Backports and Intrepid-Proposed lines should remain commented out with the leading hash unless you really, really need them)</p>
<p>Save and exit.</p>
<p>Now type in:</p>
<pre><span style="color: #000080;">$ sudo apt-get update</span></pre>
<p>All of a sudden you see that your machine is pulling all its package lists from Internode&#8217;s mirror instead of your old repository! How does this work? And why is this source list so much shorter than the one that Ubuntu already provides?</p>
<h3>Apt-get can handle multiple source.list files</h3>
<p>By default Apt reads the /etc/apt/sources.list file and normally you would have this setup just for Ubuntu only.</p>
<p>The /etc/apt/sources.list.d/ directory (note the .d on the end of the directory name) can contain any number of other source list files. They can be named anything you like as long as they end in &#8220;.list&#8221;, so &#8220;foobar.list&#8221; and &#8220;banana.list&#8221; are perfectly valid names &#8211; Apt will look at all of them. The idea behind being able to make multiple sources lists is that you can setup multiple sources for various software packages, eg; you might have a separate source list to get Virtualbox from Sun&#8217;s website, Wine from the WineHQ website, Medibuntu from the Medibuntu website, etc.</p>
<p>Do you have to have separate source lists? Not at all &#8211; you can have multiple deb and deb-src lines going to different sites in the one sources.list file if you like. Having multiple separate lists just allows you to keep things clean and tidy and easily allows you to setup other workstations with various repository sources by simply copying a file over instead of editing the sources.list file everytime.</p>
<h3>Shortening your sources.list</h3>
<p>Now in the above example, all we ultimately did was setup Internode&#8217;s Ubuntu repository in a separate source list file but we could have just as easily modified the /etc/apt/sources.list file and replaced all occurences of the official AU mirror&#8217;s address with Internode&#8217;s address instead, but by showing you how to create your own source list, I&#8217;ve also shown you how to simplify the content of the Ubuntu source list too, so you can compare them side by side.</p>
<p>As you know, the deb line tells Apt which address to go to followed by the variant of Ubuntu you are using (in this case &#8220;Intrepid&#8221;) and then you specify the repository section you are interested in. in the case of Ubuntu, there are four sections in each repository group called &#8220;Main&#8221;, &#8220;Restricted&#8221;, &#8220;Universe&#8221; and &#8220;Multiverse&#8221;. This could be expressed in your source list like:</p>
<pre><span><span style="color: #000080;">deb http://mirror.internode.on.net/pub/ubuntu/ubuntu intrepid main</span><span style="color: #000080;">
deb http://mirror.internode.on.net/pub/ubuntu/ubuntu intrepid restricted
</span><span style="color: #000080;">deb http://mirror.internode.on.net/pub/ubuntu/ubuntu intrepid universe
deb http://mirror.internode.on.net/pub/ubuntu/ubuntu intrepid multiverse
</span></span></pre>
<p><span style="color: #000000;">But this is a lot of unnecessary text. You can cover the lot with one line by specifying the sections together on one line:</span></p>
<pre><span><span><span style="color: #000080;">deb http://mirror.internode.on.net/pub/ubuntu/ubuntu intrepid main</span><span style="color: #000080;"> restricted universe multiverse
</span></span></span></pre>
<p><span><span><span style="color: #000080;"><span style="color: #000000;">Repeat this for each repository, eg: intrepid-updates, intrepid-security etc and you end up with something much shorter and easier to read than the default sources.list file.<br />
</span></span></span></span></p>
<p>The main reason the default Ubuntu etc/apt/sources.list file is so big is to explain to the new user what the file is about and how to configure it. A lot of it is just comment lines.</p>
<p>So, now you can apply this to setting up your favourite Ubuntu mirror yourself be it your local ISP&#8217;s mirror or even <a title="Setting up your own Ubuntu mirror" href="http://www.serenux.com/?p=80" target="_blank">your own mirror</a> at home. Just replace the URL in the source list with the new one.</p>
<div class='wp_likes' id='wp_likes_post-109'><a class='like' href="javascript:wp_likes.like(109);" title='' ><img src="http://www.serenux.com/wp-content/plugins/wp-likes/images/like.gif" alt='' border='0'/>Like</a><span class='text'></span>
<div class='unlike'><a href="javascript:wp_likes.unlike(109);">Unlike</a></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.serenux.com/2008/10/howto-make-and-simplify-sourceslist-files/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
