Solve CentOS/Alma installation libpcap-devel error: No match for argument: libpcap-devel

Environment: Alma 8.5,Centos 7.x

solution

LinuxWhen installing the software, you need libpcap-develthis component, execute the command: yum install libpcap-devel, and report the error as follows:

Last metadata expiration check: 0:05:24 ago on Mon 12 Jun 2023 09:27:18 AM CST.
No match for argument: libpcap-devel
Error: Unable to find a match: libpcap-devel

The corresponding dependency is not matched. Through Googlethe search, the main reason for this problem is that the repository CentOS 8 / Rocky Linux 8 / RHEL 8 Linux / Alma Linuxis not enabled by default in systems such as . PowerToolsIf you need to use it, you can do it in the following way ( temporarily specify the repository ):

# 临时使用
dnf --enablerepo=powertools install libpcap-devel

Extension: What is PowerTools?

PowerToolsIt is an optional warehouse, which CentOS 8 / Rocky Linux 8 / RHEL 8 Linux / Alma Linuxis not enabled by default in systems such as PowerTools.

This repository contains a number of packages that are required as dependencies when installing other applications, and is mainly for building applications from source; also contains some very useful tools and packages, such as additional development tools, auxiliary software and libraries etc. for developers and system administrators to develop and manage in their systems.

Some of the commonly used tools in PowerTools are as follows:

  • device-mapper-devel
  • kmod-devel
  • maven-common
  • mariadb-common
  • opencv
  • perl-*
  • cmake
  • protobuf

If you just want to use it during installation, you can add --enablerepo=powertoolsparameters to the command, which only take effect for the current command; if you want to enable it globally, you can use the following method.

yum open PowerTools (global)

Before enabling the repository, the repository PowerToolsneeds to be installed first . EPELLog into the terminal as rootuser and enter the following command:

sudo yum install epel-release

Once installed, enable PowerToolsthe repository. The repository can be enabled with the following command PowerTools:

sudo yum config-manager --set-enabled PowerTools

This command will CentOSenable PowerToolsthe repository in . You can view the warehouse used by the host with the following command:

yum repolist

# 显示如下
repo id         repo name
appstream       AlmaLinux 8 - AppStream
baseos          AlmaLinux 8 - BaseOS
extras          AlmaLinux 8 - Extras
powertools		AlmaLinux 8 - PowerTools # 出现这行表示启用成功

dnf Open PowerTools (Global)

In RHEL 8 / CentOS 8 / Alma Linux 8, Dandified Yum( dnf) has replaced older versions of yumthe package manager.

Little knowledge :
Dandified: English // American //ˈdændɪfaɪdˈdændɪfaɪd

  • adj.: well-dressed; dressed like a playboy
  • v.: dress fashionable; make like a playboy (past participle of dandify)

Hahaha.

insert image description here

If you want to enable PowerToolsthe warehouse, you can execute the following command:

sudo dnf config-manager --set-enabled PowerTools

After executing this command, PowerToolsthe repository will be enabled.

You can view the warehouse used by the host with the following command:

dnf repolist

# 显示如下
repo id         repo name
appstream       AlmaLinux 8 - AppStream
baseos          AlmaLinux 8 - BaseOS
extras          AlmaLinux 8 - Extras
powertools		AlmaLinux 8 - PowerTools

[Note] If not config-manager, you need to install dnf-config-managerthe plug-in as follows:

# 安装 dnf-config-manager 插件
sudo dnf install 'dnf-command(config-manager)'

# 启用 PowerTools 仓库
sudo dnf config-manager --set-enabled PowerTools

Personal blog: Roc's Blog

Guess you like

Origin blog.csdn.net/peng2hui1314/article/details/131164408