建立本地yum仓库

[root@ks-server ~]# cd /etc/yum.repos.d/[root@ks-server yum.repos.d]# ls
CentOS-Base.repo CentOS-Media.repo
CentOS-CR.repo CentOS-Sources.repo
CentOS-Debuginfo.repo CentOS-Vault.repo
CentOS-fasttrack.repo
[root@ks-server yum.repos.d]# mkdir bak
[root@ks-server yum.repos.d]# ls
bak CentOS-fasttrack.repo
CentOS-Base.repo CentOS-Media.repo
CentOS-CR.repo CentOS-Sources.repo
CentOS-Debuginfo.repo CentOS-Vault.repo
[root@ks-server yum.repos.d]# mv *.repo bak/
[root@ks-server yum.repos.d]# ls
bak

#将原先/etc/yum.repos.d/里存在的都移除(备份)

[root@ks-server yum.repos.d]# mount /dev/sr0 /mnt
mount: /dev/sr0 is write-protected, mounting read-only
[root@ks-server yum.repos.d]# ls /mnt
CentOS_BuildTag LiveOS
EFI Packages
EULA repodata
GPL RPM-GPG-KEY-CentOS-
images RPM-GPG-KEY-CentOS-Testing-
isolinux TRANS.TBL

#挂载光盘镜像

[root@ks-server yum.repos.d]# cat local.repo
[localrepo]
name=localrepo
baseurl=file:///mnt
gpgcheck=
enabled=

编写repo文件

[root@ks-server yum.repos.d]# yum clean all
Loaded plugins: fastestmirror, langpacks
Cleaning repos: localrepo
Cleaning up everything
Maybe you want: rm -rf /var/cache/yum, to also free up space taken by orphaned data from disabled or removed repos
Cleaning up list of fastest mirrors
[root@ks-server yum.repos.d]# yum repolist
Loaded plugins: fastestmirror, langpacks
Determining fastest mirrors
localrepo | 3.6 kB :
(/): localrepo/group_gz | kB :
(/): localrepo/primary_ | 3.1 MB :
repo id repo name status
localrepo localrepo ,
repolist: ,

#清理检测

上一篇:windows internal读书笔记


下一篇:React 17 发布候选版本, 没有添加新功能