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
相关推荐
scx_link13 天前
通过git bash在本地创建分支,并推送到远程仓库中
开发语言·git·bash
江华森13 天前
高级 Bash 脚本编程指南 — 实战教程
开发语言·bash
承渊政道13 天前
【MySQL数据库学习】(MySQL表的内外连接)
数据库·学习·mysql·leetcode·bash·数据库开发·数据库系统
hyunbar14 天前
配置 Cloudflare Tunnel:把 Mac 上的 Web 服务变成安全域名
网络协议·https·bash
承渊政道14 天前
【MySQL数据库学习】(MySQL复合查询)
数据库·学习·mysql·bash·database·数据库开发·数据库架构
zh路西法16 天前
【tmux入门】终端分屏、SSH远程守护与一键启动脚本
linux·运维·ssh·bash
承渊政道16 天前
【MySQL数据库学习】(MySQL内置函数)
数据库·学习·mysql·ubuntu·bash·数据库开发·数据库系统
allway217 天前
How to Echo Multiline to a File in Bash [3 Methods]
开发语言·chrome·bash
Dontla17 天前
git bash打开Claude code报错:Claude Code on Windows requires git-bash.(别把git装其他位置,严格按照默认安装)找不到claude code
windows·git·bash
weixin_4624462317 天前
手把手教你用 Bash 脚本自动更新 /etc/hosts —— 自动绑定网卡 IP 与节点名
开发语言·tcp/ip·bash