Raj Agrawal

Learnings from software and technology

  • Home
  • Technology
  • Software
  • Work
  • Play

Connect

  • GitHub
  • LinkedIn
  • YouTube

Powered by Genesis

You are here: Home / Archives for ubuntu

Ubuntu is still half baked. It cannot replace Windows or OS X!

November 10, 2012 by Raj Agrawal 9 Comments

Note – This article was written in the year 2012 and does not reflect the current state of Ubuntu.

RANT – My peers have asserted – ‘I have downloaded my free OS. I am ditching Windows and switching to Ubuntu’. As a technology enthusiast, it’s always a moment of excitement in a open source initiative, particularly when it’s an Operating System. Having said that, Ubuntu left me disappointed.

OS X vs Linux vs Windows

There are plenty of free Linux derivatives around to try. They’re like delicious-and-ready-to-eat-candies lying around the web. I’ve tried a few of them (Sabayon, Open SUSE, Mandriva, Fedora and a few more), and among the list, I particularly liked Damn Small Linux. It’s cute and only 50MB in size. It doesn’t raise many expectations as a user nor does it explicitly claim/ imply to be a desktop replacement.

Apparently, Ubuntu is popularly believed to be a complete desktop replacement. And with so many too-good-to-be-true words and promotions about Ubuntu (back in the days), I thought ‘Ubuntu could be my new permanent OS’. Sadly, that didn’t work out. Even though my computer’s (Macbook Pro 13 Mid-2010) hardware specifications are more than recommended for Ubuntu; it was still very sluggish. The setting panels and apps took their own time to execute. The default pack of applications still include Firefox browser, which is just another layer to discomfort. And it’s not just my computer – it’s a known problem. With such minor usability issues on hand, it’s too soon to claim Ubuntu as a desktop replacement. It isn’t completely reliable yet.

Update – There are mixed experiences regarding the ‘sluggish-ness’ issue. Some users are having no problems, while some are facing severe performance issues even on systems with enough hardware specifications. A google search on this issue will help you undersand more.

Windows and OS X have been under closed development much before Ubuntu was born. Due to Ubuntu’s open source nature, it is maintained by a large developer community from around the world and it still has time grow into a complete and reliable operating system.

Sluggishness and incompatibility does NOT fit in the criteria of a reliable operating system. Ubuntu is NOT YET a suitable Windows/ OS X replacement.

Filed Under: Technology Tagged With: ubuntu, windows

Manually Install Software/ Apps On Any Linux Distro

January 26, 2012 by Raj Agrawal 1 Comment

Most of windows users who switch to Linux are befuddled when they download a software and end up with a file with extensions like “tar.gz” or “tar.bz2” contrary to straight away setups, as seen on Windows OS “.exe” or “.msi”.

Windows OS users are accustomed to installing software by downloading a setup package, and following through the installation wizard and complete the installation like a PRO. On Linux the story is quite different, you may get a handful of apps which are available as setup files, but many apps are archives of source files. The process of installing software from these source files may seem arduous for Linux newbies but once you understand the procedure you will find it’s really easy.

Requirements

Build Tools

These are the tools required for compiling the source files. The method to install these tools depend on your distribution.

The packages required on Ubuntu/Linux Mint can be installed be executing the following command in the terminal,

sudo apt-get install -y build-essential kernel-package libncurses5-dev bzip2

On Fedora, execute the following,

sudo yum -y install gcc ncurses-devel

The command begins with a “sudo” because root access is required for installing packages, if you do not have access to the root account then you cannot install these.

The procedure

Once you’ve installed build tools you are ready to compile and install the software.

Steps involved:

  1. Extract
  2. Configure
  3. Compile
  4. Install
  5. Clean

Step 1: Extract

First we need to extract the source files from the archive. Execute the following commands to extract the source:

tar -xvjf ‘archive name’ (for .tar.bz2 files)

tar -xvzf ‘archive name’ (for .tar.gz files)

Example,

tar -xvzf bison-2.3.tar.gz

extract
Screen 1

After extracting the sources navigate into the source directory, there you will find README file, you may want to read through as it contains details about the ‘to be installed’ software, the license, and instructions for installation.

Step 2: Configure

In this step we need to configure the software. To configure you just need to run the configure script using,

./configure

In this step the script checks whether your system is ready for compiling the sources. If you did not install the build tools you may get an error message during the check.

Once the script has finished it’s execution without any errors it will generate a “Makefile” in the source directory.

The Makefile is required as it is used by the “make” utility to compile the sources.

conf1
Screen 2

Step 3: Compiling

After the “configure” script has been successfully executed and a “Makefile” is generated, you can start compiling the software by executing the following command

make -j’number of cpu cores+1′

Example,

make -j3 (without spaces in between. Enter 3, if your processor is Intel core2duo)

compile
Screen 3

Step 4: Installation

Once the compilation is finished and there are no errors, your software is ready to be installed.

To install execute the following command,

sudo make install

makeinstall
Screen 4

Step 5: Cleanup

During the compilation process many temporary files are created that you no longer require. You can delete those files to free up disk space by executing,

make clean

clean
Screen 5

You may want to keep the Makefile though, as it will be required if you wish to uninstall the software.

To uninstall the software execute,

sudo make uninstall

uninst
Screen 6

Filed Under: Technology Tagged With: linux, ubuntu

Compile A Custom Linux Kernel – An Essential Guide

January 19, 2012 by Raj Agrawal 4 Comments

