How to Setup Local Yum Repository from CD-ROM/DVD-ROM image on CentOS 5.8

In this post, i will share on how to setup local yum repository from CD-ROM/DVD-ROM image on CentOS 5.8. This quick setup will very useful for those who do not have internet connection and does not have yum repository server on their organization. Using local yum repository, you will able to perform yum installation using the available packages on your CD-ROM/DVD-ROM. This steps may be also working on other version of CentOS server.

1. Insert DVD/ISO into DVD-Drive.
2. Mount the ISO from the DVD-ROM into /mnt directory :

[root@centos58 ~]# mount /dev/cdrom /mnt
mount: block device /dev/cdrom is write-protected, mounting read-only

3. Create centos58.repo text file in /etc/yum.repos.d/ with the following content. Please create something as follow:

[root@centos58 ~]# vi /etc/yum.repos.d/centos58.repo
[CentOS5.8-Repository]
name=DVD-CentOS5.8 repository
baseurl=file:///mnt
enabled=1
gpgcheck=0

4. Finish. You can start install, remove and update using yum command :
Example :

[root@centos58 ~]# yum install httpd -y

How to Setup Local Yum Repository from CD-ROM/DVD-ROM image on Fedora 16

In this post, i will share on how to install, update and remove RPM packages from CD-ROM/DVD-ROM image or local yum repository on linux Fedora 16 server. This will very useful when you are running on slow internet connection. Instead of go through the internet connection, it is possible to use local repository to install the module and package. Follow these steps to setup your local CD-ROM/DVD-ROM yum repository on linux Fedora 16 server.

1. Mount your DVD into /mnt or /media. It’s depend on you.

[root@fedora16 ~]# mount /dev/cdrom /mnt
mount: block device /dev/sr0 is write-protected, mounting read-only

2. Enter to /mnt directory and list out the files :

[root@fedora16 ~]# cd /mnt
[root@fedora16 mnt]# ls
GPL       RPM-GPG-KEY-fedora               RPM-GPG-KEY-fedora-ppc    RPM-GPG-KEY-fedora-sparc64
images    RPM-GPG-KEY-fedora-16-primary    RPM-GPG-KEY-fedora-ppc64  RPM-GPG-KEY-fedora-x86_64
isolinux  RPM-GPG-KEY-fedora-16-secondary  RPM-GPG-KEY-fedora-s390   TRANS.TBL
Packages  RPM-GPG-KEY-fedora-arm           RPM-GPG-KEY-fedora-s390x
repodata  RPM-GPG-KEY-fedora-i386          RPM-GPG-KEY-fedora-sparc

3. Create files fedora16.repo under /etc/yum.repos.d and enter the following lines :

[root@fedora16 ~]# vi /etc/yum.repos.d/fedora16.repo

Enter these lines in fedora16.repo :

[Fedora16-Repository]
name=DVD-Fedora16 Repository
baseurl=file:///mnt
enabled=1
gpgcheck=0

Please proceed to step 4 – step 8 when you perform yum command to install the package or module and get the following error :

Error: Cannot retrieve repository metadata (repomd.xml) for repository: fedora. 
Please verify its path and try again

4. Create repo.disabled inside /etc/yum.repos.d :

[root@fedora16 ~]# mkdir /etc/yum.repos.d/repo.disabled

[root@fedora16 ~]# ls /etc/yum.repos.d/
fedora16.repo fedora.repo  fedora-updates.repo  fedora-updates-testing.repo  repo.disabled

6. Then moved all these 3 repo files into “repo.disabled” folder :

[root@fedora16 ~]# mv /etc/yum.repos.d/fedora.repo /etc/yum.repos.d/repo.disabled
[root@fedora16 ~]# mv /etc/yum.repos.d/fedora-updates.repo /etc/yum.repos.d/repo.disabled
[root@fedora16 ~]# mv /etc/yum.repos.d/fedora-updates-testing.repo /etc/yum.repos.d/repo.disabled

7. List out the updated files and folders inside /etc/yum.repos.d :

[root@fedora16 ~]# ls -l /etc/yum.repos.d/
total 8
-rw-r--r--. 1 root root   92 Mar 18 00:09 fedora16.repo
drwxr-xr-x. 2 root root 4096 Mar 18 01:27 repo.disabled

Note : Only file fedora16.repo and folder repo.disabled should be exist.

8. Run yum clean all to clear up your yum cache directory :

[root@fedora16 ~]# yum clean all
Cleaning repos: Fedora16-Repository
Cleaning up Everything

9. Steps completed. You can start using yum command as usual.

[root@fedora16 ~]# yum install module/package
[root@fedora16 ~]# yum update module/package
[root@fedora16 ~]# yum remove module/package

How to Fix “Warning: RPMDB altered outside of yum” Error on Linux Fedora 16 Server

Question :
When i try to install the packages or software using the yum command, the following error or warning message appeared:

Running Transaction Check
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
  Installing :......

Answer :
Some application has altered the rpm database (installed or removed a package) without going through the Yum APIs. To avoid this, it’s recommended to update, install or remove RPM packages using yum command, instead of ” rpm -e” or “rpm -i” or “rpm -ivh” or “rpm -Uvh”.

To fix this, just run this command :

[root@fedora16 ~]# yum clean all
Cleaning repos: Fedora16-Repository
Cleaning up Everything

How to Install and Configure EPEL Repository on CentOS 6.2

In this post, i will show you on how to install and configure the Extra Packages for Enterprise Linux (EPEL) repository on CentOS 6.2. EPEL repository is another extra repository that creates, maintains, and manages a high quality set of additional packages for Enterprise Linux, including, but not limited to, Red Hat Enterprise Linux (RHEL) and CentOS server. To install the repository, you can follow this steps :

1. First we import the GPG keys for EPEL software packages:

[root@centos62 ~]# wget http://ftp.riken.jp/Linux/fedora/epel/RPM-GPG-KEY-EPEL-6
[root@centos62 ~]# wget http://ftp.riken.jp/Linux/fedora/epel/RPM-GPG-KEY-EPEL-6
--2012-03-07 22:08:39--  http://ftp.riken.jp/Linux/fedora/epel/RPM-GPG-KEY-EPEL-6
Resolving ftp.riken.jp... 134.160.38.1
Connecting to ftp.riken.jp|134.160.38.1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1649 (1.6K) [text/plain]
Saving to: âRPM-GPG-KEY-EPEL-6â

100%[==========================================================>] 1,649       --.-K/s   in 0.002s

2012-03-07 22:08:40 (929 KB/s) - âRPM-GPG-KEY-EPEL-6â

2. Then we enable the EPEL repositories using the following command :

[root@centos62 ~]# rpm --import RPM-GPG-KEY-EPEL-6

3. Download EPEL repository for 32-bit CentOS :

[root@centos62 ~]# wget http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-5.noarch.rpm
[root@centos62 ~]# wget http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-5.noarch.rpm
--2012-03-07 22:06:10--  http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-5.noarch.rpm
Resolving dl.fedoraproject.org... 209.132.181.27, 209.132.181.23, 209.132.181.24, ...
Connecting to dl.fedoraproject.org|209.132.181.27|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 14064 (14K) [application/x-rpm]
Saving to: âepel-release-6-5.noarch.rpmâ

100%[==========================================================>] 14,064      36.7K/s   in 0.4s

2012-03-07 22:06:14 (36.7 KB/s) - âepel-release-6-5.noarch.rpmâ

4. Install EPEL repository on 32-bit CentOS :

[root@centos62 ~]# rpm -ivh epel-release-6-5.noarch.rpm
Preparing...                ########################################### [100%]
   1:epel-release           ########################################### [100%]

5. Edit the the EPEL repository file and Set priority for the EPEL repository as below :

[root@centos62 ~]# vi /etc/yum.repos.d/epel.repo

6. Add priority=3 to the [epel] section, under enabled=1 :

[epel]
name=Extra Packages for Enterprise Linux 6 - $basearch
#baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch
failovermethod=priority
enabled=1
priority=3
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6

[epel-debuginfo]
name=Extra Packages for Enterprise Linux 6 - $basearch - Debug
#baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch/debug
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-6&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
gpgcheck=1

[epel-source]
name=Extra Packages for Enterprise Linux 6 - $basearch - Source
#baseurl=http://download.fedoraproject.org/pub/epel/6/SRPMS
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-source-6&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
gpgcheck=1

What packages and versions are available in EPEL?
You can take a look on any of the available EPEL mirrors from our mirror list

Alternately, you can browse the package set using repoview:

How to Install and Configure yum-priorities on RHEL 6/CentOS 6

In this post, i will show on how to install and configure yum-priorities on CentOS 6 or RHEL 6 Linux server. Theoretically, the repositories with the lowest numerical priority number have the highest priority. This is one of the method to prevents mistakes such as accidentally running yum upgrade with everything. This steps has been tested on CentOS 6.2, but it may working on CentOS 6.0, CentOS 6.1 and RHEL 6 server.

1. To Install the yum-priorities, simply run this command :

[root@centos62 ~]# yum install yum-priorities -y

Example :

[root@centos62 ~]# yum install yum-priorities -y
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.ipserverone.com
 * epel: ftp.jaist.ac.jp
 * extras: centos.ipserverone.com
 * remi: iut-info.univ-reims.fr
 * remi-test: iut-info.univ-reims.fr
 * rpmforge: ftp-stud.fht-esslingen.de
 * updates: centos.ipserverone.com
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package yum-plugin-priorities.noarch 0:1.1.30-10.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================
 Package                          Arch              Version                   Repository       Size
====================================================================================================
Installing:
 yum-plugin-priorities            noarch            1.1.30-10.el6             base             22 k

