一、CentOS 7.9 配置Yum 本地源Everything
1 设置系统光盘开机自动挂载
增加内容
/dev/cdrom /mnt iso9660 defaults 0 0
vi /etc/fstab
#
# /etc/fstab
# Created by anaconda on Thu Oct 20 03:29:12 2022
#
# 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
#
/dev/mapper/centos-root / xfs defaults 0 0
UUID=823a0431-42ac-49ee-864b-b06d5979faba /boot xfs defaults 0 0
/dev/mapper/centos-swap swap swap defaults 0 0
/dev/cdrom /mnt iso9660 defaults 0 0
2 执行挂载命令
[root@localhost ~]# mount -a
mount: /dev/sr0 is write-protected, mounting read-only
[root@localhost ~]# df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 1.3G 0 1.3G 0% /dev
tmpfs 1.3G 0 1.3G 0% /dev/shm
tmpfs 1.3G 9.5M 1.3G 1% /run
tmpfs 1.3G 0 1.3G 0% /sys/fs/cgroup
/dev/mapper/centos-root 98G 1.3G 97G 2% /
/dev/sda1 497M 131M 367M 27% /boot
tmpfs 263M 0 263M 0% /run/user/0
/dev/sr0 9.5G 9.5G 0 100% /mnt
3 此目录下有内容,说明挂载成功
[root@localhost ~]# ls /mnt/
CentOS_BuildTag EULA images LiveOS repodata RPM-GPG-KEY-CentOS-Testing-7
EFI GPL isolinux Packages RPM-GPG-KEY-CentOS-7 TRANS.TBL
4 配置本地Yum源
# 备份已有Yum源
mkdir /etc/yum.repos.d.bak
cp /etc/yum.repos.d/* /etc/yum.repos.d.bak/
rm -rf /etc/yum.repos.d/*
# 新建自己的本地Yum原
vim /etc/yum.repos.d/CentOS-xyz.repo
[CentOS-XYZ] # Yum的ID,必须唯一
name=CentOS7.9-Yum # 描述信息
baseurl=file:///mnt # /mnt 表示光盘的挂载点
enabled=1 # 启用
gpgcheck=0 # 取消验证,不用校验
5 测试
[root@localhost yum.repos.d]# yum install httpd
Loaded plugins: fastestmirror
Determining fastest mirrors
CentOS-XYZ | 3.6 kB 00:00:00
(1/2): CentOS-XYZ/group_gz | 153 kB 00:00:00
(2/2): CentOS-XYZ/primary_db | 6.1 MB 00:00:00
Resolving Dependencies
--> Running transaction check
---> Package httpd.x86_64 0:2.4.6-95.el7.centos will be installed
--> Processing Dependency: httpd-tools = 2.4.6-95.el7.centos for package: httpd-2.4.6-95.el7.centos.x86_64
--> Processing Dependency: /etc/mime.types for package: httpd-2.4.6-95.el7.centos.x86_64
--> Processing Dependency: libaprutil-1.so.0()(64bit) for package: httpd-2.4.6-95.el7.centos.x86_64
--> Processing Dependency: libapr-1.so.0()(64bit) for package: httpd-2.4.6-95.el7.centos.x86_64
--> Running transaction check
---> Package apr.x86_64 0:1.4.8-7.el7 will be installed
---> Package apr-util.x86_64 0:1.5.2-6.el7 will be installed
---> Package httpd-tools.x86_64 0:2.4.6-95.el7.centos will be installed
---> Package mailcap.noarch 0:2.1.41-2.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=====================================================================================================
Package Arch Version Repository Size
=====================================================================================================
Installing:
httpd x86_64 2.4.6-95.el7.centos CentOS-XYZ 2.7 M
Installing for dependencies:
apr x86_64 1.4.8-7.el7 CentOS-XYZ 104 k
apr-util x86_64 1.5.2-6.el7 CentOS-XYZ 92 k
httpd-tools x86_64 2.4.6-95.el7.centos CentOS-XYZ 93 k
mailcap noarch 2.1.41-2.el7 CentOS-XYZ 31 k
Transaction Summary
=====================================================================================================
Install 1 Package (+4 Dependent packages)
Total download size: 3.0 M
Installed size: 10 M
Is this ok [y/d/N]: y
Downloading packages:
-----------------------------------------------------------------------------------------------------
Total 50 MB/s | 3.0 MB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : apr-1.4.8-7.el7.x86_64 1/5
Installing : apr-util-1.5.2-6.el7.x86_64 2/5
Installing : httpd-tools-2.4.6-95.el7.centos.x86_64 3/5
Installing : mailcap-2.1.41-2.el7.noarch 4/5
Installing : httpd-2.4.6-95.el7.centos.x86_64 5/5
Verifying : httpd-tools-2.4.6-95.el7.centos.x86_64 1/5
Verifying : mailcap-2.1.41-2.el7.noarch 2/5
Verifying : apr-1.4.8-7.el7.x86_64 3/5
Verifying : httpd-2.4.6-95.el7.centos.x86_64 4/5
Verifying : apr-util-1.5.2-6.el7.x86_64 5/5
Installed:
httpd.x86_64 0:2.4.6-95.el7.centos
Dependency Installed:
apr.x86_64 0:1.4.8-7.el7 apr-util.x86_64 0:1.5.2-6.el7
httpd-tools.x86_64 0:2.4.6-95.el7.centos mailcap.noarch 0:2.1.41-2.el7
Complete!
标签:httpd,x86,CentOS,centos,Everything,64,Yum,el7 From: https://www.cnblogs.com/huaxiayuyi/p/16808392.html