村網(wǎng)站建設計劃書深圳專業(yè)建站公司
使用VMWare安裝centos7
啟用網(wǎng)卡設備
修改文件/etc/sysconfig/network-scripts/ifcfg-ens33中的ONBOOT=yes
重啟網(wǎng)絡服務 systemctl restart network
配置yum倉庫
直接將如下內(nèi)容覆蓋原有的/etc/yum.repos.d/CentOS-Base.repo文件
清理yum緩存
yum clean all
刷新yum
yum update
注意:本機是X86_64并且是centos7環(huán)境
# 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-7 - Base - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/7/os/x86_64/http://mirrors.aliyuncs.com/centos/7/os/x86_64/http://mirrors.cloud.aliyuncs.com/centos/7/os/x86_64/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7#released updates
[updates]
name=CentOS-7 - Updates - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/7/updates/x86_64/http://mirrors.aliyuncs.com/centos/7/updates/x86_64/http://mirrors.cloud.aliyuncs.com/centos/7/updates/x86_64/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7#additional packages that may be useful
[extras]
name=CentOS-7 - Extras - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/7/extras/x86_64/http://mirrors.aliyuncs.com/centos/7/extras/x86_64/http://mirrors.cloud.aliyuncs.com/centos/7/extras/x86_64/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-7 - Plus - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/7/centosplus/x86_64/http://mirrors.aliyuncs.com/centos/7/centosplus/x86_64/http://mirrors.cloud.aliyuncs.com/centos/7/centosplus/x86_64/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7#contrib - packages by Centos Users
[contrib]
name=CentOS-7 - Contrib - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/7/contrib/x86_64/http://mirrors.aliyuncs.com/centos/7/contrib/x86_64/http://mirrors.cloud.aliyuncs.com/centos/7/contrib/x86_64/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
安裝wget
yum install -y wget
安裝gcc
新建一個目錄并且進入該目錄
mkdir ~/software;cd ~/software
下載gcc安裝包
wget https://ftp.gnu.org/gnu/gcc/gcc-10.5.0/gcc-10.5.0.tar.gz
解壓安裝包
tar -xvf gcc-10.5.0.tar.gz
進入解壓后的文件夾
cd gcc-10.5.0
下載gcc 依賴項
yum install make bzip2 curl file gcc gcc-c++ glibc-devel glibc-static libmpc-devel mpfr-devel libstdc++-devel libatomic libatomic-devel perl-ExtUtils-MakeMaker perl-Test-Simple perl-File-Temp perl-Time-HiRes perl-Path-Tiny perl-Getopt-Long perl-File-Copy-Recursive perl-Module-BuildTiny texinfo bison flex libmpc libmpfr libgmp zlib-devel
下載前置依賴項
./contrib/download_prerequisites
配置gcc
./configure --prefix=/usr/local --enable-bootstrap --enable-languages=c,c++,fortran --disable-multilib --enable-shared --with-system-zlib --without-included-gettext
編譯gcc
make -j$(nproc)
注意:若編譯過程中出現(xiàn)其他報錯,一般是依賴項錯誤,可以自行根據(jù)錯誤信息檢索解決方法
安裝gcc