配置阿里云yum源

  • 配置阿里云yum源已关闭评论
  • 103 次浏览
  • A+
所属分类:linux技术
  1. 修改默认的yum仓库,把原有的移动到创建的目录里(踢出国外的yum源)
# 切换到/ect/yum.repos.d/目录下 cd /etc/yum.repos.d/ # 新建repo目录 mkdir repo # 把原有的移动到创建的目录里 mv ./*.repo ./repo/ 
  1. 配置yum源
# 找到阿里云的官方镜像源地址 https://opsx.alibaba.com/mirror 
  1. 如果没有wget 可以先yum安装
yum -y install wget 
  1. 下载centos7的yum源
# wget下载 wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo # curl下载(如果yum安装wget失败的话用curl) curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo 
  1. 清空旧的yum缓存
yum clean all 
  1. 生成新的yum仓库缓存(这个缓存来自于阿里云的yum仓库,便于加速软件下载)
yum makecache 
  1. 显示当前可用yum源
yum repolist 
  1. 安装CentOS基础依赖
yum -y install gcc gcc-c++ make ntpdate bzip2-devel curl-devel libjpeg-devel libpng-devel freetype-devel libXpm-devel gmp-devel openldap-devel unixODBC-devel postgresql-devel sqlite-devel net-snmp-devel libxslt-devel libxml2-devel pcre pcre-devel mysql-devel libmemcached zlib zlib-devel vim wget lrzsz tree nmap elinks openssl openssl-devel curl lynx net-tools dos2unix nc tcpdump iotop sysstat vim-enhanced ruby patch bash-completion zip unzip lsof psmisc python-devel expat-devel libnl-devel cyrus-sasl* 
  1. 因为CentOS7操作系统默认安装mariadb-libs库,它与MySQL冲突,影响初始化
yum -y remove mariadb-libs