RPM - Distributing RPM Packages
Contents
Distributing RPM Packages
Installing with RPM
The binary packages generated by rpmbuild can now be installed on target
machines using the rpm command. Before doing so, the public GPG key must be
loaded into the rpm database. Both must be done as root
.
#
rpm --import MYCOMPANY-RPM-GPG-KEY
#
rpm --ivH adempiere-server-….noarch.rpm
or
#
rpm --ivH adempiere-client-….noarch.rpm
But of course it would be much more efficient to have a central repository from which client machines can use tools like yum for automatic installation and upgrading.
Distributing the server package through a central yum repository might not be such a good idea, especially if it was built using pre-configured settings. That would enable anybody to download the server package and access critical information such us database passwords. And anyway, servers should always be upgraded manually.
Creating a YUM Repository
A web server is needed to distribute packages from a yum repository. The httpd server can be
installed using yum, and for our purposes it can be started out of the box without
having to configure it. Below commands have to be run as root
.
#
yum install httpd createrepo
#
service httpd start
Create an adempiere
directory under /var/www/html
, and copy the
GPG public key and the RPM packages to be distributed into it. Make sure that everybody has read permissions
for those files.
$
mkdir -p /var/www/html/adempiere
$
cp MYCOMPANY-RPM-GPG-KEY /var/www/html/adempiere/
$
cp adempiere-….noarch.rpm /var/www/html/adempiere/
$
chmod o+x /var/www/html/adempiere
$
chmod -R o+r /var/www/html/adempiere
Create the repository by executing createrepo . (the last dot is important!) inside
/var/www/html/adempiere
$
cd /var/www/html/adempiere
$
createrepo .
Your yum repository is now up and running and can be accessed from client machines.
For distributing upgrades, simply drop the new RPM files into the repository and run createrepo . again.
Installing with YUM
Before being able to use your new Adempiere repository, client
machines must be aware that it exists. As root
, create a file adempiere.repo
in /etc/yum.repos.d
with following contents:
[adempiere] name=Adempiere baseurl=http://address.of.your.web.server/adempiere enabled=1
And of course the public key for signature verification must be imported into the RPM database
(needs to be done as root
):
#
rpm --import http://address.of.your.web.server/adempiere/MYCOMPANY-RPM-GPG-KEY
Now yum can be used to install, upgrade, or remove your Adempiere packages:
#
yum install adempiere-client
or
#
yum upgrade adempiere-client
or
#
yum remove adempiere-client
If the client machine has daily run of yum enabled, it will automatically upgrade to the
newest package published in the adempiere
repository.