Friday 28 August 2009

Installing a package from the source in UBUNTU 9.04

Installing a package from source

  • Make sure you have all the necessary development tools (i.e. libraries, compilers, headers):
aryan@aryan-laptop~$sudo apt-get install build-essential
aryan@aryan-laptop~$sudo apt-get install linux-headers-`uname -r`
Note: "uname -r" lists the current kernel you are using
  • Extract the archive that contains the source files:
aryan@aryan-laptop~$tar xvf sourcefilesarchive.tar.gz
  • Build the package using the package's script (in this case the configure script), compile the package (make), and install the compiled package into your system (make install):
aryan@aryan-laptop~$cd /path/to/extracted/sourcefiles
aryan@aryan-laptop~$./configure
aryan@aryan-laptop~$sudo make
aryan@aryan-laptop~$sudo make install
Note: typing ./ before a filename in the current folder allows the Linux shell to try and execute the file as an application even if it is not in the path (the set of folders which it searches when you type a command name). If you get a "permission denied" error, the file is not marked as being executable. To fix this:
aryan@aryan-laptop~$sudo chmod +x filename
Example: In the above instructions, configure is the shell script to build the package from source. To be sure the configure script is executable:
aryan@aryan-laptop~$sudo chmod +x configure

Handling .tar.gz and .tar.bz2 files in ubuntu 9.04

Handling (Tar/GZip) and (Tar/Bzip2) archives

(Tar/GZip) archives end in ".tar.gz" and (Tar/Bzip2) archives end in ".tar.bz2". Bzip2 is the newer, more efficient compression method. These files can generally be automatically extracted by merely clicking on them from your file manager (Nautilus), since file associations with the appropriate archival utilities are set by default in Ubuntu. These instructions are for those who wish to use the command line Terminal.

  • To extract:
aryan@aryan-laptop:~$tar xvf packagename.tar.gz

Note: tar is an application which can extract files from an archive, decompressing if necessary.

-x means extract.
-v means verbose (list what it is extracting).
-f specifies the file to use.
  • Decompressing ".gz" files
aryan@aryan-laptop:~$gunzip file.gz
  • Decompressing ".bz2" files
aryan@aryan-laptop:~$bunzip2 file.bz2
Note: You can also decompress a package first by using the command gunzip (for .gz) or bunzip2 (for .bz2), leaving the .tar file. You would then use tar to extract it.
  • To create a .gz archive:
aryan@aryan-laptop:~$tar cvfz packagename.tar.gz folder
  • To create a .bz2 archive:
aryan@aryan-laptop:~$tar cvfj packagename.tar.bz2 folder

apt and package basics in ubuntu 9.04

These instructions are for installing packages from the command-line Terminal. Terminal can be started:
Applications -> Accessories -> Terminal
  • Install packages:
aryan@aryan-laptop:~$sudo apt-get install packagename

Example:
aryan@aryan-laptop:~$sudo apt-get install vlc
  • Remove packages:
aryan@aryan-laptop:~$sudo apt-get remove packagename
  • To remove all dependencies:
aryan@aryan-laptop:~$sudo apt-get autoremove
Example:
aryan@aryan-laptop:~$sudo apt-get remove mpd sbackup
  • Search for packages:
aryan@aryan-laptop:~$apt-cache search 
Examples:
aryan@aryan-laptop:~$apt-cache search Music MP3
aryan@aryan-laptop:~$apt-cache search "Text Editor"
aryan@aryan-laptop:~$sudo apt-get update
  • Upgrade packages:
aryan@aryan-laptop:~$sudo apt-get upgrade
  • Upgrade the entire distribution (e.g. from Intrepid to Jaunty):
aryan@aryan-laptop:~$sudo apt-get dist-upgrade


Post Installation steps via Terminal in ubuntu 9.04

1. Multimedia

* Audio and Video Playback

Playing a Video (XVid, DivX etc.) or Audio (MP3) file has become pretty easy. Just double click the file you want and allow Totem to automatically download the needed codecs. But you could also do this by yourself very easily by installing a package which contains all the needed codecs and more. Just look below at Ubuntu Restricted Extras.

* DVD Playback

In Ubuntu 9.04 there is no need to manually configure the Medibuntu repository. If you have previously installed Ubuntu Restricted Extras skip the following command. If you haven't open a terminal and type:

