25 Oct 2008

Eureka - Using Ubuntu Repos from USB HDD

Tommorrow, I start work at Wondogenet. And, I still hadn't figured out how to get Synaptic to look at my USB HDD. No internet - I miss ubuntuforums, boohoo :(

And, then a stroke of complete brilliance - okok, a slight exaggeration. Nonetheless, this is uber-cool for a linux noob. Treat the repos folder on the USB HDD as a webfolder and Ubuntu will think it is downloading from the network. XAMPP and my linux books to the rescue. I had already installed XAMPP on my laptop.

Create a new folder in htdocs to serve as container for repos

sudo mkdir /opt/lampp/htdocs/ubuntu

Did I want to copy 28GB of data on to this folder...naah. Certainly not on to the PCs at the health centre. The next command does the trick by binding the folder on the USB HDD to the folder on the local webserver.

sudo mount --bind /media/USBHDD/ubuntu /opt/lampp/htdocs/ubuntu

Let me test this out.

sudo /opt/lampp/lampp start 

Let's see what my own Ubuntu repository looks like.

The next thing to do was to test Synaptic - just for the pleasure of seeing it work. But before that, I edited sources.list to point to the new repository.

sudo cp /etc/apt/sources.list /etc/apt/sources_orig.list
sudo gedit /etc/apt/sources.list

I deleted all the entries and added these new ones.

deb http://localhost/ubuntu/ hardy main universe restricted multiverse
deb http://localhost/ubuntu/ hardy-security universe main multiverse restricted
deb http://localhost/ubuntu/ hardy-updates universe main multiverse restricted
deb http://localhost/ubuntu/ hardy-backports universe main multiverse restricted

And, finally making sure that everything works.

sudo apt-get update

Let me try installing Gnochm, a utility to view .chm files (one of my e-learning materials was in this format - don't ask!).

sudo apt-get install gnochm

After opening and closing Synaptic and restarting my laptop and doing this all from scratch again (just to be sure) I went to sleep. Time to test this out in Wondogenet.

No comments:

Post a Comment