在 Ubuntu 里,getconf 一般不需要单独安装,它是系统自带工具,属于 libc-bin 包(glibc 的一部分)。
先执行:
getconf --version
或
which getconf
如果有输出路径(如 /usr/bin/getconf),说明已经安装。
可以安装它所属的包:
sudo apt update
sudo apt install libc-bin
安装完成后即可使用:
getconf LONG_BIT
getconf -a
getconf PAGE_SIZE
getconf _NPROCESSORS_ONLN
getconf PATH_MAX
如果你是在 最小化容器(如 docker ubuntu:minimal) 里遇到这个问题,安装 libc-bin 通常就能解决。
需要我帮你查某个具体 getconf 参数吗?