Offline installation
To be able to install Centreon on servers with no internet access, create a local copy of the Centreon repository on a server that has an internet access, then make your offline Centreon servers point to it.
Creating a local copy of the Centreon repository
- Install Centreon repository on your mirror server.
- Alma / RHEL / Oracle Linux 8
- CentOS 7
- Debian 11
dnf install -y dnf-plugins-core
dnf config-manager --add-repo https://packages.centreon.com/rpm-standard/22.10/el8/centreon-22.10.repo
yum install -y yum-utils
yum-config-manager --add-repo https://packages.centreon.com/rpm-standard/22.10/el7/centreon-22.10.repo
echo "deb https://packages.centreon.com/apt-standard-22.10-stable $(lsb_release -sc) main" | tee /etc/apt/sources.list.d/centreon.list
echo "deb https://packages.centreon.com/apt-plugins-stable/ $(lsb_release -sc) main" | tee /etc/apt/sources.list.d/centreon-plugins.list
- Retrieve the gpg key for the packages:
- Alma / RHEL / Oracle Linux 8
- CentOS 7
- Debian 11
rpm --import https://yum-gpg.centreon.com/RPM-GPG-KEY-CES
rpm --import https://yum-gpg.centreon.com/RPM-GPG-KEY-CES
wget -O- https://apt-key.centreon.com | gpg --dearmor | tee /etc/apt/trusted.gpg.d/centreon.gpg > /dev/null 2>&1
- Create a directory for the local repository:
- Alma / RHEL / Oracle Linux 8
- CentOS 7
- Debian 11
mkdir -p /var/www/html/repos/centreon
mkdir -p /var/www/html/repos/centreon
mkdir /var/www/html/centreon
- Install the required packages:
- Alma / RHEL / Oracle Linux 8
- CentOS 7
- Debian 11
yum install yum-utils createrepo httpd
yum install yum-utils createrepo httpd
apt install apache2 debmirror
- Synchronize the repositories:
- Alma / RHEL / Oracle Linux 8
- CentOS 7
- Debian 11
reposync -p /var/www/html/repos/centreon/ --repo centreon-stable-noarch
reposync -p /var/www/html/repos/centreon/ --repo centreon-stable
reposync -p /var/www/html/repos/centreon/ --repo centreon-stable-noarch
reposync -p /var/www/html/repos/centreon/ --repo centreon-stable
debmirror \
-a amd64 \
--no-source \
-s main \
-h apt.centreon.com \
-d bullseye \
-r /repository/22.10 \
--keyring=/etc/apt/trusted.gpg.d/centreon.gpg \
--method=https \
/var/centreon-mirror/22.10
- Run the following commands:
- Alma / RHEL / Oracle Linux 8
- CentOS 7
- Debian 11
Create the repository:
createrepo /var/www/html/repos/centreon/
Create the repository:
createrepo /var/www/html/repos/centreon/
Make the local synchronized repository availble via Apache:
ln -s /var/centreon-mirror/22.10 /var/www/html/centreon/22.10
- Start the web server:
- Alma / RHEL / Oracle Linux 8
- CentOS 7
- Debian 11
service httpd start
service httpd24-httpd start
systemctl start apache2
- On your Centreon server, edit the following file:
- Alma / RHEL / Oracle Linux 8
- CentOS 7
- Debian 11
vi /etc/yum.repos.d/centreon.repo
Add the following lines:
[centreon]
name=centreon
baseurl=http://<mirror_ip_address>/repos/centreon
gpgcheck=1
enabled=1
Replace
<mirror_ip_address>
by the actual address of your local repository.
vi /etc/yum.repos.d/centreon.repo
Add the following lines:
[centreon]
name=centreon
baseurl=http://<mirror_ip_address>/repos/centreon
gpgcheck=1
enabled=1
Replace
<mirror_ip_address>
by the actual address of your local repository.
vi /etc/apt/sources.list.d/centreon.list
Add the address of the mirror repository and comment the address of the official Centreon repository:
deb http://`<mirror_ip_address>`/centreon/22.10 bullseye main
#deb https://apt.centreon.com/repository/22.10/ bullseye main
Replace
<mirror_ip_address>
by the actual address of your local repository.
Keeping your local repository up-to-date
To synchronize your mirror with the Centreon repository regularly, create a cron file:
cd /var/spool/cron
crontab -e
- Alma / RHEL / Oracle Linux 8
- CentOS 7
- Debian 11
The following commands will schedule a synchronization every day at 2 for the centreon-stable-noarch repository, and every day at 3 for the centreon-stable repository :
* 2 * * * reposync -p /var/www/html/repos/centreon/ -r centreon-stable-noarch
* 3 * * * reposync -p /var/www/html/repos/centreon/ -r centreon-stable
The following commands will schedule a synchronization every day at 2 for the centreon-stable-noarch repository, and every day at 3 for the centreon-stable repository :
* 2 * * * reposync -p /var/www/html/repos/centreon/ -r centreon-stable-noarch
* 3 * * * reposync -p /var/www/html/repos/centreon/ -r centreon-stable
The following command will schedule a synchronization every day at 1:
* 01 * * * debmirror -a amd64 --no-source -s main -h apt.centreon.com -d bullseye -r /repository/22.10 --keyring=/etc/apt/trusted.gpg.d/centreon.gpg --method=https /var/centreon-mirror/22.10 >> /var/log/debmirror.log