Showing posts with label Yum. Show all posts
Showing posts with label Yum. Show all posts

Installing gcc4 on CentOS 4 from the command line

This is a very simple entry today. I wanted to install gcc 4.x on CentOS 4. But whenever you do a yum install gcc, it gets gcc 3.4.6. Of course, I try yum install gcc4 and was not able to get the package either. I manage to get it only when I
yum install gcc*

Installing lapack, blas and atlas on CentOS 5.4

Installing lapack, blas and atlas on CentOS 5.4 is very simple.Firstly you must enable the follow repositories:

  1. atlas package - EPEL (For more information on how to download EPEL, see Red Hat Enterprise Linux / CentOS Linux Enable EPEL Repository
  2. blas and lapack packages - RPMForge (For more information on how to download RPMForge, See Install RPMForge
Installing atlas, blas and lapack x86_64 packages
# yum install atlas.x86_64 blas.x86_64 lapack.x86_64

Installing GNU Compilers for CentOS 4.x

If you are installing GNU compilers from yum for CentOS 4.x, here is the yum command to achieve it

GNU Compilers for 3.x (C, C++, Fortran 77, Java)
# yum install gcc, gcc-c++, gcc-g77, gcc-java

GNU Compilers for 4.x (C, C++, Fortran 77, Java)
# yum install gcc4, gcc4-c++, gcc4-gfortran, gcc4-java
Or
#yum install gcc4*

Use Yum to download without installing it

Step 1: First, you have to install the yum-downloadonly plugin for yum
# yum install yum-downloadonly

Step 2: Run the command to download the latest vsftpd
# yum install vsftpd --downloadonly 

Step 3: To specifies an alternate directory to store packages
# yum install vsftpd --downloadonly --downloaddir=/opt

Using yum to local install without checking repository

To prevent yum from going online and check with the repositories, you will need to include --disablerepo flag. For example:
 
yum localinstall --disablerepo=* gcc-4.1.2-48.el5.x86_64.rpm --nogpgcheck

Using Yum Provides

This is a continuation of Using Yum effectively (Part 1) and Using Yum effectively (Part 2)

I have learned a cool command line "yum provides". "yum provides" help you search for the packages that will install either a file or directory. For example

# yum provides bash

bash-3.2-24.el5.x86_64 : The GNU Bourne Again shell (bash) version 3.2
Repo : base
Matched from:

bash-3.2-24.el5.x86_64 : The GNU Bourne Again shell (bash) version 3.1.
Repo : installed
Matched from:
Other : Provides-match: bash

Unable to update glibc for CentOS 4.x

I was trying to update glibc package on my old CentOS 4.x Server, but I seem to encounter errors such as these and unable to

Error: Unable to satisfy dependencies
Error: Package glibc-devel needs glibc = 2.3.4-2.43.el4_8.2, this is not available.
Error: Package glibc-devel needs glibc-headers = 2.3.4-2.43.el4_8.2, this is not available.

To allow the smooth update of glibc package first,
# yum remove glibc-devel glibc-headers glibc-kernheaders

Then finally update the glibc packages
# yum install glibc*

I've got the materials for this blog entry from Bug 6018 - Missing dependency in glibc packages yum not updating

There are unfinished transactions remaining. You might consider running yum-complete-transaction first to finish them

When I was using yum to install a package, I've received a
"There are unfinished transactions remaining. You might consider running yum-complete-transaction first to finish them. The program yum-complete-transaction is found in the yum-utils package."
Apparently, there were aborted or incomplete yum transactions on the system.

First thing First Make sure you have yum-utils package
# yum install yum-utils
Next,run the yum-complete-transaction. You may want to run the yum-transaction --cleanup which is a safe option
# yum-complete-transaction --cleanup-only

Using yum effectively (Part 2)

This is the 2nd part of using yum effectively. See information Using yum effectively (Part 1)

There is one utility seldom used which is part of yum ie yumdownloader. Yumdownloader is a cool utility to download the rpm package instead of installing directly

Using yumdownloader# yum install yum-utils (download the yum-utils package)
# yumdownloader (package-name)
# yumdownloader alpine (For example)
# yumdownloader --source (package-name) (source packages)


Using the GUI yum installer
# yum install pirut
# pirut

Using yum effectively (Part 1)

Yum (Yellow Dog Updater, Modified) is used by CentOS, RHEL, Fedora an an interface to the underlying rpm system.

Some important usages:

1. To install package
# yum install (package-name)
# yum -y install (package-name)


2. To update package
# yum update (package-name)

Launch the GUI for yum update
# yum install pirut
# pup



3. To use yum to install instead of rpm.
(Yum will search for dependencies and repositories)
# yum localinstall (package-name)


4. Uninstalling Package
# yum remove (package-name)


5. Listing Package
# yum list (package-name)


6. Group Install
# yum groupinstall (group-package-name)

Using yum to download the rpm package that have already been installed

Firstly, download the yum-utils method
yum -y install yum-utils

To download a package that have been installed, please use yumdownloader instead
yumdownloader ganglia-gmond

Red Hat Enterprise Linux / CentOS Linux Enable EPEL (Extra Packages for Enterprise Linux) Repository

EPEL (Extra Packages for Enterprise Linux) is a volunteer-based community effort from the Fedora project to create a repository of high-quality add-on packages that complement the Fedora-based Red Hat Enterprise Linux (RHEL) and its compatible spinoffs, such as CentOS and Scientific Linux.
EPEL provide lots of packages for CentOS / RHEL, It is not part of RedHat or CentOS but is designed to work with these major distributions. Please note that EPEL only provides free and open source software unencumbered by patents or any legal issues. In short you will not find mp3, dvd and music / media player under EPEL. However, you will find many programs related to networking, monitoring, sys admin, programming and so on.
Packages are supplied in RPM format and in most cases are ready to use. Beware that some packages may break something and you should not blindly install those packages.
To enable EPEL for CentOS 5
For 32-bits
# rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm
For 64-bits
# rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
To enable EPEL for CentOS 4For 32-bits
# rpm-Uvh http://download.fedora.redhat.com/pub/epel/4/i386/epel-release-4-10.noarch.rpm
For 64-bits
# rpm-Uvh http://download.fedora.redhat.com/pub/epel/4/x86_64/epel-release-4-10.noarch.rpm

Installing RPMForge

RPMForge is a collaboration of Dag, Dries, and other packagers. They provide over 2600 packages for CentOS, including mplayer, xmms-mp3, and other popular media tools. It is not part of RedHat or CentOS but is designed to work with these major distributions.
This Repository is definitely something you will not want to miss out

For CentOS 5 (summary)
# yum install yum-priorities
(x86_64)
wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.1-1.el5.rf.x86_64.rpm
(i386)
# wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.1-1.el5.rf.i386.rpm
# rpm -ivh rpmforge-release-0.5*.rpm
# yum check-update


For CentOS 4 (summary)
# yum install yum-plugin-priorities
(x86_64)
# wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.1-1.el4.rf.x86_64.rpm
(i386)
# wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.1-1.el4.rf.i386.rpm
rpm -ivh rpmforge-release-0.5*.rpm
# yum check-update

For more information, read go to http://rpmrepo.org/RPMforge/

Install g77 on CentOS 5

gfortran which is part of the GNU Compiler Collection (GCC) has replaced the g77 compiler, which stopped development before GCC version 4.0.

For some users who require to use g77, you have to install with the following yum command
yum install compat-gcc*

Encountering Yum error in CentOS 5.x - Traceback (most recent call last) : File "/usr/bin/yum", line 28, in ?

After I have installed CentOS 5.4, and do a yum update, I encountered an error
Traceback (most recent call last) :
     File "/usr/bin/yum", line 28, in ?
     import yummain
ImportError: No module named yummain

I tried doing yum clean all, but the error came up even for this command. To solve the issue, I've used rpm and re-install yum-3.2.22-20.el5.centos.noarch.rpm from the CentOS 5.4 DVD again and the problem ceased.
rpm -Uvh yum-3.2.22-20.el5.centos.noarch.rpm

On another note, there were some solution on Google suggesting to install yum-complete-transaction. Now that was quite painful. I did a yum install yum-complete-transaction. But it actually  meant a

yum install yum-utils

rpm.livna.org Repository

rpm.livna.org, a repository of add-on RPM packages for Fedora as well as RHEL (version 5 and later) and its compatible derivates like CentOS.

In 2008 rpm.livna.org merged with two other package repositories into RPM Fusion. All packages have been moved there except one that RPM Fusion for various reasons didn't want to take.

# wget http://rpm.livna.org/livna-release.rpm
# rpm -Uvh livna-release.rpm

RPM Fusion Repository

RPM Fusion is a merger of Dribble, Freshrpms, and Livna; our goal is to simplify end-user experience by grouping as much add-on software as possible in a single location.

Step 1:
You need to enable EPEL on RHEL5 or compatible distributions like CentOS before you enable RPM Fusion for EL.

Step 2: Download and install rpm package for CentOS
# wget
RPM Fusion free for RHEL5 or compatible like CentOS
RPM Fusion nonfree for RHEL5 or compatible like CentOS

For more information for Fedora and the above information, go to RPM Fusion Configuration

Extra CentOS Repository (CentOS.karan.org)

Extra CentOS Repository (http://centos.karan.org/).

Getting Yum to install from selected repository only

Working from Using Yum to local install without checking Repository, you can use the same principle to install from selected repository while disabling the rest.

# yum --disablerepo=* --enablerepo=dag install (packages)
where dag and update are repositories. If you are not sure the repository names to use, go to /etc/yum.repos.d/xxx.repo. The first line [.....] is the repository names

Cache packages permanently by yum

It is possible to stored installed packages by yum by tweaking th /etc/yum.conf command. Edit with the following
keepcache=1

After installing packages, you will noticed that the rpm will be found at /var/cache/yum