1.挂载DVD镜像或者光盘
1. sudo mount -t iso9660 -o loop /source /mnt/ISO
2.
3. sudo mount -t iso9660 -o loop /dev/cdrom /mnt/cdrom
2.移走/etc/yum.repos.d下的所有文件到你的备份目录,这里为$HOME/backup,自己可以更改
1. sudo mv /etc/yum.repos.d/* $HOME/backup
3.编辑/etc/yum.conf
1. sudo gedit /etc/yum.conf
2. 在末尾添加
3. [ISO]
4. name=iso
5. baseurl=file:///mnt/ISO
6. gpgcheck=0
复制代码
4. 清除缓存文件,并更新本地源
1. #yum clean all
2. Cleaning up Everything
3. #yum update
4. ISO 100% |=========================| 2.4 kB 00:00
5. primary.sqlite.bz2 100% |=========================| 1.4 MB 00:00
6. Setting up Update Process
7. No Packages marked for Update