From Fedora Project Wiki


Using the Command Line Interface

One option how to install, remove or upgrade an application or group of applications is to use the command line and DNF (Dandified Yum) in Fedora 22 or later versions, or YUM (Yellowdog Update Manager) in Fedora 21 and earlier versions. This can be a much faster process than other interface, but requires the user to use the command line. If this feels uncomfortable, other method may be a more familiar way to manage software. To open the command line Click Activities > Show Applications > Utilities > Terminal.

Software Management in Fedora 22 and Later Versions

This guide covers the often used cases for software management. More detailed description or additional commands and options can be found in DNF documentation.

Installing Software with DNF

Type to the command line following command to install application or package:

su -c 'dnf install <spec>'

Where <spec> is the name of the program or the package you wish to install. DNF makes sure that the given packages and their dependencies are installed on the system. Each <spec> can be either a <package-spec>, which specifies a package directly, or a path to the local rpm package, or an URL to a remote rpm package, or a @<group-spec>, which specifies an (environment) group which contains it. If the package is already installed DNF will return "Nothing to do" message even if in repository is newer version presented. To upgrade application to last newer version, use dnf upgrade (see bellow). For each operation, dnf downloads the latest package information from the configured repositories. If your system uses a slow network connection dnf may require several seconds to download the repository indexes and the header files for each package.

Installing Software from a Package File
The dnf install <rpm-file-name> commands can be used to install software from an individual package file. If you install software that is not provided by a repository, dnf upgrade command cannot automatically upgrade it as new versions become available.

If you are unsure of the exact name of your desired installation or you want to get more information about packages, the chapter Package Search and Information will provide useful information.

After using the dnf install command, you will be prompted for the computer's root password. Type in the root password and press 'Enter'. You will not see the password as you type. The terminal will start giving information about the application, and end with Is this ok [y/N]: (see example bellow). Oftentimes, the installation of an application will require that other programs, called dependencies, are installed as well. These are programs or utilities upon which your selected application relies.

Package Versions
The dnf utility only displays and uses the newest version of each package, unless you specify an older version.

If you wish to continue installation after seeing the dependencies and their disk space requirements (which may be unexpectedly considerable), type: y and DNF downloads the necessary files and completes the installation of your application. If you press [N] or [Enter] , dnf does not download or change any packages, and will exit.

New Services Require Activation
When you install a service, Fedora does not activate or start it. If you for ecample install dnf-automatic (component for automatic upgrading applications in system) su -c 'dnf install dnf-automatic'. After install it is necessary to enable and start up it with command systemctl enable dnf-automatic.timer && systemctl start dnf-automatic.timer


Example 1: Example of the transaction for installing stellarium by command su -c 'dnf install stellarium':

Dependencies resolved.
===============================================================================================
 Package                  Arch             Version                     Repository         Size
===============================================================================================
Installing:
 geoclue                  x86_64           0.12.99-7.fc22              fedora            105 k
 qt5-qtlocation           x86_64           5.5.0-3.fc22                updates           649 k
 qt5-qtquick1             x86_64           5.5.0-3.fc22                updates           1.2 M
 qt5-qtscript             x86_64           5.5.0-3.fc22                updates           1.0 M
 qt5-qtsensors            x86_64           5.5.0-3.fc22                updates           183 k
 qt5-qtwebkit             x86_64           5.5.0-4.fc22                updates            11 M
 stellarium               x86_64           0.13.3-1.fc22               fedora            109 M

Transaction Summary
===============================================================================================
Install  7 Packages

Total download size: 123 M
Installed size: 183 M
Is this ok [y/N]:
Transaction Log
Every completed transaction records the affected packages in the log file /var/log/dnf.log. You may only read this file with root access.

Updating Software with DNF

To update each specified installed package <package-installed-specs> the latest available version including dependencies as necessary, type:

su -c 'dnf upgrade <package-installed-specs>'

Enter the password for the root account when prompted.

