centos 离线安装tree命令

在线安装tree命令:

 yum -y install tree

 

但是在线包总是下载失败:

Repository epel is listed more than once in the configuration
Repository epel-debuginfo is listed more than once in the configuration
Repository epel-source is listed more than once in the configuration
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * centos-sclo-rh: ftp.sjtu.edu.cn
 * centos-sclo-sclo: mirror.lzu.edu.cn
 * epel: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
http://mirrors.aliyun.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.aliyun.com; 未知的错误"
正在尝试其它镜像。
http://mirrors.aliyuncs.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.aliyuncs.com; 未知的错误"
正在尝试其它镜像。
http://mirrors.tuna.tsinghua.edu.cn/centos/7.9.2009/sclo/x86_64/rh/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.tuna.tsinghua.edu.cn; 未知的错误"
正在尝试其它镜像。
http://ftp.sjtu.edu.cn/centos/7.9.2009/sclo/x86_64/rh/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: ftp.sjtu.edu.cn; 未知的错误"
正在尝试其它镜像。
http://mirrors.cn99.com/centos/7.9.2009/sclo/x86_64/rh/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.cn99.com; 未知的错误"
正在尝试其它镜像。
http://mirrors.neusoft.edu.cn/centos/7.9.2009/sclo/x86_64/rh/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.neusoft.edu.cn; 未知的错误"
正在尝试其它镜像。
http://mirror.lzu.edu.cn/centos/7.9.2009/sclo/x86_64/rh/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirror.lzu.edu.cn; 未知的错误"
正在尝试其它镜像。
http://mirrors.163.com/centos/7.9.2009/sclo/x86_64/rh/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.163.com; 未知的错误"
正在尝试其它镜像。
http://mirrors.bfsu.edu.cn/centos/7.9.2009/sclo/x86_64/rh/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.bfsu.edu.cn; 未知的错误"
正在尝试其它镜像。
http://mirrors.cqu.edu.cn/CentOS/7.9.2009/sclo/x86_64/rh/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.cqu.edu.cn; 未知的错误"
正在尝试其它镜像。
http://mirrors.huaweicloud.com/centos/7.9.2009/sclo/x86_64/rh/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.huaweicloud.com; 未知的错误"
正在尝试其它镜像。
http://mirrors.nju.edu.cn/centos/7.9.2009/sclo/x86_64/rh/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.nju.edu.cn; 未知的错误"
正在尝试其它镜像。
http://mirrors.tuna.tsinghua.edu.cn/centos/7.9.2009/sclo/x86_64/sclo/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.tuna.tsinghua.edu.cn; 未知的错误"
正在尝试其它镜像。
http://mirrors.bupt.edu.cn/centos/7.9.2009/sclo/x86_64/sclo/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.bupt.edu.cn; 未知的错误"
正在尝试其它镜像。
http://mirrors.jlu.edu.cn/centos/7.9.2009/sclo/x86_64/sclo/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.jlu.edu.cn; 未知的错误"
正在尝试其它镜像。
http://mirrors.ustc.edu.cn/centos/7.9.2009/sclo/x86_64/sclo/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.ustc.edu.cn; 未知的错误"
正在尝试其它镜像。
http://mirror.lzu.edu.cn/centos/7.9.2009/sclo/x86_64/sclo/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirror.lzu.edu.cn; 未知的错误"
正在尝试其它镜像。
http://mirrors.163.com/centos/7.9.2009/sclo/x86_64/sclo/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.163.com; 未知的错误"
正在尝试其它镜像。
http://mirrors.bfsu.edu.cn/centos/7.9.2009/sclo/x86_64/sclo/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.bfsu.edu.cn; 未知的错误"
正在尝试其它镜像。
http://mirrors.cqu.edu.cn/CentOS/7.9.2009/sclo/x86_64/sclo/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.cqu.edu.cn; 未知的错误"
正在尝试其它镜像。
http://mirrors.huaweicloud.com/centos/7.9.2009/sclo/x86_64/sclo/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.huaweicloud.com; 未知的错误"
正在尝试其它镜像。
http://mirrors.nju.edu.cn/centos/7.9.2009/sclo/x86_64/sclo/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.nju.edu.cn; 未知的错误"
正在尝试其它镜像。
http://mirrors.aliyun.com/epel/7/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.aliyun.com; 未知的错误"
正在尝试其它镜像。
http://mirrors.aliyuncs.com/epel/7/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.aliyuncs.com; 未知的错误"
正在尝试其它镜像。
http://mirrors.aliyun.com/centos/7/extras/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.aliyun.com; 未知的错误"
正在尝试其它镜像。
http://mirrors.aliyuncs.com/centos/7/extras/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.aliyuncs.com; 未知的错误"
正在尝试其它镜像。
http://mirrors.aliyun.com/centos/7/updates/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.aliyun.com; 未知的错误"
正在尝试其它镜像。
http://mirrors.aliyuncs.com/centos/7/updates/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.aliyuncs.com; 未知的错误"
正在尝试其它镜像。
正在解决依赖关系
--> 正在检查事务
---> 软件包 tree.x86_64.0.1.6.0-10.el7 将被 安装
--> 解决依赖关系完成

