Sunday, March 6, 2011

Downloading packages from CLI.

I started setting up Micro Core in VirtualBox yesterday. Initially I was a bit sceptical as to whether or not my Eee 1001HA would be able to handle running VirtualBox, but it's actually been running rather smoothly. That introduction aside; installing Micro Core is always a bit challenging. I read up on the installation guide on the Tiny Core website plus the "Adding a Desktop to Micro Core" tutorial in the wiki. As usual things didn't go as smooth as lined out, but I learnt a lot from the experience. Basically I've installed and reinstalled it four times since then and I'm still having some issues. I'm certain I'll work it out in the end so for now let's go through the good stuff I've learnt these past 24 hours.

Getting and installing packages.

I initially thought I had to install the command line version of the Appbrowser to get the tools I needed to prepare the install. This is how I used to download and install it:
tc@box:~$ wget -c http://distro.ibiblio.org/pub/linux/distributions/tinycorelinux/3.x/tcz/appbrowser-cli.tgz
tc@box:~$ wget -c http://distro.ibiblio.org/pub/linux/distributions/tinycorelinux/3.x/tcz/appbrowser-cli.tgz.md5sum.txt
tc@box:~$ md5sum -c appbrowser-cli.tgz
tc@box:~$ tce-load -w -i appbrowser-cli.tgz
Tedious, isn't it? I did all of that before I even started doing anything else. In addition I did it with the wrong keymap for my keyboard. After I followed the steps I lined out above I'd launch the ncurses interface in order to install the stuff I really wanted by typing:
tc@box:~$ appbrowser-cli
In short, the whole process was long-winded and tiresome, so I'm happy that I've discovered a better way of doing it. You don't need 'appbrowser-cli' at all. Why not you ask? Because the 'tce-load -iw' command takes care of all that annoying stuff for you. What tce-load does is finding the location of you package you requested, downloads it, handles the dependencies for it and then installs the whole bunch. Basically it's Tiny/Micro Core's version of 'apt-get install' and I've fallen in love with it. Here's an example of how to use it:
tc@box:~$ sudo tce-load -iw cfdisk.tgz
VoilĂ , now grub splash is installed on your system. Note that you're not allowed to use tce-load in the root shell so you have to be logged in as a regular user and sudo it. As for the appbrowser-cli itself you don't have to use the ncurses interface. There's another more frugal interface to it; namely the 'ab' command.
tc@box:~$ sudo ab grub-0.97-splash.tcz
After typing that you get presented with a interactive screen where you have to select the package you want before confirming that you want to download it.

In summary, we've now covered four ways of downloading packages. 'tce-load -iw' is my favorite.