Saturday, February 28, 2009

Installing RPM's using the Redhat Package Manager

Redhat RPM's offer a flexible and easy method to install new software. Software installed from an RPM package differs from compiling from source in a few ways, but the most important one of all is the software is already compiled for you. Essentially all you are doing is extracting the pre-built binaries and copying them to their pre-selected destination. RPM's are files that have a ".rpm" extention. The good point about RPM's is installation of new software, and maintaining the software currently installed is much easier than doing so for individual packages compiled from source. The downside to RPM's is that you don't have as much choice about where software is installed on your system, how it is compiled, and how it is configured.

If rpm is not pre-installed u can easily do it.
Open terminal.
Type sudo apt-get install rpm.

Using the RPM system is fairly straight forward. To install a package, you can use the following command:

rpm -i filename.rpm

When using rpm, you must be logged in as the root user. The "-i" flag in the above command means "install".

Un installing a package is just as easy:

rpm -e package

The "-e" switch used here means "erase" (un install).
Note that is different from used when installing.

For example, if you are installing an application called "mysoftware", you may use a command like "rpm -i mysoftware-1.0.2-i386.rpm" to install "mysoftware", when removing we dont follow the filename for installation, but rather the name of the software itself.

For further uses of RPM, please use rpm website, which has some fairly useful information.


If you need to find & download the RPM file for a piece of software, I recommend using RPM Find and RPM Pbone Search. Note that not all applications are available as RPM's, in these cases you will need to compile the software from source. (see previous blog).

Friday, February 27, 2009

Compiling and Installing software from source

Typically applications you must compile from source as a ".tar.gz", ".tar.bz2", or ".zip" file.

You'll probably want to operate from inside your home directory. If your user is (for example) username, your home directory will be /home/username/. For the rest of this section we will assume you have downloaded your zip file to /home/username/src. If you do not have a src directory, you can create it with the following "mkdir" (make directory) command:

mkdir /home/username/src/
So, we have our source package in /home/username/src/.

Change to the /home/username/src/ directory with the "cd" (change directory) command like so:

cd /home/username/src/

Use the "ls" (list directory contents) command, to see the file is present:

ls

We now need to unzip the zipped file, this is done differently depending on the file extension.

for files ending in .tar.gz, use:

tar -zxvf filename.tar.gz
(replacing with the name of the file).

for files ending in .tar.bz2, use:

tar -jxvf
filename.tar.bz2

for files ending in .zip, use:

unzip
filename.zip

You should now have a new directory, containing all of the source files. To confirm it exists, and to get its name, use the "ls" command again.

we now need to go into the new directory, so use the cd command:

cd

This is where things will differ. Some packages will have an INSTALL or README file which will contain installation instructions. use "ls" to see if the software has an install or readme file. If it does have one, you can use the "more" command to read it, like so:

more INSTALL

Generally, the final 3 stages are as follows:
- Configure the installation
- Compile the software
- Install the binaries

The pre-installation configuration is done by executing ./configure:

./configure

This will perform some requirements testing on your system, and create a "Makefile" which will explain to the "make" utility how the software should be compiled. If you receive any error messages during this stage, you may wish to search the linux forums to see if they have been found and resolved by someone else already, if not, feel free to send a mail to me- Please include all of the output including any error messages, and some details about your system - what distro you are using, what are you trying to install etc etc


The next stage is to compile the software, this is done using "make". When you run "make" it will read the instructions in the Makefile and build the application binaries.

make

The final stage is to install these binaries, ie, copy them to a more permanent location. Typically only the "root" user can do this, so you will need to swich to the root user with the su command:

Once you are root, install the binaries using the "make" command, followed by "install", like so:

make install

That is it! Check the user documentation of the software you installed for details of how to run the application.

How to install files in linux

Introduction:

For the benifit of people new to Linux, I have written a generic explanation of how to install software in Linux. Note that some software may have specific installation procedures, this HOWTO is not a substitute for reading the official installation documentation

The upcoming blogs will cover HOWTO for the following topics:

  • Compiling and Installing software from source
  • Installing RPM's using the Redhat Package Manager
  • Installing using Debian's apt-get
  • Installing binary files (.BIN/.SH)
  • Installing with fedora / yum
  • Installing slackware packages

So just find the relevant one and if still unsuccessfull, jus drop me a mail.

