Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9221585
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T03:36:37+00:00 2026-06-18T03:36:37+00:00

So, I’m trying out an update (upgrade) script for CentOS I have a Virtualbox

  • 0

So, I’m trying out an update (upgrade) script for CentOS

I have a Virtualbox VM for testing, on which I have a snapshot to which I can roll back

The script is written in dash (not bash)
These are the lines that matter in my script:

HOLDPKGS=(kernel python)

The following loop adds strings nicely

for paket in ${HOLDPKGS[*]}
do
  HOLDSTRING="--exclude=\"$paket*\" $HOLDSTRING"
done

Here lies the problem:

yum $HOLDSTRING -y update >> "$UPGRADE_LOGFILE" 2>&1

When I run the script with sh -x < scriptname >, this is the output (that matters):

+ HOLDSTRING='--exclude="python*" --exclude="kernel*" '
++ yum '--exclude="python*"' '--exclude="kernel*"' -y update

It finishes the update without errors, and no warnings regarding the syntax.

Yum completely ignores the exclude directives. This is what i’m seeing in the log:

Dependencies Resolved

================================================================================
 Package                 Arch   Version                           Repository
                                                                           Size
================================================================================
Installing:
 kernel                  x86_64 2.6.32-279.19.1.el6               updates  25 M
Updating:
 cpio                    x86_64 2.10-11.el6_3                     updates 192 k
 dhclient                x86_64 12:4.1.1-31.0.1.P1.el6.centos.1   updates 317 k
 dhcp-common             x86_64 12:4.1.1-31.0.1.P1.el6.centos.1   updates 141 k
 dracut                  noarch 004-284.el6_3.1                   updates 112 k
 dracut-kernel           noarch 004-284.el6_3.1                   updates  21 k
 glibc                   x86_64 2.12-1.80.el6_3.6                 updates 3.8 M
 glibc-common            x86_64 2.12-1.80.el6_3.6                 updates  14 M
 initscripts             x86_64 9.03.31-2.el6.centos.1            updates 935 k
 kernel-firmware         noarch 2.6.32-279.19.1.el6               updates 8.7 M
 krb5-libs               x86_64 1.9-33.el6_3.3                    updates 713 k
 libblkid                x86_64 2.17.2-12.7.el6_3                 updates 112 k
 libssh2                 x86_64 1.2.2-11.el6_3                    updates  75 k
 libudev                 x86_64 147-2.42.el6                      updates  75 k
 libuuid                 x86_64 2.17.2-12.7.el6_3                 updates  65 k
 mysql-libs              x86_64 5.1.66-2.el6_3                    updates 1.2 M
 nspr                    x86_64 4.9.1-2.el6_3                     updates 111 k
 nss                     x86_64 3.13.5-1.el6_3                    updates 763 k
 nss-sysinit             x86_64 3.13.5-1.el6_3                    updates  32 k
 nss-tools               x86_64 3.13.5-1.el6_3                    updates 729 k
 nss-util                x86_64 3.13.5-1.el6_3                    updates  53 k
 openldap                x86_64 2.4.23-26.el6_3.2                 updates 262 k
 openssl                 x86_64 1.0.0-25.el6_3.1                  updates 1.4 M
 python                  x86_64 2.6.6-29.el6_3.3                  updates 4.8 M
 python-libs             x86_64 2.6.6-29.el6_3.3                  updates 623 k
 redhat-logos            noarch 60.0.14-12.el6.centos             updates  15 M
 selinux-policy          noarch 3.7.19-155.el6_3.14               updates 1.3 M
 selinux-policy-targeted noarch 3.7.19-155.el6_3.14               updates 2.6 M
 sudo                    x86_64 1.7.4p5-13.el6_3                  updates 423 k
 tzdata                  noarch 2012j-1.el6                       updates 453 k
 udev                    x86_64 147-2.42.el6                      updates 361 k
 util-linux-ng           x86_64 2.17.2-12.7.el6_3                 updates 1.5 M

