Difference between revisions of "SME Server:Adding Software"

From SME Server
Jump to navigationJump to search
(→‎Installing software: RestrictRepo and RestrictRpm)
 
(26 intermediate revisions by 7 users not shown)
Line 1: Line 1:
 +
<noinclude>{{Languages}}</noinclude>
 
==Adding new software ==
 
==Adding new software ==
Preferably new software includes any Red Hat EL4 server rpm.<br>
+
New software should be installed from RPMs<br>
Often these rpms are configured with a SME Server specific rpm.   
+
Red Hat or Centos Version .el4 rpms should be compatible for SME7, use .el5 for SME8 and .el6 for SME9.<br>
 +
Often these rpms are configured with a SME Server integration rpm.   
  
 
===Packages available===
 
===Packages available===
Current rpms in the [http://bugs.contribs.org/describecomponents.cgi?product=SME%20Contribs SME Contribs] section, user contributed documentation is located in [[:Category:Contrib]].
+
User contributed documentation is located in [[:Category:Contrib]].
 +
 
 +
Packages are available in the smecontribs repository or other individuals repositories.
  
 
===Installing software===
 
===Installing software===
Line 10: Line 14:
 
SME Server has an option to install software using the Software Installer option in the server-manager, after enabling 'Manage Individual Packages' you can install rpms from enabled repositories and if you know exactly what you are doing, you can also remove rpms.  
 
SME Server has an option to install software using the Software Installer option in the server-manager, after enabling 'Manage Individual Packages' you can install rpms from enabled repositories and if you know exactly what you are doing, you can also remove rpms.  
  
From SME 7.2 you can restrict the software that is shown in the 'Software Installer' - 'Available packages' dialog. Use this to hide software software that we don't want. eg desktop software such as oppenoffice from the centos repositories.
+
From SME Server 7.2 you can restrict the software that is shown in the 'Software Installer' - 'Available packages' dialog. Use this to hide software that you don't want: eg desktop software such as openoffice from the centos repositories.  
  
We can allow one or more terms that are contained in the repository name
+
At a command line as root you can allow one or more terms that are contained in the repository name
  config setprop yum RestrictRepo smeserver,dungog
+
  config setprop yum RestrictRepo sme,dungog
  
 
Or one or more terms that are contained in the rpm name
 
Or one or more terms that are contained in the rpm name
 
  config setprop yum RestrictRpm perl
 
  config setprop yum RestrictRpm perl
  
If you add both these example only rpms with perl in there name '''and''' are in any of the smeserver or dungog repositories will be visible.
+
If you add both these examples only rpms with perl in their name '''and''' are in any of the enabled sme or dungog repositories will be visible.
  
 
  yum_update_dbs  
 
  yum_update_dbs  
to update the database, or wait overnight for the next updates check
+
to update the database, ignore the messages.
  
 
====Command Line====
 
====Command Line====
Line 27: Line 31:
 
With everyone having yum repositories set up the same way, Howto authors can now use instructions like:
 
With everyone having yum repositories set up the same way, Howto authors can now use instructions like:
  
  yum --enablerepo=dag install dansguardian
+
  yum --enablerepo=dag install packagename
 +
 
 +
 
 +
====Localinstall====
 +
 
 +
To install an RPM already on your system you can also use yum to install:
 +
 
 +
yum localinstall /path/to/packagename.rpm
 +
 
 +
To satisfy dependencies you can enable or disable other repositories using the --enablerepo=xxx or the --disablerepo=xxx option.
 +
{{Note box|msg=Using yum will run other actions such as updating server-manager menus, that rpm -Uvh will not!}}
  
 
===Yum Repositories===
 
===Yum Repositories===
 
Yum repositories on SME Server are to be configured by the internal configuration database. Repositories are stored in the yum_repositories database. The yum configuration file, located at /etc/yum.conf holds the actual configuration and is generated using the data in the yum_repositories database.
 
Yum repositories on SME Server are to be configured by the internal configuration database. Repositories are stored in the yum_repositories database. The yum configuration file, located at /etc/yum.conf holds the actual configuration and is generated using the data in the yum_repositories database.
 +
 +
====Checking status of installed repositories====
 +
To check which repositories are installed and their status do
 +
/sbin/e-smith/audittools/repositories
 +
On an unmodified sme server only the following are enabled
 +
 +
base: enabled
 +
 +
smeaddons: enabled
 +
 +
smeextras: enabled
 +
 +
smeos: enabled
 +
 +
smeupdates: enabled
 +
 +
updates: enabled
 +
 +
Any other repository that is installed and listed should have a status of disabled.
 +
This is to prevent the inadvertant and potentially undesirable update of packages.
 +
To update packages from other repos, use the --enablerepo=reponame switch in the yum update command eg
 +
yum update --enablerepo=dag
 +
which will also bring in any rpm updates from the dag repo (only for packages that are already installed on your system). See more details below.
  
 
====Installing or modifying a repository====
 
====Installing or modifying a repository====
For the syntax of modifying or adding see the examples below in the 3rd-Party Yum Repositories setup section. For more details on the configuration database and how to work with it you can have a look at the [http://mirror.contribs.org/smeserver/contribs/gordonr/devguide/html/book1.htm SME Server Developer's Guide].
+
For the syntax of modifying or adding see the examples below in the 3rd-Party Yum Repositories setup section. For more details on the configuration database and how to work with it see the [SME_Server:Documentation SME Server Developer's Guide].
 
After adding or modifying the yum_repositories database you will have to make sure you regenerate the configuration file using the following command:
 
After adding or modifying the yum_repositories database you will have to make sure you regenerate the configuration file using the following command:
 +
 +
signal-event yum-modify
  
 
====Options for the yum_repositories database====
 
====Options for the yum_repositories database====
 
The repositories for SME Server are configured using the internal yum-repositories configuration database. There are several options that can be set for every repository:
 
The repositories for SME Server are configured using the internal yum-repositories configuration database. There are several options that can be set for every repository:
  
Visible yes|no - yes displays in server manager
+
*Visible yes|no - yes displays in server manager
status enabled|disabled - disabled are ignored unless specified with --enablerepo=
+
*status enabled|disabled - disabled are ignored unless specified with --enablerepo=
Exclude - don't fetch these rpms
+
*Exclude=xxx,yyy - don't fetch these rpms
IncludePkgs - only fetch these rpms
+
*IncludePkgs=xxx,yyy - only fetch these rpms
  
 
====3rd-Party Yum Repositories setup====
 
====3rd-Party Yum Repositories setup====
 
A list of repositories for SME Server is available in [[:Category:Yum Repository]].
 
A list of repositories for SME Server is available in [[:Category:Yum Repository]].
  
If you use the commands below to add 3rd party yum repositories, they will be added to the yum-repositories database, but not enabled by default, so this will not affect automatic yum upgrades. It only adds options for running yum manually. They are also set up to block you from installing RPMs that exist already in SME Server 7.0.
+
If you use the commands below to add 3rd party yum repositories, they will be added to the yum-repositories database, but not enabled by default, so this will not affect automatic yum upgrades. It only adds options for running yum manually.  
  
 
To reflect the changes in the database you will have to regenerate the yum.conf file:
 
To reflect the changes in the database you will have to regenerate the yum.conf file:
  
   expand-template /etc/yum.conf
+
   signal-event yum-modify
  
{{Warning box|msg=Be sure to never set the status of one of these repositories to enabled as this imposes the risk of installing newer versions SME Server core packages which might brake your server. If you want to install software from them you can enable them using the SME Server shell and the yum option --enablerepo=reponame.}}
+
{{Warning box|msg=Be sure to never set the status of one of these repositories to enabled as this imposes the risk of installing newer versions SME Server core packages which might break your server. If you want to install software from them you can enable them using the SME Server shell and the yum option --enablerepo=reponame.}}
  
  
Below are a few repositories, for which the configuration can be copied to the SME Server shell to install them on your server. The lines are long, but it it so you can cut and paste into your ssh client. Also note you shouldn't enable these repositories, they should just be used at the command line with "yum install", and not with "yum upgrade".
+
Below are a few repositories, for which the configuration can be copied to the SME Server shell to install them on your server. The lines are long, but it so you can cut and paste into your ssh client. Also note you shouldn't enable these repositories, they should just be used at the command line with "yum install", and not with "yum upgrade".
  
 
If a site has a RPM-GPG-KEY you have to install it first with a line such as.  
 
If a site has a RPM-GPG-KEY you have to install it first with a line such as.  
Line 63: Line 102:
 
====Restoring Default Yum Repositories====
 
====Restoring Default Yum Repositories====
  
If you have problems with your yum setup you may have entered dud repository values
+
If you have problems with your yum setup you may have entered incorrect repository values
  
remove the current values and restore the original setting with these commands
+
Remove the current values and restore the original setting with these commands
  
 
  cd /home/e-smith/db/
 
  cd /home/e-smith/db/
Line 73: Line 112:
 
Now you have a clean install, you can re-add 3rd party repos as described above <br>
 
Now you have a clean install, you can re-add 3rd party repos as described above <br>
  
  expand-template /etc/yum.conf
+
  signal-event yum-modify
  
 
and check  
 
and check  
Line 79: Line 118:
 
  yum update
 
  yum update
  
===Using RPMs===
+
<noinclude>[[Category:Howto]][[Category:SME Server]]</noinclude>
Since SME Server is based on CentOS, the preferred way to install software is with yum, a lot of you might be familiar with its predecessor rpm.
 
To install an RPM already on your system you can also use yum to install:
 
 
 
yum localinstall /path/to/filename.rpm
 
 
 
To satisfy dependencies you can enable or disable other repositories using the --enablerepo or the --disablerepo option.
 
{{Note box|msg=Using yum will run other actions such as updating server-manager menus, that rpm -Uvh will not!}}
 
 
 
<noinclude>[[Category:Howto]]</noinclude>
 

Latest revision as of 21:28, 16 May 2018


Adding new software

New software should be installed from RPMs
Red Hat or Centos Version .el4 rpms should be compatible for SME7, use .el5 for SME8 and .el6 for SME9.
Often these rpms are configured with a SME Server integration rpm.

Packages available

User contributed documentation is located in Category:Contrib.

Packages are available in the smecontribs repository or other individuals repositories.

Installing software

Server Manager

SME Server has an option to install software using the Software Installer option in the server-manager, after enabling 'Manage Individual Packages' you can install rpms from enabled repositories and if you know exactly what you are doing, you can also remove rpms.

From SME Server 7.2 you can restrict the software that is shown in the 'Software Installer' - 'Available packages' dialog. Use this to hide software that you don't want: eg desktop software such as openoffice from the centos repositories.

At a command line as root you can allow one or more terms that are contained in the repository name

config setprop yum RestrictRepo sme,dungog

Or one or more terms that are contained in the rpm name

config setprop yum RestrictRpm perl

If you add both these examples only rpms with perl in their name and are in any of the enabled sme or dungog repositories will be visible.

yum_update_dbs 

to update the database, ignore the messages.

Command Line

SME Server uses yum to install software, this is a newer and improved version of the well-known rpm command. Yum makes use of so-called repositories in which a lot of pacakges (RPMs) are stored. The big advantage of yum over rpm is that it can not only determine it's own dependencies, but if can also download required dependencies from enabled repositories. With everyone having yum repositories set up the same way, Howto authors can now use instructions like:

yum --enablerepo=dag install packagename


Localinstall

To install an RPM already on your system you can also use yum to install:

yum localinstall /path/to/packagename.rpm

To satisfy dependencies you can enable or disable other repositories using the --enablerepo=xxx or the --disablerepo=xxx option.

Important.png Note:
Using yum will run other actions such as updating server-manager menus, that rpm -Uvh will not!


Yum Repositories

Yum repositories on SME Server are to be configured by the internal configuration database. Repositories are stored in the yum_repositories database. The yum configuration file, located at /etc/yum.conf holds the actual configuration and is generated using the data in the yum_repositories database.

Checking status of installed repositories

To check which repositories are installed and their status do

/sbin/e-smith/audittools/repositories

On an unmodified sme server only the following are enabled

base: enabled

smeaddons: enabled

smeextras: enabled

smeos: enabled

smeupdates: enabled

updates: enabled

Any other repository that is installed and listed should have a status of disabled. This is to prevent the inadvertant and potentially undesirable update of packages. To update packages from other repos, use the --enablerepo=reponame switch in the yum update command eg

yum update --enablerepo=dag

which will also bring in any rpm updates from the dag repo (only for packages that are already installed on your system). See more details below.

Installing or modifying a repository

For the syntax of modifying or adding see the examples below in the 3rd-Party Yum Repositories setup section. For more details on the configuration database and how to work with it see the [SME_Server:Documentation SME Server Developer's Guide]. After adding or modifying the yum_repositories database you will have to make sure you regenerate the configuration file using the following command:

signal-event yum-modify

Options for the yum_repositories database

The repositories for SME Server are configured using the internal yum-repositories configuration database. There are several options that can be set for every repository:

  • Visible yes|no - yes displays in server manager
  • status enabled|disabled - disabled are ignored unless specified with --enablerepo=
  • Exclude=xxx,yyy - don't fetch these rpms
  • IncludePkgs=xxx,yyy - only fetch these rpms

3rd-Party Yum Repositories setup

A list of repositories for SME Server is available in Category:Yum Repository.

If you use the commands below to add 3rd party yum repositories, they will be added to the yum-repositories database, but not enabled by default, so this will not affect automatic yum upgrades. It only adds options for running yum manually.

To reflect the changes in the database you will have to regenerate the yum.conf file:

 signal-event yum-modify


Warning.png Warning:
Be sure to never set the status of one of these repositories to enabled as this imposes the risk of installing newer versions SME Server core packages which might break your server. If you want to install software from them you can enable them using the SME Server shell and the yum option --enablerepo=reponame.



Below are a few repositories, for which the configuration can be copied to the SME Server shell to install them on your server. The lines are long, but it so you can cut and paste into your ssh client. Also note you shouldn't enable these repositories, they should just be used at the command line with "yum install", and not with "yum upgrade".

If a site has a RPM-GPG-KEY you have to install it first with a line such as.

rpm --import http://dag.wieers.com/packages/RPM-GPG-KEY.dag.txt

Restoring Default Yum Repositories

If you have problems with your yum setup you may have entered incorrect repository values

Remove the current values and restore the original setting with these commands

cd /home/e-smith/db/
mv yum_repositories yum_repositories.po
/etc/e-smith/events/actions/initialize-default-databases

Now you have a clean install, you can re-add 3rd party repos as described above

signal-event yum-modify

and check

yum update