当前位置:网站首页 > 编程语言 > 正文

安装yum的命令(安装yum-utils)



Yum-utils 剖析
功能简介:
管理repository及扩展包的工具 (主要是针对repository)
准备:
1.安装createrepo ,可以通过如下命令实现
yum install createrepo
2. rpm包放在/media





命令简介
一、 debuginfo-install :
安装debuginfo 包及其依赖
选项:
-h, --help
-t, --tolerant :
允许有错误
-C :
从cache 中运行,且不更新cache
-c [config file ] :
配置文件位置
-R [minutes] :
命令行等待的最长时间
-d [debug level] :
debugging output level
–showduplicates :
show duplicates, in repos, in list/search commands 显示重复
-e [error level] :
error output level
-q, --quiet :
quiet operation
-v, --verbose :
verbose operation (详细)
-y : answer yes for all questions
–version : show Yum version and exit
–installroot=[path]
set install root
–enablerepo=[repo]
enable one or more repositories (wildcards allowed)
–disablerepo=[repo]
disable one or more repositories (wildcards allowed)
-x [package], --exclude=[package]
exclude package(s) by name or glob
–disableexcludes=[repo]
disable exclude from main, for a repo or for everything
–obsoletes :
enable obsoletes processing during updates
–noplugins :
disable Yum plugins (插件)
–nogpgcheck :
disable gpg signature checking
–disableplugin=[plugin]
disable plugins by name
–enableplugin=[plugin]
enable plugins by name
–skip-broken :
skip packages with depsolving problems
–color=COLOR :
control whether color is used















































  1. package-cleanup: 清除重复包、孤儿包、及明显的包依赖问题
    GENERAL OPTIONS:
    -c :
    使用-c 后面指定的配置文件,默认是 /et/yum.conf
    -h : 帮助
    -q , --quiet :
    Print out nothing unecessary
    -v , --version :
    报告程序版本同时退出
    -y :
    响应任何请求
    –leaves :
    列出local RPM database 中的叶子节点。即没有软件包依赖叶节点。
    –orphans:
    列出从当前软件仓库库中无法安装的包
    –oldkernels:
    删除老的 kernel 及kernel-devel 包
    –problems :
    列出local RPM database 中的赖问题
    –dupes :
    扫描local RPM database 中重复的包
    –cleandupes :
    扫描本地rpm数据库中重复的包并清除老版本的rpm包





















leaves options :
–all:列出所有的节点,包括不是本库中的
–leaf-regex :
指定某rpm包为叶子节点
–exclude-bin:
除了在bin 目录中出现的包,其他的包都列出来




oldkernels options:
–count :
保持对系统内核软件包的数量,默认为2
–keepdevel :
删除内核时不删除kernel-devel



例子:

  1. 列出所有存在问题的依赖
    package-cleanup --problems
  2. 列出不属于任何repository的包
    package-cleanup --orphans
  3. 删除旧版本的kernel ,并保存3个包,保留kernel-devel
    package-cleanup --oldkernels --count=3 --keepdevel
    4.列出在bin目录下没有文件且以 perl 或者 python开头的叶子节点包
    package-cleanup --leaves --exclude-bin --leaf-regex=“^(perl)|(python)”


结果为:
#package-cleanup --leaves --exclude-bin --leaf-regex=“^(perl)|(python)”
Loaded plugins: fastestmirror
perl-Crypt-SSLeay-0.57-16.el6.x86_64
perl-XML-Dumper-0.81-6.el6.noarch
perl-XML-Grove-0.46alpha-40.el6.noarch
perl-core-5.10.1-115.el6.x86_64





三、repo-graph: 以点格式输出一个完整的软件包依赖关系列表
格式:
repo-graph [options]
options:
–repoid=REPOID :
指定使用哪个软件仓库
-c CONFIFILE :
config file location






四、 repo-rss : 一个RSS feed 生成一个或多个资料库
格式:
repo-rss [options] repoid1 repoid2
选项:
-h :
-f :
指定RSS生成的文件名,默认是repo-rss.xml
-l :
RSS feed 的URL, 默认是 http://yum.baseurl.org/
-t TITLE :
指定RSS feed的标题, 默认是RSS “Repository - Recent Packages".
-d DESCRIPTION: :
Default is “Most recent packages in Repositories”.
-r DAYS :
指定的天数,默认是3
–tempcache :
使用yum缓存启用一个临时目录(由非root用户默认启用)
-g :
Generate one feed per package group
-a ARCHES :
arches to use – can be listed more than once
-c CONFIG :
config file





