aryan@aryan-laptop:~$sudo apt-get install libdvdread4
Next type:

aryan@aryan-laptop:~$sudo apt-get install totem-gstreamer
aryan@aryan-laptop:~$sudo /usr/share/doc/libdvdread4/install-css.sh

* SMPlayer

Ubuntu 9.04 by default comes with totem as its video and media player. Personally, I prefer SMPlayer for watching my video files and movie DVDs. SMPlayer is a GUI frontend it for mplayer. To install it type:

aryan@aryan-laptop:~$sudo apt-get install smplayer smplayer-themes
You will find it under Applications -> Sound & Video -> Smplayer

* VLC

Many users prefer the Video Lan Client (VLC) as their multimedia player. Simply install it by typing:

aryan@aryan-laptop:~$sudo apt-get install vlc

2. Eye Candy

* Change Usplash Theme

This is the splash screen you see at boot, when you are asked for a login and password. You can change the USplash screen using the utility startupmanager. Startup Manager can also be used to change GRUB boot settings, such as the timeout in bootloader menu. Install it by typing:

aryan@aryan-laptop:~$sudo apt-get install startupmanager
It will be installed under System -> Administration -> StartUp-Manager

To download additional USplash themes go to www.gnome-look.org

* Compiz Fusion

Compiz Fusion allows you to use advanced desktop effects such as the rotating cube desktop.

aryan@aryan-laptop:~$sudo apt-get install compiz compizconfig-settings-manager compiz-fusion-plugins-main compiz-fusion-plugins-extra fusion-icon
Run Applications -> System Tools -> Compiz Fusion Icon. A blue icon will appear to the tray. From here you can configure Compiz.

* Conky

Conky is a light-weight system monitor for X, that displays any information on your desktop.

aryan@aryan-laptop:~$ sudo apt-get install conky

* Screenlets

Screenlets are small applications that are laying on your desktop. Eye candy stuff and useful in many ways. Just type:

aryan@aryan-laptop:~$ sudo apt-get install screenlets
Go to Applications -> Accessories –> Screenlets choose the screenlet you want click launch/add (you can choose Auto start on login)

You can download additional screenlets from www.gnome-look.org or from screenlets.org from

3. Internet Applications

* Firewall

By default Ubuntu has ufw, a netfilter firewall, installed. If you want a Graphical Interface (GUI) install gufw

aryan@aryan-laptop:~$ sudo apt-get install gufw

* Google Earth

Google Earth lets you fly anywhere on Earth to view satellite imagery, maps, terrain, 3D buildings, from galaxies in outer space to the canyons of the ocean. You can explore rich geographical content, save your toured places, and share with others. To install it type:

aryan@aryan-laptop:~$sudo apt-get install googleearth-package
aryan@aryan-laptop:~$make-googleearth-package --force
aryan@aryan-laptop:~$sudo dpkg -i googleearth*.deb
Afterwards you will find Google Earth under Applications -> Internet -> Google Earth

If you want to uninstall Google Earth open a terminal and type:

aryan@aryan-laptop:~$sudo dpkg --purge googleearth
This will remove all configuration files of Google Earth as well.

* Skype

Skype is the popular VOIP and video conferencing program. Open a terminal and type:
aryan@aryan-laptop:~$wget -O skype-install.deb http://www.skype.com/go/getskype-linux-ubuntu
aryan@aryan-laptop:~$sudo dpkg -i --force-architecture skype-install.deb
You will find it under Applications -> Internet -> Skype.
If you have a 64-bit sytem you must install some extra packages before. Type:
aryan@aryan-laptop:~$ sudo apt-get install ia32-libs lib32asound2 libqt4-core libqt4-gui

* XChat - IRC Client

XChat is a popular client for connecting to the Internet Relay Chat network. Open a terminal and type:
aryan@aryan-laptop:~$ sudo apt-get install xchat
You will find it under Applications -> Internet -> XChat IRC.

4. System Applications

* Gnome Do

GNOME Do (Do) is an intelligent launcher tool that makes performing common tasks on your computer simple and efficient. Do not only allows you to search for items in your desktop environment (e.g. applications, contacts, bookmarks, files, music), it also allows you to specify actions to perform on search results (e.g. run, open, email, chat, play).

