一. 安装nushell
- 前置准备项
基于RHEL系统库安装
yum install libxcb openssl-devel libX11-devel -y
- github下载最新的bin安装包.
https://github.com/nushell/nushell
下载最新的0.35.0版本:
3. 解压/安装
- cd /tmp
- curl -s https://api.github.com/repos/nushell/nushell/releases/latest | grep browser_download_url | cut -d ‘"’ -f 4 | grep ‘\linux.tar.gz’ | wget -i -
tar -xvf nu_*_linux.tar.gz
将二进制文件复制到您的 PATH:
A).如果只想体验nu的基础功能
cp /tmp/nu_0_35_0_linux/nushell-0.35.0/nu /usr/local/bin
B).如果想体验nu的全部功能
cp /tmp/nu_0_35_0_linux/nushell-0.35.0/* /usr/local/bin
此外,还可以将文件拷贝到opt目录下, 在配置环境变量允许任何路径下都可以访问到nu命令.
①. cp /tmp/nu_0_35_0_linux/nushell-0.35.0 /opt/
②. /etc/profile中配置:
export PATH=$JAVA_HOME/bin:$PATH:$/opt/nushell-0.35.0
③. source /etc/profile
- 使用nu
命令行下,键入nu命令进入nushell的世界.
二. 安装中的issue解决
如果您本地linux中的GLIBC的版本较低,如笔者的为2.17
版本查询命令:
strings /lib64/libc.so.6 | grep GLIBC
则在执行nu命令时,大概率会报如下错误:
[root@dn2 build]# nu
nu: /lib64/libm.so.6: version `GLIBC_2.18' not found (required by nu)
nu: /lib64/libm.so.6: version `GLIBC_2.27' not found (required by nu)
nu: /lib64/libm.so.6: version `GLIBC_2.29' not found (required by nu)
此时需要按如下步骤来升级GLIBC库到较高版本:
# wget http://ftp.gnu.org/gnu/glibc/glibc-2.18.tar.gz
# wget http://ftp.gnu.org/gnu/glibc/glibc-2.27.tar.gz
# wget http://ftp.gnu.org/gnu/glibc/glibc-2.29.tar.gz
# tar -xf glibc-2.18.tar.gz
# ll
# cd glibc-2.18
# ll
# mkdir build; cd build
# ../configure --prefix=/usr --disable-profile --enable-add-ons --with-headers=/usr/include --with-binutils=/usr/bin
# make -j 8
# make install
# strings /lib64/libc.so.6 | grep GLIBC
# nu
经实验发现,安装GLIBC_2.18是没有问题的.
if test -r /usr/include/gnu/stubs-64.h && cmp -s /tmp/glibc-2.18/build/stubs.h /usr/include/gnu/stubs-64.h; \
then echo 'stubs.h unchanged'; \
else /bin/install -c -m 644 /tmp/glibc-2.18/build/stubs.h /usr/include/gnu/stubs-64.h; fi
stubs.h unchanged
rm -f /tmp/glibc-2.18/build/stubs.h
/tmp/glibc-2.18/build/elf/sln /tmp/glibc-2.18/build/elf/symlink.list
rm -f /tmp/glibc-2.18/build/elf/symlink.list
test ! -x /tmp/glibc-2.18/build/elf/ldconfig || LC_ALL=C LANGUAGE=C \
/tmp/glibc-2.18/build/elf/ldconfig \
/lib64 /usr/lib64
LD_SO=ld-linux-x86-64.so.2 CC="gcc -B/usr/bin/" /bin/perl scripts/test-installation.pl /tmp/glibc-2.18/build/
Your new glibc installation seems to be ok.
make[1]: Leaving directory `/tmp/glibc-2.18'
但安装GLIBC_2.2x版本(如GLIBC_2.27)时, 会报如下错误:
checking version of sed... 4.2.2, ok
checking for gawk... gawk
checking version of gawk... 4.0.2, ok
checking for bison... no
checking if gcc -B/usr/bin/ is sufficient to build libc... no
checking for nm... nm
checking for python3... no
checking for python... python
configure: error:
*** These critical programs are missing or too old: bison compiler
*** Check the INSTALL file for required versions.
bison的作用经查,是:
这个包是Linux的基础包之一,它包括 bison 和 yacc 这两个程序,用于GNU编译工具包的语法生成,以一系列规则, 分析文本文件结构,这个库通常没有什么用处,但是POSIX 需要它。
解决办法也很简单, 直接安装bison库即可,如下:
[root@dn2 build]# yum -y install bison
[root@dn2 build]# bison -V
bison (GNU Bison) 3.0.4
Written by Robert Corbett and Richard Stallman.
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
安装后,再次执行编译打包命令,发现如下错误:
checking for bison... bison
checking version of bison... 3.0.4, ok
checking if gcc -B/usr/bin/ is sufficient to build libc... no
checking for nm... nm
checking for python3... no
checking for python... python
configure: error:
*** These critical programs are missing or too old: compiler
*** Check the INSTALL file for required versions.
显然提示python3未安装, 安装python3 即可. 必要时, centos 7.6下把make工具 升级到make4.2.