I fixed a bug in yum

Well, it was a tiny syntax error in Fedora 17 alpha. For some reason Presto had a tiny typo where a hyphen/minus “-” was used instead of an underscore “_”. The full traceback allowed me to get the file and line number where the error was. I just visually scanned the surrounding code to see what could be wrong. That’s when I realized that replacing the unary minus with the underscore would solve the problem. I made the change and ran su -c 'yum update' again and the problem had been resolved. So a big win for the technologies and people involved.

A win for Python because I was able to make a change in the source and then run the code without having to know about or go through the linking, compiling, executing process.

A win for open source because I was able to view and modify the source code.

A win for Fedora because they are using Python, which made it so easy for me to fix a tiny bug without breaking updates for me.

I’d also like to add that I needed to do something similar for work. Something was broken and I had to read through some Ruby files. Although the syntax didn’t make too much sense to me, I was able to judge what changes I needed to make. I made them and worked around some bugs until they could be fixed. So hooray for Ruby as well.

Mouse Scroll Wheel Doesn’t Work in Fedora 17 in VirtualBox 4.1.10

I installed Fedora 17 alpha (KDE as my desktop environment) in VirtualBox but the mouse scroll wheel didn’t work. It was a regular two-button mouse with a scroll wheel. I had also installed VirtualBox Guest Additions. Thanks to Scroll wheel in debian guest after updating virtualbox from 3.x to 4.x, I was able to get the scroll wheel to work.

su -
vim /usr/share/X11/xorg.conf.d/50-vmmouse.conf

Now make sure 50-vmmouse.conf looks like the following.


Section "InputClass"
        Identifier      "vmmouse"
        MatchIsPointer  "on"
        MatchTag        "vmmouse"
        Driver          "vmmouse"
        Option          "Buttons" "5"
        Option          "ZAxisMapping" "4 5"
EndSection

Save file and quit vim. Reboot the machine and your mouse wheel should now work.

Remember to re-install VirtualBox Guest Additions (VBGA) after updating your kernel and then reboot. Otherwise the wheel stops working until you re-install VBGA.

Politics and Pragmatism in Using Linux Distributions

Recently I’ve been making decisions on which Linux distribution deserves my support when I write how-to or similar articles. I started my journey with Ubuntu. Out of all, this is the distribution closest to my heart and may be it always will be. I ventured into CentOS for work-related reasons and found it to be a workhorse. I forayed into Fedora on a netbook with some success. I have had to use a bit of SLES for more work-related stuff. And I have been attracted to, used, and migrated businesses to Debian. Both politics and pragmatism have played a part each time I used a distribution. And thus this post.

You can see from my recent posts that I have made a decision to go with Fedora. It was mostly for political (philosophical) reasons but also for pragmatism (cutting-edge technology, etc.). When the time came for me to choose something other than Debian or Ubuntu, I chose Fedora over openSUSE mainly for philosophical reasons. And I’ve been re-evaluating my decision ever since.

I am very happy I picked Fedora. It’s making bold decisions in the future direction of a Linux distribution, especially with the two most controversial and highly-debated steps: /usr unification and systemd. I have started using Fedora 17 alpha and find systemd a joy to use. I only care about systemctl enable/disable or systemctl start/stop as a user (or sysadmin) and it does exactly what I want it to. Much better than chkconfig, service or invoke-rc.d. The /usr unification hasn’t affected me so much so far. Package availability has also been excellent for the server use cases to which I have put Fedora 17.

Fedora seems like a good fit for me for now. But a second question still remains: which distribution should I recommend to others for home/workstation use when asked? My gut feeling is Ubuntu because they do a lot of good work for this sort of user. I’m also well-versed in it so I can provide ample support if required. But I also want to provide a different answer for users who don’t want to use Ubuntu. A very valid answer for this would be Linux Mint but it’s so similar to Ubuntu that it might not be an option in some cases. This leaves a few distributions that I would really like others to use (if only because they’ll come to me for answers most of the time).