Transaction Summary
====================================================================================================
Install       1 Package(s)

Total download size: 22 k
Installed size: 28 k
Downloading Packages:
yum-plugin-priorities-1.1.30-10.el6.noarch.rpm                               |  22 kB     00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
  Installing : yum-plugin-priorities-1.1.30-10.el6.noarch                                       1/1

Installed:
  yum-plugin-priorities.noarch 0:1.1.30-10.el6

Complete!

2. After the plugin is installed, make sure that it is enabled on /etc/yum/pluginconf.d/priorities.conf file.

[root@centos62 ~]# more /etc/yum/pluginconf.d/priorities.conf
[main]
enabled = 1

If “enabled” value = 0, you can enable it using vi editor and set it to 1.

3. With the plugin enabled, you may add priorities to the target repositories by adding the following line :

priority=N

Where N is an integer from 1 to 99. The lower the number the more important it is, so CentOS-Base.repo must always the lowest.

[root@centos62 ~]# vi /etc/yum.repos.d/CentOS-Base.repo

Add this line on base repo :

priority = 1

Example :

# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#

[base]
name=CentOS-$releasever - Base
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
priority = 1

#released updates
[updates]
name=CentOS-$releasever - Updates
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
#baseurl=http://mirror.centos.org/centos/$releasever/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
-- INSERT --

4. As an example, another 3rd party repository is Remi. Follow this steps to Add the Remi Repository on CentOS 6/RHEL 6 Linux Server :
Open the Remi configuration file and insert “priority = 5” after “enabled = 1” in the [remi] section :

[root@centos62 ~]# vi /etc/yum.repos.d/remi.repo

Example :

[remi]
name=Les RPM de remi pour Enterprise Linux $releasever - $basearch
#baseurl=http://rpms.famillecollet.com/enterprise/$releasever/remi/$basearch/
mirrorlist=http://rpms.famillecollet.com/enterprise/$releasever/remi/mirror
enabled=1
priority = 5
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi
failovermethod=priority

[remi-test]
name=Les RPM de remi en test pour Enterprise Linux $releasever - $basearch
#baseurl=http://rpms.famillecollet.com/enterprise/$releasever/test/$basearch/
mirrorlist=http://rpms.famillecollet.com/enterprise/$releasever/test/mirror
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi

How to Install and Configure EPEL Repository on CentOS 5.8

EPEL repository is another extra repository that creates, maintains, and manages a high quality set of additional packages for Enterprise Linux, including, but not limited to, Red Hat Enterprise Linux (RHEL) and CentOS server. In this post, i will show you on how to install and configure the Extra Packages for Enterprise Linux (EPEL) repository on CentOS 5.8. To install the repository, you can follow this steps :

1. First we import the GPG keys for EPEL software packages:

[root@centos58 ~]# wget http://ftp.riken.jp/Linux/fedora/epel/RPM-GPG-KEY-EPEL-5

Example :

[root@centos58 ~]# wget http://ftp.riken.jp/Linux/fedora/epel/RPM-GPG-KEY-EPEL-5
--2012-05-12 05:01:11--  http://ftp.riken.jp/Linux/fedora/epel/RPM-GPG-KEY-EPEL-5
Resolving ftp.riken.jp... 134.160.38.1
Connecting to ftp.riken.jp|134.160.38.1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1698 (1.7K) [text/plain]
Saving to: `RPM-GPG-KEY-EPEL-5'

100%[==========================================================>] 1,698       --.-K/s   in 0s

2012-05-12 05:01:12 (42.2 MB/s) - `RPM-GPG-KEY-EPEL-5' saved [1698/1698]

2. Then we enable the EPEL repositories using the following command :

[root@centos58 ~]# rpm --import RPM-GPG-KEY-EPEL-5

3. Download EPEL repository for 32-bit CentOS :

[root@centos58 ~]# wget http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm

Example :

[root@centos58 ~]# wget http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
--2012-05-12 05:04:03--  http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
Resolving dl.fedoraproject.org... 209.132.181.25, 209.132.181.26, 209.132.181.27, ...
Connecting to dl.fedoraproject.org|209.132.181.25|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 12232 (12K) [application/x-rpm]
Saving to: `epel-release-5-4.noarch.rpm'

100%[==========================================================>] 12,232      43.7K/s   in 0.3s

2012-05-12 05:04:04 (43.7 KB/s) - `epel-release-5-4.noarch.rpm' saved [12232/12232]

4. Install EPEL repository on 32-bit CentOS :

[root@centos58 ~]# rpm -ivh epel-release-5-4.noarch.rpm
Preparing...                ########################################### [100%]
   1:epel-release           ########################################### [100%]

5. You can start using EPEL repository :

# yum install package name -y
Example :

[root@centos58 ~]# yum install phpmyadmin -y

How to Install Remi yum Repository on CentOS 6.2 x86 and x86_64