I tried doing this:

echo yum $HOLDSTRING -y update >> "$UPGRADE_LOGFILE" 2>&1

And pasting the output:

yum --exclude="python*" --exclude="kernel*" -y update

into the shell. That finished nicely (ignored kernel & python)

Dependencies Resolved

================================================================================
 Package                 Arch   Version                           Repository
                                                                           Size
================================================================================
Updating:
 cpio                    x86_64 2.10-11.el6_3                     updates 192 k
 dhclient                x86_64 12:4.1.1-31.0.1.P1.el6.centos.1   updates 317 k
 dhcp-common             x86_64 12:4.1.1-31.0.1.P1.el6.centos.1   updates 141 k
 dracut                  noarch 004-284.el6_3.1                   updates 112 k
 dracut-kernel           noarch 004-284.el6_3.1                   updates  21 k
 glibc                   x86_64 2.12-1.80.el6_3.6                 updates 3.8 M
 glibc-common            x86_64 2.12-1.80.el6_3.6                 updates  14 M
 initscripts             x86_64 9.03.31-2.el6.centos.1            updates 935 k
 krb5-libs               x86_64 1.9-33.el6_3.3                    updates 713 k
 libblkid                x86_64 2.17.2-12.7.el6_3                 updates 112 k
 libssh2                 x86_64 1.2.2-11.el6_3                    updates  75 k
 libudev                 x86_64 147-2.42.el6                      updates  75 k
 libuuid                 x86_64 2.17.2-12.7.el6_3                 updates  65 k
 mysql-libs              x86_64 5.1.66-2.el6_3                    updates 1.2 M
 nspr                    x86_64 4.9.1-2.el6_3                     updates 111 k
 nss                     x86_64 3.13.5-1.el6_3                    updates 763 k
 nss-sysinit             x86_64 3.13.5-1.el6_3                    updates  32 k
 nss-tools               x86_64 3.13.5-1.el6_3                    updates 729 k
 nss-util                x86_64 3.13.5-1.el6_3                    updates  53 k
 openldap                x86_64 2.4.23-26.el6_3.2                 updates 262 k
 openssl                 x86_64 1.0.0-25.el6_3.1                  updates 1.4 M
 redhat-logos            noarch 60.0.14-12.el6.centos             updates  15 M
 selinux-policy          noarch 3.7.19-155.el6_3.14               updates 1.3 M
 selinux-policy-targeted noarch 3.7.19-155.el6_3.14               updates 2.6 M
 sudo                    x86_64 1.7.4p5-13.el6_3                  updates 423 k
 tzdata                  noarch 2012j-1.el6                       updates 453 k
 udev                    x86_64 147-2.42.el6                      updates 361 k
 util-linux-ng           x86_64 2.17.2-12.7.el6_3                 updates 1.5 M

As you can see, in the lower example, we don’t have the kernel packages, which is what we want.

Does anyone see what i’m doing wrong? :/

P.S.
I have just tried running the script within a bash environment, and the problem persists :/

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T03:36:38+00:00Added an answer on June 18, 2026 at 3:36 am

    The problem is your quotes. There is no package matching "kernel*", but there is a package matching kernel*. But you should be using arrays anyway.

    HOLDARR=()
    for paket in ${HOLDPKGS[*]}
    do
      HOLDARR+=(--exclude="$paket*")
    done
    
    yum "${HOLDARR[@]}" -y update
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an autohotkey script which looks up a word in a bilingual dictionary
I am trying to understand how to use SyndicationItem to display feed which is
I have a small JavaScript validation script that validates inputs based on Regex. I
I'm trying to select an H1 element which is the second-child in its group
I have an array which has BIG numbers and small numbers in it. I
I have a text area in my form which accepts all possible characters from
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I am trying to loop through a bunch of documents I have to put
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.