|
|
本帖最后由 Inkcup 于 2026-5-5 18:51 编辑
首先手动上传驱动至新建目录/iso下;
后续操作如下:
1.
# mkdir /mnt/iso
2.
# mount -o loop /iso/OracleLinux-R7-U9-Server-x86_64-dvd.iso /mnt/iso/
mount: /dev/loop0 is write-protected, mounting read-only
3.
# df -h
Filesystem Size Used Avail Use% Mounted on
···
/dev/loop0 4.6G 4.6G 0 100% /mnt/iso
4.
# blkid
/dev/sda2: UUID="59b6f46a-cdfb-4925-8344-d8fda512e633" TYPE="xfs"
/dev/sda3: UUID="65726b47-c367-4113-8943-c3319232389c" TYPE="swap"
/dev/sda5: UUID="52519fd4-27a6-4339-b16e-a85d9b842a24" TYPE="xfs"
/dev/loop0: UUID="2021-05-28-10-00-48-00" LABEL="OL-7.9 Server.x86_64" TYPE="iso9660" PTTYPE="dos"
5.
# vim /etc/fstab
···
UUID=2021-05-28-10-00-48-00 /mnt/iso iso9660 defaults 0 0
6.
# cd /etc/yum.repos.d/
# mkdir yumbak
# mv *.repo yumbak/
7.
# vim localnew.repo
[localnew]
name = localnew
baseurl = file:///mnt/iso/
enabled = 1
gpgcheck = 0
#需要详细指向源的路径,参考#本地源;
#废弃的yum源需要注释掉,否则会影响使用;
8.检查
# yum repolist
如果配置成功,会显示新yum源。
#在线源
[rhel-BaseOS]
name = RHEL BaseOS
baseurl = http://content/rhel9.0/x86_64/dvd/BaseOS
enabled = 1
gpgcheck =0
[rhel-AppStream]
name = RHEL AppStream
baseurl = http://content/rhel9.0/x86_64/dvd/AppStream
enabled = 1
gpgcheck =0
#本地源
[rhel-BaseOS]
name = RHEL BaseOS
baseurl = file:///mnt/iso/BaseOS
enabled = 1
gpgcheck =0
[rhel-AppStream]
name = RHEL AppStream
baseurl = file:///mnt/iso/AppStream
enabled = 1
gpgcheck =0
|
|