写一个linux的shell脚本,在yum系操作系统下执行yum install -y libpcap libpcap-devel file-libs pcre-devel pcre libyaml-devel libyaml libcap-ng-devel libcap-ng jansson jansson-devel,在apt系操作系统下执行apt install -y libpcap libpcap-dev file-libs pcre-dev pcre libyaml-dev libyaml libcap-ng-dev libcap-ng jansson jansson-de
时间: 2024-01-07 18:05:22 浏览: 124
一键配置本地yum源的shell脚本
好的,以下是针对不同操作系统的脚本:
对于yum系操作系统:
```bash
#!/bin/bash
yum install -y libpcap libpcap-devel file-libs pcre-devel pcre libyaml-devel libyaml libcap-ng-devel libcap-ng jansson jansson-devel
```
对于apt系操作系统:
```bash
#!/bin/bash
apt install -y libpcap libpcap-dev file-libs pcre-dev pcre libyaml-dev libyaml libcap-ng-dev libcap-ng jansson jansson-dev
```
请注意,这两个脚本中的命令可能需要以root用户的身份才能执行。您需要使用sudo或者在root用户下执行脚本。此外,这些命令也需要网络连接才能成功下载和安装软件包。
阅读全文