1、配置yum仓库
1.cd到/etc/yum.repos.d/
[root@localhost /]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# ll
total 4
drwxr-xr-x. 2 root root 6 Apr 25 22:18 bak
-rw-r--r--. 1 root root 358 Apr 25 22:28 redhat.repo
2.把光盘挂载到/mnt目录下
[rootaxjf yum.repos.d]# mount /dev/sr0 /mnt
mount:/mnt: WARNING: source write-protected, mounted read-only.
[rootaxjf yum.repos.d]# cd /
[root@xjf /]# ll
total 30
dr-xr-xr-x. 2 root root 6 Aug 10 2021 afs l
rwxrwxrwx. l root root 7 Aug 10 2021 bin -> usr/bin
dr-xr-xr-x. 5 root root 4096 Mar 30 16:40 boot
drwxr-xr-x. 20 root root 3400 Apr 2 09:34 dev
drwxr-xr-x. 133 root root 8192 Apr 2 09:33 etc
drwxr-xr-x. 3 root root 20 Mar 30 16:41 homel
rwxrwxrwx. 1 root root 7 Aug 10 2021 lib -> usr/lib l
rwxrwxrwx. 1 root root 9 Aug 10 2021 lib64 -> usr/lib64
drwxr-xr-x. 2 root root 6 Aug 10 2021 media
dr-xr-xr-x. 1 root root 2048 0ct 27 16:34 mnt
drwxr-xr-x. 3 root root 17 Apr 2 09:36 opt
dr-xr-xr-x. 342 root root 0 Apr 2 09:33 proc
dr-xr-x---. 13 root root 4096 Apr 22 12:10 root
drwxr-xr-x. 44 root root 1140 Apr 22 12:05 runl
rwxrwxrwx. 1 root root 8 Aug 10 2021 sbin -> usr/sbin
drwxr-xr-x. 2 root root 6 Aug 10 2021 srv
dr-xr-xr-x. 13 root root 0 Apr 2 09:33 sys
drwxrwxrwt. 20 root root 4096 Apr 22 12:06 tmp
drwxr-xr-x. 12 root root 144 Mar 30 16:33 usr
drwxr-xr-x. 20 root root 4096 Mar 30 16:40 var
3.创建本地yum仓库
[root@localhost yum.repos.d]# cat redhat.repo
#
# Certificate-Based Repositories
# Managed by (rhsm) subscription-manager
#
# *** This file is auto-generated. Changes made here will be over-written. ***
# *** Use "subscription-manager repo-override --help" if you wish to make changes. ***
#
# If this file is empty and this system is subscribed consider
# a "yum repolist" to refresh available repos
#
[root@localhost yum.repos.d]# vim local.repo
[root@localhost yum.repos.d]# cat local.repo
[root@localhost yum.repos.d]# cat local.repo
[root@localhost yum.repos.d]# vim local.repo
[root@localhost yum.repos.d]# cat local.repo
name=AppStream
enabled=1
gpgcheck=0
[Base0s]
baseurl=file:///mnt/Base0s
enabled=1
gpgcheck=0
4.创建自己新的文件
[root@localhost yum.repos.d]# mkdir myfile
2、安装httpd软件包
1.安装,并确认
root@xjf /]# cd myfile
“root@xjf myfile]# yum install httpd -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.
AppStream 90 MB/s | 6.1 MB 00:00
BaseOs 88 MB/s | 1.7 MB 00:00
Dependencies resolved.
=========================================================================================
Package Architecture Version Repository Size
=========================================================================================
Installing:
httpd x86_64 2.4.53-7.el9 AppStream 54 k
Installing dependencies:
apr x86 64 1.7.0-11.el9 AppStream 127 k
apr-util x86 64 1.6.1-20.el9 AppStream 98 k
apr-util-bdb x86 64 1.6.1-20.el9 AppStream 15 k
httpd-core x86 64 2.4.53-7.el9 AppStream 1.5 M
httpd-filesystem noarch 2.4.53-7.el9 AppStream 18 k
httpd-tools x86 64 2.4.53-7.el9 AppStream 89 k
redhat-logos-httpd noarch 90.4-1.el9 AppStream 18 k
Installing weak dependencies:
apr-util-openssl x86 64 1.6.1-20.el9 AppStream 17 k
mod http2 x86 64 1.15.19-2.el9 AppStream 53 k
mod lua x86 64 2.4.53-7.el9 AppStream 64 k
Transaction Summary
=========================================================================================
Install 11 Packages
3、创建一个3G大小的分区并格式化
1.查看磁盘分区--lsblk
[root@localhost myfile]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sr0 11:0 1 1024M 0 rom
nvme0n1 259:0 0 20G 0 disk
├─nvme0n1p1 259:1 0 1G 0 part /boot
└─nvme0n1p2 259:2 0 19G 0 part
└─luks-a2a49284-c87e-40cb-a54a-416897b32c98
253:0 0 19G 0 crypt
├─rhel-root 253:1 0 17G 0 lvm /
└─rhel-swap 253:2 0 2G 0 lvm [SWAP]
[root@localhost myfile]# fdisk /dev/sr0
2.添加磁盘--3g --fdisk
Command (m for help): n
Partition type
p primary (0 primary, 0 extended, 4 free)
e extended (container for logical partitions)
Select (default p): p
Partition number (1-4, default 1):
First sector (2048-41943039, default 2048):
Last sector. +/-sectors or +/-size{K.M.G.T.P}(2048-41943039. default 41943039): +3G
Created a new partition 1 of type 'Linux’ and of size 3 GiB.
Command (m for help): p
Disk /dev/sda: 20 GiB, 21474836480 bytes, 41943040 sectors
Disk model: VMware Virtual S
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/0 size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xef623a81
Device Boot Start End Sectors Size Id Type
/dev/sdal 2048 6293503 6291456 3G 83 Linux
3.格式化--mkfs指令