There are several 3rd party repositories for CentOS 6 server. One of the popular one is remi repository. The Remi repository is a repository containing updated PHP and MySQL packages and is maintained by Remi. In this post, i will show you on how to install remi repository on linux CentOS 6.2 server

Import the RPM-GPG-KEY key and install remi rpm package :

[root@centos62 ~]# rpm --import http://rpms.famillecollet.com/RPM-GPG-KEY-remi
[root@centos62 ~]# rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
Retrieving http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
Preparing...                ########################################### [100%]
   1:remi-release           ########################################### [100%]

To enable this repo, please change “enabled” value to 1 :

[remi]
name=Les RPM de remi pour Enterprise Linux $releasever - $basearch
#baseurl=http://rpms.famillecollet.com/enterprise/$releasever/remi/$basearch/
mirrorlist=http://rpms.famillecollet.com/enterprise/$releasever/remi/mirror
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi
failovermethod=priority

[remi-test]
name=Les RPM de remi en test pour Enterprise Linux $releasever - $basearch
#baseurl=http://rpms.famillecollet.com/enterprise/$releasever/test/$basearch/
mirrorlist=http://rpms.famillecollet.com/enterprise/$releasever/test/mirror
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi

How to Fix “Error: Cannot retrieve repository metadata (repomd.xml) for repository: fedora. Please verify its path and try again” Error When using Local DVD-ROM/CD-ROM Yum Repository on Fedora 16

Question :

I am using Local DVD-ROM/CD-ROM yum Repository on Fedora 16. But when i perform any yum command to install or update or remove the package/module, i get the following error :

Error: Cannot retrieve repository metadata (repomd.xml) for repository: fedora. 
Please verify its path and try again

Answer :
To fix the following error, follow this steps :

1. Create repo.disabled inside /etc/yum.repos.d :

[root@fedora16 ~]# mkdir /etc/yum.repos.d/repo.disabled

By default of minimal installation of Fedora 16 server, there are 3 file in /etc/yum.repos.d as below :

[root@fedora16 ~]# ls /etc/yum.repos.d/
fedora.repo  fedora-updates.repo  fedora-updates-testing.repo  repo.disabled

Note : repos.disabled is the folder that you created in step (1).

2. Then moved all these 3 repo files into “repo.disabled” folder :

[root@fedora16 ~]# mv /etc/yum.repos.d/fedora.repo /etc/yum.repos.d/repo.disabled
[root@fedora16 ~]# mv /etc/yum.repos.d/fedora-updates.repo /etc/yum.repos.d/repo.disabled
[root@fedora16 ~]# mv /etc/yum.repos.d/fedora-updates-testing.repo /etc/yum.repos.d/repo.disabled

3. Create files fedora16.repo under /etc/yum.repos.d and enter the following lines :

[root@fedora16 ~]# vi /etc/yum.repos.d/fedora16.repo

Enter these lines in fedora16.repo :

[Fedora16-Repository]
name=DVD-Fedora16 Repository
baseurl=file:///mnt
enabled=1
gpgcheck=0

Check What file and folder inside /etc/yum.repos.d :

[root@fedora16 ~]# ls -l /etc/yum.repos.d/
total 8
-rw-r--r--. 1 root root   92 Mar 18 00:09 fedora16.repo
drwxr-xr-x. 2 root root 4096 Mar 18 01:27 repo.disabled

4. Run yum clean all to clear up your yum cache directory :

[root@fedora16 ~]# yum clean all
Cleaning repos: Fedora16-Repository
Cleaning up Everything

5. Steps completed. You can start using yum command as usual.

How to Install Webtatic Repository on RHEL 6/CentOS 6

In this post, i will share on how to install Webtatic repository on Red Hat Enterprise Linux 6 (RHEL 6). However the steps may working on CentOS 6.0, CentOS 6.1 and CentOS 6.2. From the webtatic.com, the Webtatic yum repository is a CentOS/RHEL repository containing updated web-related packages. Webtatic goals are to provide CentOS/RHEL administrators with the latest stable minor releases of web development/hosting software, which are not provided in CentOS/RHEL distribution minor releases. It’s also serve as an additional installation option for some of Webtatic’s projects.

RHEL 6/ CentOS 6 for i386
RHEL 6/ CentOS 6 for x86_64

1.Download the webtatic-release package :

[root@rhel6 ~]# wget http://repo.webtatic.com/yum/el6/i386/webtatic-release-6-1.noarch.rpm
[root@rhel6 ~]# wget http://repo.webtatic.com/yum/el6/i386/webtatic-release-6-1.noarch.rpm
--2012-03-14 05:15:57--  http://repo.webtatic.com/yum/el6/i386/webtatic-release-6-1.noarch.rpm
Resolving repo.webtatic.com... 184.22.117.192
Connecting to repo.webtatic.com|184.22.117.192|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 11488 (11K) [application/x-redhat-package-manager]
Saving to: âwebtatic-release-6-1.noarch.rpmâ

