当前位置:   article > 正文

yum 安装zabbix-agent报错:transfer closed with 333939 bytes remaining to read (更换源为阿里云源)_transfer closed with bytes

transfer closed with bytes

    今天测试shell脚本安装zabbix-agent并修改zabbix-agent.conf配置文件,在下载zabbix-agent时报错:transfer closed with 333939 bytes remaining to read !

    由于起初使用的是zabbix的官方源,官方源地址为:https://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-2.el7.noarch.rpm

    替换为阿里云源:rpm -ivh https://mirrors.aliyun.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-2.el7.noarch.rpm

    各自根据安装的zabbix版本替换!

    以下为替换过程,参考:https://www.cnblogs.com/syscal/p/12461620.html

   下载repo文件

 

[root@localhost ~]# wget http://mirrors.aliyun.com/repo/Centos-7.repo


    备份并替换系统的repo文件

  1.    [root@localhost ~]# cp Centos-7.repo /etc/yum.repos.d/
  2.    [root@localhost ~]# cd /etc/yum.repos.d/
  3.    [root@localhost ~]# mv CentOS-Base.repo CentOS-Base.repo.bak 
  4.    [root@localhost ~]# mv Centos-7.repo CentOS-Base.repo


 执行yum源更新命令

  1. [root@localhost ~]# yum clean all
  2.  
  3. [root@localhost ~]# yum makecache
  4.  
  5. [root@localhost ~]# yum update

更换zabbix国内源

vim /etc/yum.repos.d/zabbix.repo


如需安装4.0:将下面改为3.0改成4.0即可

  1. [zabbix]
  2. name=Zabbix Official Repository - \$basearch
  3. baseurl=https://mirrors.aliyun.com/zabbix/zabbix/3.0/rhel/7/\$basearch/
  4. enabled=1
  5. gpgcheck=1
  6. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591
  7.   
  8. [zabbix-non-supported]
  9. name=Zabbix Official Repository non-supported - \$basearch
  10. baseurl=https://mirrors.aliyun.com/zabbix/non-supported/rhel/7/\$basearch/
  11. enabled=1
  12. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX
  13. gpgcheck=1


添加gpgkey

  1. curl https://mirrors.aliyun.com/zabbix/RPM-GPG-KEY-ZABBIX-A14FE591 \
  2. -o /etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591
  3. curl https://mirrors.aliyun.com/zabbix/RPM-GPG-KEY-ZABBIX \
  4. -o /etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX


添加之后即可使用,更新源

yum makecache -y

 

文章仅为记录,脚本见下一篇文章

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/我家自动化/article/detail/707614
推荐阅读
相关标签
  

闽ICP备14008679号