{% extends "Default/default.html" %} {% block content %}
DNF is a software package manager that installs, updates, and removes packages on RPM-based Linux distribution. For all of the detailed commands one can simply enter "dnf --help" into the terminal.
If you want to simply update the packages to the latest, you may do so using dnf on the dnf Package Update page.
Below will be a number of sections explaining how to: search for packages, update packages, add/remove packages, and an example of using packages.
The following command will show a list of all of the packages. There are a lot of packages so it is recommended to pipe this command into a file. You can also add an optional command afterwards of the package_name to narrow down the results.
dnf repoquery <package_name>
To update the packages and install a specific one follow the following commands:
dnf repoquery
dnf install -y <package_name>
Alternatively you can accomplish this on the webapp by going to the dnf Update page and selecting what packages you wish to update.
We will show an example of how to update, install, and then use one of the packages that we install. This example specifically will enable us to play the game OpenTyrian.
dnf repoquery
dnf install opentyrian
opentyrian
Now you will be able to play the game (only shows up on the desktop).
In this section we will explain how to write a simple "Hello World" application, compile it, and create a RPM package with CMake, install/remove it with "dnf", and run it. This will demonstrate the ease of installing and removing packages with "dnf".
dnf install rpm-build
#include <stdio.h>
int main(int argc, char *argv[])
{
printf("hello world\n");
return 0;
}
cmake_minimum_required(VERSION 2.6)
PROJECT(HelloWorld)
ADD_EXECUTABLE(hello hello.c)
INSTALL(TARGETS hello DESTINATION /usr/bin)
SET(CPACK_GENERATOR "RPM")
INCLUDE(CPack)
# Build
mkdir build
cd build
cmake ..
make package
# Install package
dnf install HelloWorld-0.1.1-Linux.rpm
# Run
hello
# Remove package
dnf remove helloworld