目录
一、思维导图
二、RPM软件管理
1、通过rpm安装vsftpd软件
2、查询vsftpd软件包的信息
3、卸载软件包vsftpd
三、YUM软件管理
1、挂载本地光盘,配置yum源为rhel8.repo
2、通过yum来安装httpd
3、使用yum查询ifconfig命令是由那个软件包提供的
4、卸载软件包httpd
四、源码管理
下载tree源码包并编译安装
五、进程管理
1、通过ps命令的两种选项形式查看进程信息
2、通过pgrep和pidof命令查看sshd服务的进程号
3、使dd if=/dev/zero of=/root/file bs=1M count=8190 命令操作在前台运行
4、将上题操作调入到后台并暂停
5、使dd if=/dev/zero of=/root/file2 bs=1M count=1024 命令操作在后台运行
6、查看后台的任务列表
7、恢复dd if=/dev/zero of=/root/file bs=1M count=8190 让其在后台继续运行
8、查询dd if=/dev/zero of=/root/file bs=1M count=8190 命令的进程并通过kill杀死
[root@localhost AppStream]# rpm -ivh Packages/vsftpd-3.0.3-34.el8.x86_64.rpm
warning: Packages/vsftpd-3.0.3-34.el8.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Verifying... ################################# [100%]
Preparing... ################################# [100%]
Updating / installing...
1:vsftpd-3.0.3-34.el8 ################################# [100%]
[root@localhost ~]# rpm -qi vsftpd
Name : vsftpd
Version : 3.0.3
Release : 34.el8
Architecture: x86_64
Install Date: Sat 05 Nov 2022 09:44:46 PM CST
Group : System Environment/Daemons
Size : 355692
License : GPLv2 with exceptions
Signature : RSA/SHA256, Wed 21 Apr 2021 08:42:12 PM CST, Key ID 199e2f91fd431d51
Source RPM : vsftpd-3.0.3-34.el8.src.rpm
Build Date : Tue 20 Apr 2021 10:28:24 PM CST
Build Host : x86-vm-15.build.eng.bos.redhat.com
Relocations : (not relocatable)
Packager : Red Hat, Inc.
Vendor : Red Hat, Inc.
URL : https://security.appspot.com/vsftpd.html
Summary : Very Secure Ftp Daemon
Description :
vsftpd is a Very Secure FTP daemon. It was written completely from
scratch.
[root@localhost AppStream]# rpm -e vsftpd
[root@localhost ~]# mkdir /test/cdrom
[root@localhost ~]# mount /dev/sr0 /test/cdrom
mount: /test/cdrom: WARNING: device write-protected, mounted read-only.
[root@localhost cdrom]# cat /etc/yum.repos.d/rhel8.repo
name=RHEL8-BaseOS
baseurl=file:///media/cdrom/BaseOS
gpgcheck=0
#gpgcheck=1 #如果gpgcheck为1,需要写秘钥文件路径
#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial
[RHEL8-Appstream]
name=RHEL8-Appstream
baseurl=file:///media/cdrom/AppStream
gpgcheck=0
#gpgcheck=1
#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial
[root@localhost cdrom]# yum install bind -y
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered with an entitlement server. You can use subscription-manager to register.
Warning: failed loading '/etc/yum.repos.d/rhel8.repo', skipping.
Last metadata expiration check: 0:27:44 ago on Sat 05 Nov 2022 09:35:22 PM CST.
Dependencies resolved.
==============================================================================================================================
Package Architecture Version Repository Size
==============================================================================================================================
Installing:
bind x86_64 32:9.11.26-6.el8 Appstream 2.1 M
Transaction Summary
==============================================================================================================================
Install 1 Package
Total size: 2.1 M
Installed size: 4.5 M
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Running scriptlet: bind-32:9.11.26-6.el8.x86_64 1/1
Installing : bind-32:9.11.26-6.el8.x86_64 1/1
Running scriptlet: bind-32:9.11.26-6.el8.x86_64 1/1
Verifying : bind-32:9.11.26-6.el8.x86_64 1/1
Installed products updated.
Installed:
bind-32:9.11.26-6.el8.x86_64
Complete!
[root@localhost ~]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# ll
total 12
-rw-r--r--. 1 root root 146 Oct 24 18:36 base.repo
-rw-r--r--. 1 root root 358 Oct 22 21:30 redhat.repo
-rw-r--r--. 1 root root 342 Oct 31 18:35 rhel8.repo
[root@localhost yum.repos.d]# yum -y install httpd
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered with an entitlement server. You can use subscription-manager to register.
Warning: failed loading '/etc/yum.repos.d/rhel8.repo', skipping.
AppStream 8.9 MB/s | 8.4 MB 00:00
BaseOS 7.2 MB/s | 4.6 MB 00:00
Last metadata expiration check: 0:00:02 ago on Sat 05 Nov 2022 10:14:22 PM CST.
Package httpd-2.4.37-41.module+el8.5.0+11772+c8e0c271.x86_64 is already installed.
Dependencies resolved.
==============================================================================================================================
Package Architecture Version Repository Size
==============================================================================================================================
Upgrading:
httpd x86_64 2.4.37-43.module_el8.5.0+1022+b541f3b1 aliyun-AppStream 1.4 M
httpd-filesystem noarch 2.4.37-43.module_el8.5.0+1022+b541f3b1 aliyun-AppStream 39 k
httpd-tools x86_64 2.4.37-43.module_el8.5.0+1022+b541f3b1 aliyun-AppStream 107 k
Transaction Summary
==============================================================================================================================
Upgrade 3 Packages
Total download size: 1.5 M
Downloading Packages:
(1/3): httpd-tools-2.4.37-43.module_el8.5.0+1022+b541f3b1.x86_64.rpm 654 kB/s | 107 kB 00:00
(2/3): httpd-filesystem-2.4.37-43.module_el8.5.0+1022+b541f3b1.noarch.rpm 194 kB/s | 39 kB 00:00
(3/3): httpd-2.4.37-43.module_el8.5.0+1022+b541f3b1.x86_64.rpm 5.4 MB/s | 1.4 MB 00:00
------------------------------------------------------------------------------------------------------------------------------
Total 5.8 MB/s | 1.5 MB 00:00
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Running scriptlet: httpd-tools-2.4.37-43.module_el8.5.0+1022+b541f3b1.x86_64 1/1
Upgrading : httpd-tools-2.4.37-43.module_el8.5.0+1022+b541f3b1.x86_64 1/6
Running scriptlet: httpd-filesystem-2.4.37-43.module_el8.5.0+1022+b541f3b1.noarch 2/6
Upgrading : httpd-filesystem-2.4.37-43.module_el8.5.0+1022+b541f3b1.noarch 2/6
Upgrading : httpd-2.4.37-43.module_el8.5.0+1022+b541f3b1.x86_64 3/6
Running scriptlet: httpd-2.4.37-43.module_el8.5.0+1022+b541f3b1.x86_64 3/6
Running scriptlet: httpd-2.4.37-41.module+el8.5.0+11772+c8e0c271.x86_64 4/6
Cleanup : httpd-2.4.37-41.module+el8.5.0+11772+c8e0c271.x86_64 4/6
Running scriptlet: httpd-2.4.37-41.module+el8.5.0+11772+c8e0c271.x86_64 4/6
Cleanup : httpd-filesystem-2.4.37-41.module+el8.5.0+11772+c8e0c271.noarch 5/6
Cleanup : httpd-tools-2.4.37-41.module+el8.5.0+11772+c8e0c271.x86_64 6/6
Running scriptlet: httpd-2.4.37-43.module_el8.5.0+1022+b541f3b1.x86_64 6/6
Running scriptlet: httpd-tools-2.4.37-41.module+el8.5.0+11772+c8e0c271.x86_64 6/6
Verifying : httpd-2.4.37-43.module_el8.5.0+1022+b541f3b1.x86_64 1/6
Verifying : httpd-2.4.37-41.module+el8.5.0+11772+c8e0c271.x86_64 2/6
Verifying : httpd-filesystem-2.4.37-43.module_el8.5.0+1022+b541f3b1.noarch 3/6
Verifying : httpd-filesystem-2.4.37-41.module+el8.5.0+11772+c8e0c271.noarch 4/6
Verifying : httpd-tools-2.4.37-43.module_el8.5.0+1022+b541f3b1.x86_64 5/6
Verifying : httpd-tools-2.4.37-41.module+el8.5.0+11772+c8e0c271.x86_64 6/6
Installed products updated.
Upgraded:
httpd-2.4.37-43.module_el8.5.0+1022+b541f3b1.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
Complete!
[root@localhost ~]# yum whatprovides ifconfig
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered with an entitlement server. You can use subscription-manager to register.
Warning: failed loading '/etc/yum.repos.d/rhel8.repo', skipping.
Last metadata expiration check: 0:02:42 ago on Sat 05 Nov 2022 10:14:22 PM CST.
net-tools-2.0-0.52.20160912git.el8.x86_64 : Basic networking tools
Repo : @System
Matched from:
Filename : /usr/sbin/ifconfig
net-tools-2.0-0.52.20160912git.el8.x86_64 : Basic networking tools
Repo : aliyun-BaseOS
Matched from:
Filename : /usr/sbin/ifconfig
net-tools-2.0-0.52.20160912git.el8.x86_64 : Basic networking tools
Repo : BaseOS
Matched from:
Filename : /usr/sbin/ifconfig
[root@localhost ~]# yum remove -y httpd
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered with an entitlement server. You can use subscription-manager to register.
Warning: failed loading '/etc/yum.repos.d/rhel8.repo', skipping.
Dependencies resolved.
==============================================================================================================================
Package Architecture Version Repository Size
==============================================================================================================================
Removing:
httpd x86_64 2.4.37-43.module_el8.5.0+1022+b541f3b1 @aliyun-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 230 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
httpd-filesystem noarch 2.4.37-43.module_el8.5.0+1022+b541f3b1 @aliyun-AppStream 400
httpd-tools x86_64 2.4.37-43.module_el8.5.0+1022+b541f3b1 @aliyun-AppStream 193 k
mod_http2 x86_64 1.15.7-3.module+el8.4.0+8625+d397f3da @Appstream 394 k
redhat-logos-httpd noarch 84.5-1.el8 @BaseOS 8.2 k
Transaction Summary
==============================================================================================================================
Remove 9 Packages
Freed space: 5.4 M
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 : redhat-logos-httpd-84.5-1.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+8625+d397f3da.x86_64 9/9
Running scriptlet: mod_http2-1.15.7-3.module+el8.4.0+8625+d397f3da.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 : httpd-2.4.37-43.module_el8.5.0+1022+b541f3b1.x86_64 5/9
Verifying : httpd-filesystem-2.4.37-43.module_el8.5.0+1022+b541f3b1.noarch 6/9
Verifying : httpd-tools-2.4.37-43.module_el8.5.0+1022+b541f3b1.x86_64 7/9
Verifying : mod_http2-1.15.7-3.module+el8.4.0+8625+d397f3da.x86_64 8/9
Verifying : redhat-logos-httpd-84.5-1.el8.noarch 9/9
Installed products updated.
Removed:
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
httpd-2.4.37-43.module_el8.5.0+1022+b541f3b1.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+8625+d397f3da.x86_64
redhat-logos-httpd-84.5-1.el8.noarch
Complete!
[root@localhost ~]# ps -a
PID TTY TIME CMD
2207 tty2 00:00:00 Xorg
2241 tty2 00:00:00 gnome-session-b
2333 tty2 00:00:08 gnome-shell
2348 tty2 00:00:00 ibus-daemon
2352 tty2 00:00:00 ibus-dconf
2353 tty2 00:00:02 ibus-extension-
2358 tty2 00:00:00 ibus-x11
2435 tty2 00:00:00 gsd-power
2436 tty2 00:00:00 gsd-print-notif
2439 tty2 00:00:00 gsd-rfkill
2441 tty2 00:00:00 gsd-screensaver
2444 tty2 00:00:00 gsd-sharing
2449 tty2 00:00:00 gsd-sound
2451 tty2 00:00:00 gsd-xsettings
2460 tty2 00:00:00 gsd-wacom
2463 tty2 00:00:00 gsd-smartcard
2464 tty2 00:00:00 gsd-account
2472 tty2 00:00:00 gsd-subman
2479 tty2 00:00:00 gsd-a11y-settin
2483 tty2 00:00:00 gsd-clipboard
2493 tty2 00:00:00 gsd-color
2495 tty2 00:00:00 gsd-datetime
2496 tty2 00:00:00 gsd-housekeepin
2500 tty2 00:00:00 gsd-keyboard
2504 tty2 00:00:00 gsd-media-keys
2509 tty2 00:00:00 gsd-mouse
2570 tty2 00:00:00 ibus-engine-sim
2588 tty2 00:00:06 vmtoolsd
2589 tty2 00:00:00 gsd-disk-utilit
2597 tty2 00:00:00 gsd-printer
2600 tty2 00:00:01 gnome-software
2612 tty2 00:00:00 tracker-miner-a
2616 tty2 00:00:00 tracker-miner-f
2829 pts/0 00:00:00 dbus-launch
6019 pts/0 00:00:00 ps
[root@localhost ~]# ps -u
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 2205 0.0 0.4 235084 8392 tty2 Ssl+ 20:38 0:00 /usr/libexec/gdm-x-session --register-session --run-script
root 2207 0.0 3.7 445864 68072 tty2 Sl+ 20:38 0:00 /usr/libexec/Xorg vt2 -displayfd 3 -auth /run/user/0/gdm/Xa
root 2241 0.0 1.0 732564 18612 tty2 Sl+ 20:38 0:00 /usr/libexec/gnome-session-binary --session gnome-classic
root 2333 0.1 9.1 2623888 167800 tty2 Sl+ 20:38 0:08 /usr/bin/gnome-shell
root 2348 0.0 0.6 391212 12760 tty2 Sl 20:38 0:00 ibus-daemon --xim --panel disable
root 2352 0.0 0.4 302916 8124 tty2 Sl 20:38 0:00 /usr/libexec/ibus-dconf
root 2353 0.0 1.5 456904 28956 tty2 Sl 20:38 0:02 /usr/libexec/ibus-extension-gtk3
root 2358 0.0 1.3 373912 24144 tty2 Sl 20:38 0:00 /usr/libexec/ibus-x11 --kill-daemon
root 2435 0.0 1.3 623904 25500 tty2 Sl+ 20:39 0:00 /usr/libexec/gsd-power
root 2436 0.0 0.6 364780 11996 tty2 Sl+ 20:39 0:00 /usr/libexec/gsd-print-notifications
root 2439 0.0 0.5 451584 9888 tty2 Sl+ 20:39 0:00 /usr/libexec/gsd-rfkill
root 2441 0.0 0.3 299368 7204 tty2 Sl+ 20:39 0:00 /usr/libexec/gsd-screensaver-proxy
root 2444 0.0 0.4 455512 8872 tty2 Sl+ 20:39 0:00 /usr/libexec/gsd-sharing
root 2449 0.0 0.6 367316 12560 tty2 Sl+ 20:39 0:00 /usr/libexec/gsd-sound
root 2451 0.0 1.3 524252 25068 tty2 Sl+ 20:39 0:00 /usr/libexec/gsd-xsettings
root 2460 0.0 1.3 454300 23940 tty2 Sl+ 20:39 0:00 /usr/libexec/gsd-wacom
root 2463 0.0 0.6 474620 12188 tty2 Sl+ 20:39 0:00 /usr/libexec/gsd-smartcard
root 2464 0.0 0.4 382120 8696 tty2 Sl+ 20:39 0:00 /usr/libexec/gsd-account
root 2472 0.0 1.3 451572 23912 tty2 Sl+ 20:39 0:00 /usr/libexec/gsd-subman
root 2479 0.0 0.4 301624 8220 tty2 Sl+ 20:39 0:00 /usr/libexec/gsd-a11y-settings
root 2483 0.0 1.2 373476 23300 tty2 Sl+ 20:39 0:00 /usr/libexec/gsd-clipboard
root 2493 0.0 1.3 686992 25340 tty2 Sl+ 20:39 0:00 /usr/libexec/gsd-color
root 2495 0.0 0.8 460020 15564 tty2 Sl+ 20:39 0:00 /usr/libexec/gsd-datetime
root 2496 0.0 0.5 388700 9208 tty2 Sl+ 20:39 0:00 /usr/libexec/gsd-housekeeping
root 2500 0.0 1.4 523228 25704 tty2 Sl+ 20:39 0:00 /usr/libexec/gsd-keyboard
root 2504 0.0 1.5 1122720 27808 tty2 Sl+ 20:39 0:00 /usr/libexec/gsd-media-keys
root 2509 0.0 0.5 301760 10344 tty2 Sl+ 20:39 0:00 /usr/libexec/gsd-mouse
root 2570 0.0 0.4 229112 7956 tty2 Sl 20:39 0:00 /usr/libexec/ibus-engine-simple
root 2588 0.0 2.0 536464 38032 tty2 Sl+ 20:39 0:06 /usr/bin/vmtoolsd -n vmusr
root 2589 0.0 0.4 301352 8888 tty2 Sl+ 20:39 0:00 /usr/libexec/gsd-disk-utility-notify
root 2597 0.0 0.8 517768 14756 tty2 Sl+ 20:39 0:00 /usr/libexec/gsd-printer
root 2600 0.0 3.8 1020552 70048 tty2 Sl+ 20:39 0:01 /usr/bin/gnome-software --gapplication-service
root 2612 0.0 1.4 622896 25740 tty2 SNl+ 20:39 0:00 /usr/libexec/tracker-miner-apps
root 2616 0.0 1.4 640728 25956 tty2 SNl+ 20:39 0:00 /usr/libexec/tracker-miner-fs
root 2779 0.0 0.3 31272 5896 pts/0 Ss 20:39 0:00 -bash
root 2829 0.0 0.0 62976 0 pts/0 S 20:39 0:00 dbus-launch --sh-syntax --exit-with-x11
root 6020 0.0 0.2 58736 3908 pts/0 R+ 22:30 0:00 ps -u
[root@localhost ~]# pgrep sshd
1091
2755
2772
2774
2778
[root@localhost ~]# pidof sshd
2778 2774 2772 2755 1091
[root@localhost ~]# dd if=/dev/zero of=/root/file bs=1M count=8190
8190+0 records in
8190+0 records out
8587837440 bytes (8.6 GB, 8.0 GiB) copied, 16.1021 s, 533 MB/s
[root@localhost ~]# dd if=/dev/zero of=/root/file bs=1M count=8190
^z
[1]+ Stopped dd if=/dev/zero of=/root/file bs=1M count=8190
[root@localhost ~]# dd if=/dev/zero of=/root/file2 bs=1M count=1024 &
[2] 6258
[root@localhost ~]# 1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 1.6768 s, 640 MB/s
jobs -l
[1]+ 6179 Stopped dd if=/dev/zero of=/root/file bs=1M count=8190
[2]- 6258 Done dd if=/dev/zero of=/root/file2 bs=1M count=1024
[root@localhost ~]# bg %1
[1]+ dd if=/dev/zero of=/root/file bs=1M count=8190 &
[root@localhost ~]# dd if=/dev/zero of=/root/file bs=1M count=8190 &
[1] 6417
[root@localhost ~]# kill %1