openEuler 2509 devStation 安装tcpdump 失败。

Downloading Packages:
tcpdump-4.99.5-1.oe2509.x86_64.rpm                                                           1.2 MB/s | 504 kB     00:00    
-----------------------------------------------------------------------------------------------------------------------------
Total                                                                                        323 kB/s | 504 kB     00:01     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                     1/1 
  Running scriptlet: tcpdump-14:4.99.5-1.oe2509.x86_64                                                                   1/1 
错误:%prein(tcpdump-14:4.99.5-1.oe2509.x86_64) 脚本执行失败,退出状态码为 6

Error in PREIN scriptlet in rpm package tcpdump
  Verifying        : tcpdump-14:4.99.5-1.oe2509.x86_64                                                                   1/1 

Failed:
  tcpdump-14:4.99.5-1.oe2509.x86_64                                                                                          

Error: Transaction failed

系统信息:

$ cat /etc/openEuler-release 
openEuler release 25.09
$ uname -a
Linux hw-pc 6.6.0-102.0.0.8.oe2509.x86_64 #1 SMP Tue Sep 23 19:58:30 CST 2025 x86_64 x86_64 x86_64 GNU/Linux

怎解?

① 是使用 root 用户安装的吗
② 看一下系统的 GID,72 是不是被占用了

pre-install 脚本看起来就创建一个 tcpdump 组和用户:

%pre
user_id=$(id -u tcpdump 2> /dev/null)

if [ "_${user_id}" = "_" ]; then
    # check and create group tcpdump first
    if ! getent group tcpdump &> /dev/null; then
     /usr/sbin/groupadd -g 72 tcpdump 2> /dev/null
    fi
    # group tcpdump may created by other, id is not sure
    /usr/sbin/useradd -r -u 72 -g tcpdump -d /home/tcpdump -M -s /sbin/nologin tcpdump 2> /dev/null
fi

首先,肯定是使用root用户执行软件安装。

其次,我查了, /etc/passwd, group 两个文件中均未有uid,gid为72的用户或组名称。另外,在ubuntu下看到,用户或组号是 95,这种专用的用户或组号,是各发行版自己定义的吗?