New Software Versions Require Reloading
If a piece of software is in use when you update it, the old version remains active until the application or service is restarted. Kernel updates take effect when you reboot the system.
Kernel Packages
Kernel packages remain on the system after they have been superseded by newer versions. This enables you to boot your system with an older kernel if an error occurs with the current kernel. To minimize maintenance, dnf kept only limited number of kernel versions in your system, see configuration in documentation.


To update all of the packages in the package group <group-spec>, enter the command:

su -c 'dnf group upgrade <group-spec>'

Enter the password for the root account when prompted.


To update all of the packages on your Fedora system, use the commands:

su -c 'dnf upgrade'


To preform scheduled auto-updates see AutoUpdates section.

Removing Software with DNF

Data and Configuration File Retention
The removal process leaves user data in place but may remove configuration files in some cases. If a package removal does not include the configuration file, and you reinstall the package later, it may reuse the old configuration file.


Type to the command line following command to remove application or package:

su -c 'dnf remove <spec>'

DNF removes the specified packages from the system along with any packages depending on the packages being removed. Each <spec> can be either a <package-spec>, which specifies a package directly, or a @<group-spec>, which specifies an (environment) group which contains it. If clean_requirements_on_remove is enabled (the default) also removes any dependencies that are no longer needed.

After using the dnf remove command, you will be prompted for the computer's root password. Type in the root password and press 'Enter'. You will not see the password as you type. The terminal will start giving information about the application, and end with Is this ok [y/N]:. If dependencies that were installed with the application are unneeded by other applications, you may be prompted to remove these as well.

If you wish to continue the software removal, type: y and DNF deletes the necessary files and completes the removal of your application. If you press [N] or [Enter] , dnf does not remove or change any packages, and will exit.

Group Command with DNF

Groups are virtual collections of packages. DNF keeps track of groups that the user selected (“marked”) installed and can manipulate the comprising packages with simple commands. The following commands are available:

dnf [options] group [summary] <group-spec>

Display overview of how many groups are installed and available. With a spec, limit the output to the matching groups. summary is the default groups subcommand.

dnf [options] group info <group-spec>

Display package lists of a group. Shows which packages are installed or available from a repo when -v is used.

dnf [options] group install [with-optional] <group-spec>...

Mark the specified group installed and install packages it contains. Also include optional packages of the group if with-optional is specified.

dnf [options] group list <group-spec>...

List all matching groups, either among installed or available groups. If nothing is specified list all known groups. Records are ordered by display_order tag defined in comps.xml file.

dnf [options] group remove <group-spec>...

Mark the group removed and remove those packages in the group from the system which are neither comprising another installed group and were not installed explicitly by the user.

dnf [options] group upgrade <group-spec>...

Upgrades the packages from the group and upgrades the group itself. The latter comprises of installing pacakges that were added to the group by the distribution and removing packages that got removed from the group as far as they were not installed explicitly by the user.

Package Search and Information

If you are unsure of the exact name of your desired installation, you can search your installed repositories for a keywords:

su -c 'dnf search <keywords>...'

Where <keywords>... are words you wish to search for among the names and descriptions of programs in the available repositories.


The following command is used to list description and summary information about available and installed packages.

dnf info [<package-spec>...]

Where [<package-spec>...] represent a list of packages (example: dnf info rpm gedit).

Software Management in Fedora 21 and Earlier Versions

This page needs some love
This page should be revised or reconstructed to be more helpful. Problems may include being out of step with current team or project status or process.
Following chapters are no longer applicable for recent Fedora releases.
They have to be rewritten to be more helpful

Installing Software

Click Applications > System Tools> Terminal to open the command line.

Type:

su -c 'yum install application'

Where application is the name of the program you wish to install.

If you are unsure of the exact name of your desired installation, you can search your installed repositories for a keyword:

su -c 'yum search keyword'

Where keyword is the word you wish to search for among the names and descriptions of programs in the available repositories.

After using the yum install command, you will be prompted for the computer's root password. Type in the root password and press 'Enter'. You will not see the password as you type. The terminal will start giving information about the application, and end with Is this ok [y/N]:. Oftentimes, the installation of an application will require that other programs, called dependencies, are installed as well. These are programs or utilities upon which your selected application relies.

