How to Install Perl on CentOS 5.8

Perl is an interpreted language that is very popular in the Unix community because it has a rich and powerful feature set, but is still easy to use. In this post, i will show the quick steps to install perl on linux CentOS 5.8 server.

Simply run the following command to install perl :

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

Examples :

[root@centos58 ~]# yum install perl -y
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.oscc.org.my
 * extras: mirror.oscc.org.my
 * updates: mirror.oscc.org.my
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package perl.i386 4:5.8.8-38.el5 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

=====================================================================================================
 Package              Arch                 Version                        Repository            Size
=====================================================================================================
Installing:
 perl                 i386                 4:5.8.8-38.el5                 base                  12 M

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

Total download size: 12 M
Downloading Packages:
perl-5.8.8-38.el5.i386.rpm                                                    |  12 MB     01:58
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : perl                                                                          1/1

Installed:
  perl.i386 4:5.8.8-38.el5

Complete!

How to Install Perl on Linux Fedora 16 server

In this post i will show the quick step to install perl on linux Fedora 16 server. Perl is an interpreted language that is very popular in the Unix community because it has a rich and powerful feature set, but is still easy to use.

Simply run the following command to install perl on linux Fedora 16 server :

[root@fedora16 ~]# yum install perl -y
Fedora16-Repository                                                                    | 3.7 kB     00:00 ...
Fedora16-Repository/primary_db                                                         | 2.3 MB     00:01 ...
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package perl.i686 4:5.14.1-188.fc16 will be installed
--> Processing Dependency: perl-libs = 4:5.14.1-188.fc16 for package: 4:perl-5.14.1-188.fc16.i686
--> Processing Dependency: perl(File::Spec) >= 0.8 for package: 4:perl-5.14.1-188.fc16.i686
--> Processing Dependency: perl(threads::shared) >= 1.21 for package: 4:perl-5.14.1-188.fc16.i686
--> Processing Dependency: perl(Scalar::Util) >= 1.10 for package: 4:perl-5.14.1-188.fc16.i686
--> Processing Dependency: perl(List::Util) for package: 4:perl-5.14.1-188.fc16.i686
--> Processing Dependency: perl(threads::shared) for package: 4:perl-5.14.1-188.fc16.i686
--> Processing Dependency: perl-macros for package: 4:perl-5.14.1-188.fc16.i686
--> Processing Dependency: perl(Pod::Simple) for package: 4:perl-5.14.1-188.fc16.i686
--> Processing Dependency: perl(Module::Pluggable) for package: 4:perl-5.14.1-188.fc16.i686
--> Processing Dependency: perl-libs for package: 4:perl-5.14.1-188.fc16.i686
--> Processing Dependency: perl(File::Spec::Unix) for package: 4:perl-5.14.1-188.fc16.i686
--> Processing Dependency: libperl.so for package: 4:perl-5.14.1-188.fc16.i686
--> Processing Dependency: perl(File::Spec) for package: 4:perl-5.14.1-188.fc16.i686
--> Processing Dependency: perl(Pod::Simple::RTF) for package: 4:perl-5.14.1-188.fc16.i686
--> Processing Dependency: perl(Scalar::Util) for package: 4:perl-5.14.1-188.fc16.i686
--> Processing Dependency: perl(Pod::Simple::XMLOutStream) for package: 4:perl-5.14.1-188.fc16.i686
--> Processing Dependency: perl(threads) for package: 4:perl-5.14.1-188.fc16.i686
--> Processing Dependency: perl(Cwd) for package: 4:perl-5.14.1-188.fc16.i686
--> Processing Dependency: perl(File::Spec::Functions) for package: 4:perl-5.14.1-188.fc16.i686
--> Running transaction check
---> Package perl-Module-Pluggable.noarch 1:3.90-188.fc16 will be installed
---> Package perl-PathTools.i686 0:3.33-188.fc16 will be installed
---> Package perl-Pod-Simple.noarch 1:3.16-188.fc16 will be installed
--> Processing Dependency: perl(Pod::Escapes) >= 1.04 for package: 1:perl-Pod-Simple-3.16-188.fc16.noarch
---> Package perl-Scalar-List-Utils.i686 0:1.23-188.fc16 will be installed
---> Package perl-libs.i686 4:5.14.1-188.fc16 will be installed
---> Package perl-macros.i686 4:5.14.1-188.fc16 will be installed
---> Package perl-threads.i686 0:1.83-188.fc16 will be installed
---> Package perl-threads-shared.i686 0:1.37-188.fc16 will be installed
--> Running transaction check
---> Package perl-Pod-Escapes.noarch 1:1.04-188.fc16 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

==============================================================================================================
 Package                        Arch           Version                      Repository                   Size
==============================================================================================================
Installing:
 perl                           i686           4:5.14.1-188.fc16            Fedora16-Repository         9.9 M
Installing for dependencies:
 perl-Module-Pluggable          noarch         1:3.90-188.fc16              Fedora16-Repository          44 k
 perl-PathTools                 i686           3.33-188.fc16                Fedora16-Repository         101 k
 perl-Pod-Escapes               noarch         1:1.04-188.fc16              Fedora16-Repository          36 k
 perl-Pod-Simple                noarch         1:3.16-188.fc16              Fedora16-Repository         219 k
 perl-Scalar-List-Utils         i686           1.23-188.fc16                Fedora16-Repository          52 k
 perl-libs                      i686           4:5.14.1-188.fc16            Fedora16-Repository         627 k
 perl-macros                    i686           4:5.14.1-188.fc16            Fedora16-Repository          29 k
 perl-threads                   i686           1.83-188.fc16                Fedora16-Repository          65 k
 perl-threads-shared            i686           1.37-188.fc16                Fedora16-Repository          55 k

Transaction Summary
==============================================================================================================
Install      10 Packages

Total download size: 11 M
Installed size: 30 M
Downloading Packages:
--------------------------------------------------------------------------------------------------------------
Total                                                                         9.9 MB/s |  11 MB     00:01
Running Transaction Check
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : 1:perl-Pod-Escapes-1.04-188.fc16.noarch                                                   1/10
  Installing : perl-PathTools-3.33-188.fc16.i686                                                         2/10
  Installing : 1:perl-Pod-Simple-3.16-188.fc16.noarch                                                    3/10
  Installing : perl-threads-shared-1.37-188.fc16.i686                                                    4/10
  Installing : perl-Scalar-List-Utils-1.23-188.fc16.i686                                                 5/10
  Installing : 4:perl-libs-5.14.1-188.fc16.i686                                                          6/10
  Installing : perl-threads-1.83-188.fc16.i686                                                           7/10
  Installing : 1:perl-Module-Pluggable-3.90-188.fc16.noarch                                              8/10
  Installing : 4:perl-macros-5.14.1-188.fc16.i686                                                        9/10
  Installing : 4:perl-5.14.1-188.fc16.i686                                                              10/10

Installed:
  perl.i686 4:5.14.1-188.fc16

Dependency Installed:
  perl-Module-Pluggable.noarch 1:3.90-188.fc16             perl-PathTools.i686 0:3.33-188.fc16
  perl-Pod-Escapes.noarch 1:1.04-188.fc16                  perl-Pod-Simple.noarch 1:3.16-188.fc16
  perl-Scalar-List-Utils.i686 0:1.23-188.fc16              perl-libs.i686 4:5.14.1-188.fc16
  perl-macros.i686 4:5.14.1-188.fc16                       perl-threads.i686 0:1.83-188.fc16
  perl-threads-shared.i686 0:1.37-188.fc16

Complete!

To check perl version, run this command :

[root@fedora16 ~]# perl -v

This is perl 5, version 14, subversion 1 (v5.14.1) built for i386-linux-thread-multi

Copyright 1987-2011, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl".  If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.

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