https://www.cnblogs.com/linuxprobe/p/5340013.html
# 查看系统版本
VM-0-17-sles:~ # cat /etc/issue
Welcome to SUSE Linux Enterprise Server 12 SP3 (x86_64) - Kernel \r (\l).
linux-v4x5:~ # lsb_release -a
LSB Version: n/a
Distributor ID: SUSE
Description: SUSE Linux Enterprise Server 12 SP5
Release: 12.5
Codename: n/a
# 可用的镜像
# 官方镜像站点列表
http://mirrors.opensuse.org/
# 国内镜像站点
http://mirror.bjtu.edu.cn/opensuse/ 北京交通大学
http://fundawang.lcuc.org.cn/opensuse/ linux校园联盟
http://mirrors.163.com/openSUSE/ 网易开源镜像
http://mirrors.sohu.com/opensuse/ 搜狐开源镜像
http://mirrors.ustc.edu.cn/opensuse/ 中国科学技术大学开源软件镜像
http://mirrors.xmu.edu.cn/opensuse/ 厦门大学开源软件镜像
# 中华台北镜像站点
http://ftp.ncnu.edu.tw/Linux/OpenSuSE/ 国立暨南国际大学
http://ftp.twaren.net/Linux/OpenSuSE/ 国家网络计算中心
http://ftp.cse.yzu.edu.tw/pub/Linux/openSUSE/ 元智咨讯工程学系
设置方法:
使用命令 zypper addrepo -f [URL] [Alias] (Alias是自己给这个源随便定义的英文名)添加软件源并开启自动刷新,如:
zypper addrepo -f http://mirrors.163.com/openSUSE/update/11.1/ main
zypper addrepo -f http://mirrors.163.com/openSUSE/distribution/11.1/repo/non-oss/ nonoss
zypper addrepo -f http://mirrors.163.com/openSUSE/distribution/11.1/repo/oss/ oss
# 查看源
zypper lr
# | Alias | Name | Enabled | GPG Check | Refresh
--+-------------------+-------------------+---------+-----------+--------
1 | SLES12-SP5-12.5-0 | SLES12-SP5-12.5-0 | Yes | (r ) Yes | No
#禁用源
zypper modifyrepo -d SLES12-SP5-12.5-0
# 启用源
zypper modifyrepo -e SLES12-SP5-12.5-0
# 刷新
zypper refresh
# 使用命令 zypper removerepo [URL或者Alias] 删除一个软件源:
zypper removerepo http://packman.inode.at/suse/openSUSE_Leap_42.2/
# 列出配置的软件源,显示详情(优先级、网址等等):
zypper repos -d
# 只下载不安装
iZbp1d6joj9lnoern22umwZ:~ # zypper download gcc-c++
Refreshing service 'SMT-http_mirrors_cloud_aliyuncs_com'.
Loading repository data...
Reading installed packages...
Retrieving package gcc-c++-4.8-8.2.1.x86_64 (1/1), 4.9 KiB ( 0 B unpacked)
(1/1) /var/cache/zypp/packages/SMT-http_mirrors_cloud_aliyuncs_com:SLES12-SP5-Updates/x86_64/gcc-c++-4.8-8.2.1.x86_64.rpm ..............................................................................[done]
download: Done.
zypper download gcc
zypper download gcc48
zypper download gcc-c++
zypper download gcc48-c++
zypper download glibc-devel
zypper download libasan0
zypper download libatomic1
zypper download libgomp1
zypper download libitm1
zypper download libstdc++48-devel
zypper download libtsan0
zypper download linux-glibc-devel
linux-v4x5:/var/cache/zypp/packages/SLES12-SP5-12.5-0/suse/x86_64/gcc # ll
total 19880
-r--r--r-- 1 root root 5503 Jun 16 15:13 gcc-4.8-6.189.x86_64.rpm
-r--r--r-- 1 root root 4956 Jun 16 15:13 gcc-c++-4.8-6.189.x86_64.rpm
-r--r--r-- 1 root root 8986179 Jun 16 15:32 gcc48-4.8.5-31.20.1.x86_64.rpm
-r--r--r-- 1 root root 5917698 Jun 16 15:36 gcc48-c++-4.8.5-31.20.1.x86_64.rpm
-r--r--r-- 1 root root 681238 Jun 16 15:33 glibc-devel-2.22-100.15.4.x86_64.rpm
-r--r--r-- 1 root root 81705 Jun 16 15:33 libasan0-4.8.5-31.20.1.x86_64.rpm
-r--r--r-- 1 root root 16477 Jun 16 15:33 libatomic1-8.2.1+r264010-1.3.3.x86_64.rpm
-r--r--r-- 1 root root 104651 Jun 16 15:33 libgomp1-8.2.1+r264010-1.3.3.x86_64.rpm
-r--r--r-- 1 root root 35352 Jun 16 15:33 libitm1-8.2.1+r264010-1.3.3.x86_64.rpm
-r--r--r-- 1 root root 2928631 Jun 16 15:37 libstdc++48-devel-4.8.5-31.20.1.x86_64.rpm
-r--r--r-- 1 root root 287671 Jun 16 15:33 libtsan0-8.2.1+r264010-1.3.3.x86_64.rpm
-r--r--r-- 1 root root 1284623 Jun 16 15:34 linux-glibc-devel-4.12-3.3.1.noarch.rpm
linux-v4x5:/var/cache/zypp/packages/SLES12-SP5-12.5-0/suse/x86_64/gcc #
linux-v4x5:/var/cache/zypp/packages/SLES12-SP5-12.5-0/suse/x86_64/gcc # rpm -ivh *.rpm
Preparing... ################################# [100%]
Updating / installing...
1:linux-glibc-devel-4.12-3.3.1 ################################# [ 8%]
2:glibc-devel-2.22-100.15.4 ################################# [ 17%]
3:libstdc++48-devel-4.8.5-31.20.1 ################################# [ 25%]
4:libtsan0-8.2.1+r264010-1.3.3 ################################# [ 33%]
5:libitm1-8.2.1+r264010-1.3.3 ################################# [ 42%]
6:libgomp1-8.2.1+r264010-1.3.3 ################################# [ 50%]
7:libatomic1-8.2.1+r264010-1.3.3 ################################# [ 58%]
8:libasan0-4.8.5-31.20.1 ################################# [ 67%]
9:gcc48-4.8.5-31.20.1 ################################# [ 75%]
10:gcc-4.8-6.189 ################################# [ 83%]
11:gcc48-c++-4.8.5-31.20.1 ################################# [ 92%]
12:gcc-c++-4.8-6.189 ################################# [100%]
linux-v4x5:/var/cache/zypp/packages/SLES12-SP5-12.5-0/suse/x86_64 # gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib64/gcc/x86_64-suse-linux/4.8/lto-wrapper
Target: x86_64-suse-linux
Configured with: ../configure --prefix=/usr --infodir=/usr/share/info --mandir=/usr/share/man --libdir=/usr/lib64 --libexecdir=/usr/lib64 --enable-languages=c,c++,objc,fortran,obj-c++,java,ada --enable-checking=release --with-gxx-include-dir=/usr/include/c++/4.8 --enable-ssp --disable-libssp --disable-plugin --with-bugurl=https://bugs.opensuse.org/ --with-pkgversion='SUSE Linux' --disable-libgcj --disable-libmudflap --with-slibdir=/lib64 --with-system-zlib --enable-__cxa_atexit --enable-libstdcxx-allocator=new --disable-libstdcxx-pch --enable-version-specific-runtime-libs --enable-linker-build-id --enable-linux-futex --program-suffix=-4.8 --without-system-libunwind --with-arch-32=i586 --with-tune=generic --build=x86_64-suse-linux --host=x86_64-suse-linux
Thread model: posix
gcc version 4.8.5 (SUSE Linux)
make MALLOC=libc
make的时候报错:
致命错误:jemalloc/jemalloc.h:没有那个文件或目录
解决方法:
分配器allocator, 如果有MALLOC这个 环境变量, 会有用这个环境变量的 去建立Redis。
而且libc 并不是默认的分配器,默认的是 jemalloc, 因为 jemalloc 被证明 有更少的 fragmentation problems 比libc。
但是如果你又没有jemalloc而只有 libc 当然 make 出错。 所以加这么一个参数,运行如下命令:
make MALLOC=libc
解决后,正常安装redis
linux-v4x5:~ # yast -i gcc*
DEPRECATED. Use zypper directly: zypper --non-interactive install gcc*
Loading repository data...
Reading installed packages...
'gcc' providing 'gcc*' is already installed.
No update candidate for 'gcc-4.8-6.189.x86_64'. The highest available version is already installed.
'gcc48-c++' providing 'gcc*' is already installed.
No update candidate for 'gcc48-c++-4.8.5-31.20.1.x86_64'. The highest available version is already installed.
'gcc48' providing 'gcc*' is already installed.
No update candidate for 'gcc48-4.8.5-31.20.1.x86_64'. The highest available version is already installed.
Resolving package dependencies...
The following 14 NEW packages are going to be installed:
gcc-32bit gcc-c++ gcc-c++-32bit gcc-info gcc-locale gcc48-32bit gcc48-info gcc48-locale glibc-devel-32bit libasan0-32bit libatomic1-32bit libgomp1-32bit
libitm1-32bit libstdc++48-devel-32bit
14 new packages to install.
Overall download size: 8.2 MiB. Already cached: 0 B. After the operation, additional 30.5 MiB will be used.
Continue? [y/n/...? shows all options] (y): y
Retrieving package gcc48-info-4.8.5-31.20.1.noarch (1/14), 2.0 MiB ( 2.0 MiB unpacked)
Retrieving package gcc-c++-4.8-6.189.x86_64 (2/14), 4.8 KiB ( 0 B unpacked)
Retrieving package gcc48-locale-4.8.5-31.20.1.x86_64 (3/14), 1.4 MiB ( 8.7 MiB unpacked)
Retrieving package glibc-devel-32bit-2.22-100.15.4.x86_64 (4/14), 137.8 KiB (307.6 KiB unpacked)
Retrieving package libasan0-32bit-4.8.5-31.20.1.x86_64 (5/14), 80.6 KiB (177.8 KiB unpacked)
Retrieving package libatomic1-32bit-8.2.1+r264010-1.3.3.x86_64 (6/14), 15.6 KiB ( 21.4 KiB unpacked)
Retrieving package libgomp1-32bit-8.2.1+r264010-1.3.3.x86_64 (7/14), 99.9 KiB (239.5 KiB unpacked)
Retrieving package libitm1-32bit-8.2.1+r264010-1.3.3.x86_64 (8/14), 36.3 KiB (105.6 KiB unpacked)
Retrieving package gcc-info-4.8-6.189.x86_64 (9/14), 8.0 KiB ( 0 B unpacked)
Retrieving package gcc-locale-4.8-6.189.x86_64 (10/14), 4.8 KiB ( 72 B unpacked)
Retrieving package libstdc++48-devel-32bit-4.8.5-31.20.1.x86_64 (11/14), 1.8 MiB ( 9.3 MiB unpacked)
Retrieving package gcc48-32bit-4.8.5-31.20.1.x86_64 (12/14), 2.6 MiB ( 9.6 MiB unpacked)
Retrieving package gcc-32bit-4.8-6.189.x86_64 (13/14), 4.8 KiB ( 72 B unpacked)
Retrieving package gcc-c++-32bit-4.8-6.189.x86_64 (14/14), 4.9 KiB ( 72 B unpacked)
Checking for file conflicts: ..........................................................................................................................[done]
( 1/14) Installing: gcc48-info-4.8.5-31.20.1.noarch ...................................................................................................[done]
( 2/14) Installing: gcc-c++-4.8-6.189.x86_64 ..........................................................................................................[done]
( 3/14) Installing: gcc48-locale-4.8.5-31.20.1.x86_64 .................................................................................................[done]
( 4/14) Installing: glibc-devel-32bit-2.22-100.15.4.x86_64 ............................................................................................[done]
( 5/14) Installing: libasan0-32bit-4.8.5-31.20.1.x86_64 ...............................................................................................[done]
( 6/14) Installing: libatomic1-32bit-8.2.1+r264010-1.3.3.x86_64 .......................................................................................[done]
( 7/14) Installing: libgomp1-32bit-8.2.1+r264010-1.3.3.x86_64 .........................................................................................[done]
( 8/14) Installing: libitm1-32bit-8.2.1+r264010-1.3.3.x86_64 ..........................................................................................[done]
( 9/14) Installing: gcc-info-4.8-6.189.x86_64 .........................................................................................................[done]
(10/14) Installing: gcc-locale-4.8-6.189.x86_64 .......................................................................................................[done]
(11/14) Installing: libstdc++48-devel-32bit-4.8.5-31.20.1.x86_64 ......................................................................................[done]
(12/14) Installing: gcc48-32bit-4.8.5-31.20.1.x86_64 ..................................................................................................[done]
(13/14) Installing: gcc-32bit-4.8-6.189.x86_64 ........................................................................................................[done]
(14/14) Installing: gcc-c++-32bit-4.8-6.189.x86_64 ....................................................................................................[done]