新增安装的centos7虚拟机,按要求需要安装docker-compose,遇到了使用docker-compose命令时报错
“[11798] Error loading Python lib ‘/tmp/_MEIztwHzf/libpython3.9.so.1.0’: dlopen: /lib64/libc.so.6: version ‘GLIBC_2.28’ not found (required by /tmp/_MEIztwHzf/libpython3.9.so.1.0)”,
然后有下载glibc-2.28进行安装又遇到报错
“configure: error: in `/root/test/glibc-2.28/build’:
configure: error: no acceptable C compiler found in $PATH” ,
然后按照论坛的推荐安装了yum install gcc,后又报错
“These critical programs are missing or too old: make bison compiler
Check the INSTALL file for required versions.”,
后面安装了升级了make和bison,仍然继续报错“These critical programs are missing or too old: compiler
Check the INSTALL file for required versions.”确实脑壳都爆了。
偶然翻得一篇文章https://blog.csdn.net/u012149637/article/details/112968173解决了我的问题,现将整个安装流程及问题解决整理一遍。
1.开通外网
2.安装docker
3.docker-compose
4.centos升级GCC编译器
5.升级make
6.安装glibc-2.28
1.开启外网
1.1打开网络:
/etc/sysconfig/network-scripts/ifcfg-ens33
修改NOBOOT为yes
1.2重启网络:
service network restart
2安装docker:
2.1docker安装
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
sudo yum-config-manager --add-repo
sudo yum install docker-ce docker-ce-cli containerd.io
2.2查看docker是否安装成功
[root@localhost test]# docker --version
Docker version 20.10.2, build 2291f61
2.3启动docker
service docker start
2.4设置开机启动
systemctl enable docker.service
3.安装docker-compose
3.1.安装docker-compose
sudo curl -L "https://github.com/docker/compose/releases/download/1.28.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
3.2.修改docker-compose可执行权限
chmod +x /usr/local/bin/docker-compose
3.3 验证docker-compose安装成功
docker-compose --version
报错“[11798] Error loading Python lib ‘/tmp/_MEIztwHzf/libpython3.9.so.1.0’: dlopen: /lib64/libc.so.6: version `GLIBC_2.28’ not found (required by /tmp/_MEIztwHzf/libpython3.9.so.1.0)”
解决方案:升级glibc到2.28版本
3.4安装glibc-2.28
curl -O
tar zxf glibc-2.28.tar.gz
cd glibc-2.28/
mkdir build
cd build/
../configure --prefix=/usr/local/glibc-2.28
运行到…/configure --prefix=/usr/local/glibc-2.28时报错
报错1:
configure: error: in `/root/test/glibc-2.28/build’:
configure: error: no acceptable C compiler found in $PATH
解决方案: 安装GCC软件套件
yum install gcc
报错2:
These critical programs are missing or too old: make bison compiler
Check the INSTALL file for required versions.
解决方案: make bison compiler太过老旧
4. centos 升级GCC编译器
yum -y install centos-release-scl
yum -y install devtoolset-8-gcc devtoolset-8-gcc-c++ devtoolset-8-binutils
scl enable devtoolset-8 bash
echo "source /opt/rh/devtoolset-8/enable" >>/etc/profile
5.升级make
wget
tar -xzvf make-4.2.tar.gz
cd make-4.2
sudo ./configure
sudo makesudo make install
sudo rm -rf /usr/bin/makes
udo cp ./make /usr/bin/make -v
6.升级glibc-2.28
curl -O http://ftp.gnu.org/gnu/glibc/glibc-2.28.tar.gztar zxf glibc-2.28.tar.gz
cd glibc-2.28/
mkdir build
cd build/
sudo ../configure --prefix=/usr --disable-profile --enable-add-ons --with-headers=/usr/include --with-binutils=/usr/bin
make
//make 运行时间较长
(运行make时报错:
解决方案:
sudo yum install -y bison
make install
通过strings /lib64/libc.so.6 |grep GLIBC查询是否存在glibc-2.28版本
推荐本站淘宝优惠价购买喜欢的宝贝:
本文链接:https://hqyman.cn/post/5363.html 非本站原创文章欢迎转载,原创文章需保留本站地址!
打赏微信支付宝扫一扫,打赏作者吧~
休息一下~~