先用rpm安装tree命令,并查看该软件包的详细信息,然后将tree命令卸载,卸载后再使用yum命令安装tree命令,并查看该软件包概要信息。
时间: 2024-03-20 21:44:00 浏览: 99
tree-1.7.0-1.30.x86-64.zip
可以按照以下步骤进行操作:
1. 使用 `rpm` 命令安装 `tree`:
```
sudo rpm -ivh tree-1.8.0-7.el7.x86_64.rpm
```
2. 查看安装的软件包详细信息:
```
rpm -qi tree
```
输出类似如下信息:
```
Name : tree
Version : 1.8.0
Release : 7.el7
Architecture: x86_64
Install Date: Wed 23 Jun 2021 10:49:11 PM CST
Group : Applications/System
Size : 123113
License : GPLv2
Signature : RSA/SHA256, Tue 07 Jul 2020 12:53:32 PM CST, Key ID 24c6a8a7f4a80eb5
Source RPM : tree-1.8.0-7.el7.src.rpm
Build Date : Mon 29 Jun 2020 05:23:16 PM CST
Build Host : x86-02.bsys.centos.org
Relocations : (not relocatable)
Packager : CentOS BuildSystem <http://bugs.centos.org>
Vendor : CentOS
URL : http://mama.indstate.edu/users/ice/tree/
Summary : File system tree viewer
Description :
Tree is a recursive directory listing program that produces a depth indented
listing of files. Color is supported ala dircolors if the LS_COLORS
environment variable is set, output is to tty.
```
3. 使用 `rpm` 命令卸载 `tree`:
```
sudo rpm -e tree
```
4. 使用 `yum` 命令安装 `tree`:
```
sudo yum install tree
```
5. 查看安装的软件包概要信息:
```
yum info tree
```
输出类似如下信息:
```
Available Packages
Name : tree
Version : 1.8.0
Release : 10.el7
Architecture: x86_64
Size : 58 k
Source : tree-1.8.0-10.el7.src.rpm
Repository : base
Summary : File system tree viewer
URL : http://mama.indstate.edu/users/ice/tree/
License : GPLv2
Description : The tree utility recursively displays the contents of directories
: in a tree-like format.
```
注意:以上命令需要在拥有管理员权限的终端中运行。
阅读全文