五、 repoclosure : 读取元数据资料库,检查依赖关系,并显示未解决的依赖列表
options:
-h:
-c CONFIG, --config=CONFIG
config file to use (defaults to /etc/yum.conf)
-a ARCH, --arch=ARCH check packages of the given archs, can be specified
multiple times (default: current arch)
–basearch=BASEARCH :
set the basearch for yum to run as
-b, --builddeps :
check build dependencies only (needs source repos enabled)
-r REPOID, --repoid=REPOID :
specify repo ids to query, can be specified multiple
times (default is all enabled)
-t, --tempcache :
Use a temp dir for storing/accessing yum-cache
-q, --quiet :
quiet (no output to stderr)
-n, --newest :
check only the newest packages in the repos
–repofrompath=REPOFROMPATH
specify repoid & paths of additional repositories -
unique repoid and complete path required, can be
specified multiple times.
Example.
–repofrompath=myrepo,/path/to/repo
-p PKG, --pkg=PKG :
check closure for this package only
-g GROUP, --group=GROUP
check closure for packages in this group only
六、repodiff : 比较一个或多个资料库的差异并返回一个显示增加,删除,改变的包的列表
格式:
repodiff --old=old_repo_baseurl --new=new_repo_baseurl
options:
–version :
show program’s version number and exit
-h, --help show this help message and exit
-n NEW, --new=NEW :
new baseurl[s] for repos
-o OLD, --old=OLD :
old baseurl[s] for repos
-q, --quiet :
-a ARCHLIST, --archlist=ARCHLIST
In addition to src.rpms, any arch you want to include
-s, --size :
Output size changes for any new->old packages
–simple :
output simple format














































七、 repomanage :
manage a directory of rpm packages, returns lists of newest or oldest packages in a directory for easy piping to xargs or similar programs.
管理rpm包的目录,在目录返回最新或最古老的软件包列表

格式:
repomanage [–old] [–new] path
options:
-h, --help
-o, --old :
print the older packages
-n, --new :
print the newest packages
-s, --space :
space separated output, not newline
-k KEEP, --keep=KEEP :
newest N packages to keep -defaults to 1
-c , nocheck:
do not check package payload signatures/digests












八、 repoquery : 查询yum库,并得到他们的额外信息
格式:
repoquery [options] <item…>
repoquery -a [options]


CENERAL OPTION

 
  

Package Query options:

 
  

PACKAGE SELECTION OPTIONS:
-a :
query all availabel packages
-f, --file FILE :
query package owning FILE.
–whatobsoletes CAPABILITY:
query all packages that obsolete CAPABLITY
–whatconflicts CAPABILITY
query all packages that confict with CAPABILITY (冲突)
–whatprovides CAPABILITY
query all packages that provied CAPABILITY
–whatrequires CAPABILITY :
query all packages that require CAPABILITY
–alldeps:
when used with –whatrequires, use both automatic and manual dependencies for the query
–archlist=ARCH1 [,ARCH2…]
特定架构的包
–pkgnarrow=WHAT
limit what packages are considered for the query .Valid values for WHAT are: installed, available, recent, updates, extras, all and repository (default).
–show-dupes
query all versions of package. By default only newest packages are considered.



















GROUP QUERY OPTIONS;
-i, --info:
show general information about group
-l, --list:
list packages belonging to (required by) group



 
  

GROUP SELECTION OPTIONS:
-a : query all available groups
-g: query groups instead of packages
例子:


  1. 列出所有包名中 有perl 的包
    repoquery ‘perl
  2. 列出所有依赖openssl 的包
    repoquery --whatrequires --alldeps openssl
  3. List all package names and the repository they come from, nicely formatted:
    repoquery -a --qf “%-20{repoid} %{name}”
  4. List name and summary of all available updates (if any), nicely formatted:
    repoquery -a --pkgnarrow=updates --qf “%{name}: %{summary} ”
  5. List optional packages in base group:
    repoquery -g --grouppkgs=optional -l base
  6. List build requirements from ’anaconda’ source rpm:
    repoquery --requires anaconda.src
  7. List packages which BuildRequire gail-devel
    repoquery --archlist=src --whatrequires gail- devel

