CentOS 8 上的 header socket.h 在哪里?
Where is the header socket.h on CentOS 8?
在 Ubuntu 20.04 我有:
$ dpkg -S /usr/include/x86_64-linux-gnu/sys/socket.h
libc6-dev:amd64: /usr/include/x86_64-linux-gnu/sys/socket.h
而在装有 CentOS 8 的 docker 容器中,没有文件 /usr/include/x86_64-linux-gnu/sys/socket.h
如果我尝试
$ yum whatprovides socket.h
CentOS-8 - AppStream 1.8 MB/s | 7.0 MB 00:03
CentOS-8 - Base 3.3 MB/s | 2.2 MB 00:00
CentOS-8 - Extras 8.9 kB/s | 5.5 kB 00:00
Error: No Matches found
和
$ rpm -q --whatprovides socket.h
no package provides socket.h
您可以将通配符传递给 yum whatprovides
:
$ yum whatprovides /usr/include/*sys/socket.h
Last metadata expiration check: 0:00:26 ago on Mon 04 May 2020 04:34:26 PM EDT.
glibc-headers-2.30-5.fc31.i686 : Header files for development using standard C libraries.
Repo : fedora
Matched from:
Filename : /usr/include/sys/socket.h
glibc-headers-2.30-5.fc31.x86_64 : Header files for development using standard C libraries.
Repo : fedora
Matched from:
Filename : /usr/include/sys/socket.h
glibc-headers-2.30-11.fc31.x86_64 : Header files for development using standard C libraries.
Repo : @System
Matched from:
Filename : /usr/include/sys/socket.h
glibc-headers-2.30-11.fc31.x86_64 : Header files for development using standard C libraries.
Repo : updates
Matched from:
Filename : /usr/include/sys/socket.h
所以你的答案是glibc-headers
。
在 Ubuntu 20.04 我有:
$ dpkg -S /usr/include/x86_64-linux-gnu/sys/socket.h
libc6-dev:amd64: /usr/include/x86_64-linux-gnu/sys/socket.h
而在装有 CentOS 8 的 docker 容器中,没有文件 /usr/include/x86_64-linux-gnu/sys/socket.h
如果我尝试
$ yum whatprovides socket.h
CentOS-8 - AppStream 1.8 MB/s | 7.0 MB 00:03
CentOS-8 - Base 3.3 MB/s | 2.2 MB 00:00
CentOS-8 - Extras 8.9 kB/s | 5.5 kB 00:00
Error: No Matches found
和
$ rpm -q --whatprovides socket.h
no package provides socket.h
您可以将通配符传递给 yum whatprovides
:
$ yum whatprovides /usr/include/*sys/socket.h
Last metadata expiration check: 0:00:26 ago on Mon 04 May 2020 04:34:26 PM EDT.
glibc-headers-2.30-5.fc31.i686 : Header files for development using standard C libraries.
Repo : fedora
Matched from:
Filename : /usr/include/sys/socket.h
glibc-headers-2.30-5.fc31.x86_64 : Header files for development using standard C libraries.
Repo : fedora
Matched from:
Filename : /usr/include/sys/socket.h
glibc-headers-2.30-11.fc31.x86_64 : Header files for development using standard C libraries.
Repo : @System
Matched from:
Filename : /usr/include/sys/socket.h
glibc-headers-2.30-11.fc31.x86_64 : Header files for development using standard C libraries.
Repo : updates
Matched from:
Filename : /usr/include/sys/socket.h
所以你的答案是glibc-headers
。