aryan@aryan-laptop:~$ sudo apt-get install gnome-do
You can run it through Applications -> Accessories -> Gnome Do or by pressing Windows Key + Space. The first time you run it press the little arrow at the top right and adjust its preferences.

You might also want to enable Docky which is a frontend for Gnome Do. To do so go to Preferences -> Appearance and select Docky as the theme.

5. Java

* Sun Java Runtime Environment (JRE) and Firefox Java Plugin

Close Firefox if it's running, open a terminal and type:

aryan@aryan-laptop:~$ sudo apt-get install sun-java6-jre sun-java6-plugin

* Sun Java Development Kit (JDK)

If you want to build applications, applets, and components using the Java programming language you need to install JDK.

aryan@aryan-laptop:~$ sudo apt-get install sun-java6-jdk
If there are other things you would like to see in this guide just drop me a comment here. Enjoy!

Monday 24 August 2009

Download a Youtube Video in UBUNTU 9.04

You can download YouTube video with youtube-dl.

Install youtube-dl

aryan@aryan-laptop:~$sudo apt-get install youtube-dl

Download the video

aryan@aryan-laptop:~$sudo youtube-dl http://the-youtube-video-uri

Convert into MPEG format

aryan@aryan-laptop:~$sudo ffmpeg -i source.flv output.mpg

OR

You can download simply by the following steps:-
  • Open a video in Youtube.
  • Let it buffer completely.
  • Then just Goto /tmp and find your buffered video in /tmp.
  • From /tmp you can copy the video and paste where ever you want to store it.
Isn't that awesome to download youtube video!!!

Install Java on UBUNTU 9.04

To install Java support on Ubuntu, run this command in a Terminal:

aryan@aryan-laptop:~$sudo apt-get install sun-java6-jdk sun-java6-jre sun-java6-plugin

Installing .rpm package in UBUNTU 9.04

If you have an rpm file for a package you wish to install, and if you cannot find a .deb debian package in any of the Ubuntu repositories or elsewhere, you can use the alien package converter application to install the .rpm file.

Alien is a program that converts between the rpm, dpkg, stampede slp, and slackware tgz file formats. If you want to use a package from another distribution than the one you have installed on your system, you can use alien to convert it to your preferred package format and install it.

NOTE : Alien should not be used to replace important system packages, like sysvinit, shared libraries, or other things that are essential for the functioning of your system. Many of these packages are set up differently by Debian and Red Hat, and packages from the different distributions cannot be used interchangably. In general, if you can’t uninstall the package without breaking your system, don’t try to replace it with an alien version.

Instructions for Installing RPM Files Using Alien

Installing Alien

You can install alien itself from the Ubuntu Universe repository by adding the repository to your list of sources and doing:

aryan@aryan-laptop:~$sudo apt-get update
aryan@aryan-laptop:~$sudo apt-get install alien

Installing the .rpm file

To install the .rpm file, you first need to convert it to a .deb file which can be installed on Ubuntu.
I assume that you downloaded the package to your Desktop (~/Desktop is the directory)
You can convert the .rpm to a .deb by using the following commands.
aryan@aryan-laptop:~$cd ~/Desktop
-This will change the directory to your desktop, where you have the .rpm file.

aryan@aryan-laptop:~$sudo alien -k name-of-rpm-file.rpm
- This will convert the .rpm to a .deb.
- The “-k” will keep the version number. Otherwise alien adds a “1″ to the version number.:)

aryan@aryan-laptop:~$sudo dpkg -i name-of-deb-file.deb
- This will install the .deb package

:) This tutorial installs your .rpm package in UBUNTU 9.04

Restore Your USB Key to Original State via Terminal

Restoring your USB key to it's original state using Linux:

A. First we need to delete the old partitions that remain on the USB key.

  1. Open a terminal and type sudo su
  2. Type fdisk -l and note your USB drive letter.
  3. Type fdisk /dev/sdx (replacing x with your drive letter)
  4. Type d to proceed to delete a partition
  5. Type 1 to select the 1st partition and press enter
  6. Type d to proceed to delete another partition (fdisk should automatically select the second partition)

