Dnf: Difference between revisions

From ICO wiki
Jump to navigationJump to search
(Created page with "Tarmo Laiksoo AK31")
 
No edit summary
Line 1: Line 1:
Tarmo Laiksoo AK31
=Autor=
Tarmo Laiksoo, AK31 <br>
Kevad 2015
 
=Sissejuhatus=
Käesoleva artikli eesmärk on tutvustada, mis asi on DNF Packet Manager ning mis on selle programmi võimalused.
 
=Mis on DNF Packet Manager=
DNF või teisisõnu Dandified Yum on modifitseeritud Yellowdog Updater, Modified[http://yum.baseurl.org/] versioon, mis võeti kasutusele esmakordselt Linuxi operatsioonisüsteemis Fedora 18[https://getfedora.org/] ja on vaikimisi olnud põhiline packet manager programm alates Fedora 22-st. DNF kasutab oma tööks RPM'i[http://rpm.org/], libsovli ja hawkey andmeid. Metaandmete ja pakketide allalaadimiseks kasutab DNF librepo'd ning protsesside haldamiseks libcomps'i.
 
=Sõltuvused=
 
===Libsolv[https://github.com/openSUSE/libsolv]===
*Vabavaraline paketi ahelate lahendaja
*Kasutatakse paketi sõltuvuste lahedamiseks ning hoidlate lugemiseks
 
===hawkey[https://github.com/rpm-software-management/hawkey]===
*Hawkey on hoidlat pakkuv lihtsustatud C[http://www.programmingsimplified.com/c-program-examples] ja Pythoni API[https://docs.python.org/2/c-api/] libsolvile.
 
===librepro[https://github.com/tojaj/librepo]===
*Librepro on Linuxi metadata ja pakketide varamu
 
===libcomps[https://github.com/midnightercz/libcomps]===
*On alternatiiv yum.comps-le.[http://yum.baseurl.org/api/yum/yum/comps.html]
*On kirjutatud C keeles ning omab seoseid python2-e ja python3-ga.
 
=Parameetrid=
 
===Käsud===
 
*Check Update Command
      dnf [options] check-update [<package-specs>...]
          Non-interactively checks if updates of the  specified  packages  are
          available.  If  no  <package-specs>  are  given  checks  whether any
          updates at all are available for your system. DNF exit code will  be
          100  when there are updates available and a list of the updates will
          be printed, 0 if not and 1 if an error occurs.
 
*Clean Command
      Performs  cleanup  of  temporary  files  for  the  currently  enabled
      repositories.
 
      dnf clean dbcache
              Removes cache files generated from the repository metadata. This
              forces DNF to regenerate the cache files the  next  time  it  is
              run.
 
      dnf clean expire-cache
              Removes  local  cookie  files  saying  when  the  metadata  and
              mirrorlists were downloaded for each repo. DNF will  re-validate
              the cache for each repo the next time it is used.
 
      dnf clean metadata
              Removes  repository metadata. Those are the files which DNF uses
              to determine the remote availability  of  packages.  Using  this
              option  will make DNF download all the metadata the next time it
              is run.
 
      dnf clean packages
              Removes any cached packages from the system.  Note that packages
              are not automatically deleted after they are downloaded.
 
      dnf clean plugins
              Tells all enabled plugins to eliminate their cached data.
 
      dnf clean all
              Does all of the above.
 
*Distro-sync command
      dnf distro-sync
              As  necessary  upgrades,  downgrades  or  keeps  all  installed
              packages to match the latest version available from any  enabled
              repository.
 
*Distribution-synchronization command
      dnf distribution-synchronization
              Deprecated alias for the Distro-sync command.
 
*Downgrade Command
      dnf [options] downgrade <package-specs>...
              Downgrades  the  specified  packages to the highest of all known
              lower versions.
 
*Erase Command
      dnf [options] erase <package-specs>...
              Removes the specified packages from the system  along  with  any
              packages  depending  on  the  packages  being  removed.  If
              clean_requirements_on_remove  is  enabled  (the  default)  also
              removes any dependencies that are no longer needed.
 
*Group Command
      dnf [options] group [summary] <group-spec>
              Display overview of how many groups are installed and available.
              With a spec, limit the output to the matching groups. summary is
              the default groups subcommand.
 
      dnf [options] group info <group-spec>
              Display  package  lists  of  a  group.  Shows which packages are
              installed or available from a repo when -v is used.
 
      dnf [options] group install <group-spec>
              Install packages in the specified group that are  not  currently
              installed.
 
      dnf [options] group list [<group-spec>]
              List  all  matching  groups, either among installed or available
              groups. If nothing is specified list all known groups.
 
      dnf [options] group remove [<group-spec>]
              Removes all packages (default, mandatory and conditional) in the
              group from the system.
 
*Help Command
      dnf help [<command>]
              Displays the help text for all commands. If given a command name
              then only displays the help for that particular command.
 
*History Command
      The history command allows the user to view what has happened  in  past
      transactions  and  act  according  to  this  information  (assuming the
      history_record configuration option is set).
 
      dnf history [list]
              The default history action  is  listing  all  known  transaction
              information in a table.
 
      dnf history info [<transaction_id>]
              Describe  the  given  transaction. When no ID is given describes
              what happened during the latest transaction.
 
      dnf history undo <transaction-spec>
              Performs the opposite operation to all operations  performed  in
              the  specified  transaction.  If  it is not possible to undo any
              operation due to the current state of RPMDB, DNF does  not  undo
              any operation.
 
*Info Command
      dnf [options] info <package-specs>...
              Is  used  to  list  a  description and summary information about
              available packages.
 
*Install Command
      dnf [options] install <package-specs>...
              Installs the specified packages and  their  dependencies.  After
              the  transaction  is  finished  all  the  specified packages are
              installed on the system.
 
*List Command
      Dumps lists of packages depending on  the  packages'  relation  to  the
      system. Generally packages are available (it is present in a repository
      we know about) or installed (present in the RPMDB).  The  list  command
      can also limit the displayed packages according to other criteria, e.g.
      to only those that update an installed package.
 
      All the forms take a [<package-specs>...] parameter  to  further  limit
      the result to only those packages matching it.
 
      dnf [options] list [all] [<package-name-specs>...]
              Lists  all packages known to us, present in the RPMDB, in a repo
              or in both.
 
      dnf [options] list installed [<package-name-specs>...]
              Lists installed packages.
 
      dnf [options] list available [<package-name-specs>...]
              Lists available packages.
 
      dnf [options] list extras [<package-name-specs>...]
              Lists extras, that is packages installed on the system that  are
              not available in any known repository.
 
      dnf [options] list obsoletes [<package-name-specs>...]
              List  the packages installed on the system that are obsoleted by
              packages in any known repository.
 
      dnf [options] list recent [<package-name-specs>...]
              List packages recently added into the repositories.
 
      dnf [options] list upgrades [<package-name-specs>...]
              List upgrades available for the installed packages.
 
*Makecache Command
      dnf [options] makecache
              Downloads and caches in binary format  metadata  for  all  known
              repos.  Tries  to avoid downloading whenever possible (e.g. when
              the local metadata hasn't  expired  yet  or  when  the  metadata
              timestamp hasn't changed).
 
      dnf [options] makecache timer
              Like  plain  makecache  but  instructs  DNF  to  be  more
              resource-aware, meaning will  not  do  anything  if  running  on
              battery  power  and  will terminate immediately if it's too soon
              after  the  last  successful  makecache  run  (see  dnf.conf(8),
              metadata_timer_sync).
 
*Provides Command
      dnf [options] provides <provide-spec>
              Finds  the  packages providing the given <provide-spec>. This is
              useful when one knows a filename and wants to find what  package
              (installed or not) provides this file.
 
*Reinstall Command
      dnf [options] reinstall <package-specs>...
              Installs  the  specified packages, fails if some of the packages
              are either not installed or not  available  (i.e.  there  is  no
              repository where to download the same RPM).
 
*Repolist Command
      dnf [options] repolist [enabled|disabled|all]
              Depending  on  the exact command, lists enabled, disabled or all
              known repositories. Lists all enabled repositories  by  default.
              Provides more detailed information when -v option is used.
 
*Search Command
      dnf [options] search [all] <keywords>...
              Search  package  metadata for the keywords. Keywords are matched
              as  case-insensitive  substrings,  globbing  is  supported.  By
              default  the  command  will  only  look  at  package  names  and
              summaries, failing  that  (or  whenever  all  was  given  as  an
              argument)  it  will match against package descriptions and URLs.
              The result is sorted from  the  most  relevant  results  to  the
              least.
 
*Update Command
      dnf [options] update
              Deprecated alias for the Upgrade Command.
 
*Upgrade Command
      dnf [options] upgrade
              Updates each package to a highest version that is both available
              and resolvable.
 
      dnf [options] upgrade <package-specs>...
              Updates each specified package to the latest available  version.
              Updates dependencies as necessary.
 
*Update-To Command
      dnf [options] update-to <package-nevr-specs>...
              Deprecated alias for the Upgrade-To Command.
 
 
===dnf.conf===
*DNF kasutab vaikimisi konfiguratsiooni faili /etc/dnf/dnf.conf ja kõik *.repo failid on leitavad /etc/yum.repos.d.
*Konfiguratsiooni fail on jaotatud kaheks osaks : põhi ja varamu.
 
'''Põhi sätted'''
 
      best  When upgrading a package, always  try  to  install  its  highest
              version  available,  even  only to find out some of its deps are
              not satisfiable. Enable this if you want  to  experience  broken
              dependencies in the repositories firsthand. The default is off.
 
      clean_requirements_on_remove
              Remove  dependencies that are no longer used during dnf erase. A
              package      only      qualifies      for      removal      via
              clean_requirements_on_remove if it was installed through DNF but
              not on explicit user  request,  i.e.  it  was  pulled  in  as  a
              dependency. The default is on.
 
      debuglevel
              Debug  messages  output  level, in the range 0 to 10. The higher
              the number the more debug output is put to stdout. Default is 2.
 
      errorlevel
              Error messages output level, in the range 0 to  10.  The  higher
              the number the more error output is put to stderr. Default is 2.
              This is deprecated in DNF.
 
      installonlypkgs
              List of provide names of  packages  that  should  only  ever  be
              installed,  never upgraded. Kernels in particular fall into this
              category.
 
      installonly_limit
              Number  of  installonly  packages  allowed  to  be  installed
              concurrently. Defaults to 3.
 
      metadata_expire
              The  period  after  which  the  remote repository is checked for
              metadata update and in the  positive  case  the  local  metadata
              cache is updated. The default is 48 hours.
 
      metadata_timer_sync
              The minimal period between two consecutive makecache timer runs.
              The command will stop immediately if it's less  than  this  time
              period since its last run. Does not affect simple makecache run.
              Use 0 to completely disable  automatic  metadata  synchronizing.
              The default is 3 hours.
 
'''Varamu sätted'''
     
      skip_if_unavailable
              If  enabled, DNF will continue running if this repository cannot
              be contacted for any reason. The default is True.
 
      cost  The relative cost of accessing this  repository,  defaulting  to
              1000.  If  the  same  package can be downloaded from two or more
              repositories, the repository with the lowest cost is preferred.
 
=Kokkuvõte=
DNF on Linuxi operatsioonisüsteemi Fedora osa, mis aitab kaasa süsteemi paremale toimivusele. Programm on lihtsasti kasutatav ja üsna lihtsalt selgeks õpitav.
 
=Kasutatud kirjandus=
*Yellowdog Updater, Modified [1] - http://yum.baseurl.org/
*Fedora [2] - https://getfedora.org/
*RPM [3] - http://rpm.org/
*Libsolv [4]- https://github.com/openSUSE/libsolv
*Hawkey [5] - https://github.com/rpm-software-management/hawkey
*C[6] - http://www.programmingsimplified.com/c-program-examples
*Python API [7] - https://docs.python.org/2/c-api/
*Librepro [8] - https://github.com/tojaj/librepo
*Libcomps [9] - https://github.com/midnightercz/libcomps
*Yum.comps [10] - http://yum.baseurl.org/api/yum/yum/comps.html

Revision as of 13:44, 7 June 2015

Autor

Tarmo Laiksoo, AK31
Kevad 2015

Sissejuhatus

Käesoleva artikli eesmärk on tutvustada, mis asi on DNF Packet Manager ning mis on selle programmi võimalused.

Mis on DNF Packet Manager

DNF või teisisõnu Dandified Yum on modifitseeritud Yellowdog Updater, Modified[1] versioon, mis võeti kasutusele esmakordselt Linuxi operatsioonisüsteemis Fedora 18[2] ja on vaikimisi olnud põhiline packet manager programm alates Fedora 22-st. DNF kasutab oma tööks RPM'i[3], libsovli ja hawkey andmeid. Metaandmete ja pakketide allalaadimiseks kasutab DNF librepo'd ning protsesside haldamiseks libcomps'i.

Sõltuvused

Libsolv[4]

  • Vabavaraline paketi ahelate lahendaja
  • Kasutatakse paketi sõltuvuste lahedamiseks ning hoidlate lugemiseks

hawkey[5]

  • Hawkey on hoidlat pakkuv lihtsustatud C[6] ja Pythoni API[7] libsolvile.

librepro[8]

  • Librepro on Linuxi metadata ja pakketide varamu

libcomps[9]

  • On alternatiiv yum.comps-le.[10]
  • On kirjutatud C keeles ning omab seoseid python2-e ja python3-ga.

Parameetrid

Käsud

  • Check Update Command
      dnf [options] check-update [<package-specs>...]
         Non-interactively checks if updates of the  specified  packages  are
         available.  If  no  <package-specs>  are  given  checks  whether any
         updates at all are available for your system. DNF exit code will  be
         100  when there are updates available and a list of the updates will
         be printed, 0 if not and 1 if an error occurs.
  • Clean Command
      Performs  cleanup  of  temporary  files  for  the   currently   enabled
      repositories.
      dnf clean dbcache
             Removes cache files generated from the repository metadata. This
             forces DNF to regenerate the cache files the  next  time  it  is
             run.
      dnf clean expire-cache
             Removes   local  cookie  files  saying  when  the  metadata  and
             mirrorlists were downloaded for each repo. DNF will  re-validate
             the cache for each repo the next time it is used.
      dnf clean metadata
             Removes  repository metadata. Those are the files which DNF uses
             to determine the remote availability  of  packages.  Using  this
             option  will make DNF download all the metadata the next time it
             is run.
      dnf clean packages
             Removes any cached packages from the system.  Note that packages
             are not automatically deleted after they are downloaded.
      dnf clean plugins
             Tells all enabled plugins to eliminate their cached data.
      dnf clean all
             Does all of the above.
  • Distro-sync command
      dnf distro-sync
             As   necessary  upgrades,  downgrades  or  keeps  all  installed
             packages to match the latest version available from any  enabled
             repository.
  • Distribution-synchronization command
      dnf distribution-synchronization
             Deprecated alias for the Distro-sync command.
  • Downgrade Command
      dnf [options] downgrade <package-specs>...
             Downgrades  the  specified  packages to the highest of all known
             lower versions.
  • Erase Command
      dnf [options] erase <package-specs>...
             Removes the specified packages from the system  along  with  any
             packages   depending   on   the   packages   being  removed.  If
             clean_requirements_on_remove  is  enabled  (the  default)   also
             removes any dependencies that are no longer needed.
  • Group Command
      dnf [options] group [summary] <group-spec>
             Display overview of how many groups are installed and available.
             With a spec, limit the output to the matching groups. summary is
             the default groups subcommand.
      dnf [options] group info <group-spec>
             Display  package  lists  of  a  group.  Shows which packages are
             installed or available from a repo when -v is used.
      dnf [options] group install <group-spec>
             Install packages in the specified group that are  not  currently
             installed.
      dnf [options] group list [<group-spec>]
             List  all  matching  groups, either among installed or available
             groups. If nothing is specified list all known groups.
      dnf [options] group remove [<group-spec>]
             Removes all packages (default, mandatory and conditional) in the
             group from the system.
  • Help Command
      dnf help [<command>]
             Displays the help text for all commands. If given a command name
             then only displays the help for that particular command.
  • History Command
      The history command allows the user to view what has happened  in  past
      transactions  and  act  according  to  this  information  (assuming the
      history_record configuration option is set).
      dnf history [list]
             The default history action  is  listing  all  known  transaction
             information in a table.
      dnf history info [<transaction_id>]
             Describe  the  given  transaction. When no ID is given describes
             what happened during the latest transaction.
      dnf history undo <transaction-spec>
             Performs the opposite operation to all operations  performed  in
             the  specified  transaction.  If  it is not possible to undo any
             operation due to the current state of RPMDB, DNF does  not  undo
             any operation.
  • Info Command
      dnf [options] info <package-specs>...
             Is  used  to  list  a  description and summary information about
             available packages.
  • Install Command
      dnf [options] install <package-specs>...
             Installs the specified packages and  their  dependencies.  After
             the  transaction  is  finished  all  the  specified packages are
             installed on the system.
  • List Command
      Dumps lists of packages depending on  the  packages'  relation  to  the
      system. Generally packages are available (it is present in a repository
      we know about) or installed (present in the RPMDB).  The  list  command
      can also limit the displayed packages according to other criteria, e.g.
      to only those that update an installed package.
      All the forms take a [<package-specs>...] parameter  to  further  limit
      the result to only those packages matching it.
      dnf [options] list [all] [<package-name-specs>...]
             Lists  all packages known to us, present in the RPMDB, in a repo
             or in both.
      dnf [options] list installed [<package-name-specs>...]
             Lists installed packages.
      dnf [options] list available [<package-name-specs>...]
             Lists available packages.
      dnf [options] list extras [<package-name-specs>...]
             Lists extras, that is packages installed on the system that  are
             not available in any known repository.
      dnf [options] list obsoletes [<package-name-specs>...]
             List  the packages installed on the system that are obsoleted by
             packages in any known repository.
      dnf [options] list recent [<package-name-specs>...]
             List packages recently added into the repositories.
      dnf [options] list upgrades [<package-name-specs>...]
             List upgrades available for the installed packages.
  • Makecache Command
      dnf [options] makecache
             Downloads and caches in binary format  metadata  for  all  known
             repos.  Tries  to avoid downloading whenever possible (e.g. when
             the local metadata hasn't  expired  yet  or  when  the  metadata
             timestamp hasn't changed).
      dnf [options] makecache timer
             Like   plain   makecache   but   instructs   DNF   to   be  more
             resource-aware, meaning will  not  do  anything  if  running  on
             battery  power  and  will terminate immediately if it's too soon
             after  the  last  successful  makecache  run  (see  dnf.conf(8),
             metadata_timer_sync).
  • Provides Command
      dnf [options] provides <provide-spec>
             Finds  the  packages providing the given <provide-spec>. This is
             useful when one knows a filename and wants to find what  package
             (installed or not) provides this file.
  • Reinstall Command
      dnf [options] reinstall <package-specs>...
             Installs  the  specified packages, fails if some of the packages
             are either not installed or not  available  (i.e.  there  is  no
             repository where to download the same RPM).
  • Repolist Command
      dnf [options] repolist [enabled|disabled|all]
             Depending  on  the exact command, lists enabled, disabled or all
             known repositories. Lists all enabled repositories  by  default.
             Provides more detailed information when -v option is used.
  • Search Command
      dnf [options] search [all] <keywords>...
             Search  package  metadata for the keywords. Keywords are matched
             as  case-insensitive  substrings,  globbing  is  supported.   By
             default  the  command  will  only  look  at  package  names  and
             summaries, failing  that  (or  whenever  all  was  given  as  an
             argument)  it  will match against package descriptions and URLs.
             The result is sorted from  the  most  relevant  results  to  the
             least.
  • Update Command
      dnf [options] update
             Deprecated alias for the Upgrade Command.
  • Upgrade Command
      dnf [options] upgrade
             Updates each package to a highest version that is both available
             and resolvable.
      dnf [options] upgrade <package-specs>...
             Updates each specified package to the latest available  version.
             Updates dependencies as necessary.
  • Update-To Command
      dnf [options] update-to <package-nevr-specs>...
             Deprecated alias for the Upgrade-To Command.


dnf.conf

  • DNF kasutab vaikimisi konfiguratsiooni faili /etc/dnf/dnf.conf ja kõik *.repo failid on leitavad /etc/yum.repos.d.
  • Konfiguratsiooni fail on jaotatud kaheks osaks : põhi ja varamu.

Põhi sätted

      best   When upgrading a package, always  try  to  install  its  highest
             version  available,  even  only to find out some of its deps are
             not satisfiable. Enable this if you want  to  experience  broken
             dependencies in the repositories firsthand. The default is off.
      clean_requirements_on_remove
             Remove  dependencies that are no longer used during dnf erase. A
             package      only      qualifies      for      removal       via
             clean_requirements_on_remove if it was installed through DNF but
             not on explicit user  request,  i.e.  it  was  pulled  in  as  a
             dependency. The default is on.
      debuglevel
             Debug  messages  output  level, in the range 0 to 10. The higher
             the number the more debug output is put to stdout. Default is 2.
      errorlevel
             Error messages output level, in the range 0 to  10.  The  higher
             the number the more error output is put to stderr. Default is 2.
             This is deprecated in DNF.
      installonlypkgs
             List of provide names of  packages  that  should  only  ever  be
             installed,  never upgraded. Kernels in particular fall into this
             category.
      installonly_limit
             Number  of  installonly  packages  allowed   to   be   installed
             concurrently. Defaults to 3.
      metadata_expire
             The  period  after  which  the  remote repository is checked for
             metadata update and in the  positive  case  the  local  metadata
             cache is updated. The default is 48 hours.
      metadata_timer_sync
             The minimal period between two consecutive makecache timer runs.
             The command will stop immediately if it's less  than  this  time
             period since its last run. Does not affect simple makecache run.
             Use 0 to completely disable  automatic  metadata  synchronizing.
             The default is 3 hours.

Varamu sätted

      skip_if_unavailable
             If  enabled, DNF will continue running if this repository cannot
             be contacted for any reason. The default is True.
      cost   The relative cost of accessing this  repository,  defaulting  to
             1000.  If  the  same  package can be downloaded from two or more
             repositories, the repository with the lowest cost is preferred.

Kokkuvõte

DNF on Linuxi operatsioonisüsteemi Fedora osa, mis aitab kaasa süsteemi paremale toimivusele. Programm on lihtsasti kasutatav ja üsna lihtsalt selgeks õpitav.

Kasutatud kirjandus