100%[==========================================================>] 11,488      8.15K/s   in 1.4s

2012-03-14 05:16:03 (8.15 KB/s) - âwebtatic-release-6-1.noarch.rpmâ

2. Download and import webtatic-andy GPG key :

[root@rhel6 ~]# rpm --import http://repo.webtatic.com/yum/RPM-GPG-KEY-webtatic-andy

3. Verify the webtatic-release package you have downloaded :

[root@rhel6 ~]# rpm -K webtatic-release-6-1.noarch.rpm
webtatic-release-6-1.noarch.rpm: (sha1) dsa sha1 md5 gpg OK

4. Install Webtatic Repository :

[root@rhel6 ~]# rpm -Uvh webtatic-release-6-1.noarch.rpm
Preparing...                ########################################### [100%]
   1:webtatic-release       ########################################### [100%]

How to use Webtatic repository :
[root@rhel6 ~]# yum –enablerepo=webtatic install [rpm package]

How to Install phpMyAdmin on CentOS 5.7 using RPMforge Repository

phpMyAdmin is a free software tool written in PHP intended to handle the administration of MySQL over the World Wide Web. It can manage a whole MySQL server (needs a super-user) as well as a single database. phpMyAdmin supports a wide range of operations with MySQL. The most frequently used operations are supported by the user interface (managing databases, tables, fields, relations, indexes, users, permissions, etc), while you still have the ability to directly execute any SQL statement. In this post, i will show on how to install phpMyAdmin on CentOS 5.7 using RPMforge repository. This steps has been tested on CentOS 5.7, but it may working on CentOS 5.1, CentOS 5.2, CentOS 5.4, CentOS 5.5, CentOS 5.6 and RHEL 5. At the time this article wrote, the installed phpMyAdmin was phpMyAdmin version 2.11. This post assumed that third party repository RPMforge has been added, MySQL and Apache Httpd server also has been installed and configured as per guidelines below :

How to Install MySQL Database Server on CentOS 5.7
How to Install Httpd on CentOS 5.7
How to Add the RPMforge Repository on CentOS 5/RHEL 5 Linux Server

1. Simply run this command to install phpMyAdmin :

[root@CentOS57 ~]# yum install phpmyadmin -y
[root@CentOS57 ~]# yum install phpmyadmin -y
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.oscc.org.my
 * extras: mirror.oscc.org.my
 * rpmforge: ftp-stud.fht-esslingen.de
 * updates: mirror.oscc.org.my
base                                                                         | 1.1 kB     00:00
extras                                                                       | 2.1 kB     00:00
updates                                                                      | 1.9 kB     00:00
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package phpmyadmin.noarch 0:2.11.11.3-2.el5.rf set to be updated
--> Processing Dependency: php-mysql >= 4.1.0 for package: phpmyadmin
--> Processing Dependency: php-mbstring >= 4.1.0 for package: phpmyadmin
--> Processing Dependency: php-mcrypt for package: phpmyadmin
--> Running transaction check
---> Package php-mbstring.i386 0:5.1.6-32.el5 set to be updated
--> Processing Dependency: php-common = 5.1.6-32.el5 for package: php-mbstring
---> Package php-mcrypt.i386 0:5.1.6-15.el5.centos.1 set to be updated
--> Processing Dependency: php >= 5.1.6 for package: php-mcrypt
--> Processing Dependency: libmcrypt.so.4 for package: php-mcrypt
---> Package php-mysql.i386 0:5.1.6-32.el5 set to be updated
--> Processing Dependency: php-pdo for package: php-mysql
--> Running transaction check
---> Package libmcrypt.i386 0:2.5.8-4.el5.centos set to be updated
---> Package php.i386 0:5.1.6-32.el5 set to be updated
--> Processing Dependency: php-cli = 5.1.6-32.el5 for package: php
--> Processing Dependency: libcurl.so.3 for package: php
--> Processing Dependency: libgmp.so.3 for package: php
--> Processing Dependency: libidn.so.11 for package: php
--> Processing Dependency: libaspell.so.15 for package: php
--> Processing Dependency: libpspell.so.15 for package: php
---> Package php-common.i386 0:5.1.6-32.el5 set to be updated
---> Package php-pdo.i386 0:5.1.6-32.el5 set to be updated
--> Running transaction check
---> Package aspell.i386 12:0.60.3-12 set to be updated
--> Processing Dependency: aspell-en for package: aspell
---> Package curl.i386 0:7.15.5-15.el5 set to be updated
---> Package gmp.i386 0:4.1.4-10.el5 set to be updated
---> Package libidn.i386 0:0.6.5-1.1 set to be updated
---> Package php-cli.i386 0:5.1.6-32.el5 set to be updated
--> Running transaction check
---> Package aspell-en.i386 50:6.0-2.1 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================
 Package                Arch             Version                           Repository          Size
