Linux920 RHEL 8 YUM配置;root密码;文件夹 磁盘分区 磁盘
问题
目录中的文件夹是磁盘分区的结果吗
什么是虚拟机磁盘 什么是虚拟机的磁盘分区
磁盘分区和文件夹,磁盘分区要求
[root@caozx26 yum.repos.d]# yum report list
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.
未找到命令: report。请使用 /usr/bin/yum --help
It could be a YUM plugin command, try: "yum install 'dnf-command(report)'"
[root@caozx26 yum.repos.d]#
[root@caozx26 yum.repos.d]# uname rc.local local.repo
uname: 额外的操作数 “rc.local”
请尝试执行 "uname --help" 来获取更多信息。
[root@caozx26 yum.repos.d]# cat local.repo
[AppStream]
name=AppStream
baseurl=file:///mnt
gpgcheck=0
enabled=1
[BaseOS]
name=BaseOS
baseurl=file:///mnt
gpgcheck=0
enabled=1[root@caozx26 yum.repos.d]# yum clean all
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.
0 文件已删除
[root@caozx26 yum.repos.d]# yum makecache
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.
AppStream 0.0 B/s | 0 B 00:00
Errors during downloading metadata for repository 'AppStream':- Curl error (37): Couldn't read a file:// file for file:///mnt/repodata/repomd.xml [Couldn't open file /mnt/repodata/repomd.xml]
错误:Failed to download metadata for repo 'AppStream': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
[root@caozx26 yum.repos.d]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sr0 11:0 1 7.9G 0 rom /mnt
nvme0n1 259:0 0 20G 0 disk
├─nvme0n1p1 259:1 0 600M 0 part /boot/efi
├─nvme0n1p2 259:2 0 1G 0 part /boot
└─nvme0n1p3 259:3 0 18.4G 0 part ├─rhel-root 253:0 0 16.4G 0 lvm /└─rhel-swap 253:1 0 2G 0 lvm [SWAP]
[root@caozx26 yum.repos.d]#
Rhel8 YUM配置
[root@caozx26 yum.repos.d]# tar -zcf repo.tar.gz *.repo
[root@caozx26 yum.repos.d]# ls
redhat.repo repo.tar.gz
[root@caozx26 yum.repos.d]# rm -rf *.repo
[root@caozx26 yum.repos.d]# yum report list
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.
未找到命令: report。请使用 /usr/bin/yum --help
It could be a YUM plugin command, try: "yum install 'dnf-command(report)'"
[root@caozx26 yum.repos.d]# yum report list
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.
未找到命令: report。请使用 /usr/bin/yum --help
It could be a YUM plugin command, try: "yum install 'dnf-command(report)'"
[root@caozx26 yum.repos.d]# yum reportlist all
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.
未找到命令: reportlist。请使用 /usr/bin/yum --help
It could be a YUM plugin command, try: "yum install 'dnf-command(reportlist)'"
[root@caozx26 yum.repos.d]# yum repo list
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.
未找到命令: repo。请使用 /usr/bin/yum --help
It could be a YUM plugin command, try: "yum install 'dnf-command(repo)'"
[root@caozx26 yum.repos.d]# yum repolist all
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.
没有可用的软件仓库
[root@caozx26 yum.repos.d]# ls
redhat.repo repo.tar.gz
[root@caozx26 yum.repos.d]# rm -rf redhat.repo
[root@caozx26 yum.repos.d]# vim rc.local
[root@caozx26 yum.repos.d]# cat rc.local
[Appstream]
name=AppStream
baseurl=file:///mnt
gpgcheck=0
enabled=1
[BaseOS]
name=BaseOS
baseurl=file:///mnt
gpgcheck=0
enabled=1[root@caozx26 yum.repos.d]# ls
rc.local repo.tar.gz
[root@caozx26 yum.repos.d]# ls /mnt/
hgfs
[root@caozx26 yum.repos.d]# rm -f hgfs
[root@caozx26 yum.repos.d]# ls
rc.local repo.tar.gz
[root@caozx26 yum.repos.d]# mount /dev/sr0 /mnt
mount: /mnt: WARNING: device write-protected, mounted read-only.
[root@caozx26 yum.repos.d]# mount -o ro /dev/sr0 /mnt
mount: /mnt: /dev/sr0 already mounted on /run/media/root/RHEL-8-2-0-BaseOS-x86_64.
[root@caozx26 yum.repos.d]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sr0 11:0 1 7.9G 0 rom /mnt
nvme0n1 259:0 0 20G 0 disk
├─nvme0n1p1 259:1 0 600M 0 part /boot/efi
├─nvme0n1p2 259:2 0 1G 0 part /boot
└─nvme0n1p3 259:3 0 18.4G 0 part ├─rhel-root 253:0 0 16.4G 0 lvm /└─rhel-swap 253:1 0 2G 0 lvm [SWAP]
[root@caozx26 yum.repos.d]# chmod +x /etc/rc.local
[root@caozx26 yum.repos.d]# echo "mount -o ro /dev/sr0 /mnt">>/etc/rc.local
[root@caozx26 yum.repos.d]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sr0 11:0 1 7.9G 0 rom /mnt
nvme0n1 259:0 0 20G 0 disk
├─nvme0n1p1 259:1 0 600M 0 part /boot/efi
├─nvme0n1p2 259:2 0 1G 0 part /boot
└─nvme0n1p3 259:3 0 18.4G 0 part ├─rhel-root 253:0 0 16.4G 0 lvm /└─rhel-swap 253:1 0 2G 0 lvm [SWAP]
[root@caozx26 yum.repos.d]# ls
rc.local repo.tar.gz
[root@caozx26 yum.repos.d]# uname rc.local local.repo
uname: 额外的操作数 “rc.local”
请尝试执行 "uname --help" 来获取更多信息。
[root@caozx26 yum.repos.d]# mv rc.local local.repo[root@caozx26 yum.repos.d]#
[root@caozx26 yum.repos.d]#
[root@caozx26 yum.repos.d]# ls
local.repo repo.tar.gz
[root@caozx26 yum.repos.d]# cat local.repo
[Appstream]
name=AppStream
baseurl=file:///mnt
gpgcheck=0
enabled=1
[BaseOS]
name=BaseOS
baseurl=file:///mnt
gpgcheck=0
enabled=1[root@caozx26 yum.repos.d]# yum clean all
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.
0 文件已删除
[root@caozx26 yum.repos.d]# yum makecache
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.
AppStream 0.0 B/s | 0 B 00:00
Errors during downloading metadata for repository 'Appstream':- Curl error (37): Couldn't read a file:// file for file:///mnt/repodata/repomd.xml [Couldn't open file /mnt/repodata/repomd.xml]
错误:Failed to download metadata for repo 'Appstream': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
[root@caozx26 yum.repos.d]# vim rc.local
[root@caozx26 yum.repos.d]# vim local.repo
[root@caozx26 yum.repos.d]# cat local.repo
[AppStream]
name=AppStream
baseurl=file:///mnt
gpgcheck=0
enabled=1
[BaseOS]
name=BaseOS
baseurl=file:///mnt
gpgcheck=0
enabled=1[root@caozx26 yum.repos.d]# yum clean all
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.
0 文件已删除
[root@caozx26 yum.repos.d]# yum makecache
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.
AppStream 0.0 B/s | 0 B 00:00
Errors during downloading metadata for repository 'AppStream':- Curl error (37): Couldn't read a file:// file for file:///mnt/repodata/repomd.xml [Couldn't open file /mnt/repodata/repomd.xml]
错误:Failed to download metadata for repo 'AppStream': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
[root@caozx26 yum.repos.d]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sr0 11:0 1 7.9G 0 rom /mnt
nvme0n1 259:0 0 20G 0 disk
├─nvme0n1p1 259:1 0 600M 0 part /boot/efi
├─nvme0n1p2 259:2 0 1G 0 part /boot
└─nvme0n1p3 259:3 0 18.4G 0 part ├─rhel-root 253:0 0 16.4G 0 lvm /└─rhel-swap 253:1 0 2G 0 lvm [SWAP]
[root@caozx26 yum.repos.d]# vim local.repo
[root@caozx26 yum.repos.d]# cat local.repo
[AppStream]
name=AppStream
baseurl=file:///mnt/AppStream
gpgcheck=0
enabled=1
[BaseOS]
name=BaseOS
baseurl=file:///mnt/BaseOS
gpgcheck=0
enabled=1[root@caozx26 yum.repos.d]# yum clean all
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.
0 文件已删除
[root@caozx26 yum.repos.d]# yum makecache
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.
AppStream 34 MB/s | 5.8 MB 00:00
BaseOS 96 MB/s | 2.3 MB 00:00
元数据缓存已建立。
[root@caozx26 yum.repos.d]# yum repolist all
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.
仓库标识 仓库名称 状态
AppStream AppStream 启用
BaseOS BaseOS 启用
[root@caozx26 yum.repos.d]#
root密码
e
ctrl x
mount -o remount,rw / # 确保根文件系统以读写方式挂载(如果未自动完成)
passwd root # 重置root密码,输入新密码两次
touch /.autorelabel # 如果系统使用SELinux(如CentOS),执行此命令避免权限问题
exec /sbin/reboot # 重启系统
记录
[root@caozx26 ~]# ls
公共 视频 文档 音乐 anaconda-ks.cfg
模板 图片 下载 桌面 initial-setup-ks.cfg
[root@caozx26 ~]# ls ./
公共 视频 文档 音乐 anaconda-ks.cfg
模板 图片 下载 桌面 initial-setup-ks.cfg
[root@caozx26 ~]# ls /
bin dev home lib64 mnt proc run srv tmp var
boot etc lib media opt root sbin sys usr
[root@caozx26 ~]# ls ~
公共 视频 文档 音乐 anaconda-ks.cfg
模板 图片 下载 桌面 initial-setup-ks.cfg
[root@caozx26 ~]# ls ^C
[root@caozx26 ~]# ls
公共 模板 视频 图片 文档 下载 音乐 桌面 anaconda-ks.cfg initial-setup-ks.cfg
[root@caozx26 ~]# ls /^C
[root@caozx26 ~]# df -h
文件系统 容量 已用 可用 已用% 挂载点
devtmpfs 872M 0 872M 0% /dev
tmpfs 901M 0 901M 0% /dev/shm
tmpfs 901M 9.7M 891M 2% /run
tmpfs 901M 0 901M 0% /sys/fs/cgroup
/dev/mapper/rhel-root 17G 4.2G 13G 26% /
/dev/nvme0n1p2 1014M 224M 791M 23% /boot
/dev/nvme0n1p1 599M 6.8M 593M 2% /boot/efi
tmpfs 181M 1.2M 179M 1% /run/user/42
tmpfs 181M 4.6M 176M 3% /run/user/0
[root@caozx26 ~]# du
4 ./.cache/dconf
0 ./.cache/libgweather
0 ./.cache/evolution/addressbook/trash
0 ./.cache/evolution/addressbook
0 ./.cache/evolution/calendar/trash
0 ./.cache/evolution/calendar
0 ./.cache/evolution/mail/trash
0 ./.cache/evolution/mail
0 ./.cache/evolution/memos/trash
0 ./.cache/evolution/memos
0 ./.cache/evolution/sources/trash
0 ./.cache/evolution/sources
0 ./.cache/evolution/tasks/trash
0 ./.cache/evolution/tasks
0 ./.cache/evolution
0 ./.cache/gnome-shell
7516 ./.cache/tracker
552 ./.cache/gstreamer-1.0
280 ./.cache/gnome-software/fwupd/remotes.d/lvfs
280 ./.cache/gnome-software/fwupd/remotes.d
280 ./.cache/gnome-software/fwupd
0 ./.cache/gnome-software/shell-extensions
0 ./.cache/gnome-software/odrs
280 ./.cache/gnome-software
0 ./.cache/yelp/WebKitCache/Version 14/Blobs
4 ./.cache/yelp/WebKitCache/Version 14
4 ./.cache/yelp/WebKitCache
4 ./.cache/yelp
8368 ./.cache
4 ./.dbus/session-bus
4 ./.dbus
4 ./.config/ibus/bus
4 ./.config/ibus
68 ./.config/pulse
0 ./.config/gnome-session/saved-session
0 ./.config/gnome-session
4 ./.config/dconf
4 ./.config/evolution/sources
4 ./.config/evolution
0 ./.config/goa-1.0
0 ./.config/gconf
4 ./.config/gtk-3.0
4 ./.config/yelp
100 ./.config
4 ./.local/share/gnome-shell
0 ./.local/share/evolution/addressbook/trash
0 ./.local/share/evolution/addressbook/system/photos
84 ./.local/share/evolution/addressbook/system
84 ./.local/share/evolution/addressbook
0 ./.local/share/evolution/calendar/trash
4 ./.local/share/evolution/calendar/system
4 ./.local/share/evolution/calendar
0 ./.local/share/evolution/mail/trash
0 ./.local/share/evolution/mail
0 ./.local/share/evolution/memos/trash
0 ./.local/share/evolution/memos
0 ./.local/share/evolution/tasks/trash
0 ./.local/share/evolution/tasks
88 ./.local/share/evolution
0 ./.local/share/sounds
0 ./.local/share/applications
0 ./.local/share/icc
0 ./.local/share/flatpak/db
0 ./.local/share/flatpak/repo/tmp/cache
0 ./.local/share/flatpak/repo/tmp
0 ./.local/share/flatpak/repo/extensions
0 ./.local/share/flatpak/repo/state
0 ./.local/share/flatpak/repo/refs/heads
0 ./.local/share/flatpak/repo/refs/mirrors
0 ./.local/share/flatpak/repo/refs/remotes
0 ./.local/share/flatpak/repo/refs
0 ./.local/share/flatpak/repo/objects
4 ./.local/share/flatpak/repo
4 ./.local/share/flatpak
0 ./.local/share/gnome-settings-daemon
72 ./.local/share/gvfs-metadata
152 ./.local/share/tracker/data
152 ./.local/share/tracker
0 ./.local/share/webkitgtk/localstorage
0 ./.local/share/webkitgtk/deviceidhashsalts/1
0 ./.local/share/webkitgtk/deviceidhashsalts
0 ./.local/share/webkitgtk/databases/indexeddb
0 ./.local/share/webkitgtk/databases
0 ./.local/share/webkitgtk
324 ./.local/share
324 ./.local
0 ./桌面
0 ./下载
0 ./模板
0 ./公共
0 ./文档
0 ./音乐
0 ./图片
0 ./视频
0 ./.pki/nssdb
0 ./.pki
8836 .
[root@caozx26 ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sr0 11:0 1 1024M 0 rom
nvme0n1 259:0 0 20G 0 disk
├─nvme0n1p1 259:1 0 600M 0 part /boot/efi
├─nvme0n1p2 259:2 0 1G 0 part /boot
└─nvme0n1p3 259:3 0 18.4G 0 part ├─rhel-root 253:0 0 16.4G 0 lvm /└─rhel-swap 253:1 0 2G 0 lvm [SWAP]
[root@caozx26 ~]# cd /
[root@caozx26 /]# ls
bin boot dev etc home lib lib64 media mnt opt proc root run sbin srv sys tmp usr var
[root@caozx26 /]# cd /etc/yum.repos.d
[root@caozx26 yum.repos.d]# ls
redhat.repo
[root@caozx26 yum.repos.d]# tar -zcf repo.tar.gz *.repo
[root@caozx26 yum.repos.d]# ls
redhat.repo repo.tar.gz
[root@caozx26 yum.repos.d]# rm -rf *.repo
[root@caozx26 yum.repos.d]# yum report list
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.
未找到命令: report。请使用 /usr/bin/yum --help
It could be a YUM plugin command, try: "yum install 'dnf-command(report)'"
[root@caozx26 yum.repos.d]# yum report list
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.
未找到命令: report。请使用 /usr/bin/yum --help
It could be a YUM plugin command, try: "yum install 'dnf-command(report)'"
[root@caozx26 yum.repos.d]# yum reportlist all
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.
未找到命令: reportlist。请使用 /usr/bin/yum --help
It could be a YUM plugin command, try: "yum install 'dnf-command(reportlist)'"
[root@caozx26 yum.repos.d]# yum repo list
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.
未找到命令: repo。请使用 /usr/bin/yum --help
It could be a YUM plugin command, try: "yum install 'dnf-command(repo)'"
[root@caozx26 yum.repos.d]# yum repolist all
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.
没有可用的软件仓库
[root@caozx26 yum.repos.d]# ls
redhat.repo repo.tar.gz
[root@caozx26 yum.repos.d]# rm -rf redhat.repo
[root@caozx26 yum.repos.d]# vim rc.local
[root@caozx26 yum.repos.d]# cat rc.local
[Appstream]
name=AppStream
baseurl=file:///mnt
gpgcheck=0
enabled=1
[BaseOS]
name=BaseOS
baseurl=file:///mnt
gpgcheck=0
enabled=1[root@caozx26 yum.repos.d]# ls
rc.local repo.tar.gz
[root@caozx26 yum.repos.d]# ls /mnt/
hgfs
[root@caozx26 yum.repos.d]# rm -f hgfs
[root@caozx26 yum.repos.d]# ls
rc.local repo.tar.gz
[root@caozx26 yum.repos.d]# mount /dev/sr0 /mnt
mount: /mnt: WARNING: device write-protected, mounted read-only.
[root@caozx26 yum.repos.d]# mount -o ro /dev/sr0 /mnt
mount: /mnt: /dev/sr0 already mounted on /run/media/root/RHEL-8-2-0-BaseOS-x86_64.
[root@caozx26 yum.repos.d]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sr0 11:0 1 7.9G 0 rom /mnt
nvme0n1 259:0 0 20G 0 disk
├─nvme0n1p1 259:1 0 600M 0 part /boot/efi
├─nvme0n1p2 259:2 0 1G 0 part /boot
└─nvme0n1p3 259:3 0 18.4G 0 part ├─rhel-root 253:0 0 16.4G 0 lvm /└─rhel-swap 253:1 0 2G 0 lvm [SWAP]
[root@caozx26 yum.repos.d]# chmod +x /etc/rc.local
[root@caozx26 yum.repos.d]# echo "mount -o ro /dev/sr0 /mnt">>/etc/rc.local
[root@caozx26 yum.repos.d]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sr0 11:0 1 7.9G 0 rom /mnt
nvme0n1 259:0 0 20G 0 disk
├─nvme0n1p1 259:1 0 600M 0 part /boot/efi
├─nvme0n1p2 259:2 0 1G 0 part /boot
└─nvme0n1p3 259:3 0 18.4G 0 part ├─rhel-root 253:0 0 16.4G 0 lvm /└─rhel-swap 253:1 0 2G 0 lvm [SWAP]
[root@caozx26 yum.repos.d]# ls
rc.local repo.tar.gz
[root@caozx26 yum.repos.d]# uname rc.local local.repo
uname: 额外的操作数 “rc.local”
请尝试执行 "uname --help" 来获取更多信息。
[root@caozx26 yum.repos.d]# mv rc.local local.repo[root@caozx26 yum.repos.d]#
[root@caozx26 yum.repos.d]#
[root@caozx26 yum.repos.d]# ls
local.repo repo.tar.gz
[root@caozx26 yum.repos.d]# cat local.repo
[Appstream]
name=AppStream
baseurl=file:///mnt
gpgcheck=0
enabled=1
[BaseOS]
name=BaseOS
baseurl=file:///mnt
gpgcheck=0
enabled=1[root@caozx26 yum.repos.d]# yum clean all
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.
0 文件已删除
[root@caozx26 yum.repos.d]# yum makecache
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.
AppStream 0.0 B/s | 0 B 00:00
Errors during downloading metadata for repository 'Appstream':- Curl error (37): Couldn't read a file:// file for file:///mnt/repodata/repomd.xml [Couldn't open file /mnt/repodata/repomd.xml]
错误:Failed to download metadata for repo 'Appstream': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
[root@caozx26 yum.repos.d]# vim rc.local
[root@caozx26 yum.repos.d]# vim local.repo
[root@caozx26 yum.repos.d]# cat local.repo
[AppStream]
name=AppStream
baseurl=file:///mnt
gpgcheck=0
enabled=1
[BaseOS]
name=BaseOS
baseurl=file:///mnt
gpgcheck=0
enabled=1[root@caozx26 yum.repos.d]# yum clean all
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.
0 文件已删除
[root@caozx26 yum.repos.d]# yum makecache
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.
AppStream 0.0 B/s | 0 B 00:00
Errors during downloading metadata for repository 'AppStream':- Curl error (37): Couldn't read a file:// file for file:///mnt/repodata/repomd.xml [Couldn't open file /mnt/repodata/repomd.xml]
错误:Failed to download metadata for repo 'AppStream': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
[root@caozx26 yum.repos.d]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sr0 11:0 1 7.9G 0 rom /mnt
nvme0n1 259:0 0 20G 0 disk
├─nvme0n1p1 259:1 0 600M 0 part /boot/efi
├─nvme0n1p2 259:2 0 1G 0 part /boot
└─nvme0n1p3 259:3 0 18.4G 0 part ├─rhel-root 253:0 0 16.4G 0 lvm /└─rhel-swap 253:1 0 2G 0 lvm [SWAP]
[root@caozx26 yum.repos.d]# vim local.repo
[root@caozx26 yum.repos.d]# cat local.repo
[AppStream]
name=AppStream
baseurl=file:///mnt/AppStream
gpgcheck=0
enabled=1
[BaseOS]
name=BaseOS
baseurl=file:///mnt/BaseOS
gpgcheck=0
enabled=1[root@caozx26 yum.repos.d]# yum clean all
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.
0 文件已删除
[root@caozx26 yum.repos.d]# yum makecache
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.
AppStream 34 MB/s | 5.8 MB 00:00
BaseOS 96 MB/s | 2.3 MB 00:00
元数据缓存已建立。
[root@caozx26 yum.repos.d]# yum repolist all
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.
仓库标识 仓库名称 状态
AppStream AppStream 启用
BaseOS BaseOS 启用
[root@caozx26 yum.repos.d]#