If you’ve had the same Ubuntu installation for a while and have just been upgrading to newer releases, you may have noticed that a lot of older kernel versions are piling up in your grub menu and on your system.

How to remove older kernels from Ubuntu

This can be done by using the Synaptic Package Manager, however I will show you how it is done on the command line.

First, find out what kernel you are currently running:

# uname -a

Linux foogazi 2.6.24-19-generic #1 SMP Wed Jun 18 14:43:41 UTC 2008 i686 GNU/Linux

From the output you can see that you are currently using the 2.6.24-19-generic kernel.

Next, let’s take a look at all of the kernel versions you have installed:

# dpkg -l | grep linux-headers-*


linux-headers-2.6.24-16                    2.6.24-16.30                                       Header files related to Linux kernel version
linux-headers-2.6.24-16-generic            2.6.24-16.30                                       Linux kernel headers for version 2.6.24 on x
linux-headers-2.6.24-19                    2.6.24-19.34                                       Header files related to Linux kernel version
linux-headers-2.6.24-19-generic            2.6.24-19.34                                       Linux kernel headers for version 2.6.24 on x
linux-headers-generic                      2.6.24.19.21                                       Generic Linux kernel headers

Now all you need to do is remove the old versions with apt-get.  Since we’ve noted with uname -a that we are currently running 2.6.24-19-generic we want to make sure we do not remove it.  All of the others can be removed.

# sudo apt-get remove linux-headers-2.6.24-16 linux-headers-2.6.24-16-generic

Now the older kernels are gone.  Repeat the apt-get remove step to remove any others you may have.  Remember to not remove your current kernel.

Important note: It is a good idea to keep at least one old kernel version around in case anything breaks in your current kernel and you are unable to boot into it.  An example would be that you boot into your current kernel but recieve a kernel panic.  With an old kernel still available you can reboot the computer and select the older kernel version from the Grub menu and still access your system to find out what is going on.

Popularity: 25% [?]

Are Linux Users More Productive?

I’ve been wondering if using Linux actually makes me more productive.  I can think of a few reasons why a Linux user may be more productive but I can also counter those reasons with ways running Linux can make you unproductive.  Ultimately, I think it doesn’t really matter what operating system you’re running, your level of productivity mostly depends on your motivation and what you choose to do with your time.

Why Linux users may be more productive

Linux offers a variety of command line and desktop applications for just about anything you’re wanting to accomplish.  There are all kinds of reasons people may argue that using Linux allows them to be more productive.  Here are a few I can think of:

  • Less gaming distractions – Though it’s not necessarily a good thing that Linux has no native computer games worthy enough of distracting users and bringing productivity levels down, it is indeed a fact; using Linux will definitely allow you to be more productive without the distraction of your favorite computer game icon sitting on the desktop.
  • Highly customizable – The Linux desktop is completely customizable to your liking.  You’re able to place things wherever you want, run multiple desktops, easily create scripts that automate simple tasks for you, etc.  All of these things can indeed boost a users productivity if used correctly.
  • Viruses – In Windows, it’s safe to say that a considerable amount of time is spent either blocking, removing, or preventing viruses and spyware.  It’s like walking down a dark alley in a bad neighborhood all alone, you have to be on the defensive and make sure nobody is going to jump out and get you.  In Linux, you really don’t have to worry about catching viruses over the Internet.  The fact that Linux is not as highly targeted as Windows allows you to go about your business without being on that defensive, which in turn allows for more productivity.
  • System Maintenance – On a Linux desktop there really is not much system maintenance that needs to be performed on a regular basis.  With the exception of security updates and recommended application updates on a distribution like Ubuntu, you really have no required maintenance that you have to perform.  On an operating system like Windows XP or Vista, if you want your system to remain running seamlessly you’re forced to do things like defrag your hard drive.  If you have a large hard drive, you know that defraging completely halts all other productivity as you really can’t do anything else while the defrag is taking place.

Additionally, here are a few tools and applications in Linux that help productivity:

  • BASH
  • Tab completion
  • APT
  • GNU/Screen

Why Linux users may be less productive

Just as there are a lot of arguments as to why Linux users may be more productive, I can think of reasons why Linux users may produce less.  Lets take a look at a couple reasons Linux users may be less productive.

  • Tweaking and Customizing – Just as it can allow you more productivity, the ability to customize and tweak your Linux desktop can also work against you.  I can count how many people in the community I speak with that are obsessed with tweaking their desktop over and over.  This is a real productivity killer and can become an addicition for some.
  • Learning and exploring – Sometimes a new Linux user can find themselves getting lost in the exploration and learning process Linux.  Once you start understanding Linux you tend to want to know more and more about how everything little thing works.  A great example of this is that you are wanting to do some scientific research for a school project, so you install an application you found on the web, open it, but it crashes.  Now you’re in investigative mode and trying to find out why it is crashing.  Checking logs, checking mailing lists, searching forums, etc.  Eventually a few hours have gone by and you really haven’t accomplished what you set out to do even if you do indeed get the application up and running.

Overall, it’s my opinion that productivity comes from the user and not the operating system.  All operating systems and distributions have the tools and the ability for you to create a producitive work environment, it’s simply up to you to do so.

Popularity: 4% [?]

I don’t know about you but I find the login sound on Ubuntu pretty annoying. Here is a quick, nice and easy way to disable it.

How to disable Ubuntu Login and Logout sounds

Navigate to System > Preferences > Sound then click the Sounds tab.

Disable Login and Logout Sound on Ubuntu

Set the Log Out and Log In sounds to “No Sound” to disable the login and logout sounds in Ubuntu.

Popularity: 5% [?]

It may be a bold statement to make, especially considering the fact that I’m by far no Ubuntu fanboy.  My background in Linux began with Slackware, and I’ve always preferred the more simplistic distributions that allow you to have complete control over what goes on.  However, as the demand and the user base for Linux grows, it’s obvious that people want simplicity in another way; people want an operating system that is free and easy to install, configure, and most of all, use.  Ubuntu has answered the calling for a Linux desktop that moms, dads and grandmas alike can all use with a little openness to a change in the overall look and feel.  These are my arguments as to why I believe Ubuntu is superior to all other Linux distributions available today.

The ability to try everything out

The fact that Ubuntu has a live CD built right into the installation disk allows users to actually test out the basics and get a feel for Ubuntu right from the start without installing anything to your disk.  With all of the distros available to choose from these days it’s important for a distro to offer a straightforward, easy to use live CD option.

Ease of installation

Ubuntu offers users very simple methods of installation. Whether you choose to install from windows using wubi, dual boot, or single boot, every option is easily configurable and straight forward.  You don’t have to be a tech geek or have understanding of partitions and swap space in order to install Ubuntu.

Ease of upgrades

Since Ubuntu is based off Debian and uses the apt package manager, upgrades to new versions as well as security updates are simple to apply requiring almost no interaction apart from entering a root password.  It’s important to offer users an easy way to update packages for security as well as upgrade to a newer version when one is available.  Upgrading Ubuntu from one version to the latest version is as easy as pie; a few clicks, a little waiting, and a system restart and you’re on the newest version.

Community

Having a community that can offer support is crucial for any Linux distribution. It’s what makes or breaks any Linux project. Ubuntu has a great community for both development and support.  The Ubuntu forums are full of great questions and answers from both new Linux users and old timers.  The IRC channel on freenode is also a great place to hang out and ask questions or even provide your own assistance to those that need it.

Ubuntu just works

Taking into account that Ubuntu is just a distibution of Linux and it is actually Linux that “just works” it is important to note the fact that the the ubuntu developers have done in excellent job in creating a Linux distrobution that just works right out of the box. From plugging in third party devices such as digital cameras and usb drives, easy to use wireless, to the ability and awareness of using restricted device drivers if you wish makes Ubuntu great for people of all skillsets.

Popularity: 4% [?]

The Best Way To Learn Linux

Dan Craciun posted a nice article on his blog titled What is the best way to learn linux? that got me thinking just what some of the best ways to learn Linux are.  Dan and I agree that reading documentation is one of the best ways to learn Linux in general.

Dan uses the famous quote “give a man a fish and he will have food for one day, teach the same man how to fish and he will have food for his entire life” which really does make sense in relation to learning Linux.  A lot of new Linux users will ask a question on a forum or in an IRC chat room and demand or expect a direct answer.  However, a lot of times what they end up getting is a way to solve their problem, not exactly how to do it.  There is a general consensus among old time and advanced Linux users that it’s important to read documentation and manuals if you want answers.

Here are some of the best ways to learn Linux:

  • Start off on the command line to learn the true way of Linux before you start on the desktop and use GUI tools to do everything for you.  Remember each GUI tool you use is just a front end for command line tools that can accomplish the same thing.
  • Read manuals and ask a lot of questions.  Be sure you’re asking the right questions though. Research before you ask.  Don’t bother to ask questions to something that you could easily find by spending 5 minutes searching Google.
  • Subscribe to Linux blogs and participate in Linux forums.
  • Explore your options by trying different Linux distributions.

Popularity: 7% [?]

If you have a video card capable of running a composition manager like Compiz, you may be interested in running the Avant Window Navigator for Ubuntu.  This document will explain the steps you need to take to install and configure the Avant Window Navigator on Ubuntu 8.04.

The Avant Window Navigator (AWN/Awn) is a dock-like navigation bar for the Linux desktop that positions itself at the bottom of the screen. It can be used to keep track of open windows and behaves like a normal window list. It is very similar to the menu doc in Mac OSX Leopard.

First, you need to make sure you have composition turned on.  In Ubuntu, navigate to the System > Preferences > Appearance > Visual Effects tab.  Make sure that visual effects is enabled.

Enable Compiz in Ubuntu

Now that we know composition is enabled, we can go ahead and install AWN.

Installing Avant Window Navigator

First we need to make sure that you have the backports repository enabled in your /etc/apt/sources.list.  This can be done via the GUI, but I am going to demonstrate how to edit the file from the command line, the true Linux way.

Edit the /etc/apt/sources.list file with a text editor such as vi or nano.

