How to Install Perl in CentOS 6.2

When you try to install the rpm packages that was depend on the perl, you will get this error. The best practice is to check up if perl is already installed on your server before start the installation for the software that depend on perl to run.

Symptom :

    [root@centos6 ~]# rpm -U webmin-1.570-1.noarch.rpm
    warning: webmin-1.570-1.noarch.rpm: Header V3 DSA/SHA1 Signature, key ID 11f63c51: NOKEY
    error: Failed dependencies:
            /usr/bin/perl is needed by webmin-1.570-1.noarch
    

This is how you fix this problem. This command will install the perl and the dependencies.

    [root@centos6 ~]# yum install perl
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
     * base: mirrors.hostemo.com
     * extras: mirrors.hostemo.com
     * updates: mirrors.hostemo.com
    Setting up Install Process
    Resolving Dependencies
    --> Running transaction check
    ---> Package perl.i686 4:5.10.1-119.el6_1.1 will be installed
    --> Processing Dependency: perl-libs = 4:5.10.1-119.el6_1.1 for package: 4:perl-5.10.1-119.el6_1.1.i686
    --> Processing Dependency: perl-libs for package: 4:perl-5.10.1-119.el6_1.1.i686
    --> Processing Dependency: perl(Pod::Simple) for package: 4:perl-5.10.1-119.el6_1.1.i686
    --> Processing Dependency: libperl.so for package: 4:perl-5.10.1-119.el6_1.1.i686
    --> Processing Dependency: perl(version) for package: 4:perl-5.10.1-119.el6_1.1.i686
    --> Processing Dependency: perl(Module::Pluggable) for package: 4:perl-5.10.1-119.el6_1.1.i686
    --> Running transaction check
    ---> Package perl-Module-Pluggable.i686 1:3.90-119.el6_1.1 will be installed
    ---> Package perl-Pod-Simple.i686 1:3.13-119.el6_1.1 will be installed
    --> Processing Dependency: perl(Pod::Escapes) >= 1.04 for package: 1:perl-Pod-Simple-3.13-119.el6_1.1.i686
    ---> Package perl-libs.i686 4:5.10.1-119.el6_1.1 will be installed
    ---> Package perl-version.i686 3:0.77-119.el6_1.1 will be installed
    --> Running transaction check
    ---> Package perl-Pod-Escapes.i686 1:1.04-119.el6_1.1 will be installed
    --> Finished Dependency Resolution
    
    Dependencies Resolved
    
    ================================================================================================
     Package                        Arch          Version                       Repository     Size
    ================================================================================================
    Installing:
     perl                           i686          4:5.10.1-119.el6_1.1          base          9.7 M
    Installing for dependencies:
     perl-Module-Pluggable          i686          1:3.90-119.el6_1.1            base           37 k
     perl-Pod-Escapes               i686          1:1.04-119.el6_1.1            base           30 k
     perl-Pod-Simple                i686          1:3.13-119.el6_1.1            base          209 k
     perl-libs                      i686          4:5.10.1-119.el6_1.1          base          590 k
     perl-version                   i686          3:0.77-119.el6_1.1            base           49 k
    
    Transaction Summary
    ================================================================================================
    Install       6 Package(s)
    
    Total download size: 11 M
    Installed size: 30 M
    Is this ok [y/N]: y
    Downloading Packages:
    (1/6): perl-5.10.1-119.el6_1.1.i686.rpm                                  | 9.7 MB     02:26
    (2/6): perl-Module-Pluggable-3.90-119.el6_1.1.i686.rpm                   |  37 kB     00:00
    (3/6): perl-Pod-Escapes-1.04-119.el6_1.1.i686.rpm                        |  30 kB     00:00
    (4/6): perl-Pod-Simple-3.13-119.el6_1.1.i686.rpm                         | 209 kB     00:03
    (5/6): perl-libs-5.10.1-119.el6_1.1.i686.rpm                             | 590 kB     00:09
    (6/6): perl-version-0.77-119.el6_1.1.i686.rpm                            |  49 kB     00:00
    ------------------------------------------------------------------------------------------------
    Total                                                            67 kB/s |  11 MB     02:41
    Running rpm_check_debug
    Running Transaction Test
    Transaction Test Succeeded
    Running Transaction
      Installing : 1:perl-Pod-Escapes-1.04-119.el6_1.1.i686                                     1/6
      Installing : 3:perl-version-0.77-119.el6_1.1.i686                                         2/6
      Installing : 4:perl-libs-5.10.1-119.el6_1.1.i686                                          3/6
      Installing : 1:perl-Pod-Simple-3.13-119.el6_1.1.i686                                      4/6
      Installing : 1:perl-Module-Pluggable-3.90-119.el6_1.1.i686                                5/6
      Installing : 4:perl-5.10.1-119.el6_1.1.i686                                               6/6
    
    Installed:
      perl.i686 4:5.10.1-119.el6_1.1
    
    Dependency Installed:
      perl-Module-Pluggable.i686 1:3.90-119.el6_1.1     perl-Pod-Escapes.i686 1:1.04-119.el6_1.1
      perl-Pod-Simple.i686 1:3.13-119.el6_1.1           perl-libs.i686 4:5.10.1-119.el6_1.1
      perl-version.i686 3:0.77-119.el6_1.1
    
    Complete!
    

Check the installed perl version using this command:

    [root@centos6 ~]# rpm -qa perl
    perl-5.10.1-119.el6_1.1.i686
    

How to Install wget on CentOS 6.2

If your CentOS 6.2 server has been installed with minimal installation, wget command will not exist. Wget is a free network utility for linux to download files from the Web. Therefore, there is simple step to install the wget command utility into your CentOS 6.2 server.

Symptom/error message:

    [root@centos6 ~]# wget http://prdownloads.sourceforge.net/webadmin/webmin-1.570-1.noarch.rpm
    bash: wget: command not found
    

Install wget using yum install command:

    [root@centos6 ~]# yum install wget
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
     * base: mirror.issp.co.th
     * extras: mirror.yourconnect.com
     * updates: mirror.yourconnect.com
    base                                                                     | 3.7 kB     00:00
    extras                                                                   | 3.5 kB     00:00
    updates                                                                  | 3.5 kB     00:00
    Setting up Install Process
    Resolving Dependencies
    --> Running transaction check
    ---> Package wget.i686 0:1.12-1.4.el6 will be installed
    --> Finished Dependency Resolution
    
    Dependencies Resolved
    
    ================================================================================================
     Package             Arch                Version                      Repository           Size
    ================================================================================================
    Installing:
     wget                i686                1.12-1.4.el6                 base                481 k
    
    Transaction Summary
    ================================================================================================
    Install       1 Package(s)
    
    Total download size: 481 k
    Installed size: 1.8 M
    Is this ok [y/N]: y
    Downloading Packages:
    wget-1.12-1.4.el6.i686.rpm                                               | 481 kB     00:04
    warning: rpmts_HdrFromFdno: Header V3 RSA/SHA256 Signature, key ID c105b9de: NOKEY
    Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
    Importing GPG key 0xC105B9DE:
     Userid : CentOS-6 Key (CentOS 6 Official Signing Key) 
     Package: centos-release-6-2.el6.centos.7.i686 (@anaconda-CentOS-201112130233.i386/6.2)
     From   : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
    Is this ok [y/N]: y
    Running rpm_check_debug
    Running Transaction Test
    Transaction Test Succeeded
    Running Transaction
    Warning: RPMDB altered outside of yum.
      Installing : wget-1.12-1.4.el6.i686                                                       1/1
    
    Installed:
      wget.i686 0:1.12-1.4.el6
    
    Complete!
    

How to Configure Static IP Address on CentOS 6.2 Linux Server

After you have installed CentOS 6.2 linux server, the network configuration will be like this.

    DEVICE="eth0"
    HWADDR="xx:xx:xx:xx:xx:xx"
    NM_CONTROLLED="yes"
    ONBOOT="no"
    

The system will no get the ip automatically and the network interface will not auto start even after the server rebooted. Follow this steps to set static ip and set it auto start once rebooted in CentOS 6.2 :

1. Configure eth0:

    [root@centos6 ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0
    
    DEVICE="eth0"
    HWADDR="00:0C:29:67:51:B1"
    NM_CONTROLLED="yes"
    ONBOOT="yes"
    IPADDR=192.168.1.44
    BOOTPRO=static
    NETMASK=255.255.255.0
    

2. Configure Default gateway:

    [root@centos6 ~]# vi /etc/sysconfig/network
    
    NETWORKING=yes
    HOSTNAME=centos6.2
    GATEWAY=192.168.1.1
    

3. Restart Network interface:

    [root@centos6 ~]# /etc/init.d/network restart
    

or

    [root@centos6 ~]# Service network restart
    

4. Configure DNS server:

    [root@centos6 ~]# vi /etc/resolv.conf
    
    nameserver 8.8.8.8
    nameserver 192.168.1.1