How To Install pcre2 on CentOS 8

pcre2 is Perl-compatible regular expression library Perl-compatible regular expression library

Introduction

In this tutorial we learn how to install pcre2 on CentOS 8.

What is pcre2

PCRE2 is a re-working of the original PCRE (Perl-compatible regular expression) library to provide an entirely new API. PCRE2 is written in C, and it has its own API. There are three sets of functions, one for the 8-bit library, which processes strings of bytes, one for the 16-bit library, which processes strings of 16-bit values, and one for the 32-bit library, which processes strings of 32-bit values. There are no C++ wrappers. This package provides support for strings in 8-bit and UTF-8 encodings. Install pcre2-utf16 or pcre2-utf32 packages for the other ones. The distribution does contain a set of C wrapper functions for the 8-bit library that are based on the POSIX regular expression API (see the pcre2posix man page). These can be found in a library called libpcre2posix. Note that this just provides a POSIX calling interface to PCRE2; the regular expressions themselves still follow Perl syntax and semantics. The POSIX API is restricted, and does not give full access to all of PCRE2’s facilities. pcre2 10.32 2.el8 i686 246 k pcre2-10.32-2.el8.src.rpm baseos Perl-compatible regular expression library http BSD PCRE2 is a re-working of the original PCRE (Perl-compatible regular expression) library to provide an entirely new API. PCRE2 is written in C, and it has its own API. There are three sets of functions, one for the 8-bit library, which processes strings of bytes, one for the 16-bit library, which processes strings of 16-bit values, and one for the 32-bit library, which processes strings of 32-bit values. There are no C++ wrappers. This package provides support for strings in 8-bit and UTF-8 encodings. Install pcre2-utf16 or pcre2-utf32 packages for the other ones. The distribution does contain a set of C wrapper functions for the 8-bit library that are based on the POSIX regular expression API (see the pcre2posix man page). These can be found in a library called libpcre2posix. Note that this just provides a POSIX calling interface to PCRE2; the regular expressions themselves still follow Perl syntax and semantics. The POSIX API is restricted, and does not give full access to all of PCRE2’s facilities.

We can use yum or dnf to install pcre2 on CentOS 8. In this tutorial we discuss both methods but you only need to choose one of method to install pcre2.

Install pcre2 on CentOS 8 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

The output should look something like this:

CentOS Linux 8 - AppStream                                       43 kB/s | 4.3 kB     00:00    
CentOS Linux 8 - BaseOS                                          65 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - ContinuousRelease                               43 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - Extras                                          23 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - FastTrack                                       40 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - HighAvailability                                36 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - Plus                                            24 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - PowerTools                                      50 kB/s | 4.3 kB     00:00    
Extra Packages for Enterprise Linux Modular 8 - x86_64           13 kB/s | 9.2 kB     00:00    
Extra Packages for Enterprise Linux 8 - x86_64                   24 kB/s | 8.5 kB     00:00    
Metadata cache created.

After updating yum database, We can install pcre2 using dnf by running the following command:

sudo dnf -y install pcre2

Install pcre2 on CentOS 8 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

The output should look something like this:

CentOS Linux 8 - AppStream                                       43 kB/s | 4.3 kB     00:00    
CentOS Linux 8 - BaseOS                                          65 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - ContinuousRelease                               43 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - Extras                                          23 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - FastTrack                                       40 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - HighAvailability                                36 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - Plus                                            24 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - PowerTools                                      50 kB/s | 4.3 kB     00:00    
Extra Packages for Enterprise Linux Modular 8 - x86_64           13 kB/s | 9.2 kB     00:00    
Extra Packages for Enterprise Linux 8 - x86_64                   24 kB/s | 8.5 kB     00:00    
Metadata cache created.

After updating yum database, We can install pcre2 using yum by running the following command:

sudo yum -y install pcre2

How To Uninstall pcre2 on CentOS 8

To uninstall only the pcre2 package we can use the following command:

sudo dnf remove pcre2

pcre2 Package Contents on CentOS 8

/usr/lib/.build-id
/usr/lib/.build-id/02
/usr/lib/.build-id/02/9bc04665ac8b110982c04dda33d2549b4ed39e
/usr/lib/.build-id/75
/usr/lib/.build-id/75/933dbbdba3a8b0f8852c15f230787f34463ecb
/usr/lib/libpcre2-8.so.0
/usr/lib/libpcre2-8.so.0.7.1
/usr/lib/libpcre2-posix.so.2
/usr/lib/libpcre2-posix.so.2.0.1
/usr/share/doc/pcre2
/usr/share/doc/pcre2/AUTHORS
/usr/share/doc/pcre2/ChangeLog
/usr/share/doc/pcre2/NEWS
/usr/share/licenses/pcre2
/usr/share/licenses/pcre2/COPYING
/usr/share/licenses/pcre2/LICENCE
/usr/lib/.build-id
/usr/lib/.build-id/c6
/usr/lib/.build-id/c6/35d2616b678171eb204331dccfec6ca46f57ae
/usr/lib/.build-id/f6
/usr/lib/.build-id/f6/c73db0dcf94e454e367a7c33b483c71e8d8e82
/usr/lib64/libpcre2-8.so.0
/usr/lib64/libpcre2-8.so.0.7.1
/usr/lib64/libpcre2-posix.so.2
/usr/lib64/libpcre2-posix.so.2.0.1
/usr/share/doc/pcre2
/usr/share/doc/pcre2/AUTHORS
/usr/share/doc/pcre2/ChangeLog
/usr/share/doc/pcre2/NEWS
/usr/share/licenses/pcre2
/usr/share/licenses/pcre2/COPYING
/usr/share/licenses/pcre2/LICENCE

References

Summary

In this tutorial we learn how to install pcre2 on CentOS 8 using yum and dnf.