centos7 查看pcre pcre-devel有没有安装命令
时间: 2023-02-14 07:06:15 浏览: 517
可以使用命令 "yum list installed | grep pcre" 和 "yum list installed | grep pcre-devel" 来查看 pcre 和 pcre-devel 是否已经安装在 CentOS7 上。
相关问题
写一个linux的shell脚本,自动分辨操作系统区别,在centos操作系统下执行yum install -y libpcap libpcap-devel file-libs pcre-devel pcre libyaml-devel libyaml libcap-ng-devel libcap-ng jansson jansson-devel,在其他操作系统下执行apt install -y libpcap libpcap-dev file-libs pcre-dev pcre libyaml-dev libyaml libcap-ng-dev libcap-ng jansson jansson-de
以下是一个自动分辨操作系统并执行相应命令的shell脚本:
```bash
#!/bin/bash
# 检查操作系统类型
if [[ $(uname -s) == "Linux" ]]; then
if [[ -f /etc/os-release ]]; then
. /etc/os-release
OS=$ID
else
OS=$(uname -s)
fi
else
echo "该脚本只能在Linux系统上运行!"
exit 1
fi
# 根据操作系统类型执行相应命令
if [[ $OS == "centos" ]]; then
yum install -y libpcap libpcap-devel file-libs pcre-devel pcre libyaml-devel libyaml libcap-ng-devel libcap-ng jansson jansson-devel
elif [[ $OS == "ubuntu" || $OS == "debian" ]]; then
apt install -y libpcap libpcap-dev file-libs pcre-dev pcre libyaml-dev libyaml libcap-ng-dev libcap-ng jansson jansson-dev
else
echo "不支持的操作系统类型:$OS"
exit 1
fi
```
该脚本会在执行时自动检测操作系统类型,并根据类型执行相应的安装命令。如果检测到的操作系统类型不是CentOS、Ubuntu或Debian,则会提示不支持的操作系统类型并退出。
gcc zlib zlib-devel pcre-devel openssl openssl-devel centos7系统离线安装包哪里下载
对于 CentOS 7 系统,你可以在以下镜像站点中下载这些离线安装包:
- GCC:http://ftp.gnu.org/gnu/gcc/
- zlib:https://www.zlib.net/
- zlib-devel:http://mirror.centos.org/centos/7/os/x86_64/Packages/zlib-devel-1.2.7-18.el7.x86_64.rpm
- pcre-devel:http://mirror.centos.org/centos/7/os/x86_64/Packages/pcre-devel-8.32-17.el7.x86_64.rpm
- openssl:https://www.openssl.org/source/
- openssl-devel:http://mirror.centos.org/centos/7/os/x86_64/Packages/openssl-devel-1.0.2k-19.el7.x86_64.rpm
以上链接中的 RPM 文件可以通过 yum 命令进行安装,例如:
```
yum install -y /path/to/zlib-devel-1.2.7-18.el7.x86_64.rpm
```
注意,这些镜像站点可能随时更新或者改变链接,建议在下载前仔细核对下载链接和版本号。
阅读全文