Koozali.org: home of the SME Server

How to update completely and properly a SME?

Offline Arnaud

  • *
  • 143
  • +0/-0
    • GuedeL
How to update completely and properly a SME?
« on: December 31, 2016, 12:44:08 PM »
Hello,

with this question, I don't mean a  simple "yum update"......"
yum update --enablerepo=*" is wrong too!

Due to dependencies coming sometimes from different repos, I'm looking for a way to update all the rpms from the repo of which they were installed from:
eg. if XYZ.rpm has been installed from "epel", yum should only look for in the "epel" repo for this rpm and make the update if present into epel. If XYZ.rpm hast got a more recent release in another repo, this more recent release should be ignore.

Of course, I don't want to list the rpm's manually...

Thanks.
Bye
Arnaud

Offline Stefano

  • *
  • 10,836
  • +2/-0
Re: How to update completely and properly a SME?
« Reply #1 on: December 31, 2016, 01:35:22 PM »
Code: [Select]
yum update

will update only OS

Code: [Select]
yum --enablerepo=smecontribs update

wil update both contribs and OS

I understand you need, but there are more cons that pro to update massively a server..
the external repos (epel, dag, whatever) must be enabled only when you need to update a single contrib

something like
Code: [Select]
yum --enablerepo=smecontribs,epel update smeserver-mycontrib

you'd try to play with the check_updates (or something similar) script to make it do some work for you.. be aware: it can break your server, play on a test machine

Offline janet

  • ****
  • 4,812
  • +0/-0
Re: How to update completely and properly a SME?
« Reply #2 on: December 31, 2016, 04:25:47 PM »
Arnaud

Interesting idea.
You should lodge a New Feature Request (NFR) bug report at Bugzilla, & see what the devs think of your idea.
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline mmccarn

  • *
  • 2,626
  • +10/-0
Re: How to update completely and properly a SME?
« Reply #3 on: December 31, 2016, 04:27:34 PM »
This forum post from 2011 describes a way to configure yum repositories to make subsequent updates easy:
https://forums.contribs.org/index.php?topic=48005.0

Since that process is so painful to maintain on my test system, I tend to do this:

* yum update --enablerepo=* update
--> answer "no"
--> note the non-sme packages with pending updates
-->  ** update the non-sme packages manually, one-by-one, with the minimum number of repos enabled to accomplish the udpate
--> finish with yum update

** This step depends on memory & research.  It has always frustrated me that /var/log/yum.log does not indicate the repository from which a particular package was installed...

Offline Stefano

  • *
  • 10,836
  • +2/-0
Re: How to update completely and properly a SME?
« Reply #4 on: December 31, 2016, 04:54:26 PM »
this could be a start:
Code: [Select]
yum list installed | grep -v '@anaconda' | grep -v '@base'

Offline Jean-Philippe Pialasse

  • *
  • 2,746
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: How to update completely and properly a SME?
« Reply #5 on: December 31, 2016, 05:24:22 PM »
One way with epel could be to create a myepel repo in yum repo db, identical to the epel one, except for the name and the inclusion of a Include statement listing all the rpm you decided to add once, and keep it uptodate. Also you can set this one enabled so it is used for auto update.

Offline Arnaud

  • *
  • 143
  • +0/-0
    • GuedeL
Re: How to update completely and properly a SME?
« Reply #6 on: December 31, 2016, 05:27:33 PM »
Hello,

thanks for your replies.
Quote
something like
Code: [Select]
yum --enablerepo=smecontribs,epel update smeserver-mycontrib
unfortunately, this would only update "smeserver-mycontrib" but not its dependencies.

I've got a concrete example with my test VM:
smeserver-php-scl installed by a "yum install smeserver-php-scl --enablerepo=smecontribs,remi,epel" a few weeks ago.
The repo "remi" gives a lot of dependencies "php55...", "php54..."
Today
Code: [Select]
yum --enablerepo=smecontribs,remi,epel update smeserver-php-scl returns that "smeserver-php-scl" is up to date.
Today
Code: [Select]
yum update php5* --enablerepo=remi returns that 16 rpm's are for update available. I know that these are all dependencies of "smeserver-php-scl"

If I would install a new machine today, these updates would be installed by the "yum install smeserver-php-scl --enablerepo=smecontribs,remi,epel"

As a help for manual update:
Code: [Select]
yum list installed | grep remi or as a basic for a script that would  return a clean list of rpm that could be drag&drop in a yum command.

Bye

PS: ups, Stefano and JP are quicker.....
edit: wrong command!


« Last Edit: December 31, 2016, 05:31:28 PM by Arnaud »

Offline Arnaud

  • *
  • 143
  • +0/-0
    • GuedeL
Re: How to update completely and properly a SME?
« Reply #7 on: December 31, 2016, 05:56:51 PM »
on my test VM:
Code: [Select]
yum install yum-utils-> 2x rpm / 400kB
Code: [Select]
repoquery -a --installed --qf "%{name} %{ui_from_repo}" | grep @smecontribs
BackupPC @smecontribs
awstats @smecontribs
fuse-encfs @smecontribs
libmcrypt @smecontribs
.....
very clean output => "just have to" remove the strings beginning by "@" and the "return" in order to have an "horizontal" list......

