Installing and updating packages in linux.

I have always had difficulty in installing packages in Linux/ UNIX system. But after doing lots of googling and studying about it I found out that it is not so difficult indeed .I would like to share the knowledge.

There are three ways by which you can install a package.

1. Through a package manager like YUM/APT.

2. Using an RPM package.

3. Installing from source.

I will take up each method one by one.

I. Installing using package management utility-

Note: You should have you computer connected to net.

Installing packages using package management utility is the easiest of all the method.

YUM /APT fetches the files related to the package from a repository and installs it to your computer.

Advantages.

1. Easy option to install, uninstalls, update and maintain packages.

2. You get the latest package.

3. All the dependent modules/packages can also be installed

Commands for installation using YUM.

Lets try to install mplayer

1. we will check if the package is available .

# yum list mplayer

This will list information about the packsge iff available.

2. Install Packages

# yum install mplayer

You can also use wildcard to install all mplayer packages.

# yum install mplayer*

Will install all the dependent packages also.

3. Uninstall Packages

# yum remove mplayer

It completely removes the package.

Commands for installation using APT.

1. We will check if the package is available.

# apt-cache search mplayer

This will list information about the package if available.

2. Install Packages

# apt-get install mplayer

You can also use wildcard to install all mplayer packages.

3. Uninstall Packages

# apt-get remove mplayer

It completely removes the package.

II. Installing from RPM file-

1. Download the RPM file of the package.

For ex-

# wget http://apt.sw.be/redhat/9/en/i386/RPMS.dag/mplayer-1.0-0.20.pre7.0.rh9.rf.i386.rpm

2. Install package.

# rpm -ivh mplayer-1.0-0.20.pre7.0.rh9.rf.i386.rpm

or

# dpkg -i [Package] (for debian linux)

3. Upgrade package.

# rpm -Uvh [Package]

Command will upgrade the package if it is already installed or install it if it is not

To perfrom only upgrade if the package is curently installed, use,

# rpm -Fvh [Package]

4. Remove package.

# rpm -e [Package]

Will remove the package completely

III. Installing from Source-

Installing packages from source file in the most difficult of all instalation process and should avoid it.

1. Move to src directory.

# cd /usr/src

2. Get the source code.

# svn checkout svn://svn.mplayerhq.hu/mplayer/trunk mplayer

or

download and unzip

3. Move to the source directory.

4. Check configuration options

# ./configure -help

5. Configure with appropriate options

# ./configure --enable-jpeg

6. Compile

# make

7. Install

# make install

8. Uninstall

# make uninstall





Post a Comment

0 Comments