{"id":9335,"date":"2019-02-09T07:58:52","date_gmt":"2019-02-09T07:58:52","guid":{"rendered":"https:\/\/www.appservgrid.com\/paw92\/?p=9335"},"modified":"2019-02-10T03:29:58","modified_gmt":"2019-02-10T03:29:58","slug":"how-to-configure-software-repositories-in-fedora","status":"publish","type":"post","link":"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/02\/09\/how-to-configure-software-repositories-in-fedora\/","title":{"rendered":"How to Configure Software Repositories in Fedora"},"content":{"rendered":"<p>Your Fedora distribution obtains its software from repositories and each of these repositories comes with number of free and proprietary software applications available for you to install. The official Fedora repositories have thousands of free and open source applications.<\/p>\n<p>In this article, we will show how to configure software repositories in Fedora distribution using the\u00a0<a href=\"https:\/\/www.tecmint.com\/dnf-commands-for-fedora-rpm-package-management\/\" target=\"_blank\" rel=\"noopener\">DNF package manager tool<\/a>\u00a0from the command line.<\/p>\n<h3>View Enabled Repositories in Fedora<\/h3>\n<p>To list all enabled repositories on your Fedora system, in the format repository ID, name, and status (number of packages it provides), run the following command.<\/p>\n<pre>$ sudo dnf repolist\r\n<\/pre>\n<div id=\"attachment_31805\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2019\/02\/list-all-enabled-repositories-in-fedora.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-31805\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2019\/02\/list-all-enabled-repositories-in-fedora.png\" sizes=\"auto, (max-width: 884px) 100vw, 884px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2019\/02\/list-all-enabled-repositories-in-fedora.png 884w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2019\/02\/list-all-enabled-repositories-in-fedora-768x249.png 768w\" alt=\"List Enabled Repositories in Fedora\" width=\"884\" height=\"287\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">List Enabled Repositories in Fedora<\/p>\n<\/div>\n<p>You can list packages from a specified repository, for instance\u00a0<strong>fedora<\/strong>, by running the following command. It will list all packages available and installed from the repository specified.<\/p>\n<pre>$ sudo dnf repository-packages fedora list\r\n<\/pre>\n<p>To display only a list of those packages available or installed from the specified repository, add the\u00a0<strong>available<\/strong>\u00a0or\u00a0<strong>installed<\/strong>\u00a0option respectively.<\/p>\n<pre>$ sudo dnf repository-packages fedora list <strong>available<\/strong>\r\nOR\r\n$ sudo dnf repository-packages fedora list <strong>installed<\/strong>\r\n<\/pre>\n<h3>Adding, Enabling, and Disabling a DNF Repository<\/h3>\n<p>Before you add a new repository to your Fedora system, you need to define it by either adding a\u00a0<code>[repository]<\/code>section to the\u00a0<strong>\/etc\/dnf\/dnf.conf<\/strong>\u00a0file, or to a\u00a0<strong>.repo<\/strong>\u00a0file in the\u00a0<strong>\/etc\/yum.repos.d\/<\/strong>\u00a0directory. Most developers or package maintainers provide DNF repositories with their own\u00a0<strong>.repo<\/strong>\u00a0file.<\/p>\n<p>For example to define the repository for\u00a0<a href=\"https:\/\/www.tecmint.com\/install-grafana-analytics-in-centos-ubuntu-debian\/\" target=\"_blank\" rel=\"noopener\">Grafana<\/a>\u00a0in a\u00a0<strong>.repo<\/strong>\u00a0file, create it as shown.<\/p>\n<pre>$ sudo vim \/etc\/yum.repos.d\/grafana.repo\r\n<\/pre>\n<p>Then add the\u00a0<code>[repository]<\/code>\u00a0section in the file and save it. If you observe carefully, in the repository configuration shown in the image, it is not enabled as indicated by the\u00a0<strong>parameter<\/strong>\u00a0<code>(enabled=0)<\/code>; we changed this for demonstration purposes.<\/p>\n<div id=\"attachment_31806\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2019\/02\/define-new-dnf-repository.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-31806\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2019\/02\/define-new-dnf-repository.png\" alt=\"Add New DNF Repository in Fedora\" width=\"678\" height=\"290\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Add New DNF Repository in Fedora<\/p>\n<\/div>\n<p>Next, to add and enable new repository, run the following command.<\/p>\n<pre>$ sudo dnf config-manager --add-repo \/etc\/yum.repos.d\/grafana.repo\r\n<\/pre>\n<div id=\"attachment_31807\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2019\/02\/add-and-enable-dnf-repository.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-31807\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2019\/02\/add-and-enable-dnf-repository.png\" sizes=\"auto, (max-width: 944px) 100vw, 944px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2019\/02\/add-and-enable-dnf-repository.png 944w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2019\/02\/add-and-enable-dnf-repository-768x56.png 768w\" alt=\"Add and Enable DNF Repo\" width=\"944\" height=\"69\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Add and Enable DNF Repo<\/p>\n<\/div>\n<p>To\u00a0<strong>enable<\/strong>\u00a0or\u00a0<strong>disable<\/strong>\u00a0a DNF repository, for instance while trying to install a package from it, use the\u00a0<code>--enablerepo<\/code>\u00a0or\u00a0<code>--disablerepo<\/code>\u00a0option.<\/p>\n<pre>$ sudo dnf --enablerepo=grafana install grafana  \r\nOR\r\n$ sudo dnf --disablerepo=fedora-extras install grafana  \r\n<\/pre>\n<div id=\"attachment_31808\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2019\/02\/enable-dnf-repo-once-on-the-cli.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-31808\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2019\/02\/enable-dnf-repo-once-on-the-cli.png\" sizes=\"auto, (max-width: 988px) 100vw, 988px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2019\/02\/enable-dnf-repo-once-on-the-cli.png 988w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2019\/02\/enable-dnf-repo-once-on-the-cli-768x222.png 768w\" alt=\"Install Package from Enabled Repository\" width=\"988\" height=\"286\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Install Package from Enabled Repository<\/p>\n<\/div>\n<p>You can also enable or disable more than one repositories with a single command.<\/p>\n<pre>$ sudo dnf --enablerepo=grafana, repo2, repo3 install grafana package2 package3 \r\nOR\r\n$ sudo dnf --disablerepo=fedora, fedora-extras, remi install grafana \r\n<\/pre>\n<p>You can also enable and disable repositories at the same time, for example.<\/p>\n<pre>$ sudo dnf --enablerepo=grafana --disablerepo=fedora, fedora_extra, remi, elrepo install grafana\r\n<\/pre>\n<p>To permanently enable a particular repository, use the\u00a0<code>--set-enabled<\/code>\u00a0option.<\/p>\n<pre>$ sudo grep enable \/etc\/yum.repos.d\/grafana.repo\r\n$ sudo dnf config-manager --set-enabled grafana\r\n$ sudo grep enable \/etc\/yum.repos.d\/grafana.repo\r\n<\/pre>\n<div id=\"attachment_31809\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2019\/02\/permanently-enable-dnf-repo.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-31809\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2019\/02\/permanently-enable-dnf-repo.png\" alt=\"Permanently Enable DNF Repo\" width=\"752\" height=\"202\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Permanently Enable DNF Repo<\/p>\n<\/div>\n<p>To permanently disable a particular repository, use the\u00a0<code>--set-disabled<\/code>\u00a0switch.<\/p>\n<pre>$ sudo dnf config-manager --set-disabled grafana\r\n<\/pre>\n<p>That\u2019s all for now! In this article, we have explained how to configure software repositories in Fedora. Share your comments or ask questions via the feedback form below.<\/p>\n<p><a href=\"https:\/\/www.tecmint.com\/configure-software-repositories-in-fedora\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Your Fedora distribution obtains its software from repositories and each of these repositories comes with number of free and proprietary software applications available for you to install. The official Fedora repositories have thousands of free and open source applications. In this article, we will show how to configure software repositories in Fedora distribution using the\u00a0DNF &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/02\/09\/how-to-configure-software-repositories-in-fedora\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;How to Configure Software Repositories in Fedora&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-9335","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/9335","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/comments?post=9335"}],"version-history":[{"count":2,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/9335\/revisions"}],"predecessor-version":[{"id":9404,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/9335\/revisions\/9404"}],"wp:attachment":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/media?parent=9335"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/categories?post=9335"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/tags?post=9335"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}