Offline mmccarn

  • *
  • 2,626
  • +10/-0
Re: How to update completely and properly a SME?
« Reply #8 on: January 01, 2017, 04:07:49 PM »
Here's a start...  on my system I have a bunch of rpms installed using 'localinstall' which cause problems...

Code: [Select]
for f in $(/sbin/e-smith/audittools/newrpms |awk '/i386|i586|noarch/ {print $1}';); do \
repo=$(repoquery $f |awk '/Repo/ {print $3}';);  \
echo yum --enablerepo=$repo $f; \
done

Offline Arnaud

  • *
  • 143
  • +0/-0
    • GuedeL
Re: How to update completely and properly a SME?
« Reply #9 on: January 02, 2017, 03:18:26 PM »
Hi mmccarn,
I can't get your script running properly and I can't understand it completely... :oops: No "update" into the yum command?
I guess that it generates a command "yum --enablerepo=THE-REPO ????? the_rpm" for each rpm.

Bye
Arnaud

Offline mmccarn

  • *
  • 2,626
  • +10/-0
Re: How to update completely and properly a SME?
« Reply #10 on: January 02, 2017, 03:55:14 PM »
Hi mmccarn,
I can't get your script running properly and I can't understand it completely... :oops: No "update" into the yum command?
I guess that it generates a command "yum --enablerepo=THE-REPO ????? the_rpm" for each rpm.

Bye
Arnaud

Yes; I somehow lost the "-i" argument for repoquery, and there are other problems.

Here is a command that "works", but is still only a partial solution. 

This command will show the various "yum update" commands that need to be run, but it would still potentially pull in unwanted dependencies from the non-SME repositories.

Code: [Select]
for f in $(/sbin/e-smith/audittools/newrpms |awk '/i386|i586|noarch/ {print $1}';); do \
repo=$(repoquery -i $f |awk '/Repo/ {print $3}';); \
if [[ -z "$repo" ]]; then \
echo "# $f not installed from yum repository"; \
else \
echo "yum --enablerepo=$repo update $f"; \
fi; \
done

A full solution would require the creation of new repos  using IncludePkgs.

A modified version of this script could be used to:
* identify the non-SME packages that have been installed (/sbin/e-smith/audittools/newrpms)
* display the repos they were installed from (if any)



Offline Arnaud

  • *
  • 143
  • +0/-0
    • GuedeL
Re: How to update completely and properly a SME?
« Reply #11 on: January 02, 2017, 11:00:08 PM »
I'm preparing "something"  :-? based on your first command. It should execute a yum command for each repo and not for each rpm.
The central point is:
Code: [Select]
#!/bin/bash

repo="sogo";

for rpm in $(/sbin/e-smith/audittools/newrpms |awk -v repo_awk=@"$repo" '/@sogo/ {print $1}'); do     ####### -v repo unnecessary in this command, but just for tests to make sure that it doesn't make troubel
#for rpm in $(/sbin/e-smith/audittools/newrpms |awk -v repo_awk=@"$repo" '/$repo_awk/ {print $1}}'); do  ########## WHY DOESN'T IT RUN????? "$repo_awk" doesn't get recognized

     rpms=$rpm' '$rpms

done

yum --enablerepo=$repo update $rpms;

exit 0

In this exemple, for repo "sogo" the script "loads" in my case:
Code: [Select]
yum --enablerepo=sogo update sope49-xml.x86_64 sope49-sbjson.x86_64 sope49-mime.x86_64 sope49-ldap.x86_64 sope49-gdl1-mysql.x86_64 sope49-gdl1-contentstore.x86_64 sope49-gdl1.x86_64 sope49-core.x86_64 sope49-cards.x86_64 sope49-appserver.x86_64 sogo-tool.x86_64 sogo-ealarms-notify.x86_64 sogo-activesync.x86_64 sogo.x86_64 libwbxml.x86_64 libmemcached.x86_64 gnustep-base.x86_64 and ask Y/n for processing.
=> this is in the correct direction.

Now, I would like not to entering "@sogo" in the script but use a variable "repo" (that could be set by hand or from the command "yum --repolist --all") and I'm definitively not able to put the variable "repo_awk" in the condition of the regex of awk. (see above)  :sad:
=> the help of an expert with regex is need!!

Thanks
Arnaud

PS: I hate bash and regex hate me! :evil:
« Last Edit: January 02, 2017, 11:03:19 PM by Arnaud »

Offline Jean-Philippe Pialasse

  • *
  • 2,746
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: How to update completely and properly a SME?
« Reply #12 on: January 03, 2017, 04:39:23 AM »
Arnaud,
rpm from epel, should be present in smecontribs repo. If not you could open a bug against the contrib that does not has it to help us correct that.

rpm from remi, needed by contribs will soon be imported into smecontribs repo.

Of course you present work might still be needed for other rpm you might need not related to a contrib in smecontribs.

Offline Arnaud

  • *
  • 143
  • +0/-0
    • GuedeL
Re: How to update completely and properly a SME?
« Reply #13 on: January 03, 2017, 10:43:42 PM »
Hi
@JP: thanks for making me aware that there won't be a real need for this in the future but my "special" friends "bash" and "regex" won't let me sleep in peace until I show them who is stronger.........
So just for fun and personal satisfaction:
Code: [Select]
#!/bin/bash

