Issue
In my bash script I have the following lines installing various Linux packages on Centos 6.5 - two questions:
- is it good practice to do it this way?
OR is there a better way maybe using rpms and how would I go about doing that?
http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm yum -y install update nano mlocate bind bind-utils php-mbstring aide psacct screen tmux iperf ipset rsync htop innotop dstat traceroute strace ltrace rkhunter nmap curl curl-devel php-pear php-xml php-devel gcc zlib-devel pcre-devel php zip unzip telnet php-imap vsftpd wget yum -y install perl-DateTime-Format-HTTP perl-DateTime-Format-Builder yum -y install php-pdo php-gd php-xml yum -y install expect rpm -Uvh --force ftp://ftp.univie.ac.at/systems/linux/fedora/epel/6/x86_64/perl-BerkeleyDB-0.43-3.el6.x86_64.rpm pecl install -f zip
Solution
First, things will go faster if you simply combine all your yum
commands into a single invocation:
yum -y install nano mlocate bind bind-utils \
php-mbstring aide psacct screen tmux iperf ipset rsync \
htop innotop dstat traceroute strace ltrace rkhunter \
nmap curl curl-devel php-pear php-xml php-devel gcc \
zlib-devel pcre-devel php zip unzip telnet php-imap \
vsftpd wget perl-DateTime-Format-HTTP \
perl-DateTime-Format-Builder php-pdo php-gd php-xml \
expect
This way yum only needs to calculate dependencies once.
When installing an RPM from a remote server, you can also use yum:
yum -y install ftp://ftp.univie.ac.at/systems/linux/fedora/epel/6/x86_64/perl-BerkeleyDB-0.43-3.el6.x86_64.rpm
This will ensure that any dependencies of the package are installed as well.
Answered By - larsks Answer Checked By - David Goodson (WPSolving Volunteer)