Category Archives: Linux

Tips for upgrading Ubuntu

Directly upgrading Ubuntu from the internet can take a lot of time and internet bandwidth, so many people prefer doing a fresh install by downloading the ISO or by ordering a CD. Having to again install all your favourite applications on your new system can be a nightmare. Here are some tips that will make your life easier.

1) Backup all files in /var/cache/apt

Whenever you install a new application, all packages are downloaded to this location. Simply copy all files and folders in this location to some other place, and copy them back again after installing the new version of Ubuntu. When you try to install the same applications again, the packages in this folder will be used by apt instead of re-downloading them. It will save a lot of time and internet bandwidth. Also useful for installing packages when you are not connected to the internet.

Note: If you are connected to the internet and newer versions are available, then the newer packages will be downloaded and installed.

Note: Instead of doing this manually you can use an application called AptOnCD which will automatically burn these packages on a CD/DVD for you. Type apt-get install aptoncd in a terminal window to install it.

2) Create an installation script

Creating an installation script is very easy. After installing a fresh copy of Ubuntu simply connect to the internet and run the script. All your favourite apps will be downloaded and installed automatically. For example, consider the following script:

sudo -i
apt-get install sun-java6-bin sun-java6-jre
apt-get install ubuntu-restricted-extras
apt-get install rar p7zip-full gnochm
apt-get install gparted cups-pdf sensors-applet aptoncd

Save it to a file named update.sh in your home folder and run it by typing the following in a command window:

sh update.sh

It will take some time and effort to identify the package names for all your favourite applications and to create the script. But once the script is created it will make your life a whole lot easier the next time you reinstall your OS.

Install GRUB2 Splash Image in Ubuntu

One of the major highlights in Ubuntu 9.10(Karmic Koala) its the new GRUB2 boot loader which allows high-resolution images to be used as backgrounds in the boot screen. However, after installing Karmic you will realise that the background image is disabled by default and what you get is a simple black background.

Installing a splash image for GRUB2 is very simple. All you have to do is follow the steps given below:

Download the images

Open a command window, copy-paste the following text and press Enter:

sudo apt-get install grub2-splashimages

This will install a number of images (in TGA format) in the /usr/share/images/grub folder. Open this folder to view the images you downloaded.

Install a splash image

Lets install Lake_mapourika_NZ.tga as the splash image.

Type the following in a command window:

sudo gedit /etc/grub.d/05_debian_theme

This will open up the file /etc/grub.d/05_debian_theme in gedit text editor with root priviledges.

Find the line:

for i in {/boot/grub,/usr/share/images/desktop-base}/moreblue-orbit-grub.{png,tga} ; do

Replace it with:

for i in {/boot/grub,/usr/share/images/desktop-base,/usr/share/images/grub}/Lake_mapourika_NZ.{png,tga} ; do

Save the file and exit.

Update your grub.cfg using the following command:

sudo update-grub

Thats it. Reboot your machine and enjoy the new boot screen.

Notes:

1) The line:

for i in {/boot/grub,/usr/share/images/desktop-base,/usr/share/images/grub}/Moraine_Lake_17092005.{png,tga} ;

tells grub to look for Moraine_Lake_17092005 (in PNG or TGA format) in the following locations:

/boot/grub
/usr/share/images/desktop-base
/usr/share/images/grub

You can use any image in PNG or TGA format as the splash image by simply copying the image to any of these folders and changing the line as described above. You can also specify some other folder of your choice. Always remember to run sudo update-grub after editing the line otherwise your changes will not be saved.

2) The images that you get by installing the grub2-splashimages package are extremely boring (screenshot below).

You can download a number of high-resolution wallpapers from the following site and use them as the splash image.

http://www.desktopnexus.com/tag/ubuntu/

3) The default resolution for the boot screen is very low (640×480). If the image you use is larger than 640×480 pixels, then it will be cropped and the boot screen will look a little weird. You can increase the resolution to 1024×768 for better results.

Type the following in a command window:

$sudo gedit /etc/default/grub

This will open up the file /etc/default/grub in gedit text editor with root priviledges.

Find the line:

#GRUB_GFXMODE=640x480

Replace it with:

GRUB_GFXMODE=1024x768

Save the file and reboot.

4) Your graphics card supports a very limited number of video modes during boot time. Make sure that you are using a supported resolution. To see the video modes available at boot time, reboot your machine, press C at the boot screen and type vbeinfo

5) The syntax for editing the GRUB2 configuration files can be found on the following page:

https://wiki.ubuntu.com/Grub2

Fix problems with Ubuntu 9.10 on Dell Studio 1555

Problems with video playback (Compiz + ATI graphics card)

Problem:

# Playing a video with Totem, VLC or MPlayer gives a black screen

# Switching to fullscreen causes a crash

# The video stutters or freezes on fullscreen playback

Cause:

The problem is with Compiz and with the proprietary ATI graphics driver (fglrx). You will see many solutions which tell you to either disable compiz or use the xv or x11 video driver. This solution is what I was using till now. The disadvantage of using the X11 video output is that the playback will be poor (stutter, freeze, etc) and hardware acceleration is not used for video playback.

Solution:

Install the compizconfig-settings-manager package using Synaptic.

Open CompizConfig Settings Manager from System -> Preferences.

Select General from the left panel and General Options from the right panel.

There’s an option called Undirect Fullscreen Windows. Check this option.

This will fix all your video playback problems!

TIP: If you are using SMPlayer please note that the Spacebar is used for Pause only! It is not used to toggle between Play/Pause! You can change the default keyboard mapping from the Options->Preferences window.

Problems with LCD brightness

Problem:

# The media keys for adjusting LCD brightness sometimes work and sometimes don’t.

Solution

Open /etc/default/grub using GEdit.

Find the line

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

change it to

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash noapic"

Save the file and close GEdit.

Open a terminal and type update-grub.

Reboot.

Thats it. The media keys for adjusting LCD brightness should work correctly now.

Calibrate your LCD

See the 3 pictures above?

The picture in the middle is the actual image.

The images on the left and right are from displays that are are not calibrated correctly. Both images have very poor contrast. The left one is too dark and the right one is too bright. Most laptops by default are configured with a default gamma of 1.0. This corresponds to the image on the right.

It is very important to calibrate your LCD display in order to get good color reproduction and contrast. These settings can be adjusted from the Catalyst Control Center (from the colors tab). The settings that I am using are given below. These settings are very easy on the eyes and give good results.

Gamma = 1.40
Brightness = 0 (default)
Contrast = 70
Hue = 0 (default)

After changing these values, adjust the LCD brightness using the media keys so that it doesn’t strain your eyes.

If your hardware is different then these values may not give good results. The following sites have some good tools for calibrating your LCD or monitor.

http://www.displaycalibration.com/brightness_contrast.html

http://www.photoscientia.co.uk/Gamma.htm

How to install Picasa in Ubuntu

Add Google’s software repository to your system.

Go to System->Administration->Software Sources.
In the Third-Party Software tab click Add.
Copy/Paste the following line and click Add Source.

deb http://dl.google.com/linux/deb/ stable non-free main

Add google repo

Install Google’s public keys

Download Google’s public key file from here:

https://dl-ssl.google.com/linux/linux_signing_key.pub

Go to System->Administration->Software Sources.
In the Authentication tab click Import Key File…
Import the key file that you downloaded earlier.

Install google's public key

Install picasa

Now open a terminal window and type the following

sudo apt-get update
sudo apt-get install picasa

That it. Picasa will be downloaded and installed. You will find the Picasa under Applications->Graphics.

Note: Google is using wine to run Picasa under Linux. So the program will look a little ugly (screenshot below).

You can remove Picasa using the following line:

sudo apt-get remove picasa

picasa

How to update MPlayer & MEncoder in Ubuntu

The MPlayer version that is available through the official Ubuntu repositories is very old (1.0 RC2, released in April 2008). When you run a program like SMPlayer, it will complain that the MPlayer version is very old and some of the features won’t work properly.

To update MPlayer to the latest version, open a terminal window, copy-paste the following text and press Enter:

sudo sh -c "echo 'deb http://ppa.launchpad.net/rvm/mplayer/ubuntu karmic main' >> /etc/apt/sources.list"
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 03E02400
sudo apt-get update
sudo apt-get install mplayer mencoder smplayer

Thats it! All the required packages will be downloaded and installed, and MPlayer will be updated to the latest version. To check the MPlayer version, open a command window and type mplayer.

Note:

The following repo is maintained by the SMPlayer developers and is regularly updated to include the latest MPlayer builds:

deb http://ppa.launchpad.net/rvm/mplayer/ubuntu karmic main

If you are using an older Ubuntu release then replace the word karmic with the corresponding nickname. For example, if you are using Ubuntu 9.04 (Jaunty Jackalope) then replace karmic with jaunty.

Follow

Get every new post delivered to your Inbox.