Update contribs

From SME Server
Revision as of 16:10, 15 December 2018 by Mmccarn (talk | contribs) (Add notes on correcting yum source after using smedev, smetest or smecontribs-testing)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Is this article helpful to you?
Please consider donating or volunteering
Thank you!

Update contribs

Background

Important.png Note:
These scripts depend on a yum feature introduced in Centos 6 / SME 9, and will not work on earlier versions

Due to dependencies, the installation of contribs requires very often the installation of rpms coming from 3rd party (non-SME) repositories.

Enabling 3rd party repositories during a general yum update can pull in packages that are incompatible with SME server such as newer versions of PHP, mysql, samba, etc.

Updating the installed contribs needs sometimes to update the dependencies or sometimes only the dependencies get updated.

In order to avoid serious problems of compatibility, it is very important that all the rpms get updated only from the repository they are installed from, instead of only taking the most recent release existing in all the repositories that are available.

Yum doesn't do this job in one command but small scripts must be used for this purpose.

yumcheck.sh

yumcheck.sh can be used to check for and optionally install updates to packages that were originally installed from a 3rd party repository.

yumcheck.sh is an attachment to bugzilla:10158

Install at the sme server shell using (updated 2017-12-14):
(If this curl command doesn't work you can open the bug using the link above, view the attachment, create a local file with the same content, and make the local file executable)

curl -s https://bugs.contribs.org/attachment.cgi?id=6016 |sed -e 's/\r//' >/usr/local/bin/yumcheck.sh
chmod +x /usr/local/bin/yumcheck.sh


Usage:

yumcheck.sh
Check for updates for all packages installed from non-standard repos. Output only info for packages that need updates
Indicate before exit if any packages were installed using yum localinstall
Indicate before exit if the server requires signal-event post-upgrade; signal-event reboot
yumcheck.sh update
Run in verbose mode, do the updates, prompt the user after checking each repo if updates are pending
yumcheck.sh update -q -y
Show only those items to be updated, do the updates, and answer 'yes' to each suggested update.
yumcheck.sh @/
List all rpms that have been installed using yum localinstall
yumcheck.sh @smecontribs @sogo @/
Check for updates from "smecontribs", "sogo3", and any locally installed rpms
Note that "@sogo" will be expanded to "sogo3" at runtime. Likewise, "@sme" would expand to "smecontribs"

Notes:

  • Using the default settings will list updates from the enabled repositories multiple times (once for each disabled repo with installed packages)
  • Since this command starts from the output of /sbin/e-smith/audittools/newrpms, it is possible to get errors. That is, if you configure a repository, install a package from it, then remove the configuration, this script will error.
  • Arguments starting with "@" are stripped out and handled separately. If *all* arguments start with "@", the default "check-update -q" will be passed to yum.

Problems

smeupdates-testing

You might be directed in the forums or in bugzilla to install an update to a package from the smedev, smetest, or smeupdates-testing repository. Once the developer is confident that the update works and solves the problem, it gets "released" to smeupdates or smecontribs. In this case, yumcheck.sh will continue to look for updates only in original repo until you have installed the "released" version from the correct repository.

Assuming you have been directed to update "smeserver-php-scl" from the "smecontribs-testing" repository, you would "correct" the package once it is released by running:
yum --enablerepo=smecontribs reinstall smeserver-php-scl
Note: "yum reinstall" works only for identical package versions. If smecontribs has a newer version, you can get it using "yum --enablerepo=smecontribs update smeserver-php-scl"

Changed Dependencies

From time to time an rpm will acquire new dependencies. Since yumcheck.sh is restricting each repository to only the packages that already came from that repository, the update will fail.

To work around this problem, you will need to update the affected packages manually with the source repository enabled.

Be sure to check the output of your yum update command carefully before allowing the update to be installed - make sure that no SME-specific rpms are included in the update!

Example:

yumcheck.sh fails to run due to a dependency problem:
# yumcheck.sh update
...
Error: Package: php71-php-mcrypt-7.1.25-1.el6.remi.x86_64 (installed)
           Requires: php71-php-common(x86-64) = 7.1.25-1.el6.remi
...
Find the repository that the installed package came from:
# yum info php71-php-mcrypt
# yum info php71-php-mcrypt
Loaded plugins: fastestmirror, post-transaction-actions, smeserver
Loading mirror speeds from cached hostfile
 * base: centos2.zswap.net
 * smeaddons: mirror.canada.pialasse.com
 * smeextras: mirror.canada.pialasse.com
 * smeos: mirror.canada.pialasse.com
 * smeupdates: mirror.canada.pialasse.com
 * updates: centos2.zswap.net
Installed Packages
Name        : php71-php-mcrypt
Arch        : x86_64
Version     : 7.1.25
Release     : 2.el6.remi
Size        : 39 k
Repo        : installed
From repo   : remi-safe
Summary     : Standard PHP module provides mcrypt library support
URL         : http://www.php.net/
License     : PHP
Description : The php71-php-mcrypt package contains a dynamic shared object that will add
            : support for using the mcrypt library to PHP.
Do an update with only the indicated repository enabled:
# yum --disablerepo=* --enablerepo=remi-safe update
...
Dependencies Resolved

============================================================================================================================================================
 Package                                   Arch                          Version                                     Repository                        Size
============================================================================================================================================================
Updating:
 php54-php                                 x86_64                        5.4.45-16.el6.remi                          remi-safe                        1.4 M
 php54-php-bcmath                          x86_64                        5.4.45-16.el6.remi                          remi-safe                         59 k
 php54-php-cli                             x86_64                        5.4.45-16.el6.remi                          remi-safe                        2.7 M
 php54-php-common                          x86_64                        5.4.45-16.el6.remi                          remi-safe                        581 k
 php54-php-enchant                         x86_64                        5.4.45-16.el6.remi                          remi-safe                         44 k
 php54-php-gd                              x86_64                        5.4.45-16.el6.remi                          remi-safe                        125 k
 php54-php-imap                            x86_64                        5.4.45-16.el6.remi                          remi-safe                         65 k
 php54-php-ldap                            x86_64                        5.4.45-16.el6.remi                          remi-safe                         56 k
 php54-php-mbstring                        x86_64                        5.4.45-16.el6.remi                          remi-safe                        498 k
 php54-php-mcrypt                          x86_64                        5.4.45-16.el6.remi                          remi-safe                         49 k
 php54-php-mysqlnd                         x86_64                        5.4.45-16.el6.remi                          remi-safe                        1.8 M
 php54-php-pdo                             x86_64                        5.4.45-16.el6.remi                          remi-safe                         91 k
 php54-php-pear                            noarch                        1:1.10.7-1.el6.remi                         remi-safe                        371 k
 php54-php-process                         x86_64                        5.4.45-16.el6.remi                          remi-safe                         54 k
 php54-php-soap                            x86_64                        5.4.45-16.el6.remi                          remi-safe                        160 k
 php54-php-tidy                            x86_64                        5.4.45-16.el6.remi                          remi-safe                         51 k
 php54-php-xml                             x86_64                        5.4.45-16.el6.remi                          remi-safe                        119 k
 php55-php                                 x86_64                        5.5.38-10.el6.remi                          remi-safe                        1.4 M
 php55-php-bcmath                          x86_64                        5.5.38-10.el6.remi                          remi-safe                         60 k
 php55-php-cli                             x86_64                        5.5.38-10.el6.remi                          remi-safe                        2.6 M
 php55-php-common                          x86_64                        5.5.38-10.el6.remi                          remi-safe                        672 k
 php55-php-enchant                         x86_64                        5.5.38-10.el6.remi                          remi-safe                         45 k
 php55-php-gd                              x86_64                        5.5.38-10.el6.remi                          remi-safe                         67 k
 php55-php-imap                            x86_64                        5.5.38-10.el6.remi                          remi-safe                         66 k
 php55-php-ldap                            x86_64                        5.5.38-10.el6.remi                          remi-safe                         57 k
 php55-php-mbstring                        x86_64                        5.5.38-10.el6.remi                          remi-safe                        512 k
 php55-php-mcrypt                          x86_64                        5.5.38-10.el6.remi                          remi-safe                         50 k
 php55-php-mysqlnd                         x86_64                        5.5.38-10.el6.remi                          remi-safe                        175 k
 php55-php-pdo                             x86_64                        5.5.38-10.el6.remi                          remi-safe                         93 k
 php55-php-pear                            noarch                        1:1.10.7-1.el6.remi                         remi-safe                        371 k
 php55-php-process                         x86_64                        5.5.38-10.el6.remi                          remi-safe                         58 k
 php55-php-soap                            x86_64                        5.5.38-10.el6.remi                          remi-safe                        163 k
 php55-php-tidy                            x86_64                        5.5.38-10.el6.remi                          remi-safe                         52 k
 php55-php-xml                             x86_64                        5.5.38-10.el6.remi                          remi-safe                        150 k
 php56-php-pear                            noarch                        1:1.10.7-1.el6.remi                         remi-safe                        371 k
 php70-php-pear                            noarch                        1:1.10.7-1.el6.remi                         remi-safe                        371 k
 php71-php                                 x86_64                        7.1.25-2.el6.remi                           remi-safe                        1.4 M
 php71-php-bcmath                          x86_64                        7.1.25-2.el6.remi                           remi-safe                         68 k
 php71-php-cli                             x86_64                        7.1.25-2.el6.remi                           remi-safe                        2.7 M
 php71-php-common                          x86_64                        7.1.25-2.el6.remi                           remi-safe                        597 k
 php71-php-enchant                         x86_64                        7.1.25-2.el6.remi                           remi-safe                         53 k
 php71-php-fpm                             x86_64                        7.1.25-2.el6.remi                           remi-safe                        1.4 M
 php71-php-gd                              x86_64                        7.1.25-2.el6.remi                           remi-safe                         70 k
 php71-php-imap                            x86_64                        7.1.25-2.el6.remi                           remi-safe                         73 k
 php71-php-json                            x86_64                        7.1.25-2.el6.remi                           remi-safe                         62 k
 php71-php-ldap                            x86_64                        7.1.25-2.el6.remi                           remi-safe                         65 k
 php71-php-mbstring                        x86_64                        7.1.25-2.el6.remi                           remi-safe                        522 k
 php71-php-mcrypt                          x86_64                        7.1.25-2.el6.remi                           remi-safe                         58 k
 php71-php-mysqlnd                         x86_64                        7.1.25-2.el6.remi                           remi-safe                        164 k
 php71-php-pdo                             x86_64                        7.1.25-2.el6.remi                           remi-safe                        102 k
 php71-php-pear                            noarch                        1:1.10.7-1.el6.remi                         remi-safe                        370 k
 php71-php-process                         x86_64                        7.1.25-2.el6.remi                           remi-safe                         66 k
 php71-php-soap                            x86_64                        7.1.25-2.el6.remi                           remi-safe                        156 k
 php71-php-tidy                            x86_64                        7.1.25-2.el6.remi                           remi-safe                         60 k
 php71-php-xml                             x86_64                        7.1.25-2.el6.remi                           remi-safe                        155 k
 php72-php                                 x86_64                        7.2.13-2.el6.remi                           remi-safe                        1.5 M
 php72-php-bcmath                          x86_64                        7.2.13-2.el6.remi                           remi-safe                         70 k
 php72-php-cli                             x86_64                        7.2.13-2.el6.remi                           remi-safe                        2.9 M
 php72-php-common                          x86_64                        7.2.13-2.el6.remi                           remi-safe                        627 k
 php72-php-enchant                         x86_64                        7.2.13-2.el6.remi                           remi-safe                         54 k
 php72-php-gd                              x86_64                        7.2.13-2.el6.remi                           remi-safe                         73 k
 php72-php-imap                            x86_64                        7.2.13-2.el6.remi                           remi-safe                         74 k
 php72-php-json                            x86_64                        7.2.13-2.el6.remi                           remi-safe                         64 k
 php72-php-ldap                            x86_64                        7.2.13-2.el6.remi                           remi-safe                         69 k
 php72-php-mbstring                        x86_64                        7.2.13-2.el6.remi                           remi-safe                        557 k
 php72-php-mysqlnd                         x86_64                        7.2.13-2.el6.remi                           remi-safe                        166 k
 php72-php-pdo                             x86_64                        7.2.13-2.el6.remi                           remi-safe                        104 k
 php72-php-process                         x86_64                        7.2.13-2.el6.remi                           remi-safe                         67 k
 php72-php-soap                            x86_64                        7.2.13-2.el6.remi                           remi-safe                        157 k
 php72-php-tidy                            x86_64                        7.2.13-2.el6.remi                           remi-safe                         61 k
 php72-php-xml                             x86_64                        7.2.13-2.el6.remi                           remi-safe                        156 k

Transaction Summary
============================================================================================================================================================
Upgrade      71 Package(s)

Total size: 30 M
Is this ok [y/N]: y
...

Updated:
  php54-php.x86_64 0:5.4.45-16.el6.remi              php54-php-bcmath.x86_64 0:5.4.45-16.el6.remi        php54-php-cli.x86_64 0:5.4.45-16.el6.remi         
  php54-php-common.x86_64 0:5.4.45-16.el6.remi       php54-php-enchant.x86_64 0:5.4.45-16.el6.remi       php54-php-gd.x86_64 0:5.4.45-16.el6.remi           
  php54-php-imap.x86_64 0:5.4.45-16.el6.remi         php54-php-ldap.x86_64 0:5.4.45-16.el6.remi          php54-php-mbstring.x86_64 0:5.4.45-16.el6.remi     
  php54-php-mcrypt.x86_64 0:5.4.45-16.el6.remi       php54-php-mysqlnd.x86_64 0:5.4.45-16.el6.remi       php54-php-pdo.x86_64 0:5.4.45-16.el6.remi         
  php54-php-pear.noarch 1:1.10.7-1.el6.remi          php54-php-process.x86_64 0:5.4.45-16.el6.remi       php54-php-soap.x86_64 0:5.4.45-16.el6.remi         
  php54-php-tidy.x86_64 0:5.4.45-16.el6.remi         php54-php-xml.x86_64 0:5.4.45-16.el6.remi           php55-php.x86_64 0:5.5.38-10.el6.remi             
  php55-php-bcmath.x86_64 0:5.5.38-10.el6.remi       php55-php-cli.x86_64 0:5.5.38-10.el6.remi           php55-php-common.x86_64 0:5.5.38-10.el6.remi       
  php55-php-enchant.x86_64 0:5.5.38-10.el6.remi      php55-php-gd.x86_64 0:5.5.38-10.el6.remi            php55-php-imap.x86_64 0:5.5.38-10.el6.remi         
  php55-php-ldap.x86_64 0:5.5.38-10.el6.remi         php55-php-mbstring.x86_64 0:5.5.38-10.el6.remi      php55-php-mcrypt.x86_64 0:5.5.38-10.el6.remi       
  php55-php-mysqlnd.x86_64 0:5.5.38-10.el6.remi      php55-php-pdo.x86_64 0:5.5.38-10.el6.remi           php55-php-pear.noarch 1:1.10.7-1.el6.remi         
  php55-php-process.x86_64 0:5.5.38-10.el6.remi      php55-php-soap.x86_64 0:5.5.38-10.el6.remi          php55-php-tidy.x86_64 0:5.5.38-10.el6.remi         
  php55-php-xml.x86_64 0:5.5.38-10.el6.remi          php56-php-pear.noarch 1:1.10.7-1.el6.remi           php70-php-pear.noarch 1:1.10.7-1.el6.remi         
  php71-php.x86_64 0:7.1.25-2.el6.remi               php71-php-bcmath.x86_64 0:7.1.25-2.el6.remi         php71-php-cli.x86_64 0:7.1.25-2.el6.remi           
  php71-php-common.x86_64 0:7.1.25-2.el6.remi        php71-php-enchant.x86_64 0:7.1.25-2.el6.remi        php71-php-fpm.x86_64 0:7.1.25-2.el6.remi           
  php71-php-gd.x86_64 0:7.1.25-2.el6.remi            php71-php-imap.x86_64 0:7.1.25-2.el6.remi           php71-php-json.x86_64 0:7.1.25-2.el6.remi         
  php71-php-ldap.x86_64 0:7.1.25-2.el6.remi          php71-php-mbstring.x86_64 0:7.1.25-2.el6.remi       php71-php-mcrypt.x86_64 0:7.1.25-2.el6.remi       
  php71-php-mysqlnd.x86_64 0:7.1.25-2.el6.remi       php71-php-pdo.x86_64 0:7.1.25-2.el6.remi            php71-php-pear.noarch 1:1.10.7-1.el6.remi         
  php71-php-process.x86_64 0:7.1.25-2.el6.remi       php71-php-soap.x86_64 0:7.1.25-2.el6.remi           php71-php-tidy.x86_64 0:7.1.25-2.el6.remi         
  php71-php-xml.x86_64 0:7.1.25-2.el6.remi           php72-php.x86_64 0:7.2.13-2.el6.remi                php72-php-bcmath.x86_64 0:7.2.13-2.el6.remi       
  php72-php-cli.x86_64 0:7.2.13-2.el6.remi           php72-php-common.x86_64 0:7.2.13-2.el6.remi         php72-php-enchant.x86_64 0:7.2.13-2.el6.remi       
  php72-php-gd.x86_64 0:7.2.13-2.el6.remi            php72-php-imap.x86_64 0:7.2.13-2.el6.remi           php72-php-json.x86_64 0:7.2.13-2.el6.remi         
  php72-php-ldap.x86_64 0:7.2.13-2.el6.remi          php72-php-mbstring.x86_64 0:7.2.13-2.el6.remi       php72-php-mysqlnd.x86_64 0:7.2.13-2.el6.remi       
  php72-php-pdo.x86_64 0:7.2.13-2.el6.remi           php72-php-process.x86_64 0:7.2.13-2.el6.remi        php72-php-soap.x86_64 0:7.2.13-2.el6.remi         
  php72-php-tidy.x86_64 0:7.2.13-2.el6.remi          php72-php-xml.x86_64 0:7.2.13-2.el6.remi           

Complete!

The objective is to update only the package or packages that are blocking safe updates using yumcheck.sh. If updating as above (with only the indicated repository enabled) includes too many packages, you might need to add package names to the update command. If the indicated packages include dependencies from other repositories you may need to enable those other repositories.

The epel repository, for example, contains many useful packages (fail2ban, nodejs, roundcube, imapsync, and many more) - but "yum --enablerepo=epel update" would break horde and php on a SME server. In that case you would add the affected package to the update command:
# yum --enablerepo=epel update roundcube

Related Information

Alternative Scripts

Original scripts

Forum

How to update completely and properly a SME?

Bugzilla

IDProductComponentSummary
10158SME Server FutureNew Feature RequestNFR Improve support for 3rd party repositories