Me Myself & Linux

Thursday, August 13, 2009

How to install apps through disc without dependency errors in Linux

This is a very common issue which Linux users face when they try to install any package from a CD or DVD they always have dependency errors as the package manger only tries to install the package you selected and if there are dependency issue it will not look for the required file either on CD (even if they are presnet in the disc) so to resolve this issue there is a Hack we can make the disc which contains package looks like a online repositry to the package manager. In this case we are doing it with YUM.
First you need to reate a dvd.repo text file in /etc/yum.repos.d/ with the following content:
[dvd]mediaid=1170972069.396645*name=DVD for RHEL5( if Redhat Enterprise Linux 5 is Your Operating system if you are using any other OS please change the name)baseurl=file:///media/RHEL_5%20i386%20DVD/Serverenabled=1gpgcheck=0 (*) The mediaid= value comes from the .discinfo file located in the root of the DVD.
For example, to install the dovecot package using the new dvd.repo file, run yum with the --noplugins option so yum will not try to communicate with the online repositry server for dependencyinfact will look in the drive for other files.
# yum install dovecot --nopluginsSetting up Install ProcessParsing package install argumentsResolving Dependencies--> Running transaction check---> Package dovecot.i386 0:1.0-1.2.rc15.el5 set to be updated--> Finished Dependency Resolution
Dependencies Resolved
Package Arch Version Repository Size ===========================================
Installing: dovecot i386 1.0-1.2.rc15.el5 dvd&nb!sp; 1.5 M
Transaction Summary===========================
Install 1 Package(s) Update 0 Package(s) Remove 0 Package(s)
Total download size: 1.5 MIs this ok [y/N]: If problems occur while trying this procedure, run yum clean all and try running yum install again.
[dvd-cluster]mediaid=1170972069.396645name=DVD for RHEL5 - Cluster (type Fedora in place of RHEL5 if using Fedora same goes for if you are using any other flavour)baseurl=file:///media/RHEL_5%20i386%20DVD/Clusterenabled=1gpgcheck=0
[dvd-cluster-storage]mediaid=1170972069.396645name=DVD for RHEL5 - ClusterStorage (type Fedora in place of RHEL5 if using Fedora same goes for if you are using any other flavour)baseurl=file:///media/RHEL_5%20i386%20DVD/ClusterStorageenabled=1gpgcheck=0
[dvd-vt]mediaid=1170972069.396645name=DVD for RHEL5 - VT (type Fedora in place of RHEL5 if using Fedora same goes for if you are using any other flavour)baseurl=file:///media/RHEL_5%20i386%20DVD/VTenabled=1gpgcheck=0
Happy Hacking :-)

How to configure & use YUM

What is yum ?
Yum or Yellow dog Update, Modified is a package manager that was developed by Duke University to improve the installation of RPMs. Yum searches numerous repositories for packages and their dependencies so they may be installed together in an effort to alleviate dependency issues. Red Hat Enterprise Linux 5 uses yum to fetch packages and install RPMs.Yum uses a configuration file at /etc/yum.conf. Also refer yum(8) man page for more information.There are multiple ways by which you can install a repository on the system and install/update packages :
- Add an existing repository
- Setup a new repository having packages populated from ISO’s downloaded from RHN
- Register the system on RHN and subscribe to the channels depending on the subscription you have.How do I use it?
Here are some useful commands.
Install a package:yum install package
Example: “yum install apache”
Remove a package:yum remove package
Example: “yum remove apache”
Update a package:yum update package
Example: “yum update apache”
Search for a package:yum search package
Example: “yum search apache”Find information about a package:yum info package
Example: “yum info apache”List packages containing a certain term:yum list term
Example: “yum list apache”
Find what package provides a particular file:yum whatprovides filename
Example: “yum whatprovides httpd.conf”