echo "List of available repos beside SME:";
#list the disabled repos
for repo in $(yum repolist disabled |awk  '$1 !~ /id|Modules|repolist:/ {print $1}'); do

      echo $repo;

done
echo "";

# repo selection
index=0;
repos="";
proceed="proceed";

until [ "$repos" == "$proceed" ]; do

        repos[$index]=$repos;
        ((index=index+1));
        read -p 'Enter 1x repo name for selection or "proceed" to start the updating: ' repos;

done

# remove the repo "proceed"
repos=("${repos[@]:1}");


for repo in "${repos[@]}"; do
        echo "";
        echo "======================================";
        echo -e "\tUPDATE from repo: "$repo;
        echo "======================================";

        # generate the list of rpm installed from the repo
        for rpm in $(/sbin/e-smith/audittools/newrpms |awk -v repo_awk=@$repo 'repo_awk==$3 {print $1}'); do

                rpms=$rpm' '$rpms

        done

# updating
        yum --enablerepo=$repo update $rpms;

done

exit 0

I tested it on the VM and it seems to work.
The User manual is: enter each updating repo (only 1 repo per line) and enter "proceed" to close the selection and start the update. Don't worry: yum will ask for "real" updating as usual after checking the updates.

For me it is enough.
Maybe we could add a listing of the rpm installed beside the repos by a "localinstall".......

Have fun.
Arnaud

PS: I would be interested to get improvements of the syntax or for the structure of this script, not only for my "special" friends..... :cool: but in order to learn something. Thanks.

Offline mmccarn

  • *
  • 2,626
  • +10/-0
Re: How to update completely and properly a SME?
« Reply #14 on: February 25, 2017, 08:09:35 PM »
Here is a modified version of your script.

This version:

* runs 'newrpms' to get all repos that have been used to install non-standard packages
* creates a list of rpms for each such repo
* use "--setopts" to specify "includepkgs" for each repo during update
* runs the update

My objectives are two-fold:
* A single command to update all non-SME packages
* No unintended packages from the wrong repo

Bonus: the updates seem to run faster using 'includepkgs'.

Code: [Select]
#!/bin/bash

for repo in $(/sbin/e-smith/audittools/newrpms |grep \@ |awk ' {print $3}' |sort -u |sed s/@//); do

        # generate the list of rpm installed from the repo
        for rpm in $(/sbin/e-smith/audittools/newrpms |awk -v repo_awk=@$repo 'repo_awk==$3 {print $1}'); do
                rpms=$rpm' '$rpms
        done

        echo -e "\n\n===";
        echo -e "Repo: "$repo;
        echo -e "\nIncludePkgs: "$rpms;
        echo "===";
        # updating
        yum --enablerepo=$repo --setopt="$repo.includepkgs='$rpms'" update

done

exit 0

Offline Arnaud

  • *
  • 143
  • +0/-0
    • GuedeL
Re: How to update completely and properly a SME?
« Reply #15 on: February 27, 2017, 04:53:07 PM »
Hi,

I'm happy to see that it's going on about this feature.

Thanks for your script: much shorter than mine, the updates seem to run quicker too => congratulation!  :cool:

Bye
Arnaud

guest22

Re: How to update completely and properly a SME?
« Reply #16 on: February 28, 2017, 07:18:55 PM »
I believe this this deserves it's own wiki page...

Offline Arnaud

  • *
  • 143
  • +0/-0
    • GuedeL
Re: How to update completely and properly a SME?
« Reply #17 on: February 28, 2017, 08:09:08 PM »
The script is the wiki page in reality.

And even if this topic is important for my use, I'm not very convinced that it is for much people when I consider the discreet feedback.

Arnaud

guest22

Re: How to update completely and properly a SME?
« Reply #18 on: February 28, 2017, 08:59:10 PM »
And even if this topic is important for my use, I'm not very convinced that it is for much people when I consider the discreet feedback.


Maybe not many really understand a full and careful update of not only SME Server basic, but also what has been installed along the way by contribs...

Offline Jáder

  • *
  • 1,099
  • +0/-0
    • LinuxFacil
Re: How to update completely and properly a SME?
« Reply #19 on: March 08, 2017, 12:14:41 AM »
I agree with RequestedDeletion.. I think this script RULES!
Even if you answer NO to updates, you can find out whats should be updated on each repo!
COOL!

Thanks by your work!
...

guest22

Re: How to update completely and properly a SME?
« Reply #20 on: March 08, 2017, 12:35:18 AM »
I suggest we add 'screen -L' to the script so we have a permanent file based copy of all output.

@mmccarn, Arnaud, is that viable please?

Offline Arnaud

  • *
  • 143
  • +0/-0
    • GuedeL
Re: How to update completely and properly a SME?
« Reply #21 on: March 08, 2017, 08:21:59 PM »
I'll do it.

Which title should I give? "Update the system from several repositories"?

Offline janet

  • ****
  • 4,812
  • +0/-0
Re: How to update completely and properly a SME?
« Reply #22 on: March 08, 2017, 10:43:33 PM »
Arnaud

How about

Updating from external repositories

Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

guest22

Re: How to update completely and properly a SME?
« Reply #23 on: March 09, 2017, 01:26:11 AM »
I'll do it.

Which title should I give? "Update the system from several repositories"?
How about 'update audit' of some kind?

Offline janet

  • ****
  • 4,812
  • +0/-0
Re: How to update completely and properly a SME?
« Reply #24 on: March 09, 2017, 01:35:41 AM »
.....Or

Update contribs
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline Jean-Philippe Pialasse

  • *
  • 2,746
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: How to update completely and properly a SME?
« Reply #25 on: March 09, 2017, 06:48:53 AM »
Or custom update

Offline TerryF

  • grumpy old man
  • *
  • 1,821
  • +6/-0
Re: How to update completely and properly a SME?
« Reply #26 on: March 09, 2017, 07:41:04 AM »
How about boaty mcboatface that seemed to be popular recently..

sorry had a humour attack, have to keep a watch on that....
--
qui scribit bis legit

Offline Arnaud

  • *
  • 143
  • +0/-0
    • GuedeL
Re: How to update completely and properly a SME?
« Reply #27 on: March 11, 2017, 04:27:38 PM »
Hi,

here https://wiki.contribs.org/Update_contribs is the summary of this topic.

Arnaud

Offline mmccarn

  • *
  • 2,626
  • +10/-0
Re: How to update completely and properly a SME?
« Reply #28 on: March 11, 2017, 05:45:19 PM »
Thanks.

I added a note that these scripts will only work on SME9 - /sbin/e-smith/audittools/newrpms does not show the 'installed from' repo information on SME8.

I also added a 3rd script - the one I'm using locally - that uses "check-update -q" by default, and accepts arguments so I can run it with "update -q -y" to install the pending updates.

I wrote (and apparently failed to post) a comment a few days ago asking if this should be an NFR bug for a new "audittool" or an update to smeserver-yum.


A note -
A few years ago (2011) I did some work on this, and was asked to leave it alone.  The thought at that time was that supported packages should be moved onto the smecontribs build server so that 3rd party repositories would not be needed.

Offline mmccarn

  • *
  • 2,626
  • +10/-0
Re: How to update completely and properly a SME?
« Reply #29 on: March 11, 2017, 05:52:06 PM »
And for TerryF:

https://wiki.contribs.org/Boaty_mcboatface


(I'm sure I'll get chastised for this...)

Offline Stefano

  • *
  • 10,836
  • +2/-0
Re: How to update completely and properly a SME?
« Reply #30 on: March 11, 2017, 06:27:23 PM »
ROTFL :-)

