Installing Software from Language Package Managers
Many programming language ecosystems include their own package managers for installing libraries and tools. This page explains how to use common language package managers on Fedora, and the important differences between them and DNF.
What are language package managers
Language package managers install software published within a specific programming language ecosystem. For example, you can install Python libraries and some Python applications by using tools such as pip. You can also install many JavaScript based applications by using tools such as npm. These tools operate independently and install packages outside of Fedora’s package management system.
Before using a language package manager, check whether the package you need is already available in the Fedora repositories. Many popular libraries are packaged for Fedora and can be installed with DNF:
$ dnf search package_name
Installing from Fedora repositories is preferred because those packages receive security updates through the normal Fedora update process and are tested for compatibility with your system.
Language package managers bypass DNF, which means:
-
Packages installed this way are invisible to DNF and do not receive updates through
dnf upgrade -
Packages might conflict with system packages if installed globally
-
Security updates must be managed separately, using the language package manager itself
-
Removing packages requires the language package manager, not DNF
-
Sources are not vetted by Fedora maintainers, so there is a higher risk of installing malicious or unmaintained software
For these reasons, install language packages at the user level or in isolated environments wherever possible, rather than system-wide.
Python - pip
Python’s package manager is pip.
Many Python packages are available in Fedora repositories as python3-packagename and should be installed that way when possible.
Installing pip
pip is included with Python, which is pre-installed on Fedora. If pip is missing:
$ sudo dnf install python3-pip
Using virtual environments
Always use a virtual environment to isolate pip-installed packages from the system Python installation. Installing pip packages globally can conflict with system Python libraries and break system tools.
Create and activate a virtual environment:
$ python3 -m venv myenv
$ source myenv/bin/activate
Install a package inside the virtual environment:
$ pip install package_name
Deactivate the virtual environment when finished:
$ deactivate
Updating pip packages
Update all packages inside an active virtual environment:
$ pip install --upgrade package_name
Alternative Python package managers
You can use other Python package managers that create isolated environments, such as:
These tools can be installed either from Fedora repositories or by using pip.
For example, to install pipx, run:
$ sudo dnf install pipx
Or, to install uv, run:
$ sudo dnf install python3-uv
Node.js - npm
npm is the package manager for the Node.js ecosystem.
Installing Node.js and npm
Install Node.js and npm from the Fedora repositories:
$ sudo dnf install nodejs npm
Installing packages
Install a package locally for a specific project (recommended):
$ npm install package_name
Install a package globally to make a command-line tool available system-wide:
$ npm install -g package_name
| Global npm installs may require elevated permissions depending on how Node.js was installed. To avoid permission issues, consider using a Node.js version manager such as nvm. |
Rust - Cargo
Cargo is Rust’s package manager and build system. Cargo compiles packages from source, so builds can take some time.
Installing Rust and Cargo
Install Rust and Cargo from the Fedora repositories:
$ sudo dnf install rust cargo
Alternatively, use the official Rust toolchain installer rustup for more control over Rust versions.
Ruby - gem
gem is Ruby’s package manager for installing Ruby libraries and tools (called "gems").
Many Ruby gems are available in the Fedora repositories as rubygem-packagename and should be installed that way when possible.
Installing Ruby and gem
Install Ruby from the Fedora repositories:
$ sudo dnf install ruby
gem is included with Ruby.
Want to help? Learn how to contribute to Fedora Docs ›