centos 离线安装tree命令
<p>在线安装tree命令:</p><div class="cnblogs_code">
<pre> yum -y install tree</pre>
</div>
<p> </p>
<p>但是在线包总是下载失败:</p>
<div class="cnblogs_code">
<pre>Repository epel <span style="color: rgba(0, 0, 255, 1)">is</span> listed more than once <span style="color: rgba(0, 0, 255, 1)">in</span><span style="color: rgba(0, 0, 0, 1)"> the configuration
Repository epel</span>-debuginfo <span style="color: rgba(0, 0, 255, 1)">is</span> listed more than once <span style="color: rgba(0, 0, 255, 1)">in</span><span style="color: rgba(0, 0, 0, 1)"> the configuration
Repository epel</span>-source <span style="color: rgba(0, 0, 255, 1)">is</span> listed more than once <span style="color: rgba(0, 0, 255, 1)">in</span><span style="color: rgba(0, 0, 0, 1)"> the configuration
Loading mirror speeds </span><span style="color: rgba(0, 0, 255, 1)">from</span><span style="color: rgba(0, 0, 0, 1)"> cached hostfile
</span>* <span style="color: rgba(0, 0, 255, 1)">base</span><span style="color: rgba(0, 0, 0, 1)">: mirrors.aliyun.com
</span>* centos-sclo-<span style="color: rgba(0, 0, 0, 1)">rh: ftp.sjtu.edu.cn
</span>* centos-sclo-<span style="color: rgba(0, 0, 0, 1)">sclo: mirror.lzu.edu.cn
</span>*<span style="color: rgba(0, 0, 0, 1)"> epel: mirrors.aliyun.com
</span>*<span style="color: rgba(0, 0, 0, 1)"> extras: mirrors.aliyun.com
</span>*<span style="color: rgba(0, 0, 0, 1)"> updates: mirrors.aliyun.com
http:</span><span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">mirrors.aliyun.com/centos/7/os/x86_64/repodata/repomd.xml: curl#6 - "Could not resolve host: mirrors.aliyun.com; 未知的错误"</span>
<span style="color: rgba(0, 0, 0, 1)">正在尝试其它镜像。
http:</span><span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">mirrors.aliyuncs.com/centos/7/os/x86_64/repodata/repomd.xml: curl#6 - "Could not resolve host: mirrors.aliyuncs.com; 未知的错误"</span>
<span style="color: rgba(0, 0, 0, 1)">正在尝试其它镜像。
http:</span><span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">mirrors.tuna.tsinghua.edu.cn/centos/7.9.2009/sclo/x86_64/rh/repodata/repomd.xml: curl#6 - "Could not resolve host: mirrors.tuna.tsinghua.edu.cn; 未知的错误"</span>
<span style="color: rgba(0, 0, 0, 1)">正在尝试其它镜像。
http:</span><span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">ftp.sjtu.edu.cn/centos/7.9.2009/sclo/x86_64/rh/repodata/repomd.xml: curl#6 - "Could not resolve host: ftp.sjtu.edu.cn; 未知的错误"</span>
<span style="color: rgba(0, 0, 0, 1)">正在尝试其它镜像。
http:</span><span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">mirrors.cn99.com/centos/7.9.2009/sclo/x86_64/rh/repodata/repomd.xml: curl#6 - "Could not resolve host: mirrors.cn99.com; 未知的错误"</span>
<span style="color: rgba(0, 0, 0, 1)">正在尝试其它镜像。
http:</span><span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">mirrors.neusoft.edu.cn/centos/7.9.2009/sclo/x86_64/rh/repodata/repomd.xml: curl#6 - "Could not resolve host: mirrors.neusoft.edu.cn; 未知的错误"</span>
<span style="color: rgba(0, 0, 0, 1)">正在尝试其它镜像。
http:</span><span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">mirror.lzu.edu.cn/centos/7.9.2009/sclo/x86_64/rh/repodata/repomd.xml: curl#6 - "Could not resolve host: mirror.lzu.edu.cn; 未知的错误"</span>
<span style="color: rgba(0, 0, 0, 1)">正在尝试其它镜像。
http:</span><span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">mirrors.163.com/centos/7.9.2009/sclo/x86_64/rh/repodata/repomd.xml: curl#6 - "Could not resolve host: mirrors.163.com; 未知的错误"</span>
<span style="color: rgba(0, 0, 0, 1)">正在尝试其它镜像。
http:</span><span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">mirrors.bfsu.edu.cn/centos/7.9.2009/sclo/x86_64/rh/repodata/repomd.xml: curl#6 - "Could not resolve host: mirrors.bfsu.edu.cn; 未知的错误"</span>
<span style="color: rgba(0, 0, 0, 1)">正在尝试其它镜像。
http:</span><span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">mirrors.cqu.edu.cn/CentOS/7.9.2009/sclo/x86_64/rh/repodata/repomd.xml: curl#6 - "Could not resolve host: mirrors.cqu.edu.cn; 未知的错误"</span>
<span style="color: rgba(0, 0, 0, 1)">正在尝试其它镜像。
http:</span><span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">mirrors.huaweicloud.com/centos/7.9.2009/sclo/x86_64/rh/repodata/repomd.xml: curl#6 - "Could not resolve host: mirrors.huaweicloud.com; 未知的错误"</span>
<span style="color: rgba(0, 0, 0, 1)">正在尝试其它镜像。
http:</span><span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">mirrors.nju.edu.cn/centos/7.9.2009/sclo/x86_64/rh/repodata/repomd.xml: curl#6 - "Could not resolve host: mirrors.nju.edu.cn; 未知的错误"</span>
<span style="color: rgba(0, 0, 0, 1)">正在尝试其它镜像。
http:</span><span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">mirrors.tuna.tsinghua.edu.cn/centos/7.9.2009/sclo/x86_64/sclo/repodata/repomd.xml: curl#6 - "Could not resolve host: mirrors.tuna.tsinghua.edu.cn; 未知的错误"</span>
<span style="color: rgba(0, 0, 0, 1)">正在尝试其它镜像。
http:</span><span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">mirrors.bupt.edu.cn/centos/7.9.2009/sclo/x86_64/sclo/repodata/repomd.xml: curl#6 - "Could not resolve host: mirrors.bupt.edu.cn; 未知的错误"</span>
<span style="color: rgba(0, 0, 0, 1)">正在尝试其它镜像。
http:</span><span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">mirrors.jlu.edu.cn/centos/7.9.2009/sclo/x86_64/sclo/repodata/repomd.xml: curl#6 - "Could not resolve host: mirrors.jlu.edu.cn; 未知的错误"</span>
<span style="color: rgba(0, 0, 0, 1)">正在尝试其它镜像。
http:</span><span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">mirrors.ustc.edu.cn/centos/7.9.2009/sclo/x86_64/sclo/repodata/repomd.xml: curl#6 - "Could not resolve host: mirrors.ustc.edu.cn; 未知的错误"</span>
<span style="color: rgba(0, 0, 0, 1)">正在尝试其它镜像。
http:</span><span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">mirror.lzu.edu.cn/centos/7.9.2009/sclo/x86_64/sclo/repodata/repomd.xml: curl#6 - "Could not resolve host: mirror.lzu.edu.cn; 未知的错误"</span>
<span style="color: rgba(0, 0, 0, 1)">正在尝试其它镜像。
http:</span><span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">mirrors.163.com/centos/7.9.2009/sclo/x86_64/sclo/repodata/repomd.xml: curl#6 - "Could not resolve host: mirrors.163.com; 未知的错误"</span>
<span style="color: rgba(0, 0, 0, 1)">正在尝试其它镜像。
http:</span><span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">mirrors.bfsu.edu.cn/centos/7.9.2009/sclo/x86_64/sclo/repodata/repomd.xml: curl#6 - "Could not resolve host: mirrors.bfsu.edu.cn; 未知的错误"</span>
<span style="color: rgba(0, 0, 0, 1)">正在尝试其它镜像。
http:</span><span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">mirrors.cqu.edu.cn/CentOS/7.9.2009/sclo/x86_64/sclo/repodata/repomd.xml: curl#6 - "Could not resolve host: mirrors.cqu.edu.cn; 未知的错误"</span>
<span style="color: rgba(0, 0, 0, 1)">正在尝试其它镜像。
http:</span><span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">mirrors.huaweicloud.com/centos/7.9.2009/sclo/x86_64/sclo/repodata/repomd.xml: curl#6 - "Could not resolve host: mirrors.huaweicloud.com; 未知的错误"</span>
<span style="color: rgba(0, 0, 0, 1)">正在尝试其它镜像。
http:</span><span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">mirrors.nju.edu.cn/centos/7.9.2009/sclo/x86_64/sclo/repodata/repomd.xml: curl#6 - "Could not resolve host: mirrors.nju.edu.cn; 未知的错误"</span>
<span style="color: rgba(0, 0, 0, 1)">正在尝试其它镜像。
http:</span><span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">mirrors.aliyun.com/epel/7/x86_64/repodata/repomd.xml: curl#6 - "Could not resolve host: mirrors.aliyun.com; 未知的错误"</span>
<span style="color: rgba(0, 0, 0, 1)">正在尝试其它镜像。
http:</span><span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">mirrors.aliyuncs.com/epel/7/x86_64/repodata/repomd.xml: curl#6 - "Could not resolve host: mirrors.aliyuncs.com; 未知的错误"</span>
<span style="color: rgba(0, 0, 0, 1)">正在尝试其它镜像。
http:</span><span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">mirrors.aliyun.com/centos/7/extras/x86_64/repodata/repomd.xml: curl#6 - "Could not resolve host: mirrors.aliyun.com; 未知的错误"</span>
<span style="color: rgba(0, 0, 0, 1)">正在尝试其它镜像。
http:</span><span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">mirrors.aliyuncs.com/centos/7/extras/x86_64/repodata/repomd.xml: curl#6 - "Could not resolve host: mirrors.aliyuncs.com; 未知的错误"</span>
<span style="color: rgba(0, 0, 0, 1)">正在尝试其它镜像。
http:</span><span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">mirrors.aliyun.com/centos/7/updates/x86_64/repodata/repomd.xml: curl#6 - "Could not resolve host: mirrors.aliyun.com; 未知的错误"</span>
<span style="color: rgba(0, 0, 0, 1)">正在尝试其它镜像。
http:</span><span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">mirrors.aliyuncs.com/centos/7/updates/x86_64/repodata/repomd.xml: curl#6 - "Could not resolve host: mirrors.aliyuncs.com; 未知的错误"</span>
<span style="color: rgba(0, 0, 0, 1)">正在尝试其它镜像。
正在解决依赖关系
</span>--><span style="color: rgba(0, 0, 0, 1)"> 正在检查事务
</span>---> 软件包 tree.x86_64.<span style="color: rgba(128, 0, 128, 1)">0.1</span>.<span style="color: rgba(128, 0, 128, 1)">6.0</span>-<span style="color: rgba(128, 0, 128, 1)">10</span><span style="color: rgba(0, 0, 0, 1)">.el7 将被 安装
</span>--><span style="color: rgba(0, 0, 0, 1)"> 解决依赖关系完成
依赖关系解决
</span>============================================================================================================================================================<span style="color: rgba(0, 0, 0, 1)">
Package 架构 版本 源 大小
</span>============================================================================================================================================================<span style="color: rgba(0, 0, 0, 1)">
正在安装:
tree x86_64 </span><span style="color: rgba(128, 0, 128, 1)">1.6</span>.<span style="color: rgba(128, 0, 128, 1)">0</span>-<span style="color: rgba(128, 0, 128, 1)">10</span>.el7 <span style="color: rgba(0, 0, 255, 1)">base</span> <span style="color: rgba(128, 0, 128, 1)">46</span><span style="color: rgba(0, 0, 0, 1)"> k
事务概要
</span>============================================================================================================================================================<span style="color: rgba(0, 0, 0, 1)">
安装</span><span style="color: rgba(128, 0, 128, 1)">1</span><span style="color: rgba(0, 0, 0, 1)"> 软件包
总下载量:</span><span style="color: rgba(128, 0, 128, 1)">46</span><span style="color: rgba(0, 0, 0, 1)"> k
安装大小:</span><span style="color: rgba(128, 0, 128, 1)">87</span><span style="color: rgba(0, 0, 0, 1)"> k
Downloading packages:
Delta RPMs disabled because </span>/usr/bin/<span style="color: rgba(0, 0, 0, 1)">applydeltarpm not installed.
tree</span>-<span style="color: rgba(128, 0, 128, 1)">1.6</span>.<span style="color: rgba(128, 0, 128, 1)">0</span>-<span style="color: rgba(128, 0, 128, 1)">10</span><span style="color: rgba(0, 0, 0, 1)">.el7.x86_64.rpm FAILED
http:</span><span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">mirrors.aliyun.com/centos/7/os/x86_64/Packages/tree-1.6.0-10.el7.x86_64.rpm: curl#6 - "Could not resolve host: mirrors.aliyun.com; Unknown error"</span>
<span style="color: rgba(0, 0, 0, 1)">正在尝试其它镜像。
tree</span>-<span style="color: rgba(128, 0, 128, 1)">1.6</span>.<span style="color: rgba(128, 0, 128, 1)">0</span>-<span style="color: rgba(128, 0, 128, 1)">10</span><span style="color: rgba(0, 0, 0, 1)">.el7.x86_64.rpm FAILED
http:</span><span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">mirrors.aliyuncs.com/centos/7/os/x86_64/Packages/tree-1.6.0-10.el7.x86_64.rpm: curl#6 - "Could not resolve host: mirrors.aliyuncs.com; Unknown error"</span>
<span style="color: rgba(0, 0, 0, 1)">正在尝试其它镜像。
Error downloading packages:
tree</span>-<span style="color: rgba(128, 0, 128, 1)">1.6</span>.<span style="color: rgba(128, 0, 128, 1)">0</span>-<span style="color: rgba(128, 0, 128, 1)">10</span>.el7.x86_64: No more mirrors to <span style="color: rgba(0, 0, 255, 1)">try</span>.</pre>
</div>
<p> </p>
<p>所以需要采用离线安装方式:</p>
<p>离线包获取地址:https://developer.aliyun.com/packageSearch?word=tree</p>
<p> </p>
<p> </p>
<p><img src="https://img2024.cnblogs.com/blog/446308/202401/446308-20240125140925620-374919042.png" alt="" loading="lazy"></p>
<p> </p>
<p><img src="https://img2024.cnblogs.com/blog/446308/202401/446308-20240125140926231-1012097379.png" alt="" loading="lazy"></p>
<p> </p>
<p>然后使用命令安装本地yum包:</p>
<div class="cnblogs_code">
<pre>yum localinstall tree-<span style="color: rgba(128, 0, 128, 1)">1.7</span>.<span style="color: rgba(128, 0, 128, 1)">0</span>-<span style="color: rgba(128, 0, 128, 1)">15</span>.el8.x86_64.rpm</pre>
</div>
<div class="cnblogs_code">
<pre>yum localinstall tree-<span style="color: rgba(128, 0, 128, 1)">1.7</span>.<span style="color: rgba(128, 0, 128, 1)">0</span>-<span style="color: rgba(128, 0, 128, 1)">15</span><span style="color: rgba(0, 0, 0, 1)">.el8.x86_64.rpm
已加载插件:fastestmirror
Repository epel </span><span style="color: rgba(0, 0, 255, 1)">is</span> listed more than once <span style="color: rgba(0, 0, 255, 1)">in</span><span style="color: rgba(0, 0, 0, 1)"> the configuration
Repository epel</span>-debuginfo <span style="color: rgba(0, 0, 255, 1)">is</span> listed more than once <span style="color: rgba(0, 0, 255, 1)">in</span><span style="color: rgba(0, 0, 0, 1)"> the configuration
Repository epel</span>-source <span style="color: rgba(0, 0, 255, 1)">is</span> listed more than once <span style="color: rgba(0, 0, 255, 1)">in</span><span style="color: rgba(0, 0, 0, 1)"> the configuration
正在检查 tree</span>-<span style="color: rgba(128, 0, 128, 1)">1.7</span>.<span style="color: rgba(128, 0, 128, 1)">0</span>-<span style="color: rgba(128, 0, 128, 1)">15</span>.el8.x86_64.rpm: tree-<span style="color: rgba(128, 0, 128, 1)">1.7</span>.<span style="color: rgba(128, 0, 128, 1)">0</span>-<span style="color: rgba(128, 0, 128, 1)">15</span><span style="color: rgba(0, 0, 0, 1)">.el8.x86_64
tree</span>-<span style="color: rgba(128, 0, 128, 1)">1.7</span>.<span style="color: rgba(128, 0, 128, 1)">0</span>-<span style="color: rgba(128, 0, 128, 1)">15</span><span style="color: rgba(0, 0, 0, 1)">.el8.x86_64.rpm 将被安装
正在解决依赖关系
</span>--><span style="color: rgba(0, 0, 0, 1)"> 正在检查事务
</span>---> 软件包 tree.x86_64.<span style="color: rgba(128, 0, 128, 1)">0.1</span>.<span style="color: rgba(128, 0, 128, 1)">7.0</span>-<span style="color: rgba(128, 0, 128, 1)">15</span><span style="color: rgba(0, 0, 0, 1)">.el8 将被 安装
</span>--><span style="color: rgba(0, 0, 0, 1)"> 解决依赖关系完成
依赖关系解决
</span>============================================================================================================================================================<span style="color: rgba(0, 0, 0, 1)">
Package 架构 版本 源 大小
</span>============================================================================================================================================================<span style="color: rgba(0, 0, 0, 1)">
正在安装:
tree x86_64 </span><span style="color: rgba(128, 0, 128, 1)">1.7</span>.<span style="color: rgba(128, 0, 128, 1)">0</span>-<span style="color: rgba(128, 0, 128, 1)">15</span>.el8 /tree-<span style="color: rgba(128, 0, 128, 1)">1.7</span>.<span style="color: rgba(128, 0, 128, 1)">0</span>-<span style="color: rgba(128, 0, 128, 1)">15</span>.el8.x86_64 <span style="color: rgba(128, 0, 128, 1)">109</span><span style="color: rgba(0, 0, 0, 1)"> k
事务概要
</span>============================================================================================================================================================<span style="color: rgba(0, 0, 0, 1)">
安装</span><span style="color: rgba(128, 0, 128, 1)">1</span><span style="color: rgba(0, 0, 0, 1)"> 软件包
总计:</span><span style="color: rgba(128, 0, 128, 1)">109</span><span style="color: rgba(0, 0, 0, 1)"> k
安装大小:</span><span style="color: rgba(128, 0, 128, 1)">109</span><span style="color: rgba(0, 0, 0, 1)"> k
Is </span><span style="color: rgba(0, 0, 255, 1)">this</span> ok : y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
正在安装 : tree</span>-<span style="color: rgba(128, 0, 128, 1)">1.7</span>.<span style="color: rgba(128, 0, 128, 1)">0</span>-<span style="color: rgba(128, 0, 128, 1)">15</span>.el8.x86_64 <span style="color: rgba(128, 0, 128, 1)">1</span>/<span style="color: rgba(128, 0, 128, 1)">1</span><span style="color: rgba(0, 0, 0, 1)">
验证中 : tree</span>-<span style="color: rgba(128, 0, 128, 1)">1.7</span>.<span style="color: rgba(128, 0, 128, 1)">0</span>-<span style="color: rgba(128, 0, 128, 1)">15</span>.el8.x86_64 <span style="color: rgba(128, 0, 128, 1)">1</span>/<span style="color: rgba(128, 0, 128, 1)">1</span><span style="color: rgba(0, 0, 0, 1)">
已安装:
tree.x86_64 </span><span style="color: rgba(128, 0, 128, 1)">0</span>:<span style="color: rgba(128, 0, 128, 1)">1.7</span>.<span style="color: rgba(128, 0, 128, 1)">0</span>-<span style="color: rgba(128, 0, 128, 1)">15</span><span style="color: rgba(0, 0, 0, 1)">.el8
完毕!</span></pre>
</div>
<p> </p><br><br>
来源:https://www.cnblogs.com/hankuikui/p/17987042
頁:
[1]