# nano /etc/apt/sources.list

Locate the following lines:

# deb http://us.archive.ubuntu.com/ubuntu/ hardy-backports main restricted universe multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ hardy-backports main restricted universe multiverse

Uncomment these by removing the pound (#) signs on both lines.  It should now look like this:

deb http://us.archive.ubuntu.com/ubuntu/ hardy-backports main restricted universe multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ hardy-backports main restricted universe multiverse

Save the file in nano by hitting ^X then Y to accept the changes.

Now that we have allowed apt to search the backports repository, we have to tell apt-get to update the repository list.

# sudo apt-get update

Now we can install Avant Window Navigator:

# sudo apt-get install avant-window-navigator

apt-get will install a few other dependencies, such as awn manager.  Awn Manager is a tool that allows you to configure your dock.

Now that AWN is installed, you should be able to run it by going to:

Applications > Accesories > Avant Window Navigator

You should now see the AWN dock at the bottom of your screen.

Configuring Avant Window Navigator

To configure AWN to your liking, open up the Awn Manager by navigating to System > Preferences > Awn Manager

AWN Manager

You’ll notice that the Awn Manager allows you to configure many aspects of the dock.  From here, you can add applets, launchers, different themes, and modify the apperance and behavior of the dock.  Hint: A nice tip you should know is that you can add apps to the dock by navigating to the Applications menu and simply dragging applications into the dock in real time.

How to get Avant Window Navigator to run at start up

If you want AWN to run during startup, all you have to do is add it to your startup sessions.

Navigate to System > Preferences > Sessions

Under the Startup Programs tab, click +Add and fill out the New Startup Program dialog box:

Add AWN to Startup Programs

Awn should now start up during after your computer boots.

Further AWN Information

To find out more about the Avant Window Navigator visit the AWN Wiki and check out the AWN Frequently Asked Questions.

Popularity: 11% [?]

Quickzi: How To Delete Bash History

If you want to delete your bash history, there are a few options you have.  First you must understand that the history of your bash session is stored into RAM and then written to ~/.bash_history when you log out of the bash session.  So even if you delete the ~/.bash_history file, your current bash session will still be written to history once you log out.

Delete bash history

To delete the bash history for your current session as well as old sessions, you should do two things:

Delete the .bash_history file:

# rm -rf ~/.bash_history

Clear the current history stored in RAM:

# history -c

Stop writing to .bash_history for good

If you don’t want to log any history for good, you can do one of two things; turn it off for all users, or turn off logging history for a single user.

Turn off bash history for all users:

Append “unset HISTFILE” to /etc/profile:

# echo "unset HISTFILE" >> /etc/profile

Turn off bash history for a specific user:

Append “unset HISTFILE” to /home/USER/.bash_profile:

# echo "unset HISTFILE" >> /home/USER/.bash_profile

That’s it! Now you have successfully deleted the bash history and stopped logging to bash history.

Popularity: 34% [?]

Here is a quick tip on how to use sed to replace a line in a text file from the command line, without opening it.

Replace a Line in a File

First, replace the text you want with sed and output it into a temporary file to ensure that it is correct:

# sed -e 's/original-text/new-text/' textFile > newFile

View the newFile and make sure that the line is correctly replaced:

# more newFile

Overwrite the textFile with the newFile:

# mv newFile textFile

Popularity: 3% [?]

Here is a quick tip on how to use sed to add a line into the middle of a text file from the command line, without opening it.

To clarify, let’s say you have a text file that has four lines:

Line1Text
Line2Text
Line3Text
Line4Text

Using sed, you can append a line anywhere you want with a simple command without even knowing the line numbers.

Add a Line into the Middle of a Text File

For this example, lets say we want to append a new line under Line3Text:

# sed '/^Line3Text/a NewLineText' textFile > newFile

You’ll notice that we output the results to a newFile so that we can make sure the new line appended correctly before overwriting the original file.  If you check the newFile, you should see a correct output, then you can overwrite the original textFile.

# mv newFile textFile

Popularity: 4% [?]

The Linux Foundation and kernel developers alike have finally decided to speak out by issuing a statement on closed source drivers, recommending “that hardware manufacturers provide open source kernel modules.”

Here’s the entire statement:

The Linux Foundation recommends that hardware manufacturers provide open source kernel modules. The open source nature of Linux is intrinsic to its success. We encourage manufacturers to work with the kernel community to provide open source kernel modules in order to enable their users and themselves to take advantage of the considerable benefits that Linux makes possible. We agree with the Linux kernel developers that vendors who provide closed-source kernel modules force their customers to give up these key Linux advantages. We urge all vendors to adopt a policy of supporting their customers on Linux with open-source kernel modules.

Background Materials

There is no telling if the hardware manufacturers will take notice and actually adhere to the Linux Foundation’s statement, but at least they will know where the Linux community developers stand.  It’s obvious as to why the hardware companies don’t want to provide open source drivers, in order to remain competitive, but there has to be a tipping point at some point.

Visit the Linux Foundation website for more information.

Popularity: 3% [?]