Pkg config linux apt get

How To Install pkg-config on Ubuntu 20.04

In this tutorial we learn how to install pkg-config on Ubuntu 20.04.

What is pkg-config

pkg-config is a system for managing library compile and link flags that works with automake and autoconf.

Increasingly libraries ship with “.pc” files that allow querying of the compiler and linker flags needed to use them through the pkg-config(1) program. Description-md5: 5622d544b680cd37e49d3435959207a2 Task: ubuntu-desktop-minimal, ubuntu-desktop, xubuntu-core, xubuntu-desktop, ubuntustudio-desktop-core, ubuntustudio-desktop, ubuntukylin-desktop, ubuntu-mate-core, ubuntu-mate-desktop, ubuntu-budgie-desktop

There are three ways to install pkg-config on Ubuntu 20.04. We can use apt-get , apt and aptitude . In the following sections we will describe each method. You can choose one of them.

Install pkg-config Using apt-get

Update apt database with apt-get using the following command.

After updating apt database, We can install pkg-config using apt-get by running the following command:

sudo apt-get -y install pkg-config 

Install pkg-config Using apt

Update apt database with apt using the following command.

After updating apt database, We can install pkg-config using apt by running the following command:

sudo apt -y install pkg-config 

Install pkg-config Using aptitude

If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Ubuntu. Update apt database with aptitude using the following command.

After updating apt database, We can install pkg-config using aptitude by running the following command:

sudo aptitude -y install pkg-config 

How To Uninstall pkg-config on Ubuntu 20.04

To uninstall only the pkg-config package we can use the following command:

sudo apt-get remove pkg-config 

Uninstall pkg-config And Its Dependencies

To uninstall pkg-config and its dependencies that are no longer needed by Ubuntu 20.04, we can use the command below:

sudo apt-get -y autoremove pkg-config 

Remove pkg-config Configurations and Data

To remove pkg-config configuration and data from Ubuntu 20.04 we can use the following command:

sudo apt-get -y purge pkg-config 

Remove pkg-config configuration, data, and all of its dependencies

We can use the following command to remove pkg-config configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge pkg-config 

References

Summary

In this tutorial we learn how to install pkg-config package on Ubuntu 20.04 using different package management tools: apt, apt-get and aptitude.

Читайте также:  Mx linux ahs что это

Источник

How To Install pkg-config-aarch64-linux-gnu on Ubuntu 20.04

In this tutorial we learn how to install pkg-config-aarch64-linux-gnu on Ubuntu 20.04. pkg-config-aarch64-linux-gnu is manage compile and link flags for libraries for arm64 architecture 9ecb9d50ad023710b605df2c531efeb5

Introduction

In this tutorial we learn how to install pkg-config-aarch64-linux-gnu on Ubuntu 20.04.

What is pkg-config-aarch64-linux-gnu

pkg-config is a system for managing library compile and link flags that works with automake and autoconf.

Increasingly libraries ship with “.pc” files that allow querying of the compiler and linker flags needed to use them through the pkg-config(1) program.

This is a dependency package providing cross pkg-config support for the arm64 architecture. Description-md5: 9ecb9d50ad023710b605df2c531efeb5

There are three ways to install pkg-config-aarch64-linux-gnu on Ubuntu 20.04. We can use apt-get , apt and aptitude . In the following sections we will describe each method. You can choose one of them.

Install pkg-config-aarch64-linux-gnu Using apt-get

Update apt database with apt-get using the following command.

After updating apt database, We can install pkg-config-aarch64-linux-gnu using apt-get by running the following command:

sudo apt-get -y install pkg-config-aarch64-linux-gnu 

Install pkg-config-aarch64-linux-gnu Using apt

Update apt database with apt using the following command.

After updating apt database, We can install pkg-config-aarch64-linux-gnu using apt by running the following command:

sudo apt -y install pkg-config-aarch64-linux-gnu 

Install pkg-config-aarch64-linux-gnu Using aptitude

If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Ubuntu. Update apt database with aptitude using the following command.

After updating apt database, We can install pkg-config-aarch64-linux-gnu using aptitude by running the following command:

sudo aptitude -y install pkg-config-aarch64-linux-gnu 

How To Uninstall pkg-config-aarch64-linux-gnu on Ubuntu 20.04

To uninstall only the pkg-config-aarch64-linux-gnu package we can use the following command:

sudo apt-get remove pkg-config-aarch64-linux-gnu 

Uninstall pkg-config-aarch64-linux-gnu And Its Dependencies

To uninstall pkg-config-aarch64-linux-gnu and its dependencies that are no longer needed by Ubuntu 20.04, we can use the command below:

sudo apt-get -y autoremove pkg-config-aarch64-linux-gnu 

Remove pkg-config-aarch64-linux-gnu Configurations and Data

To remove pkg-config-aarch64-linux-gnu configuration and data from Ubuntu 20.04 we can use the following command:

sudo apt-get -y purge pkg-config-aarch64-linux-gnu 

Remove pkg-config-aarch64-linux-gnu configuration, data, and all of its dependencies

We can use the following command to remove pkg-config-aarch64-linux-gnu configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge pkg-config-aarch64-linux-gnu 

References

Summary

In this tutorial we learn how to install pkg-config-aarch64-linux-gnu package on Ubuntu 20.04 using different package management tools: apt, apt-get and aptitude.

Читайте также:  Linux как разрешить доступ к папкам

Источник

Understanding the pkg-config Linux Command

The “pkg-config” is a command line tool to aid the developers in including and linking simply by specifying the name and version. The tool searches for “*.pc” files in specific directories defined by an environment variable, PKG_CONFIG_PATH, including the name, version, or flags.

Developers can compile libraries and applications from the terminal without fussing over hard-coded values like the path to the libraries.

This post will provide an insight into the functionality of the pkg-config command line utility in Linux with the following outcomes:

How to Install pkg-config on Linux?

The pkg-config is pre-installed on most of the Linux distros; if it isn’t, then use the appropriate commands as per your Linux distributions:

$ sudo apt-get install pkg-config #For Ubuntu/Debian $ sudo yum install pkg-config #For RedHat/Fedora $ sudo pacman -S pkgconf #For Arch Linux

If any of the above commands aren’t working, we recommend using your system’s software/package manager (GUI method).

How to Use the pkg-config Command of Linux?

The basic syntax of the pkg-config command is mentioned below:

$ pkg-config [options] [library]

The “options” are the flags that are optional and used to specify the type of information that you want to see. In comparison, the “library” is the name whose data you want to see. Let’s shift the focus to the options/flags now.

The “pkg-config” command of Linux comes with various flags/options that you can use. Since we must work with the libraries, this command lists them all.

When you see the above image, there are two columns. On the left is the library’s name, while on the right is a description.

Example 1: Display the cflags of a Library

The C Compiler Flags (cflags) is an option of the “pkg-config” that is used to view the preprocessor and compiler flags to allow the packages to be compiled on the command line. Let’s find the necessary header files when building a Python program.

In the above image, two paths are mentioned, from which the first one is the path “-I/usr/include/python3.10,” which is the location of the Python 3.10 include files. While the second is the path “-I/usr/include/x86_64-linux-gnu/python3.10,” which is the location of the Python 3.10 files for x86_64-linux-gnu architecture.

To retrieve the link flags of a library, the “–libs” option is used. The link flags are command-line options passed to the linker building the program and can be used to specify library paths, libraries to link against, and other options that affect how the program is linked. For example, let’s retrieve the flags of the GTK+ library.

Читайте также:  Distribution linux ubuntu mint

The output of the above command is the linker flags. The flag -l is used to specify the library that the linker should link against. For example, -lgtk-3 tells the linker to link against the gtk-3 library.

Example 3: Check Version Details of a Library

To check the version-related details of a library using the “pkg-config” command, we have the “–modversion” option. Let’s check the version of the GTK+ library.

$ pkg-config --modversion gtk+-3.0

In the above image, the output “3.24.33” is the version of the GTK+ library, and by using it, users can know which build of the software is compatible with which version of the library.

Example 4: Print/View Errors

The “–print-errors” option of the “pkg-config” command is used to view the library-related errors, like whether it is installed correctly and properly configured on the system. Let’s check if the errors are for the GTK+ library.

$ pkg-config --print-errors gtk+-3.0

If the output, like in the above image, is blank, then there’s no error. If there’s an error, it will print saying “library not found” or something similar.

Example 5: Display/View the variables in any Package

If you want to see all variables in the package, found in the “*.pc” file and many other details like version, included files, and libraries. Let’s see the variables of the GTK+ library.

$ pkg-config --print-variable gtk+-3.0

When executed, the above command displays the variables defined in the “*.pc” file of the package, and they specify the include & library paths and a bunch of other information.

Note: These variables aren’t the same ones used in your code.

Example 6: View Debug Information

If you need to check the debug-related information, use the “–debug” with the “pkg-config” command. This is a helpful feature for developers. Let’s check the debug information of the library named GTK+.

As expected, the above command prints the specified package’s debug information.

Example 7: Display the Static Linking

Static linking can be defined as a method to link the libraries included in the program’s executable file allowing them (libraries) to be used without being installed on your system. This is used on the system where the necessary libraries aren’t installed. Let’s view the static linked libraries of the GTK+.

$ pkg-config --cflags --static gtk+-3.0

The output displayed in the above image represents the static linked libraries of GTK+ and includes the private libraries.

Conclusion

The pkg-config command of Linux is the all-in-one solution for working with libraries while building a package. As discussed above, it also shows tons of information related to libraries and much more, and this command line tool is beneficial for developers.

Источник

Оцените статью
Adblock
detector