B. Next we need to create the new partition.

  1. Type n to make a new partition
  2. Type p to make this partition primary and press enter
  3. Type 1 to make this the first partition and then press enter
  4. Press enter to accept the default first cylinder
  5. Press enter again to accept the default last cylinder
  6. Type w to write the new partition information to the USB key
  7. Type umount /dev/sdx (replacing x with your drive letter)

C. The last step is to create the fat filesystem.

  1. Type mkfs.vfat -F 16 /dev/sdx1 (replacing x with your USB key drive letter)

That's it, you should now have a restored USB key with a single fat 16 partition that can be read from any computer.

Making Bootable USB drive(pen drive) via windows

This tutorial enables you to install, boot and run Ubuntu 9.04 from a USB flash drive. In addition to installing Ubuntu to a USB device and then booting Ubuntu from the memory stick, this tutorial will enable you to automatically save your changes and settings back to the thumb drive and further restore them on each boot using a second "casper-rw" persistent partition. The tutorial was written for those already familiar with working from Ubuntu or another Linux desktop environment. If you do not have access to or prefer not to use a Windows computer, this Ubuntu Linux on a stick tutorial is for you.

Ubuntu 9.04 USB Flash Drive Creation Essentials
  • Windows PC to perform conversion
  • Ubuntu 9.04 ISO
  • 2GB or larger USB flash drive (fat32 formatted)
  • U904p.exe (contains the files to do the conversion)

Ubuntu 9.04 USB Flash Drive Installation tutorial

  1. Download and launch u9.04p.exe, extracting to your PC. A U904p folder is automatically created
  2. Download the Ubuntu 9.04 ISO and place it in the U904p folder on your computer
  3. From the U904p folder on your PC, click U904.bat and follow the on screen instructions
  4. Once the script has finished, restart your PC and set your BIOS or Boot Menu to boot from the USB device, save your changes and reboot

If all goes well, you should now be booting from your own personal Live Ubuntu 9.04 USB that allows you to save most of your changes persistently.

Persistent size: The default casper-rw loop file that becomes the partition for saving changes is only 1GB. If you have room and would prefer to use more space for saving changes you can download one of the following zip files and extract the new casper-rw file to your USB device, replacing the old one.

You will lose any saved changes by replacing your casper-rw file with one listed above!

Use 7-zip to extract the casper-rw loop file.

Making your USB Flash drive(pen drive ) bootable via LINUX

This tutorial will show how-to install Ubuntu(or any linux version) on a usb stick.

Being able to run Linux out of a usb bar is a great way to enjoy the live CD experience (being able to use Linux on any computer you might get by) and the big advantage of being easier to carry around than a CD.

1. Requirements

You will need a few items such as:

  • a ubuntu liveCD or ubuntu's .iso file
  • a usb bar of at least 1GB
  • a running Linux operating system

Now that you have all this, it is time to prepare you USB bar do host the Ubuntu liveCD files.

2. Setting up the USB disk

2.1. Finding the device

In the first place, you need to plug your usb drive and check under which device it is associated. To find out the device, run:

$ sudo fdisk -l

On my system, the device appears as being /dev/sdb, I will therefore use /dev/sdb as a reference for this tutorial, please replace it accordingly to your system (might be sda, sdc ...).
Once you found your device, you are going to create the partitions.

NOTE : Using the wrong device name might destroy your system partition, please double check

2.2. Making the partitions

Make sure every of your already mounted partition are unmounted:

$sudo umount /dev/sdb1

and then launch fdisk, a tool to edit partition under linux:

$sudo fdisk /dev/sdb

We are going delete all the partition and then create 2 new partition: one FAT partition of 750M which will host the files from the live CD iso, and the rest on another partition.

At fdisk prompt type d x where x is the partition number (you can simply type d if you only have one partition), then:

  • n to create a new partition
  • p to make it primary
  • 1 so it is the first primary partition
  • Accept the default or type 1 to start from the first cylinder
  • +750M to make it 750 Meg big
  • a to toggle the partition active for boot
  • 1 to choose the 1 partition
  • t to change the partition type
  • 6 to set it to FAT16

Now we have out first partition set up, let's create the second one:

  • n to create yet again a new partition
  • p to make it primary
  • 2 to be the second partition
  • Accept the default by typing Enter
  • Accept the default to make your partition as big as possible
  • Finally, type w to write the change to your usb pendrive

