In this article, we'll explain how to enable a Copr repository, guide you through the process of installing and managing packages from Copr, and finally show you how to disable and remove a Copr repository in Linux, with examples.
Let's get started.
Table of Contents
What is Copr?
Copr is a repository of community-maintained packages for Fedora and Enterprise Linux (RHEL) distributions. It allows developers to build and distribute their own packages, which can be easily installed by users.
Copr is a great way to access the latest software, and packages not available in the official repositories. For more details about Copr repository, refer the following guide:
Prerequisites
Before we begin, make sure you have the following:
- A Linux distribution (Fedora or RHEL-based),
- A user account with sudo privileges,
- Internet access.
1. Enable a Copr Repository
To enable the Copr repository, you'll need to add the repository configuration file to your system.
First, you need to install the copr
plugin for DNF (if not already installed):
sudo dnf install copr
You can do this by running the following command:
sudo dnf copr enable <username>/<reponame>
Replace <username>
and <reponame>
with the actual username and repository name.
For example:
sudo dnf copr enable sctech/betterfetch
This will enable the sctech
repository, which contains the betterfetch
package used to display your system's details.
When enabling a Copr repository, you'll receive a warning message indicating that the repository is not part of the main distribution and that the quality may vary. Type 'Y' and press ENTER to enable the repository.
Enabling a Copr repository. Please note that this repository is not part of the main distribution, and quality may vary. The Fedora Project does not exercise any power over the contents of this repository beyond the rules outlined in the Copr FAQ at <https://docs.pagure.org/copr.copr/user_documentation.html#what-i-can-build-in-copr>, and packages are not held to any quality or security level. Please do not file bug reports about these packages in Fedora Bugzilla. In case of problems, contact the owner of this repository. Do you really want to enable copr.fedorainfracloud.org/sctech/betterfetch? [y/N]: y Repository successfully enabled.
You can verify the list of enabled repositories using command:
dnf repolist
Sample Output:
repo id repo name
copr:copr.fedorainfracloud.org:sctech:betterfetch Copr repo for betterfetch owned by sctech
fedora Fedora 40 - x86_64
fedora-cisco-openh264 Fedora 40 openh264 (From Cisco) - x86_64
updates Fedora 40 - x86_64 - Updates
updates-testing Fedora 40 - x86_64 - Test Updates
2. Install and Manage Copr Packages
Once the repository is enabled, you can install and manage packages using dnf
command just like you would from the official repositories.
2.1. Searching for Packages
You can search for packages using the dnf
command as usual:
dnf search <package_name>
Replace <package_name>
with the name of the package you're looking for.
For example, you can search for the betterfetch
package using command:
dnf search betterfetch
This command searches for the betterfetch, a script to quickly display system information.
2.2. Installing Packages
To install a package, use the dnf install
command:
sudo dnf install <package_name>
Replace <package_name>
with the name of the package you want to install.
For example:
sudo dnf install betterfetch
This command installs the betterfetch package.
2.3. Managing Packages
You can manage packages from Copr using the dnf
command. Here are some common operations:
- Update:
sudo dnf update
(updates all packages, including those from Copr) - Upgrade:
sudo dnf upgrade
(upgrades all packages, including those from Copr) - Remove:
sudo dnf remove <package_name>
(removes a package) - List:
dnf list <package_name>
(lists information about a package)
For more detailed usage, refer the DNF Command tutorial in the following link:
Disable Copr Repository
If you no longer want to use a Copr repository, you can disable it by running:
sudo dnf copr disable <username>/<projectname>
Replace <username>
and <projectname>
with the repository details.
Example:
sudo dnf copr disable sctech/betterfetch
Remove Copr Repository
If a Copr repository is no longer required, you can completely remove it from your system using command:
sudo dnf copr remove sctech/betterfetch
Conclusion
Installing and managing packages from Copr repository is a straightforward process. By following these steps, you can access a wide range of community-maintained packages and stay up-to-date with the latest software versions. Remember to always use the dnf
command to manage packages from Copr.
Resource: