Sunday, January 30, 2011

Installing Mercurial on RHEL 5.5

Finally after a few attempts, I could install mercurial on RHEL.

Here are the steps I followed and thanks to a few forum posts, I found out my way through it.

So I tried all kinds of ways but what eventually worked was easy_install.

So this is what you need.

easy_install
python-setuptools

Downloaded the latest mercurial rpm.  Untar it.

Now if you dont have easy_install, install it by running the below command

wget http://pypi.python.org/packages/2.4/s/setuptools/setuptools-0.6c11-py2.4.egg#md5=bd639f9b0eac4c42497034dec2ec0c2b

Once you are done downloading run the below command

ronak@ronak ~ $ sudo sh setuptools-0.6c11-py2.4.egg
[sudo] password for ronak:
Processing setuptools-0.6c11-py2.4.egg
removing '/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg' (and everything under it)
creating /usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg
Extracting setuptools-0.6c11-py2.4.egg to /usr/lib/python2.4/site-packages
setuptools 0.6c11 is already the active version in easy-install.pth
Installing easy_install script to /usr/bin
Installing easy_install-2.4 script to /usr/bin

Installed /usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg
Processing dependencies for setuptools==0.6c11
Finished processing dependencies for setuptools==0.6c11




If you see this, easy_install is installed on your system.

Now, remember you have the untar directory mercurial1.7 (or whatever you have).  Make sure you are at that location.

Run the below command

ronak@ronak ~ $ sudo easy_install mercurial-1.7/
ronak@ronak ~ $ sudo easy_install mercurial-1.7/
Processing
Running setup.py -q bdist_egg --dist-dir /usr/local/home/rpatel/mercurial-1.7/egg-dist-tmp-bHHAXk
zip_safe flag not set; analyzing archive contents...
mercurial.help: module references __file__
mercurial.lsprof: module references __file__
mercurial.commands: module references __file__
mercurial.extensions: module references __file__
mercurial.i18n: module references __file__
mercurial.templater: module references __file__
hgext.mq: module references __file__
Adding mercurial unknown to easy-install.pth file
Installing hg script to /usr/bin

Installed /usr/lib/python2.4/site-packages/mercurial-unknown-py2.4-linux-i686.egg
Processing dependencies for mercurial==unknown
Finished processing dependencies for mercurial==unknown


ronak@ronak ~ $ hg
Mercurial Distributed SCM

basic commands:

 add        add the specified files on the next commit
 annotate   show changeset information by line for each file
 clone      make a copy of an existing repository
 commit     commit the specified files or all outstanding changes
 diff       diff repository (or selected files)
 export     dump the header and diffs for one or more changesets
 forget     forget the specified files on the next commit
 init       create a new repository in the given directory
 log        show revision history of entire repository or files
 merge      merge working directory with another revision
 pull       pull changes from the specified source
 push       push changes to the specified destination
 remove     remove the specified files on the next commit
 serve      start stand-alone webserver
 status     show changed files in the working directory
 summary    summarize working directory state
 update     update working directory (or switch revisions)

use "hg help" for the full list of commands or "hg -v" for details
ronak@ronak ~ $

Hurray... You are done..!!!!


Yum

YUM (Yellow Dog Updater, Modified)

The Yellowdog Updater, Modified (YUM) is an open-source command-line package-management utility for RPM-compatible Linux operating systems and has been released under the GNU General Public License. It was developed by Seth Vidal and a group of volunteer programmers. Though yum has a command-line interface, several other tools provide graphical user interfaces to yum functionality.


Installing and Upgrading Packages with Yum

Install Packages, Upgrade packages and System upgrades
Update your package list
# yum check-update
Install a new package
# yum -y install compiz
-y flag allows unattended installation.
Update a single Package
# yum update gnome
Update several packages
# yum update nbserver nbweb-billing nginx
Update all installed packages
# yum update
Search for a package to install
# yum search ImageMagick
If you need a particular library, but don't know what package provides it, yum will find it
# yum provides compiz

Removing Packages through Yum

# yum remove compiz
# yum remove compiz gnome ImageMagick

Obtaining information of installed packages through Yum

# yum list compiz
# yum list | grep gnome
# yum info compiz
# yum list updates

Maintain Yum

# yum clean packages -- to delete all cached packages
# yum clean headers -- to force fresh download of package headers
# yum clean oldheaders -- to remove old headers that the system no longer needs
# yum clean all == remove cached packages and old headers, preserving all the current headers

RPMs

Red Hat Package Management


Installing RPMs

# rpm -i packagename

# rpm -ivh packagename
  -v adds verbose feedback, and -h draws progress hashmarks

# rpm -ivh --test packagename

Upgrading RPMs

# rpm -Uvh packagename

To test the package install without really installing it.
# rpm -Uvh --test packagename


Removing RPMs

#rpm -e packagename does the job 

# rpm -ev packagename

( You dont need to mention the entire package, (abcd-1.23.34.5.i386.rpm) just the label name (abcd).


Removing/Uninstalling multiple RPMs at once.

# rpm -ev packagename packagename packagename


If you dont want to check dependencies,

#rpm -ev --nodeps packagename


To test your command before uninstalling/removing
#rpm -ev --test packagename


Collecting information on Installed RPMs
Use RPM's querying features.  All the queries start with rpm -q.
# rpm -q compiz

# rpm -qa | grep ubuntu

Listing files in an installed package

# rpm -ql compiz



To list the documentation for an application, use

# rpm -qd ubuntu

To list the configuration files for a package, use

# rpm -qc compiz

Listing the configuration files for a command

# rpm -qcf /usr/bin/ssh


To list all the packages installed, use

# rpm -qa

To see what package a file belongs to, use

# rpm -qf /usr/bin/abcd

To display package information 

# rpm -qi packagename


RPM queries will not follow symlinks, and will report that the file is "not owned by any package"  To find the file that a symlink points to , use:

# namei ~/ronak

Collecting Information from RPMs that are not installed.

Listing documentation files
# rpm -qpd abcd.rpm


Listing all the files of the package:

# rpm -qp1 abcd.rpm

Listing dependencies this package requires, 
# rpm -qpR abcd.rpm


To see what this package provides

# rpm -qp --provides abcd.rpm


Finding recentally installed RPMs

# rpm -qa --last
If the list is too long, rpm -qa --last | head.


Rebuild RPM database

# rpm --rebuilddb


Recreate RPM database
# rpm --initdb