February 7, 2014 1 Comment
I suspect Gentoo Linux is a complete mystery to most Linux users, let alone everyone else. It is a Linux distribution I would never recommend to a newcomer to Linux or to someone not used to the command line, as it requires a certain amount of experience and knowledge when something goes wrong. This is especially true for Gentoo’s Testing Branch. Take upgrading Gentoo Testing on my main laptop today as a good example of what I mean…
Unlike most Linux distributions, Gentoo is a ‘source-based distribution’, meaning that the software is compiled and installed on your machine from source code downloaded by Gentoo build scripts called ‘ebuilds’, not installed pre-compiled as in a ‘binary-based distribution’. Furthermore, Gentoo is a ‘rolling distribution’, meaning that you do not periodically install a new release of the operating system, you install it once via the Internet using a lengthy set of commands, and thereafter ‘roll’ it forward by upgrading the installed packages (one, or several at a time) ad infinitum as new versions are released. The upgrading of all installed packages on your machine to their latest versions is called a ‘world update’. For Gentoo Stable you would expect this to be straightforward and trouble-free, and usually it is. But problems are to be expected in the case of Gentoo Testing.
To illustrate the level of detail a user of Gentoo Testing may need to go into, I’ll talk you through what happened to me today when I upgraded the world on my main laptop. I will not explain precisely what each command does; I just want to illustrate the sort of troubleshooting a Gentoo user has to perform from time to time.
I kicked off the world upgrade:
This upgraded several installed packages but the last package in the list to be upgraded, version 6.7.0 of a suite of tools named
mkvtoolnix, failed to compile. The error message displayed in the terminal window left me none the wiser, so I surfed over to the Gentoo Bugzilla Web site and searched for bug reports on
mkvtoolnix. I found Gentoo Bug No. 499332 (‘media-video/mkvtoolnix-6.7.0 should DEPEND on >=dev-lang/ruby-1.9′).
From the title of the bug report I knew I should have a look at the ebuild (an ‘ebuild’ is a script file that Gentoo uses to compile and install a package), so I searched for it on my laptop using the command:
which found the file
/usr/portage/media-video/mkvtoolnix/mkvtoolnix-6.7.0.ebuild, so I used the text editor
nano to look at the ebuild’s code and changed ‘dev-lang/ruby’ to ‘>=dev-lang/ruby-1.9′, then recreated the package manifest:
Gentoo is ‘slotted’ (i.e. different versions of the same package can be installed), so I checked the currently selected version of Ruby:
and changed it to be Ruby version 1.9 as follows:
Then I tried again to install the
and this time it was built and installed without trouble.
Lastly, I used a Gentoo tool to check, and if necessary fix, dependencies:
The output from
revdep-rebuild told me everything was fine, so
revdep-rebuild did not need to rebuild any packages and I did not need to do anything further.
Actually, I probably could have skipped editing the
mkvtoolnix ebuild and just selected Ruby 1.9 using the
eselect tool before trying to re-install
mkvtoolnix-6.7.0, but if
mkvtoolnix depends on Ruby 1.9 or higher then the ebuild for Version 6.7.0 ought to be modified in any case.
If you have read down to here, perhaps now you can see why using Gentoo requires a fair amount of prior knowledge.