Blame doc/versionlock.rst

Packit 3a9065
..
Packit 3a9065
  Copyright (C) 2015  Red Hat, Inc.
Packit 3a9065
Packit 3a9065
  This copyrighted material is made available to anyone wishing to use,
Packit 3a9065
  modify, copy, or redistribute it subject to the terms and conditions of
Packit 3a9065
  the GNU General Public License v.2, or (at your option) any later version.
Packit 3a9065
  This program is distributed in the hope that it will be useful, but WITHOUT
Packit 3a9065
  ANY WARRANTY expressed or implied, including the implied warranties of
Packit 3a9065
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
Packit 3a9065
  Public License for more details.  You should have received a copy of the
Packit 3a9065
  GNU General Public License along with this program; if not, write to the
Packit 3a9065
  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
Packit 3a9065
  02110-1301, USA.  Any Red Hat trademarks that are incorporated in the
Packit 3a9065
  source code or documentation are not subject to the GNU General Public
Packit 3a9065
  License and may only be used or replicated with the express permission of
Packit 3a9065
  Red Hat, Inc.
Packit 3a9065
Packit 3a9065
======================
Packit 3a9065
DNF versionlock Plugin
Packit 3a9065
======================
Packit 3a9065
Packit 3a9065
-----------
Packit 3a9065
Description
Packit 3a9065
-----------
Packit 3a9065
Packit 3a9065
`versionlock` is a plugin that takes a set of names and versions for packages and
Packit 3a9065
excludes all other versions of those packages. This allows you to protect
Packit 3a9065
packages from being updated by newer versions. Alternately, it accepts a specific
Packit 3a9065
package version to exclude from updates, e.g. for when it's necessary to skip a
Packit 3a9065
specific release of a package that has known issues.
Packit 3a9065
Packit 3a9065
The plugin provides a command `versionlock` which allows you to view and edit the
Packit 3a9065
list of locked packages easily.
Packit 3a9065
Packit 3a9065
The plugin will walk each line of the versionlock file, and parse out the name and
Packit 3a9065
version of the package. It will then exclude any package by that name that
Packit 3a9065
doesn't match one of the versions listed within the file. This is basically
Packit 3a9065
the same as using `dnf --exclude` for the package name itself (as you cannot exclude
Packit 3a9065
installed packages), but dnf will still see the versions you have
Packit 3a9065
installed/versionlocked as available so that `dnf reinstall` will still
Packit 3a9065
work, etc.
Packit 3a9065
Packit 3a9065
It can also work in the opposite way, like a fast exclude, by prefixing a '!'
Packit 3a9065
character to the version recorded in the lock list file. This specifically
Packit 3a9065
excludes a package that matches the version exactly.
Packit 3a9065
Packit 3a9065
Note the versionlock plugin does not apply any excludes in non-transactional
Packit 3a9065
operations like `repoquery`, `list`, `info`, etc.
Packit 3a9065
Packit 3a9065
--------
Packit 3a9065
Synopsis
Packit 3a9065
--------
Packit 3a9065
Packit 3a9065
``dnf versionlock [options] [add|exclude|list|delete|clear] [<package-name-spec>]``
Packit 3a9065
Packit 3a9065
---------
Packit 3a9065
Arguments
Packit 3a9065
---------
Packit 3a9065
Packit 3a9065
``<package-name-spec>``
Packit 3a9065
    Package spec to lock or exclude.
Packit 3a9065
Packit 3a9065
-----------
Packit 3a9065
Subcommands
Packit 3a9065
-----------
Packit 3a9065
Packit 3a9065
``dnf versionlock add <package-name-spec>``
Packit 3a9065
    Add a versionlock for all available packages matching the spec. It means that only versions of
Packit 3a9065
    packages represented by ``<package-name-spec>`` will be available for transaction operations.
Packit 3a9065
    Each ``<package-name-spec>`` is converted to concrete NEVRAs which are used for locking. The NEVRAs to lock to are first searched among installed packages and then (if none is found) in all currently available packages.
Packit 3a9065
Packit 3a9065
    Examples::
Packit 3a9065
Packit 3a9065
        Locking a package to the version installed:
Packit 3a9065
Packit 3a9065
            $ dnf repoquery --installed bash
Packit 3a9065
            bash-0:5.0.7-1.fc30.x86_64
Packit 3a9065
Packit 3a9065
            $ dnf repoquery bash
Packit 3a9065
            bash-0:5.0.2-1.fc30.i686
Packit 3a9065
            bash-0:5.0.2-1.fc30.x86_64
Packit 3a9065
            bash-0:5.0.7-1.fc30.i686
Packit 3a9065
            bash-0:5.0.7-1.fc30.x86_64
Packit 3a9065
Packit 3a9065
            $ dnf versionlock add bash
Packit 3a9065
            Adding versionlock on: bash-0:5.0.7-1.fc30.*
Packit 3a9065
Packit 3a9065
        Locking not installed package to any of available versions:
Packit 3a9065
Packit 3a9065
            $ dnf repoquery --installed mutt
Packit 3a9065
Packit 3a9065
            $ dnf repoquery mutt
Packit 3a9065
            mutt-5:1.11.4-1.fc30.x86_64
Packit 3a9065
            mutt-5:1.12.1-3.fc30.x86_64
Packit 3a9065
Packit 3a9065
            $ dnf versionlock add mutt
Packit 3a9065
            Adding versionlock on: mutt-5:1.11.4-1.fc30.*
Packit 3a9065
            Adding versionlock on: mutt-5:1.12.1-3.fc30.*
Packit 3a9065
Packit 3a9065
Packit 3a9065
``dnf versionlock exclude <package-name-spec>``
Packit 3a9065
    Add an exclude (within  versionlock) for the available packages matching the spec. It means that
Packit 3a9065
    packages represented by ``<package-name-spec>`` will be excluded from transaction operations.
Packit 3a9065
Packit 3a9065
``dnf versionlock list`` or ``dnf versionlock``
Packit 3a9065
    List the current versionlock entries.
Packit 3a9065
Packit 3a9065
``dnf versionlock delete <package-name-spec>``
Packit 3a9065
    Remove any matching versionlock entries.
Packit 3a9065
Packit 3a9065
``dnf versionlock clear``
Packit 3a9065
    Remove all versionlock entries.
Packit 3a9065
Packit 3a9065
-------
Packit 3a9065
Options
Packit 3a9065
-------
Packit 3a9065
Packit 3a9065
All general DNF options are accepted, see `Options` in :manpage:`dnf(8)` for details.
Packit 3a9065
Packit 3a9065
``--raw``
Packit 3a9065
    Do not resolve ``<package-name-spec>`` to NEVRAs to find specific version to lock to. Instead ``<package-name-spec>`` are used as they are. This enables locking to not yet available versions of the package.
Packit 3a9065
    For example you may want to keep the `bash` package on major version 5 and consume any future updates as far as they keep the major version::
Packit 3a9065
Packit 3a9065
        $ dnf versionlock add --raw 'bash-5.*'
Packit 3a9065
        Adding versionlock on: bash-5.*
Packit 3a9065
Packit 3a9065
-------------
Packit 3a9065
Configuration
Packit 3a9065
-------------
Packit 3a9065
Packit 3a9065
``/etc/dnf/plugins/versionlock.conf``
Packit 3a9065
Packit 3a9065
The minimal content of conf file should contain ``main`` sections with ``enabled`` and
Packit 3a9065
``locklist`` parameters.
Packit 3a9065
Packit 3a9065
Packit 3a9065
``locklist``
Packit 3a9065
      This option is a string that points to the file which has the versionlock
Packit 3a9065
      information in it. Note that the file has to exist (or the versionlock plugin
Packit 3a9065
      will make dnf exit). However, it can be empty.
Packit 3a9065
Packit 3a9065
      The file takes entries in the format of ``<package-name-spec>`` (optionally prefixed with '!' for
Packit 3a9065
      excludes).
Packit 3a9065
      See `Specifying packages` in :manpage:`dnf(8)` for details.
Packit 3a9065
Packit 3a9065
-----
Packit 3a9065
Notes
Packit 3a9065
-----
Packit 3a9065
Packit 3a9065
A specified package does not have to exist within the available cache of repository data
Packit 3a9065
to be considered valid for locking or exclusion. This is by design, to accommodate use
Packit 3a9065
cases such as a presently disabled repository. However, a package must exist in the
Packit 3a9065
repository cache when the ``add`` or ``exclude`` subcommands are invoked for it.