yum配置

普通配置

  • 关闭防火墙

  • 然后关闭selinux

  • 查看网卡 nmcli c s

  • 刷新网卡 nmcli c u ens33

  • 开启ssh远程连接 vi /etc/ssh/sshd_config

  • 刷新服务 systemctl restart sshd

  • 先暂时挂载mount /opt/镜像 /mnt/

  • 然后永久挂载echo /opt/镜像 /mnt/ iso9660 defaults 0 0 >> /etc/fstab

  • 然后进入/etc/yum.repo

  • 全部删除

    1
    2
    3
    4
    5
    6
    7
    8
    vi /etc/yum.repo
    [1]
    name=1
    baseurl=file:///mnt/
    enabled=1
    gpgcheck=0

    yum repolist all

阿里云源:

1
2
3
4
5
6
7
8
9
先安装wget    yum install wget -y
然后拿文件
wget -O /etc/yum.repo.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
然后清理缓存还有生成新的缓存
清理 yum clean all
生成 yum makecache
接下来下载epel库
yum install epel-release -y
然后重复一次清理和生成就可以了