Results 1 to 5 of 5

Thread: Blacklist specific version of a package in Zypper

  1. #1

    Default Blacklist specific version of a package in Zypper

    I know that Zypper can lock packages, but I am wondering if Zypper can block just a certain version of a package. (On a side note, I don't like forcing users to use the English SDB site with the "en" in the URL's domain; is there a generic URL I can use?)

    In my particular case, I have found that the latest kernel version causes problems on my computer, so I want to remove that version and use an older version. However, I don't want to cease all updates to the kernel. I tried
    Code:
    zypper addlock kernel-default-#.#.#-#.#
    But, that lock didn't seem to block anything.

  2. #2

    Default Re: Blacklist specific version of a package in Zypper

    Try something like:
    Code:
    zypper addlock kernel-default = 4.1.45
    or
    Code:
    zypper addlock kernel-default >= 4.1.45
    (the latter would of course lock 4.1.45 and *all* newer kernels)

    See also https://en.opensuse.org/openSUSE:Libzypp_locks_file for more details, which is referenced by the page you mention btw.

  3. #3
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    24,729

    Default Re: Blacklist specific version of a package in Zypper

    Quote Originally Posted by wolfi323 View Post
    Try something like:
    Code:
    zypper addlock kernel-default = 4.1.45
    or
    Code:
    zypper addlock kernel-default >= 4.1.45
    (the latter would of course lock 4.1.45 and *all* newer kernels)

    See also https://en.opensuse.org/openSUSE:Libzypp_locks_file for more details, which is referenced by the page you mention btw.
    IMHO the latter will redirect standardout of the command to the file =.
    Henk van Velden

  4. #4

    Default Re: Blacklist specific version of a package in Zypper

    Quote Originally Posted by hcvv View Post
    IMHO the latter will redirect standardout of the command to the file =.
    Yeah right, and it will lock kernel 4.1.45, not higher than 4.1.45 as a result.

    So this needs to be put into quotes:
    Code:
    zypper addlock "kernel-default >= 4.1.45"
    PS: something like this should also work (to lock only a range of versions):
    Code:
    zypper al "kernel-default >= 4.1.45 < 4.1.46"

  5. #5

    Default Re: Blacklist specific version of a package in Zypper

    Quote Originally Posted by wolfi323 View Post
    Try something like:
    Code:
    zypper addlock kernel-default = 4.1.45
    or
    Code:
    zypper addlock kernel-default >= 4.1.45
    (the latter would of course lock 4.1.45 and *all* newer kernels)

    See also https://en.opensuse.org/openSUSE:Libzypp_locks_file for more details, which is referenced by the page you mention btw.
    Yep; I skipped over the locks file page because I assumed I would be dealing with the command line only.

    I tried your method and it worked; thanks! I did discover that for any query string, I needed to enclose it in quotes. Otherwise, zypper would add three separate entries to the locks file (one for "packagename", "=", and the version "#.#.#"). The page also used a double-equals operator, rather than a single equals operator, but both seem to accomplish the same thing. In the end, I used something like the following command for my purposes:
    Code:
    zypper addlock "kernel-default == 4.1.45"

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •