1) mount iso image
mount -o loop debian-10.8.0-amd64-DVD-1.iso /media/cdrom
2) add to /etc/apt/sources.list
deb [trusted=yes] file:/media/cdrom/ buster main contrib non-free
# mkdir -p /mnt/disc # mount -o loop RHEL7.9.iso /mnt/disc
If you use DVD media, you can mount like below.
# mkdir -p /mnt/disc # mount /dev/sr0 /mnt/disc
Copy the
media.repo
file from the root of the mounted directory to/etc/yum.repos.d/
and set the permissions to0644
or another similar permissions set:# cp /mnt/disc/media.repo /etc/yum.repos.d/rhel7dvd.repo # chmod 644 /etc/yum.repos.d/rhel7dvd.repo
Edit the new repo file, changing the
gpgcheck=0
setting to1
and adding the following 3 linesvi /etc/yum.repos.d/rhel7dvd.repo enabled=1 baseurl=file:///mnt/disc/ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
In the end, the new repo file could look like the following
[InstallMedia] name=DVD for Red Hat Enterprise Linux 7.9 Server mediaid=1359576196.686790 metadata_expire=-1 gpgcheck=1 cost=500 enabled=1 baseurl=file:///mnt/disc/ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
Clear the cache and check whether you can get the packages list from the DVD repo
# yum clean all # yum repolist enabled
It should look like the following if no other repository is enabled.
To avoid any corruption its recommend to disable any non-RedHat repositories.# yum repolist enabled Loaded plugins: product-id, search-disabled-repos, subscription-manager This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register. repo id repo name InstallMedia Red Hat Enterprise Linux 7.9 repolist: 5,229
If no errors are returned, the following can be used to update:
# yum update
Комментариев нет:
Отправить комментарий