The first distribution is openSUSE. Yes, I have some misgivings about the whole openSUSE, SUSE, and Microsoft triangle. But purely on technical merits is openSUSE good enough to replace Ubuntu as my default recommendation for others? This is a question I have asked myself and the one I’ll try to answer over the next few months. I’ve decided to be pragmatic about this particular case rather than political. I’m willing to be pragmatic if openSUSE can bring in new users to Linux like Ubuntu has done for a while. It’s a tall order but openSUSE looks like a good candidate from where I stand.

The other distribution I may recommend is Mageia. It’s on its way to the second release. These people have a very pragmatic, user-centric approach to their distribution and them being a community allays many misgivings I have about openSUSE. Technically they also appear to be sure-footed and thus deserve the support of people like me. Maybe Mageia can serve Ubuntu’s role of bring new users to Linux.

I wouldn’t recommend Fedora because of two things: (a) hardware support can mean using other repositories (such as RPMfusion); and (b) it’s too bleeding-edge to keep users on it for a while without too many issues.

Now that I have to give up my moral high ground, how does it feel? Very liberating, actually. When I use FreeBSD license instead of GPL, I consider the freedom of people over freedom of code. So why should I take such hard stances when it comes to Linux? People should matter more than code or a distribution. If Ubuntu or openSUSE are not ideal Linux ecosystem participants, they are productive and willing participants nonetheless. It may be about time I gave up on idealism and focus more on doing good for more people.

Install VirtualBox Guest Additions in Fedora

I was running Fedora 17 alpha guest on a Windows 7 host (VirtualBox version 4.1.10) and wanted to install VirtualBox Guest Additions. From the VM window menu click Devices and select Install Guest Additions. This will mount a CD under /media. Open a terminal and run the following commands.

codeghar@codeghar:~$ su -

root@codeghar:/root$ yum install gcc kernel-devel

root@codeghar:/root$ cd /media/VBOXADDITIONS_4.1.10_76836/

root@codeghar:/root$ ./VBoxLinuxAdditions.run

root@codeghar:/root$ reboot

Reboot the system and you should be good to go.

Remember to re-install VirtualBox Guest Additions (VBGA) after updating/upgrading your kernel and then reboot. Otherwise some features or custom settings might not work.

Fedora 17 Post Install Checklist

I installed Fedora 17 alpha recently to really learn the ins and outs of the Fedora/RHEL ecosystem. I installed the minimal version with no GUI.

Enable Network

By default Fedora 17 had network disabled. I ran the following commands to get it running.

su -c 'systemctl enable network.service'
su -c 'systemctl start network.service'

By default it’ll pick up an IP using DHCP. If you want to set static IP address, modify your /etc/sysconfig/network-scripts/ifcfg-eth0 (or equivalent) file.

Install Applications

There are some applications I use that are not installed by default. Here’s a list of those applications and how to install them.

  • presto su -c 'yum install yum-presto'
  • vim su -c 'yum install vim'
  • scp su -c 'yum install openssh-clients'
  • ntpd su -c 'yum install ntp'
  • nslookup su -c 'yum install bind-utils'
  • whois su -c 'yum install whois'

Disable SELinux

No matter how much I want to learn SELinux, I very seldom get a chance to do so. Meanwhile, SELinux can sometimes cause headaches so I like to change it from ‘enforcing’ to ‘permissive’. Remember that doing so may cause your system to be less secure.

su -c 'vim /etc/selinux/config'

Change the line “SELINUX=enforcing” to “SELINUX=permissive”, save the file, quit vim, and then reboot the server.

Full Path in bash Command Prompt

Fedora 17′s bash displays only the current directory in the prompt. For example,

[codeghar@codeghar curr_dir]$

This can be confusing sometimes so I prefer to show the whole path. For example,

[codeghar@codeghar /path/to/curr_dir]$

To make this change globally (regular users and root), change the /etc/bashrc file.

su -

vim /etc/bashrc

Find the line similar to the one below:

[ "$PS1" = "\\s-\\v\\\$ " ] && PS1="[\u@\h \W]\\$ "

Note the use of \W which indicates that only the current directory should be displayed. Change it to \w and it’ll show the full path. For example,

[ "$PS1" = "\\s-\\v\\\$ " ] && PS1="[\u@\h \w]\\$ "

Save the file and quit vim. Log out and then log in again for the change to take effect. Now your prompt should show the full path.