Tuesday, February 24, 2009

Connect your BSNL-EVDO modem to Linux

Hi all,
here is how can u connect ur BSNL-EVDO.
  • Connect ur device to usb port.
  • Open terminal & type lsusb. It will show all connected device to ur system via usb.
  • The out put will be:
  • Bus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
    Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
    Bus 002 Device 002: ID 062a:0000 Creative Labs Optical mouse
    Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
    Bus 001 Device 003: ID 05c6:3197 Qualcomm, Inc. CDMA Wireless Modem/Phone
    Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
  • 6th line is my modem. U too will find ur device listed, if not try again or check connection
  • Log in as root user using su command.
  • Now type modprobe usbserial vendor=05c6 product=3197
  • Next insert wvdialconf
  • Now modify the wvdial.conf file:
    vim /etc/wvdial.conf
  • Del the content of file, Jus copy & paste the following:
  • [Dialer Defaults]
    Init1 = ATZ
    Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
    Stupid Mode = 1
    Modem Type = Analog Modem
    ISDN = 0
    Phone = #777
    New PPPD = yes
    Modem = /dev/ttyUSB0
    Username = xxxxxxx
    Password = xxxxxxx
    Baud = 460800
  • Verify username, password & phone number from ur service provider.
  • Now u have finished ur configuration, any time u want to connect ur device, plugin the device-open terminal and key in sudo wvdial
Note: U can connect to other dial up devices by making minor changes & giving corresponding phone number, username & password in the wvdial.conf file

Installing Java

The simplest way is to go to Synaptics Package Manager and find it. But MAY BE U MISS OUT THE LATEST VERSION......
Jus chill and download the "jdk.bin" file from java.sun.com

  • Save the .bin file to ur hard disk where u have access rights.
  • Go to terminal- to the location u saved the file.
  • Switch as a root user by su command.
  • Type chmod +x filename.bin //Eg, chmod +x jdk-6u12-linux-i586.bin
  • Now run the binary file using ./filename.bin
  • Accept terms & condn and the installation would began.
After installation u may not able to run ur java programs
  • Open terminal, go to location where u wish to run java & javac commands.
  • Type sudo export PATH=/path/jdk/bin:$PATH
  • For eg. sudo export PATH=/usr/local/jdk1.6.0_12/bin:$PATH
Don't forget to install the java docs from the same website.
  • Download the .zip file.
  • Unzip by unzip filename.zip.
  • Preferably place it on the same location as ur JDK.
  • Save the index.html as a bookmark in ur browser.
  • Docs are of sheer importance as they provide details about all built-in classes of Java so dare not to ignore it.

Microsoft Fonts for linux

The most suitable replacements to microsoft office is Open Office..... but we tend to miss one thing terribly. Fonts in microsoft,,,,,, so miss it no more get it done by downloading "Microsoft Core Fonts" using Add/Remove Programs. You can find it under Graphics tag.

Sunday, February 22, 2009

Recommended net tools

Browser
  • Firefox sudo apt-get install firefox (copy & paste in terminal to install)
  • Epiphany sudo apt-get install epiphany
Chat Messenger
  • Pidgin sudo apt-get install pidgin
Download Manager
  • Downloader for X sudo apt-get install d4x
Torrent
  • Bit Torrent Download Client sudo apt-get install bittorrent
Plugins & Addons
  • Icedtea Java Plugin
  • Open Firefox. Goto Tools-Addons-Get Addons. Get a whole new variety of recommended addons by Mozilla.
All of them can also be installed from Add/Remove Programs GUI.

Recommended Media Players for Linux

The most amazing players with excellent features and a simple user interface.
Plays almost all types of audios & videos.

Goto Application - Add/Remove Programs - Sound&Video.
Install them and enjoy unlimited fun.

Video Players:
  • VLC
  • Kaffeine
  • Also install codecs for the movie player (default linux player)
Audio Player:
  • Amarok
Download using terminal: Just copy&paste the following code.
  • sudo apt-get install vlc
  • sudo apt-get install kaffeine
  • sudo apt-get install amarok

Creating root Password

The first and most important thing needs to be done is creating a root account.

Open Terminal
Insert Command:
sudo passwd root
Type a password. This is also used for changing the password later.

It is recommended to update your linux flavour frequently.
Go to System/Administration/Update Manager. Install all updates