linux配置yum源
发布时间:2020-12-13 23:31:45 所属栏目:Linux 来源:网络整理
导读:在做linux配置yum源的时候,笔者从网上找的教程, 然后发现各种报错,最后总结了一下,比较好用的一种方法是,复制一台yum源是正常的linux虚拟机对应的?? /etc/yum.repos.d 目录下的文件,以下为笔者/etc/yum.repos.d目录下的文件 把该目录的文件全部清空,
在做linux配置yum源的时候,笔者从网上找的教程, 然后发现各种报错,最后总结了一下,比较好用的一种方法是,复制一台yum源是正常的linux虚拟机对应的?? /etc/yum.repos.d 目录下的文件,以下为笔者/etc/yum.repos.d目录下的文件 把该目录的文件全部清空,然后创建以上四个文件,把下方文件的内容拷入 CentOS-Base.repo文件的内容如下: # CentOS-Base.repo # # The mirror system uses the connecting IP address of the client and the # update status of each mirror to pick mirrors that are updated to and # geographically close to the client. You should use this for CentOS updates # unless you are manually picking other mirrors. # # If the mirrorlist= does not work for you,as a fall back you can try the # remarked out baseurl= line instead. # # [base] name=CentOS-$releasever - Base mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os #baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 #released updates [updates] name=CentOS-$releasever - Updates mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates #baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 #additional packages that may be useful [extras] name=CentOS-$releasever - Extras mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras #baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 #additional packages that extend functionality of existing packages [centosplus] name=CentOS-$releasever - Plus mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus #baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/ gpgcheck=1 enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 CentOS-Debuginfo.repo内容如下: # CentOS-Debug.repo # # The mirror system uses the connecting IP address of the client and the # update status of each mirror to pick mirrors that are updated to and # geographically close to the client. You should use this for CentOS updates # unless you are manually picking other mirrors. # # All debug packages from all the various CentOS-7 releases # are merged into a single repo,split by BaseArch # # Note: packages in the debuginfo repo are currently not signed # [debug] name=CentOS-7 - Debuginfo baseurl=http://debuginfo.centos.org/7/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-Debug-7 enabled=0 # CentOS-Sources.repo文件内容如下: # CentOS-Sources.repo # # The mirror system uses the connecting IP address of the client and the # update status of each mirror to pick mirrors that are updated to and # geographically close to the client. You should use this for CentOS updates # unless you are manually picking other mirrors. # # If the mirrorlist= does not work for you,as a fall back you can try the # remarked out baseurl= line instead. # # [base-source] name=CentOS-$releasever - Base Sources baseurl=http://vault.centos.org/centos/$releasever/os/Source/ gpgcheck=1 enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 #released updates [updates-source] name=CentOS-$releasever - Updates Sources baseurl=http://vault.centos.org/centos/$releasever/updates/Source/ gpgcheck=1 enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 #additional packages that may be useful [extras-source] name=CentOS-$releasever - Extras Sources baseurl=http://vault.centos.org/centos/$releasever/extras/Source/ gpgcheck=1 enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 #additional packages that extend functionality of existing packages [centosplus-source] name=CentOS-$releasever - Plus Sources baseurl=http://vault.centos.org/centos/$releasever/centosplus/Source/ gpgcheck=1 enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 CentOS-Vault.repo文件内容如下: # placeholder for now # # # CentOS Vault contains rpms from older releases in the CentOS-7 # tree. # # At this point in 7.0.1406,we have no older release 根据里边的代码内容来看,CentOS-Vault.repo文件似乎没有什么作用,应该可以不需要该文件,笔者也未对其进行验证,如有兴趣的可以自己不加该文件进行验证是否能正确配置yum源。 ? 最后通过以下命令进行验证是否成功设置yum源 yum clean all
yum makecache
yum update
yum repolist
? yum update对应的命令截图过长,截图部分
? ? (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- LINUX学习:IntelliJ IDEA 2016 Maven项目配置JUnit
- linux – 为什么Jenkins用户没有权限访问Docker unix套接字
- Linux操作系统log日志日志分别指什么
- linux – 自定义Openssh Shell
- 在同一台计算机上的两个Linux安装之间共享/ home分区应该怎
- linux – 如何在32位操作系统上运行64位应用程序
- linux – 如何在VMDK中编辑/添加文件
- Netstat- Linux必学的60个命令
- zsh – 在不关闭shell窗口的情况下自动重新加载别名
- linux – 如何确定哪个软件包版本将“apt-get install”ins