If you only want this change for yourself, change the ~/.bashrc file.

vim /home/codeghar/.bashrc

In this file add the following line:

export PS1="[\u@\h \w]\\$ "

Save and quit vim. Log out and then log in again for the change to take effect. Now your prompt should show the full path.

KDE Session

If you’re using KDE and don’t want it to load the last session when you login, remember to go to System Settings, Session Management, and change the default to not remember the last session.

I’m with Fedora in 2012

I posted a few months ago that I had gone back to Debian. Recently, though, I wanted to try out something different. The most important thing for me was the philosophy of the distribution. I believe that Debian is a true torch bearer for free and open source software while being pragmatic about proprietary stuff. Ubuntu gives off many mixed signals. OpenSUSE is technically a very good distribution but I fear that any contribution I make to it (tutorials, evangelism, etc.) will end up in SUSE, a product that is not the best representation of the Linux community. Fedora is very similar to Debian, albeit a bit stricter in its support for free and open source software.

Fedora has lots of good attributes that made me choose it for this year. The biggest issue for me was that any contribution I can make to it should help the general Linux community. Fedora’s primary downstream, Red Hat Enterprise Linux, is a product that gives back to the Linux ecosystem much more than some others. So I would rather use Fedora and help RHEL than use OpenSUSE and help SUSE.

I saw a post on reddit recently (Is it legal to sell computers with Ubuntu pre-installed?) and it prompted me to look at the trademark policies of Ubuntu, Debian, and Fedora. Fedora has a very open and friendly policy when compared to Ubuntu’s policy.

Looking at marketing, OpenSUSE talking points are very convincing. Similarly, Fedora’s talking points also give a wonderful overview of the project’s philosophy, goals, and methods. In the end I chose the downstream product as the defining choice (RHEL over SUSE).

Fedora is a community much like Debian. Red Hat does sponsor Fedora but I have not yet seen any overt influence on the direction of Fedora by Red Hat. Ubuntu is a collaboration between a community and a corporate entity (Canonical), with the corporate wing having an overwhelming say in the direction of the project. OpenSUSE is a community but how independent it is from corporate (Novell, SUSE, AttachMate, Microsoft) influence is difficult to understand as an outsider (although I’m certainly interested in learning more about it).

Debian has a very thorough process of becoming a maintainer. Fedora has a similar process to join the package collection maintainers. Both Ubuntu (PPA) and OpenSUSE (OBS) have a lower bar to entry to becoming a package maintainer. But they also have an issue of trust; can I trust the person who created this package? Mostly the answer is no because the maintainer has not gone through the vetting process that Debian and Fedora maintainers go through.

Fedora is known to stick as close to upstream as possible, with minimal patching when required. This unlike Debian and Ubuntu because they are both known to heavily patch upstream code. This means that Fedora gives you a close experience to what the original authors created.

Fedora has almost the same number of packages as Debian (for those that I’m interested in) but has a widely different strategy: cutting-edge versus stable. I also like the quick release cycle of 6 months where new software is released piecemeal (firewalld, systemd, etc.) or held off (BTRFS as default) if it still isn’t good enough.

Finally, I just love the Fedora logo and the logos for its foundations (freedom, friends, features, and first). I highly rate the logos of Fedora and FreeBSD. Debian’s logo is too simple for my taste, Ubuntu has a distinctive and recognizable logo, and OpenSUSE could have at least attempted to make Geeko prettier.

As I use Fedora more and more, I’ll come to know some of its shortcomings and I’ll try to point them out for the benefit of others. One that I came across right off the bat is SELinux. It’s not a shortcoming per se but its complexity causes more headaches for server use than a beginner can handle outright. With time, of course, I’ll learn to use and love it.

I want to give OpenSUSE an honest try but the misgivings about the ulterior motives of its downstream prevents me from using it wholeheartedly. I have said this before that OpenSUSE needs to become independent and then others like me (on the fence) will give it the support it deserves.

I plan to use Fedora as a server although it’s not meant for server use. They are not going to be mission critical servers but hobby projects just to learn how the future RHEL might look and work. I want to push myself in learning something vastly different from the Debian and Ubuntu world and I believe Fedora is a good first step.

Follow

Get every new post delivered to your Inbox.