今天在安装pcre时,在解压之后的目录下,进行./configure操作,发生报错 “configure: error: Invalid C++ compiler or C++ compiler flags”。
查阅资料后发现是需要安装c++编译器,网上建议使用 yum install -y gcc-c++操作,实际操作之后发现问题不少,一开始找不到yum,于是又去安装yum,安装的过程中发现,Ubuntu官网挂掉,又换阿里云镜像,发现还是不行,DNS配置出错,继续修改配置文件。流程总结如下。
更改apt镜像源
1.进入apt源配置文件目录
cd /etc/apt
2.最好先进行拷贝
cp /etc/apt/sources.list /etc/apt/sources.list.bak
3.替换阿里云镜像网站
sudo sed -i 's/archive.ubuntu.com/mirrors.aliyun.com/g' /etc/apt/sources.list
之后对apt进行更新,发生报错:
修改DNS配置文件
vi etc/resolv.conf
在文本中添加以下内容:
nameserver 8.8.8.8
nameserver 8.8.4.4
执行更新操作
sudo apt-get update
sudo apt-get upgrade
在Ubuntu上安装GCC
sudo apt install build-essential
此时GCC安装完成,报错解决