====================================================================================================
Installing:
 phpmyadmin             noarch           2.11.11.3-2.el5.rf                rpmforge           4.2 M
Installing for dependencies:
 aspell                 i386             12:0.60.3-12                      base               946 k
 aspell-en              i386             50:6.0-2.1                        base               1.6 M
 curl                   i386             7.15.5-15.el5                     base               235 k
 gmp                    i386             4.1.4-10.el5                      base               664 k
 libidn                 i386             0.6.5-1.1                         base               194 k
 libmcrypt              i386             2.5.8-4.el5.centos                extras             116 k
 php                    i386             5.1.6-32.el5                      base               2.3 M
 php-cli                i386             5.1.6-32.el5                      base               2.1 M
 php-common             i386             5.1.6-32.el5                      base               153 k
 php-mbstring           i386             5.1.6-32.el5                      base               996 k
 php-mcrypt             i386             5.1.6-15.el5.centos.1             extras              16 k
 php-mysql              i386             5.1.6-32.el5                      base                87 k
 php-pdo                i386             5.1.6-32.el5                      base                66 k

Transaction Summary
====================================================================================================
Install      14 Package(s)
Upgrade       0 Package(s)

Total download size: 14 M
Downloading Packages:
(1/14): php-mcrypt-5.1.6-15.el5.centos.1.i386.rpm                            |  16 kB     00:00
(2/14): php-pdo-5.1.6-32.el5.i386.rpm                                        |  66 kB     00:00
(3/14): php-mysql-5.1.6-32.el5.i386.rpm                                      |  87 kB     00:00
(4/14): libmcrypt-2.5.8-4.el5.centos.i386.rpm                                | 116 kB     00:01
(5/14): php-common-5.1.6-32.el5.i386.rpm                                     | 153 kB     00:01
(6/14): libidn-0.6.5-1.1.i386.rpm                                            | 194 kB     00:01
(7/14): curl-7.15.5-15.el5.i386.rpm                                          | 235 kB     00:01
(8/14): gmp-4.1.4-10.el5.i386.rpm                                            | 664 kB     00:05
(9/14): aspell-0.60.3-12.i386.rpm                                            | 946 kB     00:11
(10/14): php-mbstring-5.1.6-32.el5.i386.rpm                                  | 996 kB     00:08
(11/14): aspell-en-6.0-2.1.i386.rpm                                          | 1.6 MB     00:13
(12/14): php-cli-5.1.6-32.el5.i386.rpm                                       | 2.1 MB     00:20
(13/14): php-5.1.6-32.el5.i386.rpm                                           | 2.3 MB     00:23
(14/14): phpmyadmin-2.11.11.3-2.el5.rf.noarch.rpm                            | 4.2 MB     00:42
----------------------------------------------------------------------------------------------------
Total                                                               103 kB/s |  14 MB     02:14
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : php-common                                                                  1/14
  Installing     : libidn                                                                      2/14
  Installing     : curl                                                                        3/14
  Installing     : gmp                                                                         4/14
  Installing     : php-mbstring                                                                5/14
  Installing     : php-pdo                                                                     6/14
  Installing     : php-mysql                                                                   7/14
  Installing     : libmcrypt                                                                   8/14
  Installing     : aspell-en                                                                   9/14
  Installing     : aspell                                                                     10/14
  Installing     : php-cli                                                                    11/14
  Installing     : php                                                                        12/14
  Installing     : php-mcrypt                                                                 13/14
  Installing     : phpmyadmin                                                                 14/14

Installed:
  phpmyadmin.noarch 0:2.11.11.3-2.el5.rf

Dependency Installed:
  aspell.i386 12:0.60.3-12                           aspell-en.i386 50:6.0-2.1
  curl.i386 0:7.15.5-15.el5                          gmp.i386 0:4.1.4-10.el5
  libidn.i386 0:0.6.5-1.1                            libmcrypt.i386 0:2.5.8-4.el5.centos
  php.i386 0:5.1.6-32.el5                            php-cli.i386 0:5.1.6-32.el5
  php-common.i386 0:5.1.6-32.el5                     php-mbstring.i386 0:5.1.6-32.el5
  php-mcrypt.i386 0:5.1.6-15.el5.centos.1            php-mysql.i386 0:5.1.6-32.el5
  php-pdo.i386 0:5.1.6-32.el5

Complete!

2. Configure phpMyAdmin to allows connections not just from localhost by change the following line :

Allow from 127.0.0.1

to

Allow from all

New Configuration should as below :

#
#  Web application to manage MySQL
#

<Directory "/usr/share/phpmyadmin">
  Order Deny,Allow
  Deny from all
  Allow from all
</Directory>

Alias /phpmyadmin /usr/share/phpmyadmin
Alias /phpMyAdmin /usr/share/phpmyadmin
Alias /mysqladmin /usr/share/phpmyadmin

