CentOS7升级GNU Bash

1、下载GNU Bash的源码

GNU Bash下载地址:
http://ftp.gnu.org/gnu/bash/

2、上传bash5.2.21.tar.gz包到服务器上
3、备份原来的旧bash
bash 复制代码
mv /bin/bash /bin/bash.bak
4、解压缩bash5.2.21.tar.gz包

进入bash5.2.21.tar.gz包所在的目录

bash 复制代码
tar -zxvf bash5.2.21.tar.gz
5、进入bash源码目录
bash 复制代码
cd bash-5.2.21
6、配置编译参数,指定 bash 安装至 /bin
bash 复制代码
./configure --prefix=/ --bindir=/bin --without-bash-malloc
7、编译
bash 复制代码
make
8、安装
bash 复制代码
make install
9、验证新 bash 版本
bash 复制代码
/bin/bash -version
10、清空 shell 命令缓存
bash 复制代码
hash -r
11、检验新bash的版本
bash 复制代码
type bash
bash 复制代码
bash -version
12、检查新bash是否存在
bash 复制代码
ls -l /bin/bash
相关推荐
ziyitty2 小时前
解决Windows下Bash调用Python输出中文乱码的问题
windows·python·bash
一碗白开水一3 小时前
【训练技巧】bash: conda: command not found:conda 没有适配环境
开发语言·conda·bash
utf8mb4安全女神1 天前
怎么写shell/bash脚本【if嵌套】【case】【while死循环】【while嵌套if】【for】【随机数】
开发语言·bash
shandianchengzi1 天前
【记录】VSCode|Windows 下 VS Code 配置 Git Bash 为默认终端完整教程
windows·git·vscode·bash
承渊政道1 天前
【MySQL数据库学习】MySQL基本查询(上)
linux·数据库·学习·mysql·bash·数据库开发·数据库系统
小怪不太怪~1 天前
本地项目上传到GitHub--小怪教程(Git Bash实操+常见报错解决
git·github·bash
楚枫默寒5 天前
Linux 编辑文件后自动添加修改日期
linux·运维·bash
日晨难再6 天前
C语言&Python&Bash&Tcl:全局变量和局部变量
c语言·python·bash·tcl
闲猫6 天前
SSH 黑屏配置试用环境机器,受限bash和自定义shell
运维·ssh·bash
承渊政道7 天前
【MySQL数据库学习】MySQL表的约束(上)
数据库·c++·学习·mysql·bash·数据库架构·数据库系统