How To Install cpp on Fedora 34
Introduction
In this tutorial we learn how to install cpp
on Fedora 34.
What is cpp
Cpp is the GNU C-Compatible Compiler Preprocessor. Cpp is a macro processor which is used automatically by the C compiler to transform your program before actual compilation. It is called a macro processor because it allows you to define macros, abbreviations for longer constructs. The C preprocessor provides four separate functionalities inclusion of header files (files of declarations that can be substituted into your program); macro expansion (you can define macros, and the C preprocessor will replace the macros with their definitions throughout the program); conditional compilation (using special preprocessing directives, you can include or exclude parts of the program according to various conditions); and line control (if you use a program to combine or rearrange source files into an intermediate file which is then compiled, you can use line control to inform the compiler about where each source line originated). You should install this package if you are a C programmer and you use macros.
We can use yum
or dnf
to install cpp
on Fedora 34. In this tutorial we discuss both methods but you only need to choose one of method to install cpp.
Install cpp on Fedora 34 Using dnf
Update yum database with dnf
using the following command.
sudo dnf makecache --refresh
The output should look something like this:
Fedora 34 - x86_64 20 kB/s | 6.6 kB 00:00
Fedora 34 openh264 (From Cisco) - x86_64 1.4 kB/s | 989 B 00:00
Fedora Modular 34 - x86_64 68 kB/s | 6.5 kB 00:00
Fedora 34 - x86_64 - Updates 3.5 kB/s | 6.2 kB 00:01
Fedora Modular 34 - x86_64 - Updates 17 kB/s | 5.9 kB 00:00
Metadata cache created.
After updating yum database, We can install cpp
using dnf
by running the following command:
sudo dnf -y install cpp
Install cpp on Fedora 34 Using yum
Update yum database with yum
using the following command.
sudo yum makecache --refresh
The output should look something like this:
Fedora 34 - x86_64 20 kB/s | 6.6 kB 00:00
Fedora 34 openh264 (From Cisco) - x86_64 1.4 kB/s | 989 B 00:00
Fedora Modular 34 - x86_64 68 kB/s | 6.5 kB 00:00
Fedora 34 - x86_64 - Updates 3.5 kB/s | 6.2 kB 00:01
Fedora Modular 34 - x86_64 - Updates 17 kB/s | 5.9 kB 00:00
Metadata cache created.
After updating yum database, We can install cpp
using yum
by running the following command:
sudo yum -y install cpp
How To Uninstall cpp on Fedora 34
To uninstall only the cpp
package we can use the following command:
sudo dnf remove cpp
cpp Package Contents on Fedora 34
/usr/bin/cpp
/usr/lib/.build-id
/usr/lib/.build-id/18
/usr/lib/.build-id/18/ac143d3b870e2d6ffb379f138a8bcc77d66042
/usr/lib/.build-id/66/24b49b61569e4f041d851cddee28911c2e0181
/usr/lib/cpp
/usr/libexec/gcc
/usr/libexec/gcc/x86_64-redhat-linux
/usr/libexec/gcc/x86_64-redhat-linux/11
/usr/libexec/gcc/x86_64-redhat-linux/11/cc1
/usr/share/info/cpp.info.gz
/usr/share/info/cppinternals.info.gz
/usr/share/locale/be/LC_MESSAGES/cpplib.mo
/usr/share/locale/ca/LC_MESSAGES/cpplib.mo
/usr/share/locale/da/LC_MESSAGES/cpplib.mo
/usr/share/locale/de/LC_MESSAGES/cpplib.mo
/usr/share/locale/el/LC_MESSAGES/cpplib.mo
/usr/share/locale/eo/LC_MESSAGES/cpplib.mo
/usr/share/locale/es/LC_MESSAGES/cpplib.mo
/usr/share/locale/fi/LC_MESSAGES/cpplib.mo
/usr/share/locale/fr/LC_MESSAGES/cpplib.mo
/usr/share/locale/id/LC_MESSAGES/cpplib.mo
/usr/share/locale/ja/LC_MESSAGES/cpplib.mo
/usr/share/locale/nl/LC_MESSAGES/cpplib.mo
/usr/share/locale/pt_BR/LC_MESSAGES/cpplib.mo
/usr/share/locale/ru/LC_MESSAGES/cpplib.mo
/usr/share/locale/sr/LC_MESSAGES/cpplib.mo
/usr/share/locale/sv/LC_MESSAGES/cpplib.mo
/usr/share/locale/tr/LC_MESSAGES/cpplib.mo
/usr/share/locale/uk/LC_MESSAGES/cpplib.mo
/usr/share/locale/vi/LC_MESSAGES/cpplib.mo
/usr/share/locale/zh_CN/LC_MESSAGES/cpplib.mo
/usr/share/locale/zh_TW/LC_MESSAGES/cpplib.mo
/usr/share/man/man1/cpp.1.gz
/usr/bin/cpp
/usr/lib/.build-id
/usr/lib/.build-id/a4
/usr/lib/.build-id/a4/18b90a1bc15427a7f83ee71a2e294e024aacdf
/usr/lib/.build-id/ee
/usr/lib/.build-id/ee/ad8dcc15af5bb8df4523931b5f735afad1f51a
/usr/lib/cpp
/usr/libexec/gcc
/usr/libexec/gcc/x86_64-redhat-linux
/usr/libexec/gcc/x86_64-redhat-linux/11
/usr/libexec/gcc/x86_64-redhat-linux/11/cc1
/usr/share/info/cpp.info.gz
/usr/share/info/cppinternals.info.gz
/usr/share/locale/be/LC_MESSAGES/cpplib.mo
/usr/share/locale/ca/LC_MESSAGES/cpplib.mo
/usr/share/locale/da/LC_MESSAGES/cpplib.mo
/usr/share/locale/de/LC_MESSAGES/cpplib.mo
/usr/share/locale/el/LC_MESSAGES/cpplib.mo
/usr/share/locale/eo/LC_MESSAGES/cpplib.mo
/usr/share/locale/es/LC_MESSAGES/cpplib.mo
/usr/share/locale/fi/LC_MESSAGES/cpplib.mo
/usr/share/locale/fr/LC_MESSAGES/cpplib.mo
/usr/share/locale/id/LC_MESSAGES/cpplib.mo
/usr/share/locale/ja/LC_MESSAGES/cpplib.mo
/usr/share/locale/nl/LC_MESSAGES/cpplib.mo
/usr/share/locale/pt_BR/LC_MESSAGES/cpplib.mo
/usr/share/locale/ru/LC_MESSAGES/cpplib.mo
/usr/share/locale/sr/LC_MESSAGES/cpplib.mo
/usr/share/locale/sv/LC_MESSAGES/cpplib.mo
/usr/share/locale/tr/LC_MESSAGES/cpplib.mo
/usr/share/locale/uk/LC_MESSAGES/cpplib.mo
/usr/share/locale/vi/LC_MESSAGES/cpplib.mo
/usr/share/locale/zh_CN/LC_MESSAGES/cpplib.mo
/usr/share/locale/zh_TW/LC_MESSAGES/cpplib.mo
/usr/share/man/man1/cpp.1.gz
References
Summary
In this tutorial we learn how to install cpp
on Fedora 34 using yum and dnf.