Partitions are now created, let's format them.

2.3. Formatting the partitions

The first partition is going to be formated as a FAT filesystem of size 16 and we are going to attribute it the label "liveusb".

$ sudo mkfs.vfat -F 16 -n liveusb /dev/sdb1

The second partition is going to be of type ext2 with a blocksize of 4096 bytes and the label casper-rw. Mind that it has to be labeled as casper-rw otherwise the tutorial won't work!.

$ sudo mkfs.ext2 -b 4096 -L casper-rw /dev/sdb2

At this stage, our usb pendrive is ready to host the liveCD image. Now, let's copy the files to the usb bar.

3.1. Mounting Ubuntu liveCd image

In the first place we need to mount our ubuntu iso. Depending if you have the .iso file or the CD, there is 2 different ways of mounting it.

3.1.1. Mounting from the CD

People using Ubuntu or any other user-friendly distro, might just have to insert the cd and it will be mounted automatically. If this is not the case:

$ sudo mount /media/cdrom

should mount it.

3.1.2. Mounting from an .iso image file

We will need to create a temporary directory, let say /tmp/ubuntu-livecd and then mount our iso (I will be using a feisty fawn iso).

$ mkdir /tmp/ubuntu-livecd
$ sudo mount -o loop /path/to/feisty-desktop-i386.iso /tmp/ubuntu-livecd

Once the cd image is ready, it is time to mount the newly created usb bar partitions:

3.2. Mounting the usb bar partitions

Same here, you might be able to get both your partition by simply replugging the usb pendrive, partition might appears as: /media/liveusb and /media/casper-rw. If this is not the case, then you will need to mount them manually:

$ mkdir /tmp/liveusb
$ sudo mount /dev/sdb1 /tmp/liveusb

All the partitions we need are now mounted, let's copy the files.

3.3. Copying the files to the usb bar

Let positionned yourself on the CD image directory (in my case: /tmp/ubuntu-livecd , but it might be /media/cdrom , and copy at the root of your usb first partition:

  • the directories: 'casper', 'disctree', 'dists', 'install', 'pics', 'pool', 'preseed', '.disk'
  • The content of directory 'isolinux'
  • and files 'md5sum.txt', 'README.diskdefines', 'ubuntu.ico'
  • as well as files: 'casper/vmlinuz', 'casper/initrd.gz' and 'install/mt86plus'

$ cd /tmp/ubuntu-livecd
$ sudo cp -rf casper disctree dists install pics pool preseed .disk isolinux/* md5sum.txt README.diskdefines ubuntu.ico casper/vmlinuz casper/initrd.gz install/mt86plus /tmp/liveusb/

It might complain about symbolic links not being able to create, you can ignore this.

Now let's go to the first partition of your usb disk and rename isolinux.cfg to syslinux.cfg:

$ cd /tmp/liveusb
$ sudo mv isolinux.cfg syslinux.cfg

change /tmp/liveusb according to your settings

Edit syslinux.cfg so it looks like:

DEFAULT persistent
GFXBOOT bootlogo
GFXBOOT-BACKGROUND 0xB6875A
APPEND file=preseed/ubuntu.seed boot=casper initrd=initrd.gz ramdisk_size=1048576 root=/dev/ram rw quiet splash --
LABEL persistent
menu label ^Start Ubuntu in persistent mode
kernel vmlinuz
append file=preseed/ubuntu.seed boot=casper persistent initrd=initrd.gz ramdisk_size=1048576 root=/dev/ram rw quiet splash --
LABEL live
menu label ^Start or install Ubuntu
kernel vmlinuz
append file=preseed/ubuntu.seed boot=casper initrd=initrd.gz ramdisk_size=1048576 root=/dev/ram rw quiet splash --
LABEL xforcevesa
menu label Start Ubuntu in safe ^graphics mode
kernel vmlinuz
append file=preseed/ubuntu.seed boot=casper xforcevesa initrd=initrd.gz ramdisk_size=1048576 root=/dev/ram rw quiet splash --
LABEL check
menu label ^Check CD for defects
kernel vmlinuz
append boot=casper integrity-check initrd=initrd.gz ramdisk_size=1048576 root=/dev/ram rw quiet splash --
LABEL memtest
menu label ^Memory test
kernel mt86plus
append -
LABEL hd
menu label ^Boot from first hard disk
localboot 0x80
append -
DISPLAY isolinux.txt
TIMEOUT 300
PROMPT 1
F1 f1.txt
F2 f2.txt
F3 f3.txt
F4 f4.txt
F5 f5.txt
F6 f6.txt
F7 f7.txt
F8 f8.txt
F9 f9.txt
F0 f10.txt

Woof, finally we have our usb disk almost usuable. We have a last thing to do: make the usb bootable.

3.4. Making the usb bar bootable.

in order to make our usb disk bootable, we need to install syslinux and mtools:

$ sudo apt-get install syslinux mtools

And finally unmount /dev/sdb1 and make it bootable:

$ cd
$ sudo umount /tmp/liveusb
$ sudo syslinux -f /dev/sdb1

Here we are done now just reboot, set your BIOS to boot from the usb bar and enjoy Ubuntu linux from a pendrive

4. Troubleshooting

If you are having trouble booting on the usb bar, this might be due to your MBR being corrupted. In order to fix it up, you can use lilo (I installed lilo on my box only for this purpose).

$ lilo -M /dev/sdb

will fix the MBR on device /dev/sdb.

:)

Saturday 22 August 2009

Installing .deb package

To install suppose mypkg.deb type the following command:-
Suppose your mypkg.deb package file is in /home/aryan/Desktop directory...

$ cd /home/aryan/Desktop

Now type the following command :-

$ sudo dpkg -i mypkg.deb

This will install your any .deb package using terminal.

install an OS on Virtual Box

Required :-
  1. Linux distro
  2. Virtual Box
  3. OS's iso file
Steps-:
  1. Open VirtualBox(Applications->System Tools->Sun VirtualBox).
  2. Click New.
  3. Click Next to continue.
  4. Enter name of Vitual OS you want to have.(say winxp) , choose what OS you are installing and click Next to continue.
  5. Enter the primary memory(RAM) you want to give to your virtual box's OS (say 256 MB). and Click Next to continue.
  6. Click New to create a hard disk.
  7. Click Next to continue.
  8. Choose Fixed-size Storage and click Next to continue.
  9. Enter the secondary storage size and click next to continue and Click Finish.
  10. After processing, your Virtual Box is created.
  11. Click Settings to install your OS in newly created Virtual Box.
  12. Select CD-DVD ROM and check mount CD-DVD Drive and check ISO image file and then browse to your OS'iso file location and click OK to continue.
  13. Click Start to run OS in your Virtual Box.

Friday 21 August 2009

Installation steps for UBUNTU 9.04

Ubuntu 9.04 i.e Jaunty is the newest Ubuntu stable version and i am going to discuss here how to install ubuntu Jaunty desktop with step by step procedure.I hope this will help some ubuntu users to install ubuntu Jaunty in their machines,laptops, etc. First thing is you need to download ubuntu jaunty .iso image from here once you have the .iso image you need to create a bootable CD from this and you need to boot your machine using this CD.
First check your BIOS settings to select first cd as a boot sequence.Once It starts booting from CD you should see similar to the following screen here select your language and press enter

Here you need to select “Install ubuntu” option and press enter

Ubuntu jaunty installation loading in progress

Select your language for ubuntu installation click on forward

Select your region and city.In this example i am using Europe region,London city and click on forward.

Select your keyboad layout in this example i am using united kingdom and click on forward

Now you can See the following screen with the disks available in your machine here you need to create partitions in this example you can see the 8GB of space for this installation here i am going create a single partition,if you want to create manually use the other option you need to click on forward.

Note:- this is only example partition.In your installation you have to choose specify partitions manually and swap partition should assigned

Next you need to create User name, password and computer name you can also choose if you want to login automatically or not

If you enter weak password you should see similar to the following screen

List of information available for installation here you need to click on install to start the installation.

If you want to see advanced option screen in the above step as follows

Partitions formatting in progress

Installing ubuntu jaunty system in progress

Installation Completed Succesfully and you need to restart the system by clicking “Restart Now”

Once it boots you should see similar to the following screen to login

Conclusion :- The ubuntu jaunty installation process was much improved compared to old versions and i hope first time users feel very easy to install.