Offline TerryF

  • grumpy old man
  • *
  • 1,821
  • +6/-0
Re: How to update completely and properly a SME?
« Reply #31 on: March 12, 2017, 08:58:41 AM »
https://wiki.contribs.org/Boaty_mcboatface

I see no problems with this :-)

Quote
(I'm sure I'll get chastised for this...)

Tell em to get !@#$%^, humour, its what makes the world a civilised place (most of the time) :-)

--
qui scribit bis legit

Offline janet

  • ****
  • 4,812
  • +0/-0
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline mmccarn

  • *
  • 2,626
  • +10/-0
Re: How to update completely and properly a SME?
« Reply #33 on: March 18, 2017, 04:40:06 PM »
Wiki page updated:
https://wiki.contribs.org/Update_contribs

New Feature Request created:
https://bugs.contribs.org/show_bug.cgi?id=10158

New version of 'yumcheck.sh' added to bugzilla; installation instructions included on the wiki page.

The new version of the script:
* corrects an error in the "includepkgs" syntax used (separates packages with commas instead of spaces)**
* corrects the logic used to build the list of 'includepkgs' for each repository ***

** when 'includepkgs' used spaces instead of commas, the command would work from the command line but fail from inside the script for some updates

*** The original version of 'yumcheck.sh' would add the packages for each 3rd party repo to the existing list of packages from previously processed repositories.  This version makes sure that includepkgs only includes the packages installed from the current repository.

Offline mmccarn

  • *
  • 2,626
  • +10/-0
Re: How to update completely and properly a SME?
« Reply #34 on: March 26, 2017, 06:57:42 PM »
https://wiki.contribs.org/Update_contribs

https://bugs.contribs.org/show_bug.cgi?id=10158

yumcheck.sh updated (again).  The bug attachment and the installation instructions on the wiki have been updated.

New features:
* command line arguments starting with "@" will be stripped out and used to match the list of repositories with installed packages.  Only matching repos will be passed to yum.
* a warning is printed before exit if there are packages that were originally installed using 'yum localinstall'

Examples:
yumcheck.sh @sogo
Only look for updates to rpms with a repo name starting with "sogo".

yumcheck.sh @sogo update -q -y
Silently update all rpms originally installed from a repo whose name starts with "sogo"

yumcheck.sh @/
List all packages installed using 'yum localinstall'

guest22

Re: How to update completely and properly a SME?
« Reply #35 on: April 07, 2017, 05:21:14 AM »
Now that the CentOS 6.9 updates are available it would make a good 'stress test' on the script!

Please give it a try and report your results please? https://wiki.contribs.org/Update_contribs

