配置软件仓库
一 挂载系统镜像文件
1 下载RHEL8
2 使用虚拟机加载
二 挂载到目录
1 创建挂载目录 mkdir -p /media/cdrom
[root@linuxprobe ~]# mkdir -p /media/cdrom
2 编辑挂载配置文件 vim /etc/fstab
[root@linuxprobe ~]# vim /etc/fstab
在最后一行添加挂载信息 /dev/cdrom /media/cdrom iso9660 defaults 0 0
#
# /etc/fstab
# Created by anaconda on Tue Jun 8 06:02:20 2021
#
# Accessible filesystems, by reference, are maintained under '/dev/disk/'.
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info.
#
# After editing this file, run 'systemctl daemon-reload' to update systemd
# units generated from this file.
#
/dev/mapper/rhel-root / xfs defaults 0 0
UUID=2c1949d3-5cd8-4b71-b60d-8885bfc326e0 /boot xfs defaults 0 0
/dev/mapper/rhel-swap swap swap defaults 0 0
/dev/cdrom /media/cdrom iso9660 defaults 0 0
~
3 挂载 mount -a
[root@linuxprobe ~]# mount -a
三 编辑软件仓库配置文件 vim /etc/yum.repos.d/tom.repo
[root@linuxprobe ~]# vim /etc/yum.repos.d/tom.repo
[BaseOS] \\仓库名称
baseurl = file:///media/rhel8/BaseOS \\软件包源
enabled = true \\是否启用
gpgcheck = false \\是否pgp检验
name = BaseOS \\描述
[AppStream]
baseurl = file:///media/rhel8/AppStream
enabled = true
gpgcheck = false
name = AppStream
[EPEL]
baseurl = https://dl.fedoraproject.org/pub/epel/8/Everything/x86_64/
enabled = true
gpgcheck = false
name = EPEL
四 测试
查看软件包数量 dnf list|wc -l
[root@linuxprobe ~]# dnf list|wc -l
6331
安装httpd dnf install httpd
[root@linuxprobe ~]# dnf 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.
haha 2.7 MB/s | 2.7 kB 00:00
Dependencies resolved.
============================================================================================================================================
Package Arch Version Repository Size
============================================================================================================================================
Installing:
httpd x86_64 2.4.37-10.module+el8+2764+7127e69e hoho 1.4 M
Installing dependencies:
redhat-logos-httpd noarch 80.7-1.el8 haha 25 k
apr x86_64 1.6.3-9.el8 hoho 125 k
apr-util x86_64 1.6.1-6.el8 hoho 105 k
httpd-filesystem noarch 2.4.37-10.module+el8+2764+7127e69e hoho 34 k
httpd-tools x86_64 2.4.37-10.module+el8+2764+7127e69e hoho 101 k
mod_http2 x86_64 1.11.3-1.module+el8+2443+605475b7 hoho 156 k
Installing weak dependencies:
apr-util-bdb x86_64 1.6.1-6.el8 hoho 25 k
apr-util-openssl x86_64 1.6.1-6.el8 hoho 27 k
Enabling module streams:
httpd 2.4
Transaction Summary
============================================================================================================================================
Install 9 Packages
Total size: 2.0 M
Installed size: 5.4 M
Is this ok [y/N]: y
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : apr-1.6.3-9.el8.x86_64 1/9
Running scriptlet: apr-1.6.3-9.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-10.module+el8+2764+7127e69e.x86_64 5/9
Running scriptlet: httpd-filesystem-2.4.37-10.module+el8+2764+7127e69e.noarch 6/9
Installing : httpd-filesystem-2.4.37-10.module+el8+2764+7127e69e.noarch 6/9
Installing : redhat-logos-httpd-80.7-1.el8.noarch 7/9
Installing : mod_http2-1.11.3-1.module+el8+2443+605475b7.x86_64 8/9
Installing : httpd-2.4.37-10.module+el8+2764+7127e69e.x86_64 9/9
Running scriptlet: httpd-2.4.37-10.module+el8+2764+7127e69e.x86_64 9/9
Verifying : redhat-logos-httpd-80.7-1.el8.noarch 1/9
Verifying : apr-1.6.3-9.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-10.module+el8+2764+7127e69e.x86_64 6/9
Verifying : httpd-filesystem-2.4.37-10.module+el8+2764+7127e69e.noarch 7/9
Verifying : httpd-tools-2.4.37-10.module+el8+2764+7127e69e.x86_64 8/9
Verifying : mod_http2-1.11.3-1.module+el8+2443+605475b7.x86_64 9/9
Installed products updated.
Installed:
httpd-2.4.37-10.module+el8+2764+7127e69e.x86_64 apr-util-bdb-1.6.1-6.el8.x86_64
apr-util-openssl-1.6.1-6.el8.x86_64 redhat-logos-httpd-80.7-1.el8.noarch
apr-1.6.3-9.el8.x86_64 apr-util-1.6.1-6.el8.x86_64
httpd-filesystem-2.4.37-10.module+el8+2764+7127e69e.noarch httpd-tools-2.4.37-10.module+el8+2764+7127e69e.x86_64
mod_http2-1.11.3-1.module+el8+2443+605475b7.x86_64
Complete!
测试成功,大功告成!