I’m in Stockholm this week, training on OTRS. OTRS is packaged as an RPM for OpenSUSE and RHEL/CentOS, but the package maintainers have left a lot of basic steps for the user to run after install or upgrade. Here are commands to install all missing Perl modules for OTRS, both optional and required.
CentOS/RHEL/OpenSUSE
This is tested on CentOS 6 with OTRS RPM install and EPEL repository. This probably works on CentOS 5, RHEL, and OpenSUSE as well.
sudo yum install `/opt/otrs/bin/otrs.CheckModules.pl | grep 'Not installed' | sed 's/^ *o //;s/\.\.\..*//;s/\(.*\)/"perl\(\1\)"/' | tr '\n' ' '`
Other Linux Distributions
On other Linux distributions without yum, use CPAN. This should work on Debian, Ubuntu, or other systems with an OTRS source install.
sudo cpan `/opt/otrs/bin/otrs.CheckModules.pl | grep 'Not installed' | sed 's/^ *o //;s/\.\.\..*//' | tr '\n' ' '`
How it works
otrs.CheckModules.pl outputs a list of all required or optional Perl modules:
[root@otrs otrs]# /opt/otrs/bin/otrs.CheckModules.pl o CGI..............................ok (v3.63) o Crypt::Eksblowfish::Bcrypt.......Not installed! (optional - For strong password hashing) o Crypt::PasswdMD5.................ok (v1.3) ... o YAML::XS.........................Not installed! (required - use "perl -MCPAN -e shell;" - )
We take that output, search for “Not installed”, and then use sed to manipulate it into a list of arguments to the installer:
yum install "perl(Crypt::Eksblowfish::Bcrypt)" "perl(YAML::XS)"
cpan Crypt::Eksblowfish::Bcrypt YAML::XS
Leave a Reply