[步骤] Rocky Linux & RHEL 本地缓存的软件包的安装

步骤一:将 yum 工具 & dnf 工具缓存下来的软件包设置为持续保存

# vi /etc/yum.conf

或者:

# vi /etc/dnf/dnf.conf

将部分内容修改如下:

......
keepcache = 1

步骤二:清空本地 yum 工具 & dnf 工具的缓存

# yum clean all

或者:

# dnf clean all

步骤三:将 yum 工具 & dnf 工具的软件包清单缓存到本地

# yum makecache

步骤四:将 yum 工具 & dnf 工具所有可以升级的软件包缓存到本地

# yum update --downloadonly

或者:

# dnf update --downloadonly

步骤五:显示已经缓存的软件包

5.1 显示所有已经缓存的软件包

# yum -C list

或者:

# dnf -C list

5.2 显示某个已经缓存的软件包

# yum -C list kernel

或者:

# dnf -C list kernel

(补充:这里以显示已经缓存的 kernel 软件包为例)

步骤六:使用 yum 工具 & dnf 工具缓存的所有软件包提到系统里现存的老的软件包

# yum -C update

或者:

# dnf -C update

[DEBUG] Linux resolve at command error ‘PAM failure: Authentication service cannot retrieve authentication info’

Error Reporting Command

> at

Error Code

PAM failure: Authentication service cannot retrieve authentication info

Reason

This user which inputted at command did not have password so there is no record relate to it in /etc/shadow file.
And at command need check the record in the file /etc/shadow.
If at command can not find the user's record in /etc/shadow, it output this error code.

Solution

And password to the suer:

> passwd

[命令] Linux 命令 findmnt 的使用 (显示目前挂载的文件系统)

案例一:显示目前挂载的文件系统

# findmnt

案例二:显示目前挂载的文件系统并取消过滤器 (显示所有挂载的文件系统)

# findmnt -A

或者:

# findmnt --all

案例三:显示目前挂载的文件系统并以 df 命令的输出格式显示出来 (可以和 -A 或者 –all 选项和作用一起使用)

# findmnt -D

或者:

# findmnt --df

或者:

# findmnt -I

或者:

# findmnt --dfi

案例四:显示目前挂载的文件系统并取消显示文件系统之间的上下级关系

# findmnt -l

或者:

# findmnt --list

案例五:显示目前挂载的文件系统但是指定要显示的文件系统

# findmnt -t xfs

或者:

# findmnt --types xfs

(补充:这里以只显示 xfs 文件系统为例)

案例六:显示目前挂载的文件系统并以 tree 命令的输出格式显示出来

# findmnt --tree

案例七:显示目前挂载的文件系统但是去掉重复的挂载点

# findmnt -U

或者:

# findmnt --uniq

[命令] Linux 命令 zless 的使用 (显示压缩文本的行同时不用解压文件)

内容一:zless 命令的格式

# zless <options> <file>

内容二:zless 命令的选项

1) -n 或者 –line-numbers,在显示压缩文件的同时显示行号
2) -p 或者 –pattern=PATTERN,在压缩的文件中搜索内容

内容三:zless 命令的使用案例

# zless -p "eternalcenter" test.gz

(补充:这里以在 test.gz 压缩文件中搜索内容 eternalcenter 为例)