Yum: Difference between revisions

From DWIKI
 
(36 intermediate revisions by the same user not shown)
Line 1: Line 1:
=Cheatsheet=
=Links=
*[https://www.cyberciti.biz/faq/rhel-centos-fedora-linux-yum-command-howto/ How to use yum command on CentOS/RHEL]
*[http://xmodulo.com/how-to-fix-yum-errors-on-centos-rhel-or-fedora.html Fix yum errors]
*[https://www.thegeekdiary.com/centos-rhel-67-how-to-recover-an-interrupted-yum-package-installation/ Recover an interrupted yum package installation]




==Show installed packages==
=HOWTO=
==Yum==
===Exclude packages===
In /etc/yum.conf:
exclude=package1 package2
=== Show installed packages ===
 
  yum list installed
  yum list installed
==What provides a certain file==
 
=== Show installed packages from epel ===
 
yum list installed | grep @epel
 
==Show active repositories==
yum repolist
or
yum repolist enabled
 
=== Disable repository ===
 
yum-config-manager --disable reponame
 
 
= FAQ =
 
 
===Yum keeps trying '''Importing GPG key 0x51312F3F'''===
yum clean all
yum makecache
 
 
===Exclamationmarks?===
Repository has expired metadata, try
yum clean expire-cache
 
== What provides a certain file ==
 
  yum whatprovides
  yum whatprovides


 
== Which package does a file belong to? ==
rpm -qf /bin/bash
 
== Which packages depend on a package ==
rpm -q --whatrequires libX11
== what files depend on package?? ==
repoquery --requires --resolve <package>
== Show dependencies for a package ==
yum deplist <packagename>
=== Installed package x.y.z (from anaconda) not available ===
Package not found on mirror
== Check updates ==


==Check updates==
  yum check-update -q
  yum check-update -q
==Check security updates==
 
On CentOS 6 first install
== Check security updates ==
 
HAHA GOTCHA! no security metadata on CentOS! There is for EPEL though. see [https://access.redhat.com/solutions/10021 https://access.redhat.com/solutions/10021] On CentOS 6 first install
 
  yum install yum-plugin-security
  yum install yum-plugin-security


  yum list-security -q --errorlevel=0
  yum list-security -q --errorlevel=0
== Which repository is a package from? ==
repoquery <packagename>
or perhaps better
yum info packagename
== Clear cache ==
yum clean all
or
yum clean all --enablerepo='*'
&nbsp;
== List files from package ==
rpm -ql packagename
dnf repoquery -l somepackage
== Updateinfo file is not valid XML ==
remove yum-cron
== Warning: RPMDB altered outside of yum. ==
Happens when you install something using rpm, what usually works is:
yum history sync
&nbsp;
== Not using downloaded remi/repomd.xml because it is older than what we have ==
Try
yum clean all
&nbsp;
== yum-daily ==
==Yum error messages==
=== YumRepo Error: All mirror URLs are not using ftp, http[s] or file. ===
=== Public key for *.rpm is not installed ===
Some stuff to try:
rpm --checksig -v /var/cache/yum/<channel-name>/packages/device-mapper-multipath-0.4.7-34.el5.x86_64.rpm
rm -rfv /var/cache/yum/*
yum clean all
===75 packages excluded due to repository priority protections===
Try
yum list updates -d3
===Error: rpmdb open failed===
mkdir /tmp/rpm/
mv /var/lib/rpm/__db* /tmp/rpm
yum clean all
and then try again:
yum check-update
=== Multilib version problems found ===
Try
package-cleanup --cleandupes
Long version:
yum clean all
yum list all --showduplicates
# NOTE: this one takes forever!
yum check
yum list all --showduplicates
===/var/tmp/rpm-tmp.y7ZaM4: line 1: fg: no job control===
Try
rpm -e --noscripts <packagename>

Latest revision as of 15:04, 1 May 2024

Links


HOWTO

Yum

Exclude packages

In /etc/yum.conf:

exclude=package1 package2

Show installed packages

yum list installed

Show installed packages from epel

yum list installed | grep @epel

Show active repositories

yum repolist

or

yum repolist enabled

Disable repository

yum-config-manager --disable reponame


FAQ

Yum keeps trying Importing GPG key 0x51312F3F

yum clean all
yum makecache


Exclamationmarks?

Repository has expired metadata, try

yum clean expire-cache

What provides a certain file

yum whatprovides

 

Which package does a file belong to?

rpm -qf /bin/bash

 

Which packages depend on a package

rpm -q --whatrequires libX11

what files depend on package??

repoquery --requires --resolve <package>

Show dependencies for a package

yum deplist <packagename>

Installed package x.y.z (from anaconda) not available

Package not found on mirror

Check updates

yum check-update -q

Check security updates

HAHA GOTCHA! no security metadata on CentOS! There is for EPEL though. see https://access.redhat.com/solutions/10021 On CentOS 6 first install

yum install yum-plugin-security
yum list-security -q --errorlevel=0

Which repository is a package from?

repoquery <packagename>

or perhaps better

yum info packagename

Clear cache

yum clean all

or

yum clean all --enablerepo='*'

 

List files from package

rpm -ql packagename
dnf repoquery -l somepackage

Updateinfo file is not valid XML

remove yum-cron

Warning: RPMDB altered outside of yum.

Happens when you install something using rpm, what usually works is:

yum history sync

 

Not using downloaded remi/repomd.xml because it is older than what we have

Try

yum clean all

 


yum-daily

Yum error messages

YumRepo Error: All mirror URLs are not using ftp, http[s] or file.

Public key for *.rpm is not installed

Some stuff to try:

rpm --checksig -v /var/cache/yum/<channel-name>/packages/device-mapper-multipath-0.4.7-34.el5.x86_64.rpm
rm -rfv /var/cache/yum/* 
yum clean all


75 packages excluded due to repository priority protections

Try

yum list updates -d3

Error: rpmdb open failed

mkdir /tmp/rpm/
mv /var/lib/rpm/__db* /tmp/rpm
yum clean all

and then try again:

yum check-update


Multilib version problems found

Try

package-cleanup --cleandupes

Long version:

yum clean all 
yum list all --showduplicates
  1. NOTE: this one takes forever!
yum check
yum list all --showduplicates

/var/tmp/rpm-tmp.y7ZaM4: line 1: fg: no job control

Try

rpm -e --noscripts <packagename>