linux deploy下安装CentOS7的初始处理

linux deploy下安装CentOS7的初始处理

  • 增加dns:
  • 修改软件源为阿里云
    • 先备份原配置文件,以防丢失时恢复配置
    • 下载阿里云的CentOS-Base.repo 到 /etc/yum.repos.d/
    • 更新rpm秘钥:
    • 更新yum的软件源
  • 安装gcc

增加dns:

vi /etc/resolv.conf

[root@localhost ~]# vi /etc/resolv.conf
[root@localhost ~]# 
[root@localhost ~]# 
[root@localhost ~]# cat /etc/resolv.conf 
nameserver 192.168.31.1
# 增加dns
nameserver 8.8.8.8
nameserver 114.114.114.114
[root@localhost ~]# 

修改软件源为阿里云

先备份原配置文件,以防丢失时恢复配置

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
mv /etc/yum.repos.d/CentOS-7-aarch64.repo /etc/yum.repos.d/CentOS-7-aarch64.repo.backup

下载阿里云的CentOS-Base.repo 到 /etc/yum.repos.d/

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
wget -O /etc/yum.repos.d/CentOS-7-aarch64.repo http://mirrors.aliyun.com/repo/Centos-altarch-7.repo

更新rpm秘钥:

rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7-aarch64

更新yum的软件源

wget https://mirrors.tuna.tsinghua.edu.cn/epel//7/aarch64/Packages/e/epel-release-7-12.noarch.rpm
rpm -ivh epel-release-7-12.noarch.rpm
yum clean all
yum update

安装gcc

yum -y install gcc gcc-c++ kernel-devel

你可能感兴趣的:(坚持学习,未来可期,旧手机折腾篇)