首页 > 系统相关 >更新centos中yum仓库

更新centos中yum仓库

时间:2022-12-01 18:55:48浏览次数:43  
标签:kB 00 x86 centos 23 仓库 db 64 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                                                                                                                                                                                                             | 3.6 kB  00:00:00     
docker-ce-stable                                                                                                                                                                                                 | 3.5 kB  00:00:00     
epel                                                                                                                                                                                                             | 4.7 kB  00:00:00     
extras                                                                                                                                                                                                           | 2.9 kB  00:00:00     
treasuredata                                                                                                                                                                                                     | 3.0 kB  00:00:00     
updates                                                                                                                                                                                                          | 2.9 kB  00:00:00     
(1/23): base/7/x86_64/group_gz                                                                                                                                                                                   | 153 kB  00:00:00     
(2/23): base/7/x86_64/primary_db                                                                                                                                                                                 | 6.1 MB  00:00:00     
(3/23): base/7/x86_64/filelists_db                                                                                                                                                                               | 7.2 MB  00:00:00     
(4/23): base/7/x86_64/other_db                                                                                                                                                                                   | 2.6 MB  00:00:00     
(5/23): docker-ce-stable/7/x86_64/updateinfo                                                                                                                                                                     |   55 B  00:00:00     
(6/23): docker-ce-stable/7/x86_64/filelists_db                                                                                                                                                                   |  36 kB  00:00:00     
(7/23): epel/x86_64/group_gz                                                                                                                                                                                     |  98 kB  00:00:00     
(8/23): epel/x86_64/updateinfo                                                                                                                                                                                   | 1.0 MB  00:00:00     
(9/23): epel/x86_64/prestodelta                                                                                                                                                                                  | 1.2 kB  00:00:00     
(10/23): epel/x86_64/primary_db                                                                                                                                                                                  | 7.0 MB  00:00:00     
(11/23): docker-ce-stable/7/x86_64/primary_db                                                                                                                                                                    |  88 kB  00:00:00     
(12/23): epel/x86_64/other_db                                                                                                                                                                                    | 3.4 MB  00:00:00     
(13/23): docker-ce-stable/7/x86_64/other_db                                                                                                                                                                      | 127 kB  00:00:00     
(14/23): epel/x86_64/filelists_db                                                                                                                                                                                |  12 MB  00:00:00     
(15/23): extras/7/x86_64/filelists_db                                                                                                                                                                            | 276 kB  00:00:00     
(16/23): extras/7/x86_64/primary_db                                                                                                                                                                              | 249 kB  00:00:00     
(17/23): extras/7/x86_64/other_db                                                                                                                                                                                | 149 kB  00:00:00     
(18/23): treasuredata/7/x86_64/primary_db                                                                                                                                                                        |  34 kB  00:00:00     
(19/23): treasuredata/7/x86_64/other_db                                                                                                                                                                          | 2.9 kB  00:00:00     
(20/23): updates/7/x86_64/filelists_db                                                                                                                                                                           |  10 MB  00:00:00     
(21/23): updates/7/x86_64/other_db                                                                                                                                                                               | 1.2 MB  00:00:00     
(22/23): updates/7/x86_64/primary_db                                                                                                                                                                             |  18 MB  00:00:00     
(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!

标签:kB,00,x86,centos,23,仓库,db,64,yum
From: https://www.cnblogs.com/linuxshare/p/16942361.html

相关文章

  • Git修改远程关联仓库
    一、先查看远程关联的仓库地址#查看关联的远程仓库gitremote-v二、先删除远程关联,然后添加新的关联地址gitremotermorigingitremoteaddorigin[url]查......
  • centos零碎
    #在一台可以联网的机器上执行下列命令准备离线安装包,机器最好内核版本一致mkdir-p/usr/local/src/gccyuminstall--downloadonly--downloaddir=/usr/local/src/gccgcc......
  • Centos SSL 过期问题三个解决方案
    解决方案地址: http://www.megaleecher.net/SSL_Certificate_Verification_Error_in_Linux#axzz3P9axfRfp 返回错误信息如下:fatal:unabletoaccess'https://github.co......
  • centos7 设置时间同步
    chrony时间同步配置 时间的同步有两个命令:ntp(123udp端口)和chrony(323udp端口),这里介绍一下chrony的简单配置chrony由chrony包提供,chrony是服务端客户端一体的,既可以做......
  • macos m1虚拟机安装centos8
    一、安装vmware虚拟机1.1个人使用可获得免费许可证,注册用户激活即可。网址:https://customerconnect.vmware.com/web/vmware/evalcenter?p=fusion-player-personal&sourc......
  • centos7上安装coturn搭建turn/stun服务-WebRTC
    coturn是一个免费的开源的TURN/STUN服务器。coturn服务器完整的实现了STUN/TURN/ICE协议,支持P2P穿透防火墙。1.STUN服务器用于获取设备的外部网络地址。2.TURN服务器是在......
  • Centos安装Nodejs简单方式
    Node.js是一个基于ChromeV8引擎的​​JavaScript​​​运行时。本文主要讲的是如何在Linux即​​Centos上安装Nodejs的简单方式​​​,有比设置环境变量更加简单的方式......
  • 在CentOS编译Git源码
    ​​Git​​​是一个​​免费的开源​​分布式版本控制系统,旨在处理从小到小到的所有内容具有速度和效率的超大型项目。Git​​易于学习​​​,​​占用空间很小,性能快如闪......
  • 本地YUM源制作
    1、wget批量下载rpm包https://www.cnblogs.com/xing-29391/p/16755039.htmlwget-nd-r-l1--no-parenthttp://ooxx.com/packages/下载packages目录下所有文件:-nd不......
  • Linux基础第三章:Linux软件安装及yum本地库创建
    一、Linux软件安装软件安装共2种安装方式,通过rpm包安装或通过yum仓库库安装。1、Rpm包安装rpm:RedhatPackageManager多用于红帽系列的系统,例如Redhat、Centos等,优点是直......