I spent a couple of sleepless nights to switch from Gentoo Linux to Fedora Core, since I became a Red Hat employee. Although Fedora Core is really a nice Linux distribution, I still miss the concept of ‘world’ in Gentoo.
When a user installs a Gentoo package, the name of the installed package is appended the ‘world’ file. What’s interesting is that the dependencies of the installed package are not added to the ‘world’ file. What happens when you uninstall the package registered in the world file is that the name of the package is removed. It’s very simple, but it’s powerful when you don’t want unnecessary packages take up disk space. (Yeah, I am a paranoid. 🙂
Now, from the world file, we know what packages were installed by our own request and what were installed just as dependencies, so Gentoo can identify the unnecessary packages that is safe to be removed. Consequently, running ‘emerge --depclean‘ cleans up all the unnecessary packages.
Can’t we do this in Fedora Core or any RPM-based Linux distribution? The answer is yes.
First off, you have to install ‘rpmorphan‘. rpmorphan has the ‘keep’ file which does the same role with the ‘world’ file. It’s located at /var/lib/rpmorphan/keep, which should be empty initially.
Let’s try to find what packages are unnecessary:
$ rpmorphan -all
Unfortunately, you will see so many essential packages that you want to keep. It’s just because you didn’t add them to the ‘keep’ file yet. For example, you can add ‘gnome-terminal’ to the keep file like the following:
$ rpmorphan -add-keep gnome-terminal
Once you finished adding all the packages that you want to keep to the keep file, now you are ready to run the following shell script file (rpmdepclean).
while true; do
ORPHANS1="`rpmorphan --all | xargs echo`"
if [ -n "$ORPHANS1" ]; then
echo -n "$ORPHANS1 "
yum -q -y remove $ORPHANS1 > /dev/null 2>&1 || exit 1
ORPHANS2="`rpmorphan --guess-all | xargs echo`"
if [ -n "$ORPHANS2" ]; then
echo -n "$ORPHANS2 "
yum -q -y remove $ORPHANS2 > /dev/null 2>&1 || exit 1
if [ -z "$ORPHANS1" ] && [ -z "$ORPHANS2" ]; then
Please double-check you added required packages to the keep file. Otherwise, things can go screwed up. You have been warned. If you are in doubt, you can always run yum remove manually, which is safer.
Finally, I’ve found the text editor that fits exactly to me, highly-customizable, feature-rich and fast-launching. It’s called ‘SciTE‘. Because the command is not so comfortable to type, I created two symbolic links after uninstalling gedit.
$ ln -s /usr/bin/scite notepad
$ ln -s /usr/bin/scite gedit
The following is my ~/.SciTEUser.properties:
# Brace highlight
find.files=*.java *.xml *.txt *.c *.h *.cpp *.hpp
command.print.*=paps --font="Monospace 10" "$(FileNameExt)" | lpr
Please note that I chose Liberation Mono as the default font. You might want to use other alternatives like DejaVu Sans Mono, Monaco, and Consolas.
… is probably because I am having really great time in Red Hat. There was a Remoting team meeting in Switzerland last month and I also attended the October new hire orientation in Singapore. Both countries were fantastic to me. People, city … almost everything. Especially, I can’t forget the moment with my wife in Switzerland. I’d love to visit there again whenever there’s a chance.
Working at remote is much more exciting than I expected. People might think working at remote makes one lazy, but it’s exactly opposite. I get to keep watching myself to make sure that I am not wasting time. Although it is not really comfortable that all my teammates and manager are not in a close time zone (two in the US and one in Switzerland), it’s also one of the factors that make me do my best to catch up all the events occurring in the division. I must admit it’s somewhat difficult to catch up everything, but hopefully I will be used to this new world, and moreover, it means that Red Hat / JBoss is a very dynamic workplace that will accelerate my experience.
MINA community is also growing up very nicely. Hopefully we will be able to release the first milestone of 2.0.0 before OSSummit Asia 2007, where I will attend as a speaker. (and that might be why I am working so hard on MINA. 😉
In the middle of the fast-flowing time, I often think about many things I have never thought about before. The thoughts are somewhat fragmented to describe, but it is sure that it’s about ‘growing up’ – becoming a better and more mature person. At least I hope so.