九、reposync: 同步远程yum仓库,使用yum来获取软件包到本地目录
格式:
reposync [options]
options:
-h, --help
-c CONFIG, --config=CONFIG:
config file to use (defaults to /etc/yum.conf)
-a ARCH, --arch=ARCH :
act as if running the specified arch (default: current arch, note: does not override $releasever)
–source:
also download .src.rpm files
-r REPOID, --repoid=REPOID
specify repo ids to query , can be specified multiple times (default is all enabled)
-t, --tempcache
Use a temp dir for storing/accessing yum-cache.
-p DESTDIR, --download_path=DESTDIR
path to download packages to : defaults to current directory
-g, --gpgcheck
remove packages that fail GPG signature checking after downloading .
-u, --urls :
just list urls of what would be downloaded, don’t download.
-n, --newest-only:
Download only newest packages per-repo
-q, --quiet
output as little information as possible .
例子:
1.Sync all packages from the ’updates’ repo to the current directory:
reposync --repoid=updates
2.Sync only the newest packages from the ’updates’ repo to the current directory:
reposync -n --repoid=updates
3. Sync packages from the ’updates’ and ’extras’ repos to the current directory:
reposync --repoid=updates --repoid=extras
4.Sync all packages from the ’updates’ repo to the repos directory:
reposync -p repos --repoid=updates
































  1. repotrack: 跟踪包及其依赖,并将该包及其依赖下载
    -r REPOID, --repoid=REPOID : 查询指定的repo id ,可以被指定多次
    -a ARCH, --arch=ARCH 修改包的arch
    -t, --tempcache :用一个临时的目录存储yum-cache
    -p DESTDIR , --download_path=DESTDIR :包的下载到的地址
    -u, --urls : 列出下载包的url,但是并不下载
    -n, --newest :下载并将原来的包换成最新的包
    -q, --quiet : 尽可能少的输出






  2. yum-builddep :安装某个包的依赖

    yum-builddep [options] package1 [package2] [package…]
    options:
    -t, --tolerant :允许有错误
    -C:
    -c [config file ] config file location
    -R [minutes] 命令行等待最长时间
    -d [debug level] debugging output level
    –showduplicates : 显示重复
    -e [error level] : error output level
    -q, --quiet quite operation
    -v, --verbose : 详细的操作
    -y : answer yes for all questions
    –version : show yum version and exit
    –installroot-[path] : set install root
    –enablerepo=[repo]
    enable one or more repositories (wildcards allowed)
    –disablerepo=[repo]
    disabel one or more repositories (wildcards allowed)
    -x [package], --exclude=[package]
    exclude package(s)by name or glob
    –disableexcludes=[repo]
    disable exclude from main, for a repo or for everything
    –obsoletes :
    enable obsoletes processing during updates
    –noplugins :
    disable plugins by name
    –nogpgcheck :
    disable gpg signature checking
    –disableplugin=[plugin]
    disable plugins by name
    –enableplugin=[plugin]
    enable plugins by name
    –skip-broken :
    skip packages with depsolving problems
    –color=COLOR
    control whether color is used
    例子:
    下载并安装kernel 需要的所有的RPM包
    yum-builddep kernel





































  3. yum-complete-transaction : 发现不完整包或者因yum中止而导致的包不完整,把其补充完整
    格式:
    yum-complete-transaction [options]
    CENERAL OPTIONS:
    –cleanup-only :
    do not complete the transaction just clean up
    清除不完全的包





 
  
  1. yumdownloader : 从rpm仓库中下载rpm源码包
    格式:
    yumdownloader [options] package1 [package2…]
    GENERAL OPTIONS :
    -h, --help
    –destdir DIR
    specify a destination directory for the download. Defaults to the current directory
    指定下载程序rpm包存放目录
    –urls :
    Instead of downloading RPMS, list the URLs that would be downloaded .
    列出要下载包的url









 
  

例子:

  1. 下载kernel RPM 包到 /var/tmp
    yumdownloader --destdir /var/tmp kernel
  2. 列出 kernel 和 kernel-smp RPM 包的url
    yumdownloader --urls kernel kernel-smp

————————————————

 
  

原文链接:https://blog.csdn.net/xiaoxiao_22/article/details/

到此这篇安装yum的命令(安装yum-utils)的文章就介绍到这了,更多相关内容请继续浏览下面的相关推荐文章,希望大家都能在编程的领域有一番成就!

版权声明


相关文章:

  • 颜色编码转换器(颜色编号 转换器)2025-10-14 19:18:11
  • 来自远方的小说全集(来自远方的小说下载)2025-10-14 19:18:11
  • seamless翻译(seal 翻译)2025-10-14 19:18:11
  • 苹果电脑装双系统(苹果电脑装双系统有什么影响)2025-10-14 19:18:11
  • jflash命令行烧录程序(jflash 命令行)2025-10-14 19:18:11
  • auto不可用(autohold不可用)2025-10-14 19:18:11
  • 怎么安装yum命令(yum命令下载安装包)2025-10-14 19:18:11
  • 好玩的代码(电脑好玩的代码)2025-10-14 19:18:11
  • 好玩的代码游戏手机版(简单好玩的代码手机)2025-10-14 19:18:11
  • ad8139替代(ad8054 代替)2025-10-14 19:18:11
  • 全屏图片