安装gcc-c++报错如下:

Loaded plugins: fastestmirror, langpacks
Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast
http://mirror.lzu.edu.cn/centos/7.6.1810/os/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found
Trying other mirror.
To address this issue please refer to the below knowledge base article 

https://access.redhat.com/articles/1320623

If above article doesn't help to resolve this issue please create a bug on https://bugs.centos.org/

解决办法

在命令行输入以下内容:

[root@localhost ~]# vim /etc/yum.repos.d/CentOS-Base.repo

将enabled=1即可

 再次安装,成功!