What's New In IT Edge?
 

centos7离线安装redis6

centos版本:centos7

redis版本:redis6.0.8  自己去官网下载

因为centos7的gcc版本过低,需要先升级gcc版本

下载devtoolset-7-gcc :https://download.csdn.net/download/muguku/14987861

下载后将文件上传到离线到服务器上,比如我们这里上传到/opt下

进去上传文件到目录下,然后执行:

 rpm -ivh devtoolset-7-* libgfortran4-8.3.1-2.1.1.el7.x86_64.rpm gmp-devel-6.0.0-15.el7.x86_64.rpm libmpc-devel-1.0.1-3.el7.x86_64.rpm mpfr-devel-3.1.1-4.el7.x86_64.rpm

然后执行

source /opt/rh/devtoolset-7/enable

gcc -v

Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,fortran,lto --prefix=/opt/rh/devtoolset-7/root/usr --mandir=/opt/rh/devtoolset-7/root/usr/share/man --infodir=/opt/rh/devtoolset-7/root/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --enable-plugin --with-linker-hash-style=gnu --enable-initfini-array --with-default-libstdcxx-abi=gcc4-compatible --with-isl=/builddir/build/BUILD/gcc-7.3.1-20180303/obj-x86_64-redhat-linux/isl-install --enable-libmpx --enable-gnu-indirect-function --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux

这样gcc就升级到7.3.1了,就可以正常编译安装redis6了