用Fedora光盘设置软件本地源

时间:2022-06-02 00:12:34
//挂载光盘
[root@localhost /]# cd mnt/[root@localhost mnt]# mkdir fedora_dvd[root@localhost mnt]# mount -t iso9660 /dev/sr0 fedora_dvd/mount: block device /dev/sr0 is write-protected, mounting read-only[root@localhost mnt]#

进入/etc/yum.repos.d/:

[root@localhost mnt]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# ls
fedora-rawhide.repo fedora-updates.repo
fedora.repo fedora-updates-testing.repo

备份软件仓库设置文件:

[root@localhost yum.repos.d]# cp fedora.repo fedora.repo.bak
修改第一个字段为以下内容后保存退出:
[fedora]
name=Fedora $releasever - $basearch
failovermethod=priority
baseurl=file:///mnt/fedora_dvd/
enabled=1
metadata_expire=7d
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$basearch

清理记录:

[root@localhost yum.repos.d]# yum clean all

这时进入Add/Remove Softwares更新列表后就可以安装软件了。