1.使用rpm安装zsh(忽略依赖关系安装)
[root@RHCSA ~]# rpm -i --nodeps zsh-5.5.1-9.el8.x86_64.rpm
查询是否已安装
[root@RHCSA ~]# rpm -qa | grep zsh
zsh-5.5.1-9.el8.x86_64
卸载zsh
[root@RHCSA ~]# rpm -e zsh
查询所有已安装软件
[root@RHCSA ~]# rpm -aq
查询date命令所在软件包
[root@RHCSA ~]# whereis date
date: /usr/bin/date /usr/share/man/man1/date.1.gz /usr/share/man/man1p/date.1p.gz
[root@RHCSA ~]# rpm -qf /usr/bin/date
coreutils-8.30-6.el8.x86_64
查询未安装的zsh的文件信息
[root@RHCSA ~]# rpm -ql zsh
package zsh is not installed
2.yum本地源配置
[root@RHCSA ~]# mount /dev/sr0 /mnt
mount: /mnt: WARNING: device write-protected, mounted read-only.
[root@RHCSA ~]# cd /mnt
[root@RHCSA mnt]# ls
AppStream EULA images RPM-GPG-KEY-redhat-beta
BaseOS extra_files.json isolinux RPM-GPG-KEY-redhat-release
EFI GPL media.repo TRANS.TBL
[root@RHCSA yum.repos.d]# vim redhat.repo
[root@RHCSA yum.repos.d]# yum repolist
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Repository base is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Repository PowerTools is listed more than once in the configuration
Repository AppStream is listed more than once in the configuration
Repository AppStream is listed more than once in the configuration
BaseOS 124 MB/s | 2.2 MB 00:00
Last metadata expiration check: 0:00:01 ago on Sun 10 Apr 2022 11:48:50 AM EDT.
repo id repo name status
AppStream CentOS-8.5.2111 - AppStream - mirrors.aliyun.com 5,596
BaseOS BaseOS 1,661
base CentOS-8.5.2111 - Base - mirrors.aliyun.com 1,896
extras CentOS-8.5.2111 - Extras - mirrors.aliyun.com 38
yum网络源配置
安装httpd软件
[root@RHCSA ~]# yum install httpd
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Repository base is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Repository PowerTools is listed more than once in the configuration
Repository AppStream is listed more than once in the configuration
Repository AppStream is listed more than once in the configuration
BaseOS 2.7 MB/s | 2.8 kB 00:00
Dependencies resolved.
==========================================================================================
Package Arch Version Repository Size
==========================================================================================
Installing:
httpd x86_64 2.4.37-43.module_el8.5.0+1022+b541f3b1 AppStream 1.4 M
Installing dependencies:
centos-logos-httpd noarch 85.8-2.el8 base 75 k
apr x86_64 1.6.3-12.el8 AppStream 129 k
apr-util x86_64 1.6.1-6.el8 AppStream 105 k
httpd-filesystem noarch 2.4.37-43.module_el8.5.0+1022+b541f3b1 AppStream 39 k
httpd-tools x86_64 2.4.37-43.module_el8.5.0+1022+b541f3b1 AppStream 107 k
mod_http2 x86_64 1.15.7-3.module_el8.4.0+778+c970deab AppStream 154 k
Installing weak dependencies:
apr-util-bdb x86_64 1.6.1-6.el8 AppStream 25 k
apr-util-openssl x86_64 1.6.1-6.el8 AppStream 27 k
Enabling module streams:
httpd 2.4
Transaction Summary
==========================================================================================
Install 9 Packages
Total download size: 2.1 M
Installed size: 5.6 M
Is this ok [y/N]: y
Downloading Packages:
(1/9): apr-util-1.6.1-6.el8.x86_64.rpm 430 kB/s | 105 kB 00:00
(2/9): centos-logos-httpd-85.8-2.el8.noarch.rpm 273 kB/s | 75 kB 00:00
(3/9): apr-1.6.3-12.el8.x86_64.rpm 473 kB/s | 129 kB 00:00
(4/9): apr-util-openssl-1.6.1-6.el8.x86_64.rpm 201 kB/s | 27 kB 00:00
(5/9): apr-util-bdb-1.6.1-6.el8.x86_64.rpm 149 kB/s | 25 kB 00:00
(6/9): httpd-filesystem-2.4.37-43.module_el8.5.0+1022+b54 375 kB/s | 39 kB 00:00
(7/9): httpd-2.4.37-43.module_el8.5.0+1022+b541f3b1.x86_6 3.0 MB/s | 1.4 MB 00:00
(8/9): httpd-tools-2.4.37-43.module_el8.5.0+1022+b541f3b1 324 kB/s | 107 kB 00:00
(9/9): mod_http2-1.15.7-3.module_el8.4.0+778+c970deab.x86 629 kB/s | 154 kB 00:00
------------------------------------------------------------------------------------------
Total 2.7 MB/s | 2.1 MB 00:00
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : apr-1.6.3-12.el8.x86_64 1/9
Running scriptlet: apr-1.6.3-12.el8.x86_64 1/9
Installing : apr-util-bdb-1.6.1-6.el8.x86_64 2/9
Installing : apr-util-openssl-1.6.1-6.el8.x86_64 3/9
Installing : apr-util-1.6.1-6.el8.x86_64 4/9
Running scriptlet: apr-util-1.6.1-6.el8.x86_64 4/9
Installing : httpd-tools-2.4.37-43.module_el8.5.0+1022+b541f3b1.x86_64 5/9
Running scriptlet: httpd-filesystem-2.4.37-43.module_el8.5.0+1022+b541f3b1.noarch 6/9
Installing : httpd-filesystem-2.4.37-43.module_el8.5.0+1022+b541f3b1.noarch 6/9
Installing : centos-logos-httpd-85.8-2.el8.noarch 7/9
Installing : mod_http2-1.15.7-3.module_el8.4.0+778+c970deab.x86_64 8/9
Installing : httpd-2.4.37-43.module_el8.5.0+1022+b541f3b1.x86_64 9/9
Running scriptlet: httpd-2.4.37-43.module_el8.5.0+1022+b541f3b1.x86_64 9/9
Verifying : centos-logos-httpd-85.8-2.el8.noarch 1/9
Verifying : apr-1.6.3-12.el8.x86_64 2/9
Verifying : apr-util-1.6.1-6.el8.x86_64 3/9
Verifying : apr-util-bdb-1.6.1-6.el8.x86_64 4/9
Verifying : apr-util-openssl-1.6.1-6.el8.x86_64 5/9
Verifying : httpd-2.4.37-43.module_el8.5.0+1022+b541f3b1.x86_64 6/9
Verifying : httpd-filesystem-2.4.37-43.module_el8.5.0+1022+b541f3b1.noarch 7/9
Verifying : httpd-tools-2.4.37-43.module_el8.5.0+1022+b541f3b1.x86_64 8/9
Verifying : mod_http2-1.15.7-3.module_el8.4.0+778+c970deab.x86_64 9/9
Installed products updated.
Installed:
httpd-2.4.37-43.module_el8.5.0+1022+b541f3b1.x86_64
apr-util-bdb-1.6.1-6.el8.x86_64
apr-util-openssl-1.6.1-6.el8.x86_64
centos-logos-httpd-85.8-2.el8.noarch
apr-1.6.3-12.el8.x86_64
apr-util-1.6.1-6.el8.x86_64
httpd-filesystem-2.4.37-43.module_el8.5.0+1022+b541f3b1.noarch
httpd-tools-2.4.37-43.module_el8.5.0+1022+b541f3b1.x86_64
mod_http2-1.15.7-3.module_el8.4.0+778+c970deab.x86_64
Complete!
查看vim命令属于哪个软件包
[root@RHCSA ~]# yum provides vim
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Repository base is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Repository PowerTools is listed more than once in the configuration
Repository AppStream is listed more than once in the configuration
Repository AppStream is listed more than once in the configuration
Last metadata expiration check: 0:01:52 ago on Sun 10 Apr 2022 11:48:50 AM EDT.
vim-enhanced-2:8.0.1763-13.el8.x86_64 : A version of the VIM editor which includes recent
: enhancements
Repo : @System
Matched from:
Provide : vim = 8.0.1763-13.el8
vim-enhanced-2:8.0.1763-16.el8.x86_64 : A version of the VIM editor which includes recent
: enhancements
Repo : AppStream
Matched from:
Provide : vim = 8.0.1763-16.el8
yum卸载httpd
[root@RHCSA ~]# yum remove httpd
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Repository base is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Repository PowerTools is listed more than once in the configuration
Repository AppStream is listed more than once in the configuration
Repository AppStream is listed more than once in the configuration
Modular dependency problems:
Problem 1: conflicting requests
- nothing provides module(perl:5.26) needed by module perl-DBD-SQLite:1.58:8030020200716174729:3a70019f-0.x86_64
Problem 2: conflicting requests
- nothing provides module(perl:5.26) needed by module perl-DBI:1.641:8030020200716150652:1e4bbb35-0.x86_64
Dependencies resolved.
==========================================================================================
Package Arch Version Repository Size
==========================================================================================
Removing:
httpd x86_64 2.4.37-43.module_el8.5.0+1022+b541f3b1 @AppStream 4.3 M
Removing unused dependencies:
apr x86_64 1.6.3-12.el8 @AppStream 272 k
apr-util x86_64 1.6.1-6.el8 @AppStream 231 k
apr-util-bdb x86_64 1.6.1-6.el8 @AppStream 12 k
apr-util-openssl x86_64 1.6.1-6.el8 @AppStream 20 k
centos-logos-httpd noarch 85.8-2.el8 @base 197 k
httpd-filesystem noarch 2.4.37-43.module_el8.5.0+1022+b541f3b1 @AppStream 400
httpd-tools x86_64 2.4.37-43.module_el8.5.0+1022+b541f3b1 @AppStream 193 k
mod_http2 x86_64 1.15.7-3.module_el8.4.0+778+c970deab @AppStream 394 k
Transaction Summary
==========================================================================================
Remove 9 Packages
Freed space: 5.6 M
Is this ok [y/N]: y
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Running scriptlet: httpd-2.4.37-43.module_el8.5.0+1022+b541f3b1.x86_64 1/1
Running scriptlet: httpd-2.4.37-43.module_el8.5.0+1022+b541f3b1.x86_64 1/9
Erasing : httpd-2.4.37-43.module_el8.5.0+1022+b541f3b1.x86_64 1/9
Running scriptlet: httpd-2.4.37-43.module_el8.5.0+1022+b541f3b1.x86_64 1/9
Erasing : httpd-filesystem-2.4.37-43.module_el8.5.0+1022+b541f3b1.noarch 2/9
Running scriptlet: httpd-filesystem-2.4.37-43.module_el8.5.0+1022+b541f3b1.noarch 2/9
Erasing : centos-logos-httpd-85.8-2.el8.noarch 3/9
Erasing : httpd-tools-2.4.37-43.module_el8.5.0+1022+b541f3b1.x86_64 4/9
Erasing : apr-util-1.6.1-6.el8.x86_64 5/9
Running scriptlet: apr-util-1.6.1-6.el8.x86_64 5/9
Erasing : apr-1.6.3-12.el8.x86_64 6/9
Running scriptlet: apr-1.6.3-12.el8.x86_64 6/9
Erasing : apr-util-bdb-1.6.1-6.el8.x86_64 7/9
Erasing : apr-util-openssl-1.6.1-6.el8.x86_64 8/9
Erasing : mod_http2-1.15.7-3.module_el8.4.0+778+c970deab.x86_64 9/9
Running scriptlet: mod_http2-1.15.7-3.module_el8.4.0+778+c970deab.x86_64 9/9
Verifying : apr-1.6.3-12.el8.x86_64 1/9
Verifying : apr-util-1.6.1-6.el8.x86_64 2/9
Verifying : apr-util-bdb-1.6.1-6.el8.x86_64 3/9
Verifying : apr-util-openssl-1.6.1-6.el8.x86_64 4/9
Verifying : centos-logos-httpd-85.8-2.el8.noarch 5/9
Verifying : httpd-2.4.37-43.module_el8.5.0+1022+b541f3b1.x86_64 6/9
Verifying : httpd-filesystem-2.4.37-43.module_el8.5.0+1022+b541f3b1.noarch 7/9
Verifying : httpd-tools-2.4.37-43.module_el8.5.0+1022+b541f3b1.x86_64 8/9
Verifying : mod_http2-1.15.7-3.module_el8.4.0+778+c970deab.x86_64 9/9
Installed products updated.
Removed:
httpd-2.4.37-43.module_el8.5.0+1022+b541f3b1.x86_64
apr-1.6.3-12.el8.x86_64
apr-util-1.6.1-6.el8.x86_64
apr-util-bdb-1.6.1-6.el8.x86_64
apr-util-openssl-1.6.1-6.el8.x86_64
centos-logos-httpd-85.8-2.el8.noarch
httpd-filesystem-2.4.37-43.module_el8.5.0+1022+b541f3b1.noarch
httpd-tools-2.4.37-43.module_el8.5.0+1022+b541f3b1.x86_64
mod_http2-1.15.7-3.module_el8.4.0+778+c970deab.x86_64
Complete!
清理缓存
[root@RHCSA etc]# yum clean all
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Repository base is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Repository PowerTools is listed more than once in the configuration
Repository AppStream is listed more than once in the configuration
17 files removed
重新创建缓存
[root@RHCSA ~]# yum makecache
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Repository base is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Repository PowerTools is listed more than once in the configuration
Repository AppStream is listed more than once in the configuration
Repository AppStream is listed more than once in the configuration
CentOS-8.5.2111 - Base - mirrors.aliyun.com 781 kB/s | 4.6 MB 00:05
CentOS-8.5.2111 - Extras - mirrors.aliyun.com 22 kB/s | 10 kB 00:00
CentOS-8.5.2111 - AppStream - mirrors.aliyun.com 4.2 MB/s | 8.4 MB 00:02
BaseOS 227 MB/s | 2.2 MB 00:00
Last metadata expiration check: 0:00:01 ago on Sun 10 Apr 2022 11:54:06 AM EDT.
Metadata cache created.
3.源码安装
源码安装libevent
root@RHCSA yum.repos.d]# cd memcahed-1.6.12.tar.gz
-bash: cd: memcahed-1.6.12.tar.gz: No such file or directory
[root@RHCSA yum.repos.d]# cd /usr/local/memcached/memcached-1.6.12/
[root@RHCSA memcached-1.6.12]# ./configure
4.查看root用户带有终端的进程
[root@RHCSA ~]# ps -ux
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.3 245264 14440 ? Ss Apr09 0:09 /usr/lib/systemd/systemd
root 2 0.0 0.0 0 0 ? S Apr09 0:00 [kthreadd]
root 3 0.0 0.0 0 0 ? I< Apr09 0:00 [rcu_gp]
root 4 0.0 0.0 0 0 ? I< Apr09 0:00 [rcu_par_gp]
root 6 0.0 0.0 0 0 ? I< Apr09 0:00 [kworker/0:0H-xfs-log/dm
root 8 0.0 0.0 0 0 ? I< Apr09 0:00 [mm_percpu_wq]
显示没有终端的进程
[root@RHCSA ~]# ps -x
PID TTY STAT TIME COMMAND
1 ? Ss 0:09 /usr/lib/systemd/systemd --switched-root --system --deserializ
2 ? S 0:00 [kthreadd]
3 ? I< 0:00 [rcu_gp]
4 ? I< 0:00 [rcu_par_gp]
6 ? I< 0:00 [kworker/0:0H-xfs-log/dm-0]
8 ? I< 0:00 [mm_percpu_wq]
9 ? S 0:00 [ksoftirqd/0]
显示所有进程
[root@RHCSA ~]# ps -a
PID TTY TIME CMD
1542 tty1 00:00:00 gnome-session-b
1615 tty1 00:00:52 gnome-shell
2017 tty1 00:00:01 Xwayland
2297 tty1 00:00:00 ibus-daemon
2300 tty1 00:00:00 ibus-dconf
2302 tty1 00:00:00 ibus-x11
2412 tty1 00:00:00 gsd-xsettings
ps -aux和ps aux的区别
答:不同系统的命令
5.使用fdisk命令对当前的磁盘进行分区
fdisk /dev/sdb
在vmware上新增一块磁盘2GB,使用gdisk对磁盘进行分区,分区大小800M
fdisk /dev/sdb
n
+2G
使用刚才新增的磁盘,使用parted命令增加一个分区500M
parted /dev/sdb
ext4
500m
对上面的800M的分区,进行格式化xfs
使用mount命令创建目录/data,将800分区挂载到/data目录
取消/data的挂载
umount /data
将800M分区永久挂载到/data目录