You might question – why compile a custom linux kernel when the distro vendor already provides you with one? The answer is simple, the kernel which ships with your distro is a generic kernel, it means it’s designed to run on any machine on which it’s installed, it supports almost all types of processors, graphic cards, storage devices, wired/wireless networking, etc. As the generic kernel has support for plethora of PC hardware, you might argue that it is better to use a generic kernel instead of custom built kernel, but that’s not the case. A generic kernel has all the features you want, more specifically, your hardware wants, but it also has many features that you may never need. A simple example would be of the processor support, suppose you have an Intel processor the generic kernel will support it but it also has support for AMD processors which is redundant as you will never run the same kernel on an Intel processor and an AMD processor simultaneously. Thus a custom compiled kernel is more suited to your PC requirements and thus is smaller in size. Smaller size means your kernel occupies less space than the generic one but supports all the hardware you have installed in your machine.

To sum it up you might want to compile your custom Linux kernel to/for:

  1. Build a kernel customized for your hardware setup
  2. Improved performance
  3. Learn how kernel works
  4. Fun 😀

Requirements

Kernel sources: These are the source files of the kernel. You will need to compile these source files later. The latest kernel sources can be downloaded from HYPERLINK “http://www.kernel.org/”www.kernel.org.

Build Tools: These are the tools which you will require for compiling the source files. The method to install these tools depend on your distribution.

The packages required on Ubuntu/Linux Mint can be installed be executing the following command in the terminal,

sudo apt-get install -y build-essential kernel-package libncurses5-dev bzip2

On Fedora, execute the following,

sudo yum -y install gcc ncurses-devel

The command begins with a “sudo” because root access is required for installing packages, if you do not have access to the root account then you cannot install these.

Once you have installed the build tools and downloaded the kernel sources you are ready to compile your custom kernel.

The kernel source you have downloaded is in an archive, first you will need to extract the sources. Execute the following command without the ‘quotes’:

tar -xjvf  ‘kernel archive file name’ ‘folder in which you want to extract the sources‘

Example, the command with the appropriate paths may look like:

tar -xjvf linux-2.6.25.tar.bz2 /home/casper/kernel/

After the kernel sources are extracted navigate into that directory and create a soft link named “linux”. Some Kernel sources require a path from the linux directory in order to compile, so the soft link needed. Run the following command to make a soft link,

ln -s ‘kernel source folder name’ linux

Example,

ls -s zen-stable linux

link
Screen 1

Now navigate to the linux directory and execute the following commands:

make clean && make mrproper

Screen 2

These commands clean the directory structure deleting any files from the previous builds.

Configure

Now we are ready to configure our kernel, but we have to choose whether we want to configure the kernel from scratch or use current kernel configuration as a base and develop on it. As we are beginners in the realm of kernel compilation we will stick with the easy method i.e. use the current configuration as a base. The current configuration can be found in “/boot/”.

Run the following command to copy the current configuration into your source folder,

cp /boot/’your config file name’ ‘your kernel source path/linux/.config

Example,

cp config-3.1.5-casper.kernel-v.1.1+ /home/nishikant/kernel/linux/.config

config
Screen 3

Now we need to compare the old configuration to the new one, so run the following command,

make oldconfig

oldconfig
Screen 4

In the screenshot the command doesn’t give any output because I am current running a custom kernel, but on your PC you might be prompted to select new features that are available.

Now run the following command,

make menuconfig

Screen 5

After executing “make menuconfig” a GUI interface will appear, here you can select the features you want. Say, processor type, cpu schedulers, IO schedulers, filesystem drivers, networking drivers, etc. Once you are done with the customization, select exit and then save the configuration.

save
Screen 6

Now you have finished customizing the kernel and it’s time to compile. The command to compile the kernel is,

make -j’number of cpu cores+1′

Example,

make -j3 (without spaces in between. Enter 3, if your processor is Intel core2duo)

If your processor supports hyper-threading then the number is twice the number of cpu cores,

Example,

make -j9 on Intel corei7 2600/2600k

The compilation process make take 15 minutes to an hour depending on your PC.

Once the compilation is over (without any errors), you are now ready to install your kernel, to install the kernel execute the following command,

sudo make modules_install install

After the kernel is installed you have to update your bootloader so that you can boot using your kernel.

On Ubuntu/Linux Mint the command is,

sudo update-grub

updategrub
Screen 7

While on Fedora, run,

su -c ‘grub2-mkconfig -o /boot/grub2/grub.cfg’

If you are using a different bootloader instead of grub then the above commands won’t work.

That’s it, you’re done compiling your custom kernel, after you restart your PC you’ll be able to boot into your kernel from the bootloader’s menu.

If your PC won’t boot into your kernel or some drivers don’t work then you can always boot into the generic kernel(that’s why having more than one kernel on your PC is always useful).

If you want to delete the kernel from your PC just delete the following file/directories(root access required):

/boot/’config-kernel name’

Example,

/boot/config-3.1.5-casper.kernel-v.1.1+

Next,

/boot/initrd.img-‘kernel name’

Example,

/boot/initrd.img-3.1.5-casper.kernel-v.1.1+

Next,

/boot/vmlinuz-‘kernel name’

Example,

 /boot/vmlinuz-3.1.5-casper.kernel-v.1.1

Next,

‘kernel name’ folder in /lib/modules

Example,

3.1.5-casper.kernel-v.1.1+

Finally update your bootloader,

On Ubuntu/Linux Mint the command is,

sudo update-grub

On Fedora run,

su -c ‘grub2-mkconfig -o /boot/grub2/grub.cfg’

So, this is it. Drop in your feedback/ questions about this tutorial. I’d be glad to hear/ answer them!

Filed Under: Technology Tagged With: linux, ubuntu

  • 1
  • 2
  • Next Page »