guest22

Re: How to update completely and properly a SME?
« Reply #36 on: April 07, 2017, 05:56:22 AM »
@mmccarn,

would it be possible to DISABLE a (standard) repo and/or multiple repo's? smeextras repo holds outdated packages (way back to 2011) and results in dependency issues with other repo's. So I would like to exclude this repo from being used by yumcheck.

(for now I have added --disablerepo=smeextras to the script yum command)

TIA

Offline mmccarn

  • *
  • 2,626
  • +10/-0
Re: How to update completely and properly a SME?
« Reply #37 on: April 07, 2017, 01:02:24 PM »
I've added this note to the bug with the script; let me know over there if you disagree with what I'm saying.

If you use "--disablerepo" on the command line when invoking yumcheck.sh, a yum syntax error is generated for any extra rpms installed from the specified repo.

That is, if you call yumcheck.sh with a command line like this:
> yumcheck.sh --disablerepo=sogo3 @sogo
Then the resulting yum command looks something like this:
> yum --disablerepo=sogo3 --enablerepo=sogo3 --setopt="sogo3.includepkgs=gnustep-base.x86_64..."

which causes yum to complain.

The script needs to be modified to:
1. avoid direct update attempts from repositories that are disabled on the command line

2. do something intelligent with rpms that came from the "disabled" repositories.

I can see a way to work on #1, and for now I'll  try to list the RPMs and REPOs that had no update attempted (for #2), but doing something really clever for #2 may be a bit beyond me...

guest22

Re: How to update completely and properly a SME?
« Reply #38 on: April 07, 2017, 01:08:18 PM »
Quick question, there are now 3 scripts. 2 on the wiki page and 1 attached to the above mentioned bug.

Can this be reduced to only 1 preferred script and adjust the wiki page please?

I am now confused as to what script to use.

TIA

Offline mmccarn

  • *
  • 2,626
  • +10/-0
Re: How to update completely and properly a SME?
« Reply #39 on: April 07, 2017, 01:35:06 PM »
I had not done that since the first useful script was created by @Arnaud, and I had not heard his opinion of my version..

I have updated the wiki page to indicate only my 'yumcheck.sh' script, with the original 2 scripts available on the 'discussion' page for reference.

I am actively using and fine-tuning 'yumcheck.sh' - and adjusting it in the bug and in the wiki page instructions when I make changes.


guest22

Re: How to update completely and properly a SME?
« Reply #40 on: April 07, 2017, 01:43:24 PM »
Thanks!

@Arnaud, would you agree on going forward with the yumcheck script as attached to the bug please?

In any case, VERY useful contribution all together. Should make it to a standard part of SME Server's update check routine in Server-manager... :wink:

Offline Arnaud

  • *
  • 143
  • +0/-0
    • GuedeL
Re: How to update completely and properly a SME?
« Reply #41 on: April 11, 2017, 08:10:56 PM »
I had not done that since the first useful script was created by @Arnaud, and I had not heard his opinion of my version..
Hi,
I was just not aware that this topic runs further  :? ...My apologies.