3. Change the authentication in phpMyAdmin from cookie to http :

/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'http';

4. Reload or restart the apache server :

[root@CentOS57 ~]# service httpd reload
  •  Apache: http://httpd.apache.org/
  • References :

  • PHP: http://www.php.net/
  • MySQL: http://www.mysql.com/
  • CentOS: http://www.centos.org/
  • phpMyAdmin: http://www.phpmyadmin.net/
  • How to Install and Configure yum-priorities on CentOS 5/RHEL 5 Linux Server

    In this post, i will show on how to install and configure yum-priorities on CentOS 5 or RHEL 5 Linux server. Theoretically, the repositories with the lowest numerical priority number have the highest priority. This is one of the method to prevents mistakes such as accidentally running yum upgrade with everything. This steps has been tested on CentOS 5.7, but it may working on CentOS 5.1, CentOS 5.2, CentOS 5.4, CentOS 5.5, CentOS 5.6 and RHEL 5.

    1. To Install the yum-priorities, simply run this command :

    [root@CentOS57 ~]# yum install yum-priorities -y
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
     * base: mirror.oscc.org.my
     * extras: mirror.oscc.org.my
     * rpmforge: ftp-stud.fht-esslingen.de
     * updates: mirror.oscc.org.my
    Setting up Install Process
    Resolving Dependencies
    --> Running transaction check
    ---> Package yum-priorities.noarch 0:1.1.16-21.el5.centos set to be updated
    --> Finished Dependency Resolution
    
    Dependencies Resolved
    
    ====================================================================================================
     Package                   Arch              Version                          Repository       Size
    ====================================================================================================
    Installing:
     yum-priorities            noarch            1.1.16-21.el5.centos             base             16 k
    
    Transaction Summary
    ====================================================================================================
    Install       1 Package(s)
    Upgrade       0 Package(s)
    
    Total download size: 16 k
    Downloading Packages:
    yum-priorities-1.1.16-21.el5.centos.noarch.rpm                               |  16 kB     00:00
    Running rpm_check_debug
    Running Transaction Test
    Finished Transaction Test
    Transaction Test Succeeded
    Running Transaction
      Installing     : yum-priorities                                                               1/1
    
    Installed:
      yum-priorities.noarch 0:1.1.16-21.el5.centos
    
    Complete!
    

    2. After the plugin is installed, make sure that it is enabled on /etc/yum/pluginconf.d/priorities.conf file.

    [root@CentOS57 ~]# cat /etc/yum/pluginconf.d/priorities.conf
    [main]
    enabled = 1
    

    If enabled = 0, you can enabled it using vi editor as below :

    [root@CentOS57 ~]# vi /etc/yum/pluginconf.d/priorities.conf
    

    3. With the plugin enabled, you may add priorities to the target repositories by adding the following line :

    priority=N
    

    Where N is an integer from 1 to 99. The lower the number the more important it is, so CentOS-Base.repo must always the lowest.

    [root@CentOS57 ~]# vi /etc/yum.repos.d/CentOS-Base.repo
    

    Add this line on base repo :

    priority = 1
    
    # CentOS-Base.repo
    #
    # The mirror system uses the connecting IP address of the client and the
    # update status of each mirror to pick mirrors that are updated to and
    # geographically close to the client.  You should use this for CentOS updates
    # unless you are manually picking other mirrors.
    #
    # If the mirrorlist= does not work for you, as a fall back you can try the
    # remarked out baseurl= line instead.
    #
    #
    
    
    [base]
    name=CentOS-$releasever - Base
    mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
    #baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
    priority = 1
    
    #released updates
    [updates]
    name=CentOS-$releasever - Updates
    mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
    #baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
    
    #additional packages that may be useful
    [extras]
    name=CentOS-$releasever - Extras
    mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
    #baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
    
    #additional packages that extend functionality of existing packages
    [centosplus]
    name=CentOS-$releasever - Plus
    mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
    #baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
    gpgcheck=1
    enabled=0
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
    
    #contrib - packages by Centos Users
    [contrib]
    name=CentOS-$releasever - Contrib
    mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
    #baseurl=http://mirror.centos.org/centos/$releasever/contrib/$basearch/
    gpgcheck=1
    enabled=0
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
    

    4. As an example, another 3rd party repository is RPMforge. Follow this steps to Add the RPMforge Repository on CentOS 5/RHEL 5 Linux Server :
    How to Add the RPMforge Repository on CentOS 5/RHEL 5 Linux Server

    Open the RPMforge configuration file and insert “priority = 5” after “enabled = 1” in the [rpmforge] section :

    [root@CentOS57 ~]# vi /etc/yum.repos.d/rpmforge.repo
    

    In this case, i will add the fifth highest possible priority which is “priority=5” :

    ### Name: RPMforge RPM Repository for RHEL 5 - dag
    ### URL: http://rpmforge.net/
    [rpmforge]
    name = RHEL $releasever - RPMforge.net - dag
    baseurl = http://apt.sw.be/redhat/el5/en/$basearch/rpmforge
    mirrorlist = http://apt.sw.be/redhat/el5/en/mirrors-rpmforge
    #mirrorlist = file:///etc/yum.repos.d/mirrors-rpmforge
    enabled = 1
    priority = 5
    protect = 0
    gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag
    gpgcheck = 1
    
    [rpmforge-extras]
    name = RHEL $releasever - RPMforge.net - extras
    baseurl = http://apt.sw.be/redhat/el5/en/$basearch/extras
    mirrorlist = http://apt.sw.be/redhat/el5/en/mirrors-rpmforge-extras
    #mirrorlist = file:///etc/yum.repos.d/mirrors-rpmforge-extras
    enabled = 0
    protect = 0
    gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag
    gpgcheck = 1
    
    [rpmforge-testing]
    name = RHEL $releasever - RPMforge.net - testing
    baseurl = http://apt.sw.be/redhat/el5/en/$basearch/testing
    mirrorlist = http://apt.sw.be/redhat/el5/en/mirrors-rpmforge-testing
    #mirrorlist = file:///etc/yum.repos.d/mirrors-rpmforge-testing
    enabled = 0
    protect = 0
    gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag
    gpgcheck = 1
    

    How to Add the RPMforge Repository on CentOS 5/RHEL 5 Linux Server

    In this post i will show on how to add the RPMforge repository into CentOS 5 and Linux Red Hat Enterprise Linux 5 (RHEL 5) and also applicable on CentOS 5.1,CentOS 5.2,CentOS 5.3,CentOS 5.4,CentOS 5.5 and CentOS 5.6. RPMforge repository is a collaboration of Dag, Dries, and other packagers. This steps has been tested on CentOS 5.7 and should be working on RHEL 5.

    RHEL 5 and CentOS 5 x86 32bit
    RHEL 5 and CentOS 5 x86 64bit

    1. Import the RPMforge GPG key :

    [root@CentOS57 ~]# rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt
    
    [root@CentOS57 ~]# wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.i386.rpm
    [root@CentOS57 ~]# wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.i386.rpm
    --2012-03-13 03:36:08--  http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.i386.rpm
    Resolving pkgs.repoforge.org... 78.46.17.228
    Connecting to pkgs.repoforge.org|78.46.17.228|:80... connected.
    HTTP request sent, awaiting response... 302 Found
    Location: http://rpmforge.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.5.2-2.el5.rf.i386.rpm [following]
    --2012-03-13 03:36:09--  http://rpmforge.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.5.2-2.el5.rf.i386.rpm
    Resolving rpmforge.sw.be... 78.46.17.228
    Connecting to rpmforge.sw.be|78.46.17.228|:80... connected.
    HTTP request sent, awaiting response... 301 Moved Permanently
    Location: http://tree.repoforge.org/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.5.2-2.el5.rf.i386.rpm [following]
    --2012-03-13 03:36:10--  http://tree.repoforge.org/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.5.2-2.el5.rf.i386.rpm
    Resolving tree.repoforge.org... 78.46.17.228
    Connecting to tree.repoforge.org|78.46.17.228|:80... connected.
    HTTP request sent, awaiting response... 301 Moved Permanently
    Location: http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.5.2-2.el5.rf.i386.rpm [following]
    --2012-03-13 03:36:10--  http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.5.2-2.el5.rf.i386.rpm
    Resolving apt.sw.be... 193.1.193.67
    Connecting to apt.sw.be|193.1.193.67|:80... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: 12680 (12K) [application/x-redhat-package-manager]
    Saving to: `rpmforge-release-0.5.2-2.el5.rf.i386.rpm'
    
    100%[==========================================================>] 12,680      23.3K/s   in 0.5s
    
    2012-03-13 03:36:13 (23.3 KB/s) - `rpmforge-release-0.5.2-2.el5.rf.i386.rpm' saved [12680/12680]
    

    3. Verify the rpmforge-release package you have downloaded :

    [root@CentOS57 ~]# rpm -K rpmforge-release-0.5.2-2.el5.rf.i386.rpm
    rpmforge-release-0.5.2-2.el5.rf.i386.rpm: (sha1) dsa sha1 md5 gpg OK
    

    4. Install the rpmforge-release package using this command :

    [root@CentOS57 ~]# rpm -ivh rpmforge-release-0.5.2-2.el5.rf.i386.rpm
    Preparing...                ########################################### [100%]
       1:rpmforge-release       ########################################### [100%]
    

    5. You can start using RPMforge Repository to install, remove and update the package as below :

    [root@CentOS57 ~]# yum install package-name -y
    [root@CentOS57 ~]#  yum remove package-name -y
    [root@CentOS57 ~]#  yum update package-name -y
    

    Resources :
    RPMforge CentOS Wiki