Monday 26 March 2012

What are the different ways to install any Linux Software?


There are many ways to install the software in Linux machine . Some of the ways I would like to mention here.

Case 1:  If your system is connected to Internet  then you can install any new software using the following commands.

YUM ( YellowDog Updater, Modified)

Know More about YUM
======================
This is not an exhaustive list of all yum commands but it is a list of the basic/common/important ones. For a complete list see the yum man page.

   yum list [available|installed|extras|updates|obsoletes|all|recent] [pkgspec]

    This command lets you list packages in any repository enabled on your system or installed. It also lets you list specific types of packages as well as refine your list with a package specification of any of the package's name, arch, version, release, epoch.

   yum list

    By default 'yum list' without any options will list all packages in all the repositories and all the packages installed on your system. Note: 'yum list all' and 'yum list' give the same output.

   yum list available

    Lists all the packages available to be installed in any enabled repository on your system.

   yum list installed

    This is equivalent to rpm -qa. It lists all the packages installed on the system.

  yum list extras

    This command lists any installed package which no longer appears in any of your enabled repositories. Useful for finding packages which linger between upgrades or things installed not from a repo.

   yum list obsoletes

    This command lists any obsoleting relationships between any available package and any installed package.

   yum list updates

    This command lists any package in an enabled repository which is an update for any installed package.

   yum list recent

    This command lists any package added to any enabled repository in the last seven(7) days.

   yum list pkgspec

    This command allows you to refine your listing for particular packages.

    Examples of pkgspecs:

          yum list zsh
          yum list joe\*
          yum list \*.i386
          yum list dovecot-1.0.15

   yum install/remove/update


Case 2: How to install Package using RPM
===============================

RPM command is used for installing, uninstalling, upgrading, querying, listing, and checking RPM packages on your Linux system.

RPM stands for Red Hat Package Manager.

1. Installing a RPM package Using rpm -ivh

rpm -ivh <.rpm package>

< Install rpm Package with out dependencies with --nodeps command >
rpm  --nodeps -ivh  <.rpm package>

ex: rpm –ivh panda-2.0-1.i386.rpm

If you have GUI, then double click on RPM Package then will install respective software automatically.

2. Query all the RPM Packages using rpm -qa

You can use rpm command to query all the packages installed in your system.

rpm –qa

rpm –qa | grep ‘cdrecord’

3. Query a Particular RPM Package using rpm –q

rpm –q Mysqlclient

4. Information about Installed RPM Package using rpm –qi

# rpm -qi MySQL-client
Name        : MySQL-client                 Relocations: (not relocatable)
Version     : 3.23.57                           Vendor: MySQL AB
Release     : 1                             Build Date: Mon 09 Jun 2003 11:08:28 PM CEST
Install Date: Mon 06 Feb 2010 03:19:16 AM PST               Build Host: build.mysql.com
Group       : Applications/Databases        Source RPM: MySQL-3.23.57-1.src.rpm
Size        : 5305109                          License: GPL / LGPL

5. If you have an RPM file that you would like to install, but want to know more information about it before installing, you can do the following:

# rpm -qip MySQL-client-3.23.57-1.i386.rpm

6.  Upgrading a RPM Package using rpm –Uvh
                                                                                                                                                                                                              
Upgrading a package is similar to installing one, but RPM automatically un-installs existing versions of the package before installing the new one.
If an old version of the package is not found, the upgrade option will still install it.

# rpm -Uvh MySQL-client-3.23.57-1.i386.rpm

7. Uninstalling a RPM Package using rpm -e

To remove an installed rpm package using -e as shown below. After uninstallation, you can query using rpm -qa and verify the uninstallation.

# rpm -ev MySQL-client

8. List the Dependency Packages using rpm -qRP

To view the list of packages on which this package depends,

# rpm -qRp MySQL-client-3.23.57-1.i386.rpm
/bin/sh
/usr/bin/perl

Case 3: How to install .tar package or .tar.gz package.
========================================

Step 1: First untar (Extract) the package  using the following commands.
    
       .tar         ->      tar –xvf  <package.tar>

        .tar.gz   ->     tar  -zxvf  <package.tar.gz>

       
Step2:  Change directory to the package source directory.

Step3:  Run
./configure
Step 4:     make
Step 5:   make install

Small Example:

Try installing wireshark using the above procedure.

1.Download wireshark-1.7-tar.gz from wireshark.org

2. Unpack the source from its gzip'd tar file. If you are using Linux, or your version of UNIX uses GNU tar, you can use the following command:

tar zxvf wireshark-1.7-tar.gz
3. Change directory to the Wireshark source directory.

4. Configure your source so it will build correctly for your version of UNIX. You can do this with the following command:

./configure
                   
5. Build the sources into a binary, with the make command. For example:

make
                   
6. Install the software in its final destination, using the command:

make install
7. Once you have installed Wireshark with make install above, you should be able to run it by entering wireshark.
Wireshark &

References:
http://www.wireshark.org/docs/wsug_html_chunked/ChBuildInstallUnixBuild.html
http://www.thegeekstuff.com/2010/07/rpm-command-examples/


How to install Guest additions in Ubuntu Machine
---------------------------------------------------------------
If you already downloaded a VBoxGuestAdditions.iso file to your host filesystem, you should be able to install the image from the VM's Devices menu using Insert Guest Additions CD Image...
Note that does not actually install the guest addition components, it just makes the ISO available as a virtual CD. On Ubuntu Server guest OSes, it does not even mount the virtual CD within the guest system.
Alternatively, you can download the ISO straight into the guest system from the repository, using
sudo apt-get update
sudo apt-get install virtualbox-guest-additions-iso

Once you have made the ISO available by one of the above methods, you must mount it somewhere in the filesystem. I am going to assume you want to use mountpoint /mnt for that, but you can create a different mountpoint if you wish.
If you inserted the ISO image as a virtual CD:
sudo mount /dev/cdrom /mnt
If you installed the guest additions ISO package from inside Ubuntu:
sudo mount /usr/share/virtualbox/VBoxGuestAdditions.iso /mnt
Finally, navigate to the mount point and run the installer:
cd /mnt

sudo ./VBoxLinuxAdditions.run
 
Source:
http://askubuntu.com/questions/565919/process-to-install-virtual-box-guest-additions-virtual-box