更新centos中yum仓库

1.增加基础源

/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&infra=$infra
baseurl=https://repo.huaweicloud.com/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&infra=$infra
baseurl=https://repo.huaweicloud.com/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&infra=$infra
baseurl=https://repo.huaweicloud.com/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&infra=$infra
baseurl=https://repo.huaweicloud.com/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

2.增加扩展源

/etc/yum.repos.d/epel.repo

[epel]
name=Extra Packages for Enterprise Linux 7 - $basearch
baseurl=https://repo.huaweicloud.com/epel/7/$basearch
#metalink=https://mirrors.fedoraproject.org/#metalink?repo=epel-7&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7

[epel-debuginfo]
name=Extra Packages for Enterprise Linux 7 - $basearch - Debug
baseurl=https://repo.huaweicloud.com/epel/7/$basearch/debug
#metalink=https://mirrors.fedoraproject.org/#metalink?repo=epel-debug-7&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
gpgcheck=1

[epel-source]
name=Extra Packages for Enterprise Linux 7 - $basearch - Source
baseurl=https://repo.huaweicloud.com/epel/7/SRPMS
#metalink=https://mirrors.fedoraproject.org/#metalink?repo=epel-source-7&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
gpgcheck=1

3.清空Yum缓存

[root@10-40-9-182 shell]# yum clean all
Loaded plugins: fastestmirror
Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast
Cleaning repos: base docker-ce-stable epel extras treasuredata updates
Cleaning up list of fastest mirrors

4.更新yum缓存

[root@10-40-9-182 shell]# yum makecache
Loaded plugins: fastestmirror
Determining fastest mirrors
base                                                                                                                                                                                                             
...                                                                                                                                                                                                
(23/23): treasuredata/7/x86_64/filelists_db                                                                                                                                                                      | 504 kB  00:00:00     
Metadata Cache Created

5.安装screen

[root@10-40-9-182 shell]# yum info screen
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Available Packages
Name        : screen
Arch        : x86_64
Version     : 4.1.0
Release     : 0.27.20120314git3c2946.el7_9
Size        : 553 k
Repo        : updates/7/x86_64
Summary     : A screen manager that supports multiple logins on one terminal
URL         : http://www.gnu.org/software/screen
License     : GPLv2+
Description : The screen utility allows you to have multiple logins on just one
            : terminal. Screen is useful for users who telnet into a machine or are
            : connected via a dumb terminal, but want to use more than just one
            : login.
            : 
            : Install the screen package if you need a screen manager that can
            : support multiple logins on one terminal.


[root@10-40-9-182 shell]# yum -y install screen
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package screen.x86_64 0:4.1.0-0.27.20120314git3c2946.el7_9 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===========
 Package                                          Arch                                             Version                                                                      Repository                                         Size
===========
Installing:
 screen                                           x86_64                                           4.1.0-0.27.20120314git3c2946.el7_9                                           updates                                           553 k

Transaction Summary
===========
Install  1 Package

Total download size: 553 k
Installed size: 914 k
Downloading packages:
screen-4.1.0-0.27.20120314git3c2946.el7_9.x86_64.rpm                                                                                                                                                             | 553 kB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : screen-4.1.0-0.27.20120314git3c2946.el7_9.x86_64                                                                                                                                                                     1/1 
  Verifying  : screen-4.1.0-0.27.20120314git3c2946.el7_9.x86_64                                                                                                                                                                     1/1 

Installed:
  screen.x86_64 0:4.1.0-0.27.20120314git3c2946.el7_9                                                                                                                                                                                    

Complete!
posted @ 2022-12-01 18:48  爱折腾的大臭臭  阅读(556)  评论(0编辑  收藏  举报