yum

Comando:
yum
Tipo:
cmd
Url:
http://yum.baseurl.org
Descripcion:
Yellow dog Updater, Modified.
Plataforma:
Linux
# yum install -y yum-utils

# repoquery -l packagename
yum --showduplicates list <package>
yum --disablerepo="*" --enablerepo="rhel-7-server-extras-rpms" list available

El parámetro --disablerepo/–enablerepo solo tienen efecto en la ejecución del comando yum. (no son permanentes)

# yum repolist
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
repo id                               repo name                                    status
rhel-7-server-ansible-2.7-rpms/x86_64 Red Hat Ansible Engine 2.7 RPMs for Red Hat      11
rhel-7-server-rpms/7Server/x86_64     Red Hat Enterprise Linux 7 Server (RPMs)     23,666
repolist: 23,677
You have new mail in /var/spool/mail/root
# yum repoinfo rhel-7-server-ansible-2.7-rpms
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
Repo-id      : rhel-7-server-ansible-2.7-rpms/x86_64
Repo-name    : Red Hat Ansible Engine 2.7 RPMs for Red Hat Enterprise Linux 7 Server
Repo-status  : enabled
Repo-revision: 1548166448
Repo-updated : Tue Jan 22 09:14:08 2019
Repo-pkgs    : 11
Repo-size    : 68 M
Repo-baseurl : https://cdn.redhat.com/content/dist/rhel/server/7/7Server/x86_64/ansible/2.7/os
Repo-expire  : 86,400 second(s) (last: Wed Jan 30 16:22:03 2019)
  Filter     : read-only:present
Repo-filename: /etc/yum.repos.d/redhat.repo

repolist: 11
# reposync -l -r rhel-7-server-ansible-2.7-rpms -p /var/www/html/repo/ --download-metadata --downloadcomps
# createrepo -v /var/www/html/repo/rhel-7-server-ansible-2.7-rpms -g comps.xml
Spawning worker 0 with 11 pkgs
Worker 0: reading Packages/ansible-2.7.0-1.el7ae.noarch.rpm
Worker 0: reading Packages/ansible-2.7.1-1.el7ae.noarch.rpm
Worker 0: reading Packages/ansible-2.7.2-1.el7ae.noarch.rpm
Worker 0: reading Packages/ansible-2.7.4-1.el7ae.noarch.rpm
Worker 0: reading Packages/ansible-2.7.5-1.el7ae.noarch.rpm
Worker 0: reading Packages/ansible-2.7.6-1.el7ae.noarch.rpm
Worker 0: reading Packages/python-httplib2-0.9.1-2.1.el7.noarch.rpm
Worker 0: reading Packages/python-paramiko-2.1.1-4.el7.noarch.rpm
Worker 0: reading Packages/python-passlib-1.6.5-1.1.el7.noarch.rpm
Worker 0: reading Packages/python2-jmespath-0.9.0-4.el7ae.noarch.rpm
Worker 0: reading Packages/sshpass-1.06-1.el7.x86_64.rpm
Workers Finished
Saving Primary metadata
Saving file lists metadata
Saving other metadata
Generating sqlite DBs
Starting other db creation: Thu Jan 31 01:38:51 2019
Ending other db creation: Thu Jan 31 01:38:51 2019
Starting filelists db creation: Thu Jan 31 01:38:51 2019
Ending filelists db creation: Thu Jan 31 01:38:52 2019
Starting primary db creation: Thu Jan 31 01:38:52 2019
Ending primary db creation: Thu Jan 31 01:38:52 2019
Sqlite DBs complete

Instalamos apache

# yum install httpd

Editamos el archivo httpd.conf y configuramos el ServerName y ServerName según se llame nuestro servidor

# vim /etc/httpd/conf/httpd.conf 

Validamos la configuración, iniciamos el servicio y lo habilitamos para que se inicie después de reiniciarse.

# httpd -t
# systemctl start httpd
# systemctl enable httpd.service

Ajustamos el archivo de updateinfo.xml de nuestro repositorio (ir al directorio /var/www/html/repo/rhel-7-server-ansible-2.7-rpms)

# ll
total 24
-rw-r--r--. 1 root root 2139 Jan 31 01:24 2428b2d1601372ee3374a5d9a00b45498c4139ce50f0052318510bfbfa414df9
-rw-r--r--. 1 root root 6578 Jan 31 01:24 270762b9153ada585af988637b15ffafb39c4bd0c106b65d31b9823a0561f207-updateinfo.xml.gz
-rw-r--r--. 1 root root  104 Jan 31 01:24 comps.xml
drwxr-xr-x. 2 root root 4096 Jan 31 01:24 Packages
drwxr-xr-x. 2 root root 4096 Jan 31 01:38 repodata
# gunzip 270762b9153ada585af988637b15ffafb39c4bd0c106b65d31b9823a0561f207-updateinfo.xml.gz 
# ll
total 44
-rw-r--r--. 1 root root  2139 Jan 31 01:24 2428b2d1601372ee3374a5d9a00b45498c4139ce50f0052318510bfbfa414df9
-rw-r--r--. 1 root root 25196 Jan 31 01:24 270762b9153ada585af988637b15ffafb39c4bd0c106b65d31b9823a0561f207-updateinfo.xml
-rw-r--r--. 1 root root   104 Jan 31 01:24 comps.xml
drwxr-xr-x. 2 root root  4096 Jan 31 01:24 Packages
drwxr-xr-x. 2 root root  4096 Jan 31 01:38 repodata

# mv 270762b9153ada585af988637b15ffafb39c4bd0c106b65d31b9823a0561f207-updateinfo.xml updateinfo.xml 
# ll
total 44
-rw-r--r--. 1 root root  2139 Jan 31 01:24 2428b2d1601372ee3374a5d9a00b45498c4139ce50f0052318510bfbfa414df9
-rw-r--r--. 1 root root   104 Jan 31 01:24 comps.xml
drwxr-xr-x. 2 root root  4096 Jan 31 01:24 Packages
drwxr-xr-x. 2 root root  4096 Jan 31 01:38 repodata
-rw-r--r--. 1 root root 25196 Jan 31 01:24 updateinfo.xml

Enlaces Relacionados:


Why there are Exclamation mark in front of pulp repository names on Client system's registered with Red Hat Satellite 6 ?

# yum repolist
Loaded plugins: product-id, search-disabled-repos, subscription-manager
repo id                                                               repo name                                                                     status
!rhel-7-server-extras-rpms/x86_64                                     Red Hat Enterprise Linux 7 Server - Extras (RPMs)                               188
!rhel-7-server-optional-rpms/7Server/x86_64                           Red Hat Enterprise Linux 7 Server - Optional (RPMs)                            8483
!rhel-7-server-rh-common-rpms/7Server/x86_64                          Red Hat Enterprise Linux 7 Server - RH Common (RPMs)                            183
!rhel-7-server-rpms/7Server/x86_64                                    Red Hat Enterprise Linux 7 Server (RPMs)                                      10643
repolist: 19497

As per yum Man page yum repolist output's first column will start with a '!' if the repo. has metadata that is expired. This has been purposefully set to be expired, so it re-downloads the repomd.xml file (which is very small) so that the repo is always be up to date.

Root Cause

When Content view's are promoted to a newer version with changes,the clients are not able to see the changes unless a cache on the client is manually cleared or is regenerated by yum after a set interval of time period,so to spare the time required for cache regeneration on client end yum would try to fetch cache on each run.