【问题标题】:Where is the header socket.h on CentOS 8?CentOS 8 上的头文件 socket.h 在哪里?
【发布时间】:2020-05-05 04:36:12
【问题描述】:

在 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

【问题讨论】:

    标签: linux centos yum


    【解决方案1】:

    您可以将通配符传递给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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-07-24
      • 1970-01-01
      • 2022-01-19
      • 1970-01-01
      • 2014-08-28
      • 1970-01-01
      • 2012-12-28
      相关资源
      最近更新 更多