9. yum plugin

最後更新: 2021-06-02

目錄

  • yum plugin - downloadonly (Centos 6)
  • yum-utils (Centos 7)
  • repoquery
  • yum-plugin-versionlock

 


yum plugin - downloadonly (Centos 6)

 

Install

yum install yum-downloadonly

Usage

yumdownloader dialog             <--- 下載 dialog 的 rpm 包在當前目錄

yum update httpd -y --downloadonly --downloaddir=/opt

 


yum-utils (Centos 7)
 

yum-utils provides the

  • yum-config-manager
  • yumdownloader

Install

yum -y install yum-utils

Usage

--save                 # Save the current options (useful with --setopt).

--enable              # Enable the specified repos (automatically saves).

--disable              # Disable the specified repos (automatically saves).

--add-repo=ADDREPO              # Add (and enable) the repo from the specified file or url.

i.e.

# 最好注明下載 x86_64 版, 否則 i686 也會下載回來

yumdownloader --resolve mysql-community-client.x86_64

Opts

  • --urls            Instead of downloading RPMs, list the URLs that would  be  downloaded.
  • --resolve       resolve dependencies and also download the required packages.

 


repoquery

 

Query information from Yum repositories

List out the dependencies for a package

# -R, --requires       List package dependencies.

# --resolve              When used with --requires, resolve capabilities to originating packages.

repoquery --requires --resolve mysql-community-libs-compat

Files in Package

# -q, --query

# -l, --list

repoquery -q -l mysql-community-libs-compat

 


yum-plugin-versionlock

 

功能: lock specified packages from being updated

yum install yum-plugin-versionlock

i.e.

yum versionlock add pure-ftpd

yum versionlock [list]

Loaded plugins: fastestmirror, priorities, versionlock
0:pure-ftpd-1.0.47-4.el7.*
versionlock list done

Config:

/etc/yum/pluginconf.d/versionlock.list

# Added locks on Mon Oct 25 13:31:33 2021
0:pure-ftpd-1.0.47-4.el7.*

 


 

Creative Commons license icon Creative Commons license icon