Category Archives: Linux
First thing I noticed as Oneiric booted up was how pretty it was: from the unassuming theme to the colorful launcher, the Oneiric looks are sweet. The second thing I noticed, however, was how slow it was. Upon logging in: the desktop took about 60 seconds before becoming usable; the application menu took 10 seconds to open, and the file browser another seven. My first impression: a bit scared (no worries, read on).
Ubuntu certainly is putting good thinking into creating an efficient desktop. The colorful icons on the launcher distinguish differing programs very well. When they are clicked they provide nice feedback so you know the program is loading. I think that going the route of icons only was a nice touch (as I generally know what I have open in a program). The theme too is a design that is well thought out and works well for applications that run full screen. Unity saves screen real estate by combining the title bar, gnome panel and program options (File Edit …) into one. Since I don’t usually need the program options visible this works well for me.
The scrollbar is re-engineered too and is just hinted (a small four pixel-wide color bar) and pops-up on roll over. I’ve found this useful since it is something that I don’t always use. Other new niceties are an improved system font that has great readability and tabs have been made much smaller from the typically roomy Gnome originals.
The launcher appearing too basic originally worried me, but I began to like it because it was so. It is nice that the colorful icons stand out but I wonder if a bit later on they won’t stand out too much. If they matched Oneiric’s notification icons (monotone icons) they might be less distracting (the bright colors attract my eyes easily). I like how the launcher simply explains how many windows belong to an application by arrows to the left of the icon, and which application is focused by an arrow on the right:
The launcher though does have an Achilles heal in it’s auto-hide functionality. This feature probably has it’s reasoning based in Unity’s netbook origins where screen real-estate was the first-most thought. On a normal desktop though, auto-hide functionality takes away the direct route I am typically used to. For one, applications a lot of times open up under the launcher causing the launcher to auto-hide. This meant that I would have to go from a visual representation to a mnemonic one for my open applications. I discovered that I had to put my pointer to the left edge and wait for the launcher to re-appear a good many times. Later on I just moved applications away from the launcher but since most applications launched there this got tedious too. This behavior added a lot of work for me and there is no direct option to fix it.
The application menu on the launcher is very thorough. It’s most useful feature in my opinion being the search box where you can search applications and documents (the cursor even starts there). It is slow to load on this old computer (10s cold start, 3s warm), but I find it so useful I can take the wait.
Red Zone Issues
A few things happened that caused me a good amount of concern. First, after loading up the desktop I installed Gparted to format a USB flash drive (the new Ubuntu Software Center is very nice, though very slow)
only to have Gparted crash on me mid-format. I’ve never seen Gparted crash ever before and this really threw me (Note: running the last several days though no other application has crashed on me except Firefox once [though I haven’t tried Gparted again]). Others bugs were: resuming from suspend failing two times (out of about twenty), and having the mouse freeze up once. The big adjustment I’ve had to make is due a bug (I think) on how I normally perform my tasks: I’ve had to learn to look for a blinking cursor. There is something about Oneiric where I’ve clicked text boxes a good number of times and typed only to have the first keypress missed. I believe this behavior is due to the first keypress actually selecting the text box. I’m not sure why this behavior occurs (never seen or heard of it before) but I hope it gets fixed soon.
Ups and Downs
Up: Desktop now volume-less, leaving it available just for my work files.
Down: Flash installed by default… groan.
Down: Firefox not pgo yet.
Down: Mail Notification requires Thunderbird to be open.
Down: File manager started from launcher opens behind Firefox.
I did manage to get most my problems fixed over the last few days. The speed can be improved a good deal making it about on par with Natty, the dock can become just about as usable as the Gnome panel Application Switcher, and the missing key presses… well.
Tomorrow I’m going to write Ubuntu Oneiric: Tuning the Desktop on a adjustments that I made that improved my desktop experience.
Recently I updated the Ubuntu wiki to add using MPD locally and cleaned the Arch wiki of the same name some. MPD on the Arch wiki is a good source of information but it needs help: organization, some tech things, grammatically… but its holding together for now. Because I am mainly using Ubuntu now it is wiser for me to use MPD locally (clean installs are still recommended over updates (just engineered that way)) and having a home partition simplifies things greatly. Anyways, I’ve added .desktop file information and a fix for PulseAudio too.
REO Speedwagon to Ario MPD-wagon
One of the reasons that the MPD page on Ubuntu’s wiki is so scare, I believe, is because Ubuntu uses Banshee. Banshee is a nice MP3 player with about every feature I’d want from an MP3 player. It also has a really nice layout. For my tastes though, I’d like my MP3 player to be more responsive and lighter (MP3s aren’t incredibly resource intensive files to play) and that’s why I like MPD. Banshee on my eight year old computer takes about thirty seconds to load and has a slight (very slight but noticable to me) delay when changing tracks.
Take a look at this:
This is Ario, a MPD client I hadn’t heard of before. The flow is beautiful, very logical to me. Works great, gonna be using it for a Bit.
I had gotten this laptop as a gift/hand-me-down from someone else. Since the first thing I did was install Linux, I hadn’t thought otherwise that the buttons hadn’t been treated to well: left-click was very stubborn, often missing on some very obvious pushes. The action/response of the button resembled a sticky button. Because right-click was better, I created a script that would switch/toggle left and right click. I toggled it twice to test it (so that it reverted back to the original) when and found that left-click was working normally. Not sure why this fixed the problem and have yet to see another problem like this but I’m glad it’s good again. I created a script to quickly do this then added
.desktop file to have it load on Login. The script:
Then I created a desktop file
~/.config/autostart to start it on Login:
Additional, the touchpad button may revert to it’s original behavior after resuming from sleep. To run the script upon resume it will need to be defined to pm-utils. Put this in
Then make them executable:
sudo chmod +x ~/.config/autostart/touchpad-button-fix.desktop sudo chmod +x /etc/pm/sleep.d/90_touchpad-button-fix
Recently I had a notion after I bought my PS3 about media servers. The PlayStation 3 is pretty neat. Being just a little computer (with a big graphic card) it is able play audio, videos, and display pictures. The PS3 has categories of its’ differing abilities: Music, Video, Game, Network… On the Music, Video and Picture categories I noticed there is an option to find ‘Media Servers’. This got me intrigued: I have a basic wired/wireless home network that connects my PS3, Laptop and Printer (this also is pretty neat, a minuature Cisco router does this seamlessly) and I wondered if the media I had on my laptop could be shared with my PS3. With it I’d be better able to view/listen my media by using my TV, but would it be able to run decently on an eight year old laptop?… Yes.
This is what I was recommended first when I first asked about media servers. I think this may have been because it is the most commonly used media server on Linux. MediaTomb was easy to install, configure (all three media servers I tried are just basic daemons with easy to edit configurations), and didn’t bog down my system when it ran normally. MediaTomb does provide nice thumbnail support and after editing the configuration and restarting the daemon it showed up immediately on my PS3. After running MediaTomb for awhile though however, I gave up using MediaTomb because at times it would get heady. MediaTomb appears to rescan the library from time to time and then it appears to do some parsing of files. Doing this would run up my fan on my laptop which is generally reserved for heavier tasks like working with ffmpeg.
Not sure I want to mention much here as it probably isn’t worth the time. A bit after installing uShare (a day) I discovered it wasn’t being developed anymore. uShare ran nice for one day but after adding a video that wasn’t support (or maybe just a new start to the PS3) The PS3 gave a “A DLNA Protocol Error (501)” that I could never fix. I tried waiting for the library to fully scan on my laptop before turning on the PS3, removed any questionable media files (unsupported codecs, DRMm have reported to cause problems) with no luck. uShare has not been maintained since 2007. When it did run, it ran well and light. uShare does not have support for thumbnails, and it does not monitor (or rescan) directories while running (the daemon will need to be restarted if you add new music for instance).
Never got this to work, but I heard it is fast and cool.
Since I’ve written this article I’ve been using Rygel which is an ok media server. At least it is doing the trick now.
I’ve deleted files before that I wish I could have back and resorted to file saving utilities to try and save them but I have never done this before:
rm -rf ~/ .Arachnophilia
I was doing a bit of spring (fall?) cleaning and as you may have guessed: the space between
.Arachnophilia was not intended. An accidental slip of the thumb caused this and yes, this had caused my computer to delete my whole home directory! I remembered a post I had read at cyberciti and quickly I did
sudo init 1 to drop into single user mode. The post was for recovering a text file though and single user mode didn’t accept any input anyhow so I rebooted into my beloved Parted Magic.
R! and R? (Request!! and Recover?)
Parted Magic now has Clonezilla once again and luckily I had back up several days ago. I wrote down the files I had been working on since then to try and recover. The Arch Wiki has a good page on this. I tried extundelete first and while its probably the best and most through way to recover all files, it recovers the files like this:
ls . | head -n 2 010392 010394
Since the files I’ve been working on were just text files and scripts, Photorec was a better application for this. Photorec is able to analyze and determine certain file types including text files and script files.
Afterward, I was left with directories and files that looked like
recup_dir/f1029394.txt. 14000 and some text files if I remember right. To be able to find which one were the correct ones using
grep is awesome. So quick too. I just had to be able to remember some text within the file and search for it like this:
grep -rn --include=*.txt "the text here" .
Using grep alone instead of combined it with some program like
find is much quicker. The
-r does a recursive search, the
-n will print the line number, and
--include specifies the file type in this case. Piping grep works good for more refined searches like searching for two patterns on a string or removing a string:
grep -rn --include=*.txt "the text here" . | grep -n "this too" grep -rn --include=*.txt "the text here" . | grep -v "string not with this"
I found the files I needed, thankfully, and was able to get them back.
First thing I did after restoring from my backup was to see if I could prevent this again. The answer was pretty simple: move the files to the trash instead. By adding:
alias rm="mv -t ~/.local/share/Trash/files --backup=t --verbose"
~/.bashrc files will get moved to the trash instead of deleted. The
~/.local/share/Trash/file is defined by the freedesktop.org organization so it has interoperability with both KDE and Gnome. With the
mv will rename files with duplicate file names to ones with appended numbers (e.g.
Here’s is a more detailed version in a bash script that includes feedback:
Recently, I decided to get and audiobook to be able to listen to on my MP3 player. I had heard on TV the audible.com commercial that audiobooks could be downloaded and played on my computer or MP3 player. I went to Audible, found the book I wanted and downloaded it. When it started downloading, I noticed the extension was .aa. I hadn’t noticed but below the Download link was a mention of how to import the file to iTunes. The .aa extension is a specially created extension short for Audible Audio and it only works on several types of portable music players that support it. iPods are one, and newer Creative Zen, and SanDisks do too. Having already spent $30 dollars though, I was determined to get this to play on my slightly older MP3 player. Unfortunately, the only way to do this (without spending $20 to $30 on software that removes DRM illegally) is a time-consuming, and somewhat laborious process.
Burn, Burn, Burn… Rip, Rip, Rip
I was a bit thrown off of the MP3 mention:
Saying MP3 player (to me) seems a bit too generic to me and sadly it had me boot up my dusty Windows install :) to be able to start the process. I did bit of research and booting to Windows is necessary – there is no way to convert .aa files in Linux as of yet. I copied my .aa files to the Windows partition, rebooted to Windows, and then installed iTunes. To begin: in iTunes I had to create a new playlist ‘File > New Playlist’, and drag an .aa file to it. I had multiple .aa files so I had to do them separately, one at a time. After that, I did ‘File > Burn Playlist to Disc’, select ‘Gap Between Songs’ as ‘none’, and hit ‘Burn’. This is where the long part of the process takes. For my three part audiobook (three .aa files) the total ~15 hour audiobook spanned 13 discs. I did this for each .aa with a new playlist. I tested a CD after it was done and it played fine but oddly I noticed that iTunes had decided to break the audiobook up into 8 minute tracks – wish it didn’t do. When finished, I decided to rip in Linux. Reboot.
In Linux, Ripit is a good command line tool for ripping CDs. In Ubuntu, install by:
aptget install ripit lame
Lame is required for encoding. Make a new directory for the audiobook. In my case:
mkdir -p ~/Audiobooks/Stephen\ King/Full\ Dark\,\ No\ Stars\ \(Unabridged\) cd ~/Audiobooks/Stephen\ King/Full\ Dark\,\ No\ Stars\ \(Unabridged\)
And begin burning:
ripit --playlist 0 --bitrate 64 --quality 0 --loop 1 --outputdir ~/Audiobooks/Stephen\ King/Full\ Dark\,\ No\ Stars\ \(Unabridged\)
I did a bit of research on this and for most audiobooks the are encoded in 32bit mono but since some have sound effects, 64bit is the way to go. Also using 64bit helps because a bit of quality will be lost in the conversion. This unfortunately makes the MP3s slightly larger (the original files were about 75MB each, afterward they were around 150) but is really the best choice. The other commands here do: playlist 0 (don’t create a playlist), quality 0 (encode slower for slightly better MP3 quality), loop 1 (will eject disc after rip and prompt for a new one), and outputdir (to specify where to put the ripped folders). Ripit automatically queries the FreeDB database for MP3 tagging (there won’t be any valid entries likely) and there is no way to override it. So for each CD I had to enter into it: not to use a DB entry (0 none of the above); to label with the “Default Album…”; and for genre I just hit enter (none). Ripit burned the CDs into folders named ‘Unknown Artist – Unknown Album’ and was smart enough not to overwrite the folders of the same name and sequenced them. When it was done, I had a list like this:
ls -1 Unknown Artist - Unknown Album Unknown Artist - Unknown Album 1 Unknown Artist - Unknown Album 10 Unknown Artist - Unknown Album 11 Unknown Artist - Unknown Album 12 Unknown Artist - Unknown Album 2 Unknown Artist - Unknown Album 3 Unknown Artist - Unknown Album 4 Unknown Artist - Unknown Album 5 Unknown Artist - Unknown Album 6 Unknown Artist - Unknown Album 7 Unknown Artist - Unknown Album 8 Unknown Artist - Unknown Album 9
Put it Together, Polish it Up
To be able to put the audiobook back together, I’d have to join the numerous MP3s back together. Here, I choose to use mp3cat. I was a bit unsure which way to go. The best source I could find to do this was this question at stack overflow. I decided to use mp3cat because here it is said that (later on in post by joelhardi) that mp3wrap “inserts its own custom data format in amongst the MP3 frames (the “wrap” part), which causes issues with playback, particularly on iTunes and iPods.” mp3cat pulls the tag (ID3) information out (which leaves only the binary part of the file) and then joins the MP3s together. To install:
wget http://tomclegg.net/software/mp3cat-0.4.tar.gz tar xvf mp3cat-0.4.tar.gz cd mp3cat-0.4/ make install sudo cp mp3cat /usr/local/bin
For my audiobook, part 1 of my audiobook spanned the first folder (0) to folder 4, part 2 from 5-8, and part 3 from 9 to 12. To concatenate the files back together, I’d have to define the folder span of the MP3s to put together. However, because the folders will are not going to be recognized in the correct order (e.g. folder 10 will come after folder 1 [as recognized by the shell]) I had to zero pad them (e.g. …Album 000, …Album 001,…):
mv Unknown\ Artist\ -\ Unknown\ Album/ Unknown\ Artist\ -\ Unknown\ Album\ 0 rename 's/\d+/sprintf("%03d",$&)/e' * ls -1 Unknown Artist - Unknown Album 000 Unknown Artist - Unknown Album 001 Unknown Artist - Unknown Album 002 ...
The rename command here grabs any number and turns it into a it’s three digit equivalent. Since all my folders had numbering at the end of the name this solution worked good in this case. I created a script to concatenate the MP3s with for ease of use if I ever have to do this again. I had help from some people at the Arch Linux forums to help finish this, particularly rockin turtle. Thanks guys!
To use it for example:
mp3cat-multiplefolders 0 4 "01 Part1"
This did exactly as I wanted except for one thing: I learned that the track length information is also part of the binary file. This would cause some MP3 players to report the length incorrectly thinking that the MP3 was an eight minute track instead of the five or so hours that each actually was. To fix this, the only program I could find was MP3 Diags. This is a great tool to repair damaged MP3s with. Unfortunately, it a GUI utility only and I was hoping for a command line one. To install on Ubuntu: apt-get install mp3diags. I just clicked on 4 to fix everything (which was just the track length issue (bc)).
Tag Line and Submit
I searched online for tag information of the audiobook on both the FreeDB and MusicBrainz databases but had no luck. At this point I knew I’d have to create the audiobook information tags (ID3) manually. Originally I used EasyTag but it created a couple issues afterward when I went back and checked it with MP3 Diags, particularly when adding cover art (problems with frames and such). So it looks like its best to use MP3 Diags tag editor as it had all the basic parts I needed. The tag editor was basic but worked nice and I found the only tricky thing was adding cover art (which I had to be copied to the clipboard and pasted in). The only way I could find to put an image to the clipboard was to find the image in Firefox and copy it from there. The only question I have now is if MP3 Diags correctly assigned it as CoverArt as it has no ability to specify it. However, when playing the files in Banshee the CoverArt is show correctly.
Since this audiobook hadn’t been listed in an ID3 database, I thought I’d put it up in case anyone else was crazy enough to do this :). After looking at FreeDB some more, I read in the forums that they didn’t think this was a place for audiobooks and that the FreeDB was geared toward audio CDs. However, MusicBrainz had audiobook listings so I decided to put it there. Originally I had tried to use MusicBrainz’s own application (Picard) to tag the MP3s with but to tag with Picard the original needs to be a CD (the DiscID creator feature requires a CD to be inserted). However, Picard does have a plugin available called “Add cluster as release” that works. I installed it following the instructions, put the audiobook into a cluster, right-clicked the ‘Album’ > Plugin > Add cluster as release, created an account (required to submit), and filled out the form as best as I could:
Finally, I found the audiobook on Amazon and did ‘Relate to URL’ to add coverart. When done I was told that MusicBrainz has a process that puts new entries into a queue for peer review.
Thoughts and Conclusion
All and all the process went smooth so I’m happily listening to my audiobook now. I’m happy with the quality for the MP3s except for one thing: when I reach the length in the track where the segments were joined I can hear a slight dip in volume. Barely noticeable so I’m not too worried. I also would have liked to be able to fix the track length error from the command line and enter ID3 information from there as well. If anyone knows of anything, I’d appreciate hearing from you. And finally, if anyone knows if it is possible to get audiobooks in MP3 format that would help me quite a bit.
This isn’t exactly Linux related but I thought I’d share my experiences on how I calibrated my TV. A great source on doing this is the LCD TV Buying Guide website. This is a great source on not only why TV’s need to be calibrated but also because it has settings for most popular models. Why do TV’s need to be calibrated? Basically most companies rig their TV settings so they look the best on the show floor. However this leads to things like picture tint, contrast exaggeration and other things that doesn’t reproduce the picture realistically. Even if your TV model doesn’t exist on the website, they say to look at a similar model that will a lot of times provide the settings you need. I found this to be true with one model of TV I had, but not another. Even if they have your model it doesn’t hurt to be a bit skeptical. I found for my model I had to change a few settings a tad bit further. I’m going to print the settings now and then tell you how you can calibrate it too if you’re able to connect your computer to the TV. This TV has the model number LN32C350D1DXZA but is known as the model LN32C350.
|Digital Noise Filter||Off|
|HDMI Black Level||Normal|
The contrast is a bit stretched as to give a more in depth look, 92 is more accurate though.
Another good way to calibrate your TV is to use Lagom’s excellent computer monitor calibration tests. I always use this when I get a new computer monitor and it’s well worth the time if all else fails. Also another option is to use the THX video calibration that you will find on LucasArts movies (usually in the options menu).
Thanks to katzmaier at cnet forums for the basis if the white balance setting. Well that’s about it. If you haven’t messed around before with monitor calibration, I think you’ll find the doing so to be a pleasant experience.
Been liking my new setup after fixing things when my hard drive began to go down. When I installed Arch on this computer, I began to notice problems right away that I couldn’t explain. For instances, it would hang badly. During compiles and heavy-ish workload it would stutter and freeze for most of the time. I originally attributed this to the older ATi card (a ATi Mobility Radeon IGP 345M with 64MB Shared memory) that I had a little trouble setting up. I wasn’t sure if the trouble came from an incorrect configuration or if this legacy-ish card just couldn’t handle the load. When these hangs occurred they would last about five seconds and normally responsive tasks like moving the scrollbar, became unresponsive. I considered that this might also have to do with KDE 4, thinking that this was just too much of a workload for a Pentium 4 2.66 GHz computer with 500 MB. One day, when I went to change my password:
usermod -p secret-password root
and got this interesting response:
usermod: cannot lock /etc/shadow; try again later.
I knew something wasn’t quite right ;). I rebooted into the Parted Magic CD and did an extended S.M.A.R.T. test:
smartctl -t long /dev/sda
And when I looked at the results an hour later:
smartctl -l selftest /dev/sda
I discovered that their were 48 errors that began to start two weeks ago. Thats not good by any stretch of the imagination :). I did a backup right then (that failed) and ordered a new hard drive. The new drive is running great (also did a smartctl test on it when I first got it) and no more hangs and glitches. Turns out that faulty hardware can cause all types of input/output problems through the motherboard. The new drive (I had hoped) I thought might allow me to be able to run KDE again but to no luck. The drive I got is a good drive and considerably better than the previous but programs are just taking too long to load. Even with JFS (which is a great file system to help reduce load) KDE is out of the realm of possibility. I’ve been using LXDE and think I will stick with it. It runs great and has what I need through it… though can be a little boring at times :D.
I recently had a hard disk begin to fail on me. I had had Windows XP on this machine for quite some time and because of the immenent failure I was afraid I had lost it for good (laptop didn’t come with any XP installation disk). So I booted up the install cd, mounted Windows, backup drive, cd’d to Windows, did a:
tar --exclude=Windows-XP.tar.gz -czvpf /mnt/backup/Windows-XP.tar.gz .
After I put in a new hard drive, I extracted it:
tar xvf Windows-XP.tar.gz -C /mnt/win
And all was golden. What surprised me was that on reboot, it booted straight into Windows. My previous hard drive had dual-booted so I thought I’d have to pull out the Window XP Recovery disk and do a fixmbr to test it, but it looks like without an MBR the BIOS is programmed to look for a ntldr file (the Windows bootloader). I guess a lot of BIOS’s are like this.
Anyways, getting everything put back together again with Arch and am pretty happy with it.
Gnome Smaller Icons
For a smaller screen like I got (800×600) having smaller icons helps save a good amount of screen real estate. I figured I wanted them about half the size they normally were. I was using Lxappearance which controls a few Gnome desktop attributes, but not the icon size unfortunately. Lxappearance writes to the gtk configuration file (~/.gtkrc-2.0) and is supposed to be able to inherit additional settings in (/home/user/.gtkrc-2.0-mine) which it wasn’t doing. Had to give up Lxappearance and just manually write to the (~/.gtkrc-2.0) file directly. By adding this I get nice appropriately felt sized icons:
The last update to this installation guide was on April 2009, whether it is accurate still I can not say. Gentoo evolves gradually so for the most part it should be alright, best to use in reference with the Gentoo Handbook.
Installing Gentoo really is a breeze… once it has been done before. This guide is for installing Gentoo in a logical straight-forward manner. I have written everything generically, with necessary links for additional resource, look at the Gentoo Handbook from which this guide derives for more complex set-ups.
I choose to install from a LiveCD . I choose not to use Gentoo’s Minimal Install CD because many distro CD’s create a nice desktop to work on and a web browser can be useful to look up any questions.
Just about any Live CD a person has/likes can be used to install Gentoo with. For beginners it helps if it contains Gparted, an easy tool to partition with. If it doesn’t consider using Gparted’s LiveCD  to first partition the drive.
For security purposes and for convenience, I’d recommend having a partition for the system (root “
/“) and another for “
/home” (aka the users partition).
Linux uses a considerable less amount of memory than Windows or Mac OS X. Users with memory of 2GB or more probably don’t need a swap partition. If you choose not to have a swap partition and need to use swap, a swap file can be created later .
When done partitioning, restart and open the BIOS. Make sure the hardware clock is set to the right time, start the install disk and check the time in the terminal:
Possibly the installCD is using the UTC clock (Universal Time Clock – aka Greenwich Mean Time) for time and date and the clock will be skewed. This is not a problem. The correct settings will be entered on the new installation.
Gentoo will likely detect your network card and setup your network. If it doesn’t try the configuration utility:
You can find the name of your network device with ‘
Remote Install (Optional)
Some people may want to use another computer to install Gentoo from. This can be handy if say the remote machine has a bigger screen or has notes on it you’d like to access.
Begin by starting sshd on the computer to be installed upon:
How to start a daemon differs though per distribution. Give root a password on the machine to be installed on for security purposes:
Type “ifconfig” to find the internet address, then on the remote computer:
Preparing the Storage Unit
Mount the system partition created for the system install:
You can find out the partition you need to use with:
(e.g. /dev/hda3, or /dev/sda4) are examples of what your partition may be named.
A stage3 tarball will be needed now. Stage3 tarballs are tools and a base system that contains just enough necessary to boot your system. Gentoo builds regular stage3 tarballs. You should find the newest on the mirror (contained in /releases/<architecture>/autobuilds and download it.
On the LiveCD the internet networking needs to be working. Learn how to do this (it probably already is) and copy DNS info over to the system that is being built so the network will work on it:
/dev on the system being built:
Enter the new Gentoo environment by changing root:
chroot /mnt/gentoo /bin/bash env-update && source /etc/profile && sleep 2 && export PS1="(chroot) $PS1"
The Portage Tree (the software-repository) will need to be downloaded, this is done by:
Portage is the package installer for Gentoo. Gentoo does have some binary packages (packages pre-built) but mostly Gentoo is about compiling packages specific to your system.
For some reason Gentoo doesn’t add the portage configuration files:
Vim Default Editor (Optional)
I to do my editing with vim, why it’s not installed I don’t know.
Basic Settings – Add Timezone, Locales, Keymap
Set Time Type
Set time type to “local” if dual-booting Windows or Mac OS =<9. Later we’ll add an NTP program the syncs the time on boot, so it might be a good idea to edit “clock_systohc” to “YES” to keep the hardware clock in sync with Network Time Protocol.
Don’t bother to look at “date” as the chroot still uses the CD settings. The effect won’t be seen until you boot into your Gentoo system.
Locales provide information on regional settings – money type, character maps… To see available locales look at:
Set locales in:
Enter your locale. Here’s and example of the United States local setting:
To generate locale, run “locale-gen” and “locale” to check if the correct locale is set.
Keyboard Layout for Console
Available keymaps are in
The make files are basic settings for the system being built. There is the “
make.default” file that is the system profile for building a system. And there is the “
make.conf” file – a user-controlled profile that contains hardware information, properties wanted in packages (USE flags), and adds to or overrides the “
A system profile link to “
make.default” is set by default, make sure it is the correct one for the system:
Link to the most appropriate system profile:
The “desktop” and “server” subdirectories are optional but provide more detailed settings.
Confirm the link is correct:
“Make.conf” sits on top of the system profile choosen, adding and over-riding those settings. The most important item to a successful Gentoo build is providing as complete a “make.conf” as possible.
CHOST defines the basic architecture of the computer – 486,586,PPC… This is important to get right. It is alot of work and dangerous to try and fix this later in the build, research and be sure that it is right one.
CFLAGS are used to define the CPU architecture more specifically.
USE flags define options programs have that can be enabled or disabled. Try “
emerge -pv gcc” to see available flags.
It is nice to install Gentoo and have a reference to USE flags. You can install “gentoolkit” and use equery to find out about USE flags per packages:
The ACCEPT_KEYWORDS variable defines what software branch to use on the system. In Gentoo, there is a stable branch for already tested software and an experimental branch. If user is willing to test more recent software, consider using the testing branch, but expect more time debugging problems. To have Portage use the testing branch, add a ~ in front of the architecture.
VIDEO_CARDS define video card type. This value will tell xorg-server what video card drivers to pull in, and what DRI to use for the X server. Also a video card DRM is required either by selecting it in the kernel, x11-drm package, or the driver may have support for it: e.g. nvidia, ati, intel video card… A few values are available.
INPUT_DEVICES tells xorg-server what basic devices are or will be connected. Items include keyboard, mouse, touchpad…
GENTOO_MIRRORS are used for syncing the portage tree. You can test and add the three fastest mirrors by:
Beginning to Build
There will be a lot of compiling that can take several days to build on older computers. Portage is a well tested and complete compiling system and eases the process, but likely a few bugs will appear. A few tips:
Occasionally during compiling errors can occur. If choosing to use the unstable branch, the newest updates and less tested programs come with it. If there is a problem compiling along the way, check Dibb’s Package Page and revert back to an older version to compile. Or you can install eix (run eix-sync to update database) and do a quick search with “
Check the dependencies of a program to see if a dependency is causing the problem:
Custom USE Flags per Package
Apply custom USE flags for packages (e.g. “
media-sound/lame -gtk” removes the gtk dependencies of lame) and put in:
Read the Developer’s Notes After Emerging Packages
When emerging finishes developers will often leave notes about the program. It may mean more time and work but it is usually a good idea to follow them.
If you miss a note, developer notes are recorded in:
Installing a Kernel
The kernel contains the information of almost all the hardware on the computer and how to run it.
If this is the first time working with a kernel, I’d recommend using the genkernel – a basic all types kernel that will run on most systems.
Otherwise the configuration can be done manually. Manual configuring the kernel can make for a slightly faster boot but isn’t necessary in most cases. Manual configuration can take a long time though and requires alot of research, begin by:
Make sure the “
/usr/src/linux” link matches the downloaded kernel source:
Enter the directory and run “
make menuconfig” to get to the kernel configuration editor.
A Few Tips for Configuring the Kernel
- A good amount of details about the computer can be discovered with “
lspci” (part of the “pciutils” package).
lsusb” can be useful for USB hardware (“
lsusb” is part of the “usbutils” package).
- It’s a good idea to build sound support into the kernel if you need it.
- If unsure about an option, try adding it as a module – these can be specified to load or not load at boot time.
- More information can be found on the kernel in the Gentoo Handbook.
When the kernel config file is finished, compile the kernel, the modules, and install them:
Now the modules that were created need you need to specify which ones you need to boot.
find /lib/modules/ -type f -iname '*.o' -or -iname '*.ko'
Now add the ones needed to
/etc/modules.conf. Gentoo hasn’t added OpenRC to it’s stage3 yet but that should happen soon. When that happens you’ll have to add modules to
/etc/conf.d/modules. See the OpenRC migration guide for details.
The fstab file contains storage devices (drives and partitions), their mount points and any options that will mount at boot time. The “
/etc/fstab” file must be edited manually with the storage units you plan to be use.
An example fstab file:
Unique device nodes (UUID’s) can be used too that can prevent possible device conflicts. Take a look at this.
Setup the “
/etc/mtab” file here too. Usually the system discovers what filesystems are mounted and adds them to this file, but since this isn’t a full system yet, it needs to be created for your bootloader later:
Configuring the Network
Naming the pc is important so people on a network can recognize you. This is done with a hostname. A good practice is to name the computer <owner>-<machine> but people can name them anything – after famous philosophers, your favorite Gentoo developers… Open
Add the hostname boot script to run at startup:
Hostname will also need to be set in “
/etc/hosts” so some programs can become aware of it:
Setting a domainname is primarily used if the computer is to be server or if on a specialized network. Most people can ignore this setting.
Networking with DHCP
Most ISP’s (Internet Service Providers) use dhcp (network discovery) that makes setup easy.
Type “ifconfig” to see if your devices have been recognized. There should be a “lo” (loopback) device (necessary for some programs to access the network) a wired interface (eth0 is a common wired interface) and possibly a wireless interface (eth1, ath0…).
Any wired/wireless device will have to be linked to net.lo for the boot init system to recognize it.
Wait until reboot to see if the wired/wireless devices connect to the internet. Networks that require greater configuration can be done in “
/etc/conf.d/net“, see the Gentoo Documentation links below.
Now the init script needs to be added to load at boot:
Adding System Daemons and Tools
Daemons are constantly running programs that provide necessary services. Each service is listed below, or for ease of install, with one command:
The System Logger logs many events (good for debugging problems):
Cron Daemon schedules programs to run at a certain times.
Indexing Files for quick searches, use slocate to index files:
ACPI (Advanced Configuration and Power Interface) is used by most modern computers for power saving, suspend…
NTP client (Network Time Protocol) keeps the computer in sync with an internet time server.
File System Tools, if using another file system beside ext2/3, you’ll need their tools – xfsprogs, reiserfsprogs, jfsutils.
Check out what boot scripts are to load to be sure you got them all:
Adding Password and User
Root doesn’t have a password yet, so give it one and also create a new user.
If you need to create a regular user (not root) and you made a home partition (
/home) partition, it needs to be mounted now :
Now add a new user. Groups give the user permission to do certain tasks. Add a user to the wheel group to allow the user to ‘su’ to root. Other programs you add later may require you add a group to gain certian permissions (a developer note will usually tell you when you have to do this).
Configuring the Bootloader
A boot loader is required to load Linux. The boot loader should almost always be installed in the Master Boot Record (the first 512k of the disk – not partition). The MBR defines partitions, partition types, labels, whether it’s bootable… Getting this right is very important. Grub is the preferred bootloader, installing makes it the default system bootloader and will boot both Windows and Linux.
Grub nomenclature is different for devices. The first disk it recognizes is called “hd0“, the first partition it sees is “0” So the Linux root partition located on the first hard drive on the first partition, is labeled “hd0,0“.
First, the Grub configuration file (
/boot/grub/grub.conf) needs to be created manually:
Here’s a sample grub configuration file:
Grub also looks for kernel images relatively. So if a person has created a separate
/boot partition the correct path would be “
kernel-2.6.27” instead of “
The only require fields are default, timeout, title, root and kernel. You can also add password protection to the Grub, see Grub Password-Protection.
When done writing the grub file, create a link to it called
menu.lst (this is required because grub looks for this file):
Install Grub the Easy Way
Grub developers recommend using “
grub-install“, this usually works. If it doesn’t you’ll have to install grub manually.
“devincename” needs to be the hard disk your are installing Gentoo on. Often devicenames are “hda”, or “sda”. Grub needs to be installed at the beginning of the disk drive, not the partition.
Install Grub Manually
Now that your basic system is set up. Its a good time to see if it’s installed correctly. We’ll exit chroot here and umount the partitions:
Reboot (command is ‘
reboot‘) and test the new system.
After you see if it boots to a command prompt, I’d recommend rebooting back into the LiveCD, chrooting again, and building from there so you have a browser… to work with.
Now you should update everything. Even though the stage3 is fairly new a good number of changes may have been made already. You can update everything with:
With everything installed, now check that all library links meet their dependencies in case any breaks occured during the build (requires gentoolkit):
Now you can continue with the Gentoo documentation if for say you want to install a desktop.
For more on managing Gentoo take a look at Gentoo Linux Tidbits.
Troubleshooting and Notes
 If a distro CD refuses to boot, trying burning it to a DVD. Some BIOS’s have trouble with Linux CD’s.
 If needing to use swap later a swapfile can be created:
dd if=/dev/zero of=/swapfile bs=1024 count=2097152 mkswap /swapfile swapon /swapfile
 These two warnings will occur when there is no “
/home” partition mounted before adding a new user (i.e. a “/home/user” folder beneath the “/home” partition”):
xauth: timeout in locking authority file No directory, logging in with HOME=/
 With numerous kernel-sources, link “
/usr/src/linux” is best done by:
eselect kernel list eselect kernel set <no.>