Editing RPM Package Management

Jump to navigation Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
== intro ==
== repoquery ==
* rpm – for handling the packages themselves
--plugins: enable YUM plugin support.
* yum – the traditional level on top of rpm commands, dealing with dependencies and repositories
* DNF – the modern level on top of rpm commands, dealing with dependencies and repositories


== DNF ==
DNF is a rewrite of yum, DNF replaced YUM as the default package manager in Fedora 22.
* https://en.wikipedia.org/wiki/DNF_(software)
* https://www.man7.org/linux/man-pages/man8/dnf.8.html
* https://opensource.com/article/18/8/guide-yum-dnf
<pre>
$ yum module list MODULENAME
$ dnf install @MODULENAME:STREAM
</pre>
== yum ==
* https://en.wikipedia.org/wiki/yum_(software)
* https://www.redhat.com/sysadmin/how-manage-packages
* https://access.redhat.com/articles/yum-cheat-sheet (not searchable, because it contains a PNG)
* https://access.redhat.com/node/1284753/40/0/5827093 – yum command cheat sheet (searchable)
* https://access.redhat.com/sites/default/files/attachments/rh_yum_cheatsheet_1214_jcs_print-1.pdf (searchable)
* https://www.man7.org/linux/man-pages/man8/yum.8.html
YUM allows for automatic updates and package and dependency management on RPM-based distributions.
YUM works with software repositories (collections of packages), which can be accessed locally or over a network connection.
* ...
<pre>
$ yum makecache
</pre>
* which package provides this file?
<pre>
$ yum provides /path/to/your/file
</pre>
* which repo provides this package?
<pre>
$ yum list available | fgrep PACKAGE
</pre>
* which repo is this this package installed from?
<pre>
$ yum list installed | fgrep PACKAGE
</pre>
* …
<pre>
$ yum remove PACKAGE
</pre>
* not only remove …, but also remove dependencies!
<pre>
$ yum -y autoremove PACKAGE
</pre>
* you can display the list of packages available for installation in a specific repo REPO:
<pre>
$ yum repo-pkgs REPO list
</pre>
== yum-utils ==
<pre>
$ yum install yum-utils
</pre>
=== repoquery ===
''--plugins'': enable YUM plugin support.
* list the contents of PACKAGE -- PACKAGE is possibly not (yet) installed, i.e. only lives in the repo:
<pre>
<pre>
$ repoquery --query --list --plugins PACKAGE
repoquery --query --list --plugins PACKAGE
</pre>
</pre>


== rpm ==
== rpm ==
* https://en.wikipedia.org/wiki/RPM_Package_Manager
* http://linux.die.net/man/8/rpm
* http://linux.die.net/man/8/rpm
* which package provides FILE?
* which package provides FILE?
<pre>
<pre>
$ rpm --query --file FILE
$ rpm --query -f FILE
</pre>
</pre>
* list the contents of PACKAGE:
* list the contents of PACKAGE:
<pre>
<pre>
Line 89: Line 17:
$ rpm --query --queryformat "[%{=NAME}-%{=VERSION}-%{=RELEASE}:\t%-50{FILENAMES} %10{FILESIZES}\n]" PACKAGE
$ rpm --query --queryformat "[%{=NAME}-%{=VERSION}-%{=RELEASE}:\t%-50{FILENAMES} %10{FILESIZES}\n]" PACKAGE
</pre>
</pre>
* how to list package updates:
<pre>
$ rpm --query --all --queryformat '%{INSTALLTIME} %-40{NAME} %{INSTALLTIME:date}\n' | sort -n | cut -d' ' -f2-
</pre>
the "''sort''" command sorts the query output numerically by its very 1st column (the INSTALLTIME).
the "''cut''" command removes that very 1st column.
the output still includes the INSTALLTIME at the end of the line (in a more readable format, not intended to be sorted by).
== repositories ==
* /etc/yum.repos.d/
* http://woshub.com/install-configure-repos-centos-rhel/ – nice instructions
Please note that all contributions to wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see Wiki:Copyrights for details). Do not submit copyrighted work without permission!
Cancel Editing help (opens in new window)