From Windows-Wimp to Command-Line Warrior. Part 12: Downloading and unpacking the system files, Gentoo handbook, page 5
2 September 2005
In page 5 of the handbook you have to download a stage file and a portage snapshot. The 'stage' file is a starting set of system files and folders. The 'portage snapshot' is a starting set of 'portage' files.
Portage is Gentoo's unique and advanced package management system. In your portage directory is a load of very small files (thousands if not tens of thousands of them) that act like a database of all the programs that exist for the Gentoo system. These files (called ebuilds) tell the Gentoo system how to get and install any program you like.
Page 5 of the handbook talks about proxies, if you do not know what that means and are sitting at home then don't worry about it. Proxy servers are mostly used in big institutions like universities and major companies etc.
Getting the stage file
If you made the universal CD because you are installing on a computer without internet access then follow the instructions in the handbook for that.
In this series we are going to download a stage from the Internet. We will use the Links browser, usage instructions were given in part 8.
You need to go to the Gentoo mirror site (you can also click this link from inside the handbook):
> links www.gentoo.org/main/en/mirrors.xml
Choose the link closest to you. The hosts tend to be enlightened Universities, responsible and friendly Internet Service Providers, GNU/Linux User Groups and others. You may want to check out these universities and ISPs next time you want to take a course or buy internet services :) !
It doesn't matter if you choose an HTML or FTP mirror. Just choose one nearby so it will be as fast as possible to download. Click on the mirror to enter the site and click on the 'releases' directory.
You then need to choose your architecture, hopefully you know this by now, if not then the main ones are:
> x86 for 32-bit AMD/Pentium IBM clones - the bog standard PC. amd64 for 64 bit (x86_64) platforms such as AMD 64 etc (you cool dude). ppc for Apple Mac G3 and G4s etc. ppc64 for the Apple Mac G5 (you lucky person).
Choose the latest release, it will be the highest year followed by a dot (.) and the highest number. At time of writing it is '2005.1'. Next choose 'stages'.
To repeat, to download a file in Links you highlight it by hovering your cursor over it and then press 'd'.
Firstly download the checksum file this begins 'stage3' and ends md5, this is used to check that your file downloaded okay. (You can see the full name in the links bar at the bottom). Next download the stage file, this begins 'stage3' and ends '.bz2'.
Go and make yourself a cup of tea or coffee as this may take ten minutes (depending on the speed of your Internet Connection). You could also check the news in another terminal by using one of the following commands, (note these links are clickable):
links news.bbc.co.uk/text_only.stm
links www.google.co.uk/news?ned=tuk
Checking the download
Quit Links (or go back to the handbook) and in a terminal where you are in the /mnt/gentoo directory (use 'cd /mnt/gentoo' if you are not there already). Use 'pwd' if you are confused as to where you are! Use the following command to check the download:
md5sum -c stage3-amd64-2005.1.tar.bz2.md5
A note on completion
I have mentioned this elsewhere in this blog numerous times, but I'll repeat it here. Clever use of completion is the key to success on the Command Line. The 'Tab' key is the completion button. Tab is often represented as an arrow - it is on the left above 'Caps Lock' but below '1'.
To type the above command, use tab completion as follows, where ! represents a good slap of the Tab key:
> md5! -c s!.!
Unpacking the file
The stage file comes compressed in an archive. Therefore the next step is to unpack the file, the command will look something like this:
> tar -xvjpf stage3-amd64-2005.1.tar.bz2
Don't forget to Tab-complete on the stage name!
All the filenames will be printed on the screen. Unless you are Data from Star Trek, I wouldn't bother trying to read it. If you have a quite old computer you may want to take another break away from the machine.
When that is done, you can type the command 'ls' which will show you the folders that a normal GNU/Linux filesystem has.
Now you have to do basically the same thing again to get the portage snapshot. Go back to the mirror list using Links (see above) and now go into the 'snapshots' directory. Download the latest .tar.bz2 file (and if you want the md5 file to check the download - see above).
If you have a slow internet connection then another walk around the house might be in order!
This command checks the snapshot (of course your date in the filename will be different):
> md5sum -c portage-20050831.tar.bz2.md5sum
The check will say 'OK' for a successful download.
> portage-20050831.tar.bz2: OK
Now it is time to unpack the portage snapshot archive, note that the destination has '/usr' on the end:
> tar -xvjf /mnt/gentoo/portage-20050831.tar.bz2 -C /mnt/gentoo/usr
Sorting out make.conf
You use the groovy yet tiny editor nano, read our guide to nano for editing help.
The handbook explains what you need to do, as does Bob P's installation guide is perhaps helpful here too.
This part can seem the most arcane. Most other GNU/Linux distributions hide this whole process from you. However in Gentoo the make.conf file has enormous power to give you the best possible system.
To get the most of out make.conf will require a bit of reading, so for now don't waste too much time on it. Don't forget that you can make it more complex later.
As I have said throughout this series, the aim at the moment is to get a bootable system - not a system that is extremely optimised but doesn't boot! You can optimise the system later to your hearts content!


