在线获取所有依赖rpm包的方法
背景
现在经常有一些不能上网的LInux机器但是需要安装一些软件.
但是有时候经常因为有依赖关系找不到的情况比较麻烦.
或者是一些公司的网络总是受限,网络速度非常慢.
下载安装非常折磨人.
这个时候就需要从能够上网的机器拉取 rpm包进行处理.
但是此时经常有两个问题.
1. 拉取的架构可能不兼容.
2. 拉取的rpm包可能用来关系不完整
基于此, 需要寻找一下解决方案.
常用解决方案
最常用的下载方式有:
yum --downloadonly --downloaddir
yumdownloader xxx
如果需要解决依赖关系可能需要使用
yumdownloader ansible --resolve
但是这一个好像有一点不太一样的地方. 跟已经安装的软件多少有关系
可能会下载不完整.
还需要注意需要使用这个工具:
yum install yum-utils -y
repotrack的解决方案
首先可以查看是什么软件带这个命令:
yum provides repotrack
可以发现:
centos7的是 yum-utils*
centos8的是 dnf-plugins-core*
如果需要可以安装着两个软件 再进行处理.
查看帮助
最近学习过程中发现自己最大的缺点是动不动就想搜索解决问题.
其实最快最好的解决问题的方法是查看帮助 man 或者是 -h
通过快速查看帮助文档可以快速解决问题.
常用命令
mkdir -p /fio/x86_64
mkdir -p /fio/aarch64
cd /fio/x86_64
repotrack fio --forcearch x86_64
cd /fio/aarch64
repotrack fio --forcearch aarch64
注意如果默认的repo没有可能无法下载.
还可以指定repo
下载常用的repo
我这边还是放到了 /etc/yum.repos.d/下面
然后进行了一些简单处理.
可以使用 yum repolist 查看具体的repo
然后使用如下命令获取部分下载路径.
repotrack fio --repoid AppStream --forcearch x86_64 --urls
注意 在银河麒麟上面他的releasever 的版本是 10 与 CentOS是不一样的.
需要单独处理
sed -i 's/$releasever/8.5.2111/g' Centos-8.repo
但是银河麒麟依旧有一些与CentOS8的冲突没有解决掉.
建议还是找一个能上外网的同发行版的机器进行验证.
附件查看帮助
[root@gscloud-app-kunpeng-arm ansible_x86_64]# repotrack -h
usage: dnf download [-c [config file]] [-q] [-v] [--version]
[--installroot [path]] [--nodocs] [--noplugins]
[--enableplugin [plugin]] [--disableplugin [plugin]]
[--releasever RELEASEVER] [--setopt SETOPTS]
[--skip-broken] [-h] [--allowerasing] [-b | --nobest] [-C]
[-R [minutes]] [-d [debug level]] [--debugsolver]
[--showduplicates] [-e ERRORLEVEL] [--obsoletes]
[--rpmverbosity [debug level name]] [-y] [--assumeno]
[--enablerepo [repo]] [--disablerepo [repo] | --repo
[repo]] [--enable | --disable] [-x [package]]
[--disableexcludes [repo]] [--repofrompath [repo,path]]
[--noautoremove] [--nogpgcheck] [--color COLOR]
[--refresh] [-4] [-6] [--destdir DESTDIR] [--downloadonly]
[--comment COMMENT] [--bugfix] [--enhancement]
[--newpackage] [--security] [--advisory ADVISORY]
[--bz BUGZILLA] [--cve CVES]
[--sec-severity {Critical,Important,Moderate,Low}]
[--forcearch ARCH] [--source] [--debuginfo]
[--debugsource] [--arch [arch]] [--resolve] [--alldeps]
[--url] [--urlprotocols {http,https,rsync,ftp}]
packages [packages ...]
下载软件包至当前目录
General DNF options:
-c [config file], --config [config file]
config file location
-q, --quiet quiet operation
-v, --verbose verbose operation
--version show DNF version and exit
--installroot [path] set install root
--nodocs do not install documentations
--noplugins disable all plugins
--enableplugin [plugin]
enable plugins by name
--disableplugin [plugin]
disable plugins by name
--releasever RELEASEVER
override the value of $releasever in config and repo
files
--setopt SETOPTS set arbitrary config and repo options
--skip-broken resolve depsolve problems by skipping packages
-h, --help, --help-cmd
show command help
--allowerasing allow erasing of installed packages to resolve
dependencies
-b, --best try the best available package versions in
transactions.
--nobest do not limit the transaction to the best candidate
-C, --cacheonly run entirely from system cache, don't update cache
-R [minutes], --randomwait [minutes]
maximum command wait time
-d [debug level], --debuglevel [debug level]
debugging output level
--debugsolver dumps detailed solving results into files
--showduplicates show duplicates, in repos, in list/search commands
-e ERRORLEVEL, --errorlevel ERRORLEVEL
error output level
--obsoletes enables dnf's obsoletes processing logic for upgrade
or display capabilities that the package obsoletes for
info, list and repoquery
--rpmverbosity [debug level name]
debugging output level for rpm
-y, --assumeyes automatically answer yes for all questions
--assumeno automatically answer no for all questions
--enablerepo [repo] Enable additional repositories. List option. Supports
globs, can be specified multiple times.
--disablerepo [repo] Disable repositories. List option. Supports globs, can
be specified multiple times.
--repo [repo], --repoid [repo]
enable just specific repositories by an id or a glob,
can be specified multiple times
--enable, --set-enabled
enable repos with config-manager command
(automatically saves)
--disable, --set-disabled
disable repos with config-manager command
(automatically saves)
-x [package], --exclude [package], --excludepkgs [package]
exclude packages by name or glob
--disableexcludes [repo], --disableexcludepkgs [repo]
disable excludepkgs
--repofrompath [repo,path]
label and path to an additional repository to use
(same path as in a baseurl), can be specified multiple
times.
--noautoremove disable removal of dependencies that are no longer
used
--nogpgcheck disable gpg signature checking (if RPM policy allows)
--color COLOR control whether color is used
--refresh set metadata as expired before running the command
-4 resolve to IPv4 addresses only
-6 resolve to IPv6 addresses only
--destdir DESTDIR, --downloaddir DESTDIR
set directory to copy packages to
--downloadonly only download packages
--comment COMMENT add a comment to transaction
--bugfix Include bugfix relevant packages, in updates
--enhancement Include enhancement relevant packages, in updates
--newpackage Include newpackage relevant packages, in updates
--security Include security relevant packages, in updates
--advisory ADVISORY, --advisories ADVISORY
Include packages needed to fix the given advisory, in
updates
--bz BUGZILLA, --bzs BUGZILLA
Include packages needed to fix the given BZ, in
updates
--cve CVES, --cves CVES
Include packages needed to fix the given CVE, in
updates
--sec-severity {Critical,Important,Moderate,Low}, --secseverity {Critical,Important,Moderate,Low}
Include security relevant packages matching the
severity, in updates
--forcearch ARCH Force the use of an architecture
Download command-specific options:
--source 取而代之下载源代码软件包 src.rpm
--debuginfo 取而代之下载 -debuginfo 软件包
--debugsource download the -debugsource package instead
--arch [arch], --archlist [arch]
限定查询指定架构的软件包
--resolve 解析并下载所需的依赖关系
--alldeps when running with --resolve, download all dependencies
(do not exclude already installed ones)
--url, --urls 打印 rpm 可被下载的 url 列表而不是直接下载
--urlprotocols {http,https,rsync,ftp}
当执行时带有 --url 参数,则限制使用指定协议
packages 将要下载的软件包
在线获取所有依赖rpm包的方法的更多相关文章
- CentOS 5.4 制作 Python 2.6 RPM 包的方法
不知道什么原因,CentOS 5.4 了,默认的Python的版本还是2.4的. 但是Python在CentOS里面的又非常的重要,可是 2.4版本的Python有很多的模块没有,最新的Python ...
- 在yum出问题的情况下安装某个rpm包的方法
1 核心命令 rpm -i 2 方法 centos镜像站去找到所有的rpm包. 安装这个rpm包,发现有一个依赖没有安装,就去下载安装.因为整体的包是有限的,因此终会收敛的. 比如安装rpmbuild ...
- centos 7 无网络情况下,解决yum 安装依赖rpm包
方法一:在一台有网络的机器,用yum下载好所需程序,传到另外一台网络的机器上安装 yum install xtrabackup --downloadonly --downloaddir=/rpmpat ...
- 简单介绍RPM包制作方法
RPM是RedHat Package Manager(RedHat软件包管理工具)的缩写,是一种用于互联网下载包的打包及安装工具,它包含在某些Linux分发版中.它生成具有.RPM扩展名的文件.使用r ...
- RPM包制作方法
一.RPM介绍 RPM 前是Red Hat Package Manager 的缩写,本意是Red Hat 软件包管理,顾名思义是Red Hat 贡献出来的软件包管理:现在应为RPM Package M ...
- src.rpm包安装方法
有些软件包是以.src.rpm结尾的,这类软件包是包含了源代码的rpm包,在安装时需要进行编译.这类软件包有多种安装方法,以redhat为例说明如下: 注意: 如果没有rpmbuild可以从系统安装光 ...
- yum 下载全量依赖 rpm 包及离线安装(终极解决方案)
目录 简介 验证环境 查看依赖包 方案一(推荐):repotrack 方案二:yumdownloader 方案三:yum 的 downloadonly 插件 离线安装 rpm 参考资料 简介 通常生产 ...
- 用centos光盘安装RPM包的方法
1.在虚拟机光盘选项中设置连接路径为centos安装光盘. 2.将光盘挂载到本地目录. #新建一个文件夹 mkdir cdrom #把光盘挂载到cdrom目录下 mount /dev/cdrom cd ...
- 解压查看二进制rpm包的方法
详细参考: man cpio 具体方法: rpm2cpio qt5-qtbase-5.6.0-13.fc21.x86_64.rpm | cpio -dium 执行后可在当前目录查看 安装目录 etc ...
- Linux搭建局域网yum源和后期在yum源中更新rpm包方法
在内网中搭建自己的yum源,可以方便在内网中使用,下面简单介绍搭建局域网yum源的方法和后期更新yum源rpm包的方法. 一.搭建局域网yum源 1.需要在局域网访问,首先需要一个web服务器,比如a ...
随机推荐
- 关于汽车OTA,这篇科普文能告诉你
随着汽车中软件发挥的作用越来越重要,软件定义汽车已经是行业内的共识.汽车行业的发展极有可能最终像手机产业一样,基础硬件差异会越来越小,关键在于汽车给用户的体验的多样性,以及汽车产品在不同场景下满足用户 ...
- 华为扫地僧:揭秘IoT+鸿蒙帮助企业突围物联网安全问题
摘要:通过介绍物联网安全架构以及华为云IoT+鸿蒙端边云协同安全实践,意在通过华为云IoT+鸿蒙帮助企业解决物联网安全问题. 在本期#码出未来,与你同行#HDC.Cloud2023华为云开发者社区系列 ...
- 华为云SparkRTC面向低时延、大通量传输业务的技术探索
摘要:网络和移动设备高速发展的今天,人们开始思考如何用更短的时间下载更大的文件,追求更快的速度.当下在稳定的基础上有什么方法可以提升速度呢? 本文分享自华为云社区<华为云SparkRTC面向低时 ...
- 裴丹:AIOps 智能运维经验分享
摘要:本文结合裴丹教授过去二十余年在AIOps领域与几十家企业合作.跨多种技术栈的落地经验积累,以及150篇左右学术论文的算法积累,总结出的AIOps落地的一些经验性原则. 本文分享自华为云社区< ...
- 毕业季 | 华为专家亲授面试秘诀:如何拿到大厂高薪offer?
摘要:了解大厂面试流程.要求以及技巧,做好充分准备,赢在职场起跑线. 本文分享自华为云社区<毕业季 | 华为专家亲授面试秘诀:如何拿到大厂高薪offer?>,作者:华为云社区精选. 同学们 ...
- 华为云媒体査勇:华为云在视频AI转码领域的技术实践
摘要:为大家介绍华为云媒体处理服务在视频AI转码领域的一些技术实践. 随着5G的落地和消费终端的不断升级,消费环节对视频画质的要求也越来越高,为了给消费者带来更清晰.更逼真和更具沉浸感的观感体验,对云 ...
- 字节跳动基于 ClickHouse 优化实践之“查询优化器”
更多技术交流.求职机会,欢迎关注字节跳动数据平台微信公众号,回复[1]进入官方交流群 相信大家都对大名鼎鼎的 ClickHouse 有一定的了解了,它强大的数据分析性能让人印象深刻.但在字节大量生产使 ...
- 火山引擎 DataTester:0 代码也能实施 A/B 测试的实验平台
更多技术交流.求职机会,欢迎关注字节跳动数据平台微信公众号,并进入官方交流群 近日,火山引擎 DataTester 对 A/B 实验"可视化编辑器"进行了升级,可视化编辑器功能让用 ...
- Snack3 3.1.10的新特性及应用
<dependency> <groupId>org.noear</groupId> <artifactId>snack3</artifactId& ...
- SQL Server 2016 自动备份、收缩数据库
一般策略为:Oracle: 周一.二 增量备份,周三差异备份,周四.五.六增量备份,周日完整备份(建多计划) MsSQL: 周一.六差异备份,周日完整备份(建多计划) 打开SQL server配置管理 ...