@mmccarn, I would say that the previous version of your scripts (= the script #2) is for me sufficient and does the expected job: for each repo there is a list of rpms that are "updatable", you can decide y/n to update them and at the end I run the magic "signal-event post-upgrade; signal-event reboot". Very simple and reliable.
If I just want to see what could be done, I run the script, look at the rpm lists and simply answer "no" to all the updates.
It is possible to recognize the rpms coming via "yum localinstall" too
=> it fulfills the function I was missing.

Of course, it is always possible to add some nice features....But I don't know if it is really necessary. Again: the script#2 already makes me happy! :)
I think that if further functions are wished and seen as necessary (and not just "nice to have"), it should be defined what should be reached.

I still haven't try your last script but I'll do it and report.

Bye
Arnaud

Offline Arnaud

  • *
  • 143
  • +0/-0
    • GuedeL
Re: How to update completely and properly a SME?
« Reply #42 on: April 18, 2017, 08:50:33 PM »
Hi,

the previous version of your scripts (= the script #2) is for me sufficient and does the expected job

that is not exactly true: I had an update last week:
- the yumcheck script  "saw" 2 possible updates (on repos sogo3 + stephdl)
- the script #2 saw no update  :shock:
- the script #1 saw the same 2 possible updates than the yumcheck script
- on the prod machine I updated with the yumcheck script => OK
- on the other machine I updated with script #1 => OK too

=> I will still compare the results of the different scripts and report in case where there is a discordance between them.

Bye Arnaud

guest22

Re: How to update completely and properly a SME?
« Reply #43 on: April 18, 2017, 08:54:08 PM »
How about script #3 please? The one attached to bugzilla.

Offline Arnaud

  • *
  • 143
  • +0/-0
    • GuedeL
Re: How to update completely and properly a SME?
« Reply #44 on: April 18, 2017, 08:55:58 PM »
How about script #3 please? The one attached to bugzilla.
for me it's called "yumcheck script"  isn't it?

guest22

Re: How to update completely and properly a SME?
« Reply #45 on: April 18, 2017, 08:56:54 PM »
Id we can all agree on it, yes ;-) Yumcheck

Offline mmccarn

  • *
  • 2,626
  • +10/-0
Re: How to update completely and properly a SME?
« Reply #46 on: December 13, 2017, 03:06:41 PM »
I've updated the yumcheck.sh script to create a single monolithic yum command, then run the indicated yum command only once.

That is:
* The old version ran the yum command for each custom repo -- which would list updates available from the standard repos over and over, and which took longer than necessary.
* The new version saves all the specific repo "enablepkgs" directives, then runs yum only once

For example, here is the output of the new version on my system - showing the extra arguments generated for each repo, then showing the final, single yum command and its results (I currently have a reboot pending):
Code: [Select]
yumcheck.sh check-update


===
--enablerepo=centos-sclo-rh --setopt="centos-sclo-rh.includepkgs=mysql55.x86_64,mysql55-mysql.x86_64,mysql55-mysql-libs.x86_64,mysql55-mysql-server.x86_64,mysql55-runtime.x86_64"
===


===
--enablerepo=epel --setopt="epel.includepkgs=fail2ban.noarch,ghc-HTTP.x86_64,ghc-array.x86_64,ghc-base.x86_64,ghc-base64-bytestring.x86_64,ghc-binary.x86_64,ghc-blaze-builder.x86_64,ghc-blaze-html.x86_64,ghc-bytestring.x86_64,ghc-citeproc-hs.x86_64,ghc-containers.x86_64,ghc-deepseq.x86_64,ghc-digest.x86_64,ghc-directory.x86_64,ghc-extensible-exceptions.x86_64,ghc-filepath.x86_64,ghc-highlighting-kate.x86_64,ghc-json.x86_64,ghc-mtl.x86_64,ghc-network.x86_64,ghc-old-locale.x86_64,ghc-old-time.x86_64,ghc-pandoc-types.x86_64,ghc-parsec.x86_64,ghc-pcre-light.x86_64,ghc-pretty.x86_64,ghc-process.x86_64,ghc-random.x86_64,ghc-syb.x86_64,ghc-tagsoup.x86_64,ghc-temporary.x86_64,ghc-texmath.x86_64,ghc-text.x86_64,ghc-time.x86_64,ghc-transformers.x86_64,ghc-unix.x86_64,ghc-utf8-string.x86_64,ghc-xml.x86_64,ghc-zip-archive.x86_64,ghc-zlib.x86_64,gnustep-filesystem.x86_64,gnustep-make.x86_64,gyp.noarch,http-parser.x86_64,http-parser-devel.x86_64,jemalloc.x86_64,libuv.x86_64,libuv-devel.x86_64,node-gyp.noarch,nodejs.x86_64,nodejs-abbrev.noarch,nodejs-ansi.noarch,nodejs-archy.noarch,nodejs-asn1.noarch,nodejs-assert-plus.noarch,nodejs-async.noarch,nodejs-aws-sign.noarch,nodejs-block-stream.noarch,nodejs-boom.noarch,nodejs-child-process-close.noarch,nodejs-chmodr.noarch,nodejs-chownr.noarch,nodejs-cmd-shim.noarch,nodejs-combined-stream.noarch,nodejs-config-chain.noarch,nodejs-cookie-jar.noarch,nodejs-cryptiles.noarch,nodejs-ctype.noarch,nodejs-delayed-stream.noarch,nodejs-devel.x86_64,nodejs-editor.noarch,nodejs-forever-agent.noarch,nodejs-form-data.noarch,nodejs-fstream.noarch,nodejs-fstream-ignore.noarch,nodejs-fstream-npm.noarch,nodejs-github-url-from-git.noarch,nodejs-glob.noarch,nodejs-graceful-fs.noarch,nodejs-hawk.noarch,nodejs-hoek.noarch,nodejs-http-signature.noarch,nodejs-inherits.noarch,nodejs-ini.noarch,nodejs-init-package-json.noarch,nodejs-json-stringify-safe.noarch,nodejs-lockfile.noarch,nodejs-lru-cache.noarch,nodejs-mime.noarch,nodejs-minimatch.noarch,nodejs-mkdirp.noarch,nodejs-mute-stream.noarch,nodejs-node-uuid.noarch,nodejs-nopt.noarch,nodejs-npm-registry-client.noarch,nodejs-npm-user-validate.noarch,nodejs-npmconf.noarch,nodejs-npmlog.noarch,nodejs-oauth-sign.noarch,nodejs-once.noarch,nodejs-opener.noarch,nodejs-osenv.noarch,nodejs-packaging.noarch,nodejs-promzard.noarch,nodejs-proto-list.noarch,nodejs-qs.noarch,nodejs-read.noarch,nodejs-read-installed.noarch,nodejs-read-package-json.noarch,nodejs-request.noarch,nodejs-retry.noarch,nodejs-rimraf.noarch,nodejs-semver.noarch,nodejs-sha.noarch,nodejs-sigmund.noarch,nodejs-slide.noarch,nodejs-sntp.noarch,nodejs-tar.noarch,nodejs-tunnel-agent.noarch,nodejs-uid-number.noarch,nodejs-which.noarch,npm.noarch,pandoc.x86_64,perl-File-Tail.noarch,python-inotify.noarch,redis.x86_64,v8.x86_64,v8-devel.x86_64"
===


===
--enablerepo=fws --setopt="fws.includepkgs=smeserver-fail2ban.noarch"
===


===
--enablerepo=smecontribs --setopt="smecontribs.includepkgs=ddclient.noarch,fping.x86_64,hddtemp.x86_64,perl-rrdtool.x86_64,rrdtool.x86_64,smeserver-dovecot-extras.noarch,smeserver-lazy_admin_tools.noarch,smeserver-mysql55.noarch,smeserver-sme9admin.noarch"
===


===
--enablerepo=sogo3 --setopt="sogo3.includepkgs=gnustep-base.x86_64,libmemcached.x86_64,libwbxml.x86_64,sogo.x86_64,sogo-activesync.x86_64,sogo-ealarms-notify.x86_64,sogo-tool.x86_64,sope49-appserver.x86_64,sope49-cards.x86_64,sope49-core.x86_64,sope49-gdl1.x86_64,sope49-gdl1-contentstore.x86_64,sope49-gdl1-mysql.x86_64,sope49-ldap.x86_64,sope49-mime.x86_64,sope49-sbjson.x86_64,sope49-xml.x86_64"
===


===
--enablerepo=stephdl --setopt="stephdl.includepkgs=sarg.x86_64,smeserver-sarg.noarch,smeserver-sogo.noarch"
===


===
--enablerepo=/wazuh-agent-2.0.1-1.rhel6.x86_64 --setopt="/wazuh-agent-2.0.1-1.rhel6.x86_64.includepkgs=wazuh-agent.x86_64"
===


===
yum check-update --enablerepo=centos-sclo-rh --setopt=centos-sclo-rh.includepkgs=mysql55.x86_64,mysql55-mysql.x86_64,mysql55-mysql-libs.x86_64,mysql55-mysql-server.x86_64,mysql55-runtime.x86_64 --enablerepo=epel --setopt=epel.includepkgs=fail2ban.noarch,ghc-HTTP.x86_64,ghc-array.x86_64,ghc-base.x86_64,ghc-base64-bytestring.x86_64,ghc-binary.x86_64,ghc-blaze-builder.x86_64,ghc-blaze-html.x86_64,ghc-bytestring.x86_64,ghc-citeproc-hs.x86_64,ghc-containers.x86_64,ghc-deepseq.x86_64,ghc-digest.x86_64,ghc-directory.x86_64,ghc-extensible-exceptions.x86_64,ghc-filepath.x86_64,ghc-highlighting-kate.x86_64,ghc-json.x86_64,ghc-mtl.x86_64,ghc-network.x86_64,ghc-old-locale.x86_64,ghc-old-time.x86_64,ghc-pandoc-types.x86_64,ghc-parsec.x86_64,ghc-pcre-light.x86_64,ghc-pretty.x86_64,ghc-process.x86_64,ghc-random.x86_64,ghc-syb.x86_64,ghc-tagsoup.x86_64,ghc-temporary.x86_64,ghc-texmath.x86_64,ghc-text.x86_64,ghc-time.x86_64,ghc-transformers.x86_64,ghc-unix.x86_64,ghc-utf8-string.x86_64,ghc-xml.x86_64,ghc-zip-archive.x86_64,ghc-zlib.x86_64,gnustep-filesystem.x86_64,gnustep-make.x86_64,gyp.noarch,http-parser.x86_64,http-parser-devel.x86_64,jemalloc.x86_64,libuv.x86_64,libuv-devel.x86_64,node-gyp.noarch,nodejs.x86_64,nodejs-abbrev.noarch,nodejs-ansi.noarch,nodejs-archy.noarch,nodejs-asn1.noarch,nodejs-assert-plus.noarch,nodejs-async.noarch,nodejs-aws-sign.noarch,nodejs-block-stream.noarch,nodejs-boom.noarch,nodejs-child-process-close.noarch,nodejs-chmodr.noarch,nodejs-chownr.noarch,nodejs-cmd-shim.noarch,nodejs-combined-stream.noarch,nodejs-config-chain.noarch,nodejs-cookie-jar.noarch,nodejs-cryptiles.noarch,nodejs-ctype.noarch,nodejs-delayed-stream.noarch,nodejs-devel.x86_64,nodejs-editor.noarch,nodejs-forever-agent.noarch,nodejs-form-data.noarch,nodejs-fstream.noarch,nodejs-fstream-ignore.noarch,nodejs-fstream-npm.noarch,nodejs-github-url-from-git.noarch,nodejs-glob.noarch,nodejs-graceful-fs.noarch,nodejs-hawk.noarch,nodejs-hoek.noarch,nodejs-http-signature.noarch,nodejs-inherits.noarch,nodejs-ini.noarch,nodejs-init-package-json.noarch,nodejs-json-stringify-safe.noarch,nodejs-lockfile.noarch,nodejs-lru-cache.noarch,nodejs-mime.noarch,nodejs-minimatch.noarch,nodejs-mkdirp.noarch,nodejs-mute-stream.noarch,nodejs-node-uuid.noarch,nodejs-nopt.noarch,nodejs-npm-registry-client.noarch,nodejs-npm-user-validate.noarch,nodejs-npmconf.noarch,nodejs-npmlog.noarch,nodejs-oauth-sign.noarch,nodejs-once.noarch,nodejs-opener.noarch,nodejs-osenv.noarch,nodejs-packaging.noarch,nodejs-promzard.noarch,nodejs-proto-list.noarch,nodejs-qs.noarch,nodejs-read.noarch,nodejs-read-installed.noarch,nodejs-read-package-json.noarch,nodejs-request.noarch,nodejs-retry.noarch,nodejs-rimraf.noarch,nodejs-semver.noarch,nodejs-sha.noarch,nodejs-sigmund.noarch,nodejs-slide.noarch,nodejs-sntp.noarch,nodejs-tar.noarch,nodejs-tunnel-agent.noarch,nodejs-uid-number.noarch,nodejs-which.noarch,npm.noarch,pandoc.x86_64,perl-File-Tail.noarch,python-inotify.noarch,redis.x86_64,v8.x86_64,v8-devel.x86_64 --enablerepo=fws --setopt=fws.includepkgs=smeserver-fail2ban.noarch --enablerepo=smecontribs --setopt=smecontribs.includepkgs=ddclient.noarch,fping.x86_64,hddtemp.x86_64,perl-rrdtool.x86_64,rrdtool.x86_64,smeserver-dovecot-extras.noarch,smeserver-lazy_admin_tools.noarch,smeserver-mysql55.noarch,smeserver-sme9admin.noarch --enablerepo=sogo3 --setopt=sogo3.includepkgs=gnustep-base.x86_64,libmemcached.x86_64,libwbxml.x86_64,sogo.x86_64,sogo-activesync.x86_64,sogo-ealarms-notify.x86_64,sogo-tool.x86_64,sope49-appserver.x86_64,sope49-cards.x86_64,sope49-core.x86_64,sope49-gdl1.x86_64,sope49-gdl1-contentstore.x86_64,sope49-gdl1-mysql.x86_64,sope49-ldap.x86_64,sope49-mime.x86_64,sope49-sbjson.x86_64,sope49-xml.x86_64 --enablerepo=stephdl --setopt=stephdl.includepkgs=sarg.x86_64,smeserver-sarg.noarch,smeserver-sogo.noarch
===
Loaded plugins: fastestmirror, smeserver
Loading mirror speeds from cached hostfile
 * base: mirrors.ocf.berkeley.edu
 * epel: fedora-epel.mirrors.tds.net
 * smeaddons: www.mirrorservice.org
 * smecontribs: smeserver.mirror.garr.it
 * smeextras: www.mirrorservice.org
 * smeos: www.mirrorservice.org
 * smeupdates: www.mirrorservice.org
 * updates: repo1.ash.innoscale.net


===
Locally installed package(s) exist.
You need to manage updates for these packages manually:

wazuh-agent.x86_64

(You would also get this message if you have created a
 yum repository whose name begins with a forward slash)
===

A contrib has set the UnsavedChanges flag to 'yes'
You should  execute the following commands to complete the update:

 signal-event post-upgrade; signal-event reboot

Offline Arnaud

  • *
  • 143
  • +0/-0
    • GuedeL
Re: How to update completely and properly a SME?
« Reply #47 on: December 13, 2017, 09:22:10 PM »
Hi mmccarn,
where can the new script be found? Could you (re)give us a link to it please?
Thanks.
Bye
Arnaud

Offline mmccarn

  • *
  • 2,626
  • +10/-0
Re: How to update completely and properly a SME?
« Reply #48 on: December 14, 2017, 01:46:26 PM »
[I have made another minor adjustment since yesterday...]

It's an attachment to this bug (I have perhaps unwisely renamed the attachment itself from 'yumcheck.sh' to 'yumstingy'):
https://bugs.contribs.org/show_bug.cgi?id=10158

You can 'see' the new version at this bug attachment URL:
https://bugs.contribs.org/attachment.cgi?id=6016

The download instructions on the wiki have been updated:
https://wiki.contribs.org/Update_contribs#yumcheck.sh

Here are the download instructions from the wiki page (the 'sed' bit is because I originally posted this script from a windows box that screwed up newlines...):
Code: [Select]
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


I also added a 'diff' between the old 'yumcheck.sh' and the latest 'yumstingy':
https://bugs.contribs.org/attachment.cgi?id=6017&action=diff

Offline Jean-Philippe Pialasse

  • *
  • 2,746
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: How to update completely and properly a SME?
« Reply #49 on: December 14, 2017, 05:24:13 PM »
[I have made another minor adjustment since yesterday...]

It's an attachment to this bug (I have perhaps unwisely renamed the attachment itself from 'yumcheck.sh' to 'yumstingy'):
https://bugs.contribs.org/show_bug.cgi?id=10158

You can 'see' the new version at this bug attachment URL:
https://bugs.contribs.org/attachment.cgi?id=6016

The download instructions on the wiki have been updated:
https://wiki.contribs.org/Update_contribs#yumcheck.sh

Here are the download instructions from the wiki page (the 'sed' bit is because I originally posted this script from a windows box that screwed up newlines...):
Code: [Select]
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

Have you gave a try to dos2unix command instead of the sed hack ?