{"id":1460,"date":"2024-06-23T12:16:49","date_gmt":"2024-06-23T12:16:49","guid":{"rendered":"http:\/\/shijuvarghese.com\/?p=1460"},"modified":"2025-05-23T18:52:43","modified_gmt":"2025-05-23T18:52:43","slug":"creating-yum-and-dnf-repositories","status":"publish","type":"post","link":"http:\/\/shijuvarghese.com\/?p=1460","title":{"rendered":"Creating YUM and DNF Repositories"},"content":{"rendered":"<p>As we all knows the yum and dnf commands are used to download and install software packages from software repositories configured in the node. In a centOS server, centos repositories will be configured by default. Similarly, in an RHEL system, redhat repositories will be configured. The EPEL repositories are used to install extra packages usually in redhat based systems.<\/p>\n<p>Basics of DNF \/ YUM and its usage can be found <a href=\"http:\/\/shijuvarghese.com\/?p=1498\" target=\"_blank\">here<\/a>.<\/p>\n<p>The command to list all repositories in a Redhat system is as follows:<\/p>\n<p><strong>[root@centos9vm ~]#<\/strong> dnf repolist all<\/p>\n<p>===== ==<br \/>\n<em>repo id repo name status<\/em><br \/>\n<em>appstream\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0CentOS Stream 9 &#8211; AppStream enabled<\/em><br \/>\n<em>appstream-source\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0CentOS Stream 9 &#8211; AppStream &#8211; Source disabled<\/em><br \/>\n<em>baseos\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0CentOS Stream 9 &#8211; BaseOS enabled<\/em><br \/>\n<em>baseos-source\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0CentOS Stream 9 &#8211; BaseOS &#8211; Source disabled<\/em><br \/>\n<em>crb-debuginfo\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0CentOS Stream 9 &#8211; CRB &#8211; Debug disabled<\/em><br \/>\n<em>epel\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0Extra Packages for Enterprise Linux 9 &#8211; x86_64 enabled<\/em><br \/>\n<em>epel-cisco-openh264\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0Extra Packages for Enterprise Linux 9 openh264 (From Cisco) &#8211; x86_64 enabled<\/em><\/p>\n<p>==== ==<\/p>\n<p>As you can see some repositories are in\u00a0<strong>enabled<\/strong> or\u00a0<strong>disabled<\/strong> stage. This can be changed by using the following command<\/p>\n<p><strong>[root@centos9vm ~]#<\/strong> dnf repolist all | grep crb-debuginfo<br \/>\n<em>crb-debuginfo\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 CentOS Stream 9 &#8211; CRB &#8211; Debug <strong>disabled<\/strong><\/em><\/p>\n<p><strong>[root@centos9vm ~]#<\/strong> dnf config-manager &#8211;enable crb-debuginfo<\/p>\n<p><strong>[root@centos9vm ~]#<\/strong> dnf repolist all | grep crb-debuginfo<br \/>\n<em>crb-debuginfo\u00a0 \u00a0 \u00a0 \u00a0 \u00a0CentOS Stream 9 &#8211; CRB &#8211; Debug <strong>enabled<\/strong><\/em><\/p>\n<p>===== ===<\/p>\n<p>A new repository can be added by creating a &#8220;<strong>.<\/strong>repo&#8221; file in the folder &#8220;<strong>\/etc\/yum.repo.d<\/strong>&#8221;<\/p>\n<p>The same can be achieved by using the following command too:<\/p>\n<p><strong>[root@centos9vm ~]#<\/strong> dnf repolist all | grep fedora<\/p>\n<p><strong>[root@centos9vm ~]#<\/strong> dnf config-manager &#8211;add-repo &#8220;https:\/\/dl.fedoraproject.org\/pub\/epel\/9\/Everything\/x86_64\/&#8221;<\/p>\n<p><em>Adding repo from: https:\/\/dl.fedoraproject.org\/pub\/epel\/9\/Everything\/x86_64\/<\/em><\/p>\n<p><strong>[root@centos9vm ~]#<\/strong> dnf repolist all | grep fedora<\/p>\n<p><em>dl.fedoraproject.org_pub_epel_9_Everything_x86_64_\u00a0 \u00a0 \u00a0 \u00a0created by dnf confi enabled<\/em><\/p>\n<p><strong>[root@centos9vm ~]#<\/strong> cat \/etc\/yum.repos.d\/dl.fedoraproject.org_pub_epel_9_Everything_x86_64_.repo<br \/>\n[dl.fedoraproject.org_pub_epel_9_Everything_x86_64_]<\/p>\n<p>======= ==<br \/>\n<em>name=created by dnf config-manager from https:\/\/dl.fedoraproject.org\/pub\/epel\/9\/Everything\/x86_64\/<\/em><br \/>\n<em>baseurl=https:\/\/dl.fedoraproject.org\/pub\/epel\/9\/Everything\/x86_64\/<\/em><br \/>\n<em>enabled=1<\/em><\/p>\n<p>===== ===<\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"mh-excerpt\"><p>As we all knows the yum and dnf commands are used to download and install software packages from software repositories configured in the node. In <a class=\"mh-excerpt-more\" href=\"http:\/\/shijuvarghese.com\/?p=1460\" title=\"Creating YUM and DNF Repositories\">[&#8230;]<\/a><\/p>\n<\/div>","protected":false},"author":1,"featured_media":1791,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,31,30],"tags":[],"class_list":["post-1460","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","category-rhel-4","category-rhel-9"],"_links":{"self":[{"href":"http:\/\/shijuvarghese.com\/index.php?rest_route=\/wp\/v2\/posts\/1460","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/shijuvarghese.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/shijuvarghese.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/shijuvarghese.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/shijuvarghese.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1460"}],"version-history":[{"count":7,"href":"http:\/\/shijuvarghese.com\/index.php?rest_route=\/wp\/v2\/posts\/1460\/revisions"}],"predecessor-version":[{"id":1511,"href":"http:\/\/shijuvarghese.com\/index.php?rest_route=\/wp\/v2\/posts\/1460\/revisions\/1511"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/shijuvarghese.com\/index.php?rest_route=\/wp\/v2\/media\/1791"}],"wp:attachment":[{"href":"http:\/\/shijuvarghese.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1460"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/shijuvarghese.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1460"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/shijuvarghese.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1460"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}