If you wish to continue installation after seeing the dependencies and their disk space requirements (which may be unexpectedly considerable), type:

 y

The terminal downloads the necessary files and completes the installation of your application.

Removing Software

Click Applications > System Tools> Terminal to open the command line.

Type:

su -c 'yum remove application'

Where application is the name of the program you wish to install.

If you are unsure of the exact name of your desired installation, you can search your installed repositories for a keyword:

su -c 'yum search keyword'

Where keyword is the word you wish to search for among the names and descriptions of programs in the available repositories.

After using the yum remove command, you will be prompted for the computer's root password. Type in the root password and press 'Enter'. You will not see the password as you type. The terminal will start giving information about the application, and end with Is this ok [y/N]:. If dependencies that were installed with the application are unneeded by other applications, you may be prompted to remove these as well.

If you wish to continue the software removal, type:

 y

The terminal deletes the necessary files and completes the removal of your application.

Advanced Yum

Advanced Usage
This content is written for the more advanced user. It assumes that you are comfortable with the command line and have a relatively good knowledge of Linux terminology. It is probably not necessary to using Fedora as a desktop user, but can help a desktop user expand their knowledge base and face more complicated troubleshooting issues.

Use the yum utility to modify the software on your system in four ways:

  • To install new software from package repositories,
  • To install new software from an individual package file,
  • To update existing software on your system, and
  • To remove unwanted software from your system.
Installing Software from a Package File
The yum commands shown in this section use repositories as package sources. Refer to Section 8, “Installing Software from an Isolated Package” for details of using yum to install software from an individual package file.

To use yum, specify a function and one or more packages or package groups. Each section below gives some examples.

For each operation, yum downloads the latest package information from the configured repositories. If your system uses a slow network connection yum may require several seconds to download the repository indexes and the header files for each package.

The yum utility searches these data files to determine the best set of actions to produce the required result, and displays the transaction for you to approve. The transaction may include the installation, update, or removal of additional packages, in order to resolve software dependencies.

This is an example of the transaction for installing tsclient:

=============================================================================
Package                 Arch       Version          Repository        Size
=============================================================================
Installing:
tsclient                i386       0.132-6          base              247 k
Installing for dependencies:
rdesktop                i386       1.4.0-2          base              107 k

Transaction Summary
=============================================================================
Install      2 Package(s)
Update       0 Package(s)
Remove       0 Package(s)
Total download size: 355 k
Is this ok [y/N] :

Example 1. Format of yum Transaction Reports

Review the list of changes, and then press [y] to accept and begin the process. If you press [N] or [Enter] , yum does not download or change any packages, and will exit.

Package Versions
The yum utility only displays and uses the newest version of each package, unless you specify an older version.

The yum utility also imports the repository public key if it is not already installed on the rpm keyring. For more information on keys and keyrings, you may wish to read the Fedora Security Guide.

This is an example of the public key import:

warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID 4f2a6fd2
public key not available for tsclient-0.132-6.i386.rpm
Retrieving GPG key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora
Importing GPG key 0x4F2A6FD2 "Fedora Project <fedora@redhat.com>"
Is this ok [y/N] :

Example 2. Format of yum Public Key Import

Check the public key, and then press [y] to import the key and authorize the key for use. If you press [N] or [Enter] , yum stops without installing any packages. Ensure that you trust any key's owner before accepting it.

To ensure that downloaded packages are genuine, yum verifies the digital signature of each package against the public key of the provider. Once all of the packages required for the transaction are successfully downloaded and verified, yum applies them to your system.

Transaction Log
Every completed transaction records the affected packages in the log file /var/log/yum.log. You may only read this file with root access.
Installing New Software with yum

To install a generic package my-package, enter the command:

su -c 'yum install my-package'

Enter the password for the root account when prompted.

To install a package group PackageGroup, enter the command:

su -c 'yum groupinstall "PackageGroup"'

Enter the password for the root account when prompted. Examples of package groups include MySQL Database and Authoring and Publishing.

New Services Require Activation
When you install a service, Fedora does not activate or start it. To configure a new service to run on bootup, choose System → Administration → Services from the top desktop panel, or use the chkconfig and service command-line utilities. See the man pages for more details.
Updating Software with yum

To update the generic package my-package to the latest version, type:

su -c 'yum update my-package'

Enter the password for the root account when prompted.

New Software Versions Require Reloading
If a piece of software is in use when you update it, the old version remains active until the application or service is restarted. Kernel updates take effect when you reboot the system.
Kernel Packages
Kernel packages remain on the system after they have been superseded by newer versions. This enables you to boot your system with an older kernel if an error occurs with the current kernel. To minimize maintenance, yum automatically removes obsolete kernel packages from your system, retaining only the current kernel and the previous version.

To update all of the packages in the package group PackageGroup, enter the command:

su -c 'yum groupupdate "PackageGroup"'

Enter the password for the root account when prompted.

Updating the Entire System
To update all of the packages on your Fedora system, use the commands described in Section 6, “Updating Your System with yum”.
Removing Software with yum
Data and Configuration File Retention
The removal process leaves user data in place but may remove configuration files in some cases. If a package removal does not include the configuration file, and you reinstall the package later, it may reuse the old configuration file.

To remove software, yum examines your system for both the specified software, and any software which claims it as a dependency. The transaction to remove the software deletes both the software and the dependencies.

To remove the generic package my-package from your system, use the command:

su -c 'yum remove my-package'

Enter the password for the root account when prompted.

To remove all of the packages in the package group PackageGroup, enter the command:

su -c 'yum groupremove "PackageGroup"'

Enter the password for the root account when prompted.


Using PackageKit

Fedora 10 uses a program called PackageKit to graphically assist the user with installing and removing software. Any application from the Fedora repositories, including the ones described in this user guide, can be installed with the following method.

Installing Software

Here is how to install software using Add/Remove Software in the Gnome Desktop Environment.

Click System > Administration > Add/Remove Software. This will open the Add/Remove Software application.

In the [Search Box] with the binoculars icon, type the name of the application you wish to install. If you are unsure of the specific application you need to install, you can also type keywords in this box, just like you would for an internet search engine.

Next, click the [Find] button. The message "Querying" appears in the lower left corner.

Zero or more listings will appear that match your search query. Tick the box next to the description of the application or applications you wish to install. The message "Downloading repository information" appears in the lower left corner. The window area below the list of packages contains additional information about the selected software.

Select any additional packages to install or remove at this time by changing tick boxes next to the package name.

Finally, click the [Apply] button. This starts the installation process and concurrently installs or removes any additional packages where you modified the tick box. Follow any prompts to install additional packages.


Unless an error is displayed, the application is now installed on your computer.

Removing Software

To remove software using PackageKit, you should follow the standard installation procedure, but untick boxes beside the programs you wish to uninstall instead of ticking boxes to install new programs.

Click System > Administration > Add/Remove Software. This will open the Add/Remove Software application.

In the [Search Box] with the binoculars icon, type the name of the application you wish to remove. If you are unsure of the specific application you need to remove, you can also type keywords in this box, just like you would for an internet search engine.

Next, click the [Find] button. The message "Querying" appears in the lower left corner.

Zero or more listings will appear that match your search query. Untick the box next to the description of the application or applications you wish to remove.

Software Installed Outside of PackageKit
If the box is already unticked, then the program is probably not already installed. If you are sure that you've selected the right application, but it still appears to not be installed, then it may have been installed using a method other than PackageKit. If, for example, the program was compiled and installed from source, then it may not register as installed in PackageKit. If this is the case, you will need to find an alternate method of removing it. If it was installed from source, you may find more information in the source distribution's Readme file.

The message "Downloading repository information" appears in the lower left corner. The window area below the list of packages contains additional information about the selected software.

Select any additional packages to install or remove at this time by changing tick boxes next to the package name.

Finally, click the [Apply] button. This starts the removal process and concurrently installs or removes any additional packages where you modified the tick box. Follow any prompts to remove additional packages, such as dependencies that only your newly uninstalled program relied upon.


Unless an error is displayed, the application is now removed from your computer.

Previous Page - Customizing the Desktop Table of Contents