依赖关系解决

============================================================================================================================================================
 Package                           架构                                版本                                         源                                 大小
============================================================================================================================================================
正在安装:
 tree                              x86_64                              1.6.0-10.el7                                 base                               46 k

事务概要
============================================================================================================================================================
安装  1 软件包

总下载量:46 k
安装大小:87 k
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
tree-1.6.0-10.el7.x86_64.rpm   FAILED                                          
http://mirrors.aliyun.com/centos/7/os/x86_64/Packages/tree-1.6.0-10.el7.x86_64.rpm: [Errno 14] curl#6 - "Could not resolve host: mirrors.aliyun.com; Unknown error"
正在尝试其它镜像。
tree-1.6.0-10.el7.x86_64.rpm   FAILED                                          
http://mirrors.aliyuncs.com/centos/7/os/x86_64/Packages/tree-1.6.0-10.el7.x86_64.rpm: [Errno 14] curl#6 - "Could not resolve host: mirrors.aliyuncs.com; Unknown error"
正在尝试其它镜像。


Error downloading packages:
  tree-1.6.0-10.el7.x86_64: [Errno 256] No more mirrors to try.

 

所以需要采用离线安装方式:

离线包获取地址:https://developer.aliyun.com/packageSearch?word=tree

 

 

 

 

然后使用命令安装本地yum包:

yum localinstall tree-1.7.0-15.el8.x86_64.rpm
yum localinstall tree-1.7.0-15.el8.x86_64.rpm 
已加载插件:fastestmirror
Repository epel is listed more than once in the configuration
Repository epel-debuginfo is listed more than once in the configuration
Repository epel-source is listed more than once in the configuration
正在检查 tree-1.7.0-15.el8.x86_64.rpm: tree-1.7.0-15.el8.x86_64
tree-1.7.0-15.el8.x86_64.rpm 将被安装
正在解决依赖关系
--> 正在检查事务
---> 软件包 tree.x86_64.0.1.7.0-15.el8 将被 安装
--> 解决依赖关系完成

依赖关系解决

============================================================================================================================================================
 Package                      架构                           版本                                   源                                                 大小
============================================================================================================================================================
正在安装:
 tree                         x86_64                         1.7.0-15.el8                           /tree-1.7.0-15.el8.x86_64                         109 k

事务概要
============================================================================================================================================================
安装  1 软件包

总计:109 k
安装大小:109 k
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  正在安装    : tree-1.7.0-15.el8.x86_64                                                                                                                1/1 
  验证中      : tree-1.7.0-15.el8.x86_64                                                                                                                1/1 

已安装:
  tree.x86_64 0:1.7.0-15.el8                                                                                                                                

完毕!

 

posted @ 2024-01-25 14:13  二奎  阅读(170)  评论(0编辑  收藏  举报