Sometimes you work in environments where yum (or another package manager is not available), and you are expected to provide an offline installation of a product. In one case I had to provide a syslog-ng offline installation for CentOS
I’ll describe here how to create an offline installation rpm packages to install syslog-ng on CentOS / RHEL. The same process can help you create an offline installation for any other software. But if you are short on time and just want to get syslog-ng 3.35 for CentOS 7 you can get it here.
So let’s start:
Prerequisites
- CentOS / RHEL machine that has yum – we will be using it to download the required rpm and all its dependencies.
- Make sure that yum has `downloadonly` plugin
Configuring syslog-ng repos
Following the instructions on syslog-ng website:
If you are on RHEL add additional repository
#RHEL 7:
sudo subscription-manager repos --enable rhel-7-server-optional-rpms
#RHEL 8:
sudo subscription-manager repos --enable rhel-8-for-x86_64-supplementary-rpms
Install Extra Packages for Enterprise Linux (replace 7 with 8 for If you need for CentOS/RHEL 8
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
sudo rpm -Uvh epel-release-latest-7.noarch.rpm
Add the repo containing the latest unofficial build of syslog-ng. By the time of writing it is syslog-ng 3.35(replace 7 with 8 for CentOS/RHEL 8):
cd /etc/yum.repos.d/
wget https://copr.fedorainfracloud.org/coprs/czanik/syslog-ng335/repo/epel-8/czanik-syslog-ng335-epel-7.repo<
Note: to check what is the latest version of syslog-ng for CentOS/RHEL just head to Fedora Copr website and search for syslog-ng
Download the rpms required for installation
Execute yum install
with downloadonly
option and provide the destination where you want syslog-ng and the rpm it depends on to be downloaded.
sudo yum install -downloadonly --downloaddir=/tmp/ syslog-ng
If you are getting PG key error, but trust the source you can either add the keys or just add --nopgcheck
option to the yum install
command
That will download syslog-ng
as well as the ivykis
and libnet
rpm that syslog-ng depends on.
syslog-ng offline installation on the destination host
Copy the previously downloaded rpms to the destination machine.
Install the rpms
sudo yum localinstall ./ivykis-0.36.2-2.el7.x86_64.rpm ./libnet-1.1.6-7.el7.x86_64.rpm ./syslog-ng-3.35.1-2.el7.x86_64.rpm
Enable and start syslog-ng service
systemctl enable syslog-ng
systemctl start syslog-ng
That’s it for now.
Bye