{"id":415,"date":"2021-06-29T08:41:58","date_gmt":"2021-06-29T08:41:58","guid":{"rendered":"https:\/\/ownwebservers.com\/kb\/?p=415"},"modified":"2021-06-29T08:41:58","modified_gmt":"2021-06-29T08:41:58","slug":"using-yum-commands-to-disable-and-remove-package-repositories-on-centos","status":"publish","type":"post","link":"https:\/\/ownwebservers.com\/kb\/using-yum-commands-to-disable-and-remove-package-repositories-on-centos\/","title":{"rendered":"Using Yum Commands to Disable and Remove Package Repositories on CentOS"},"content":{"rendered":"<p>YUM also referred to as Yellowdog Updater, Modified could be a default package management system that is generally utilized in all versions of CentOS to install and update packages and repositories. With the assistance of \u201cyum\u201d a user will maintain their OS and applications updates simply. From this tutorial, we are going to understand how to disable and remove package repositories on CentOS using yum.<\/p>\n<h2><strong>Disabling a Package Repository<\/strong><\/h2>\n<p>Usually, the package repositories are located in the definition files, which can be found in the directory named \/etc\/yum.repos.d . In order to disable the file, you need to modify the proper file and set the below given parameter.<\/p>\n<blockquote><p><em><strong>enable = 0<\/strong><\/em><\/p><\/blockquote>\n<p>The above parameter will keep the repository, however it will disable it until you decide to use it in future.<\/p>\n<h2><strong>Removing the Repository Completely<\/strong><\/h2>\n<p>If you wish to remove the repository completely, simply delete the aforesaid file.<\/p>\n<h2><strong>How to Clear the YUM Cache?<\/strong><\/h2>\n<p>Generally, when a package is downloaded, installed and then it is removed there is a possibility that the package may still be memorized in the yum\u2019s cache. In order to clean all the cached packages from the enabled repository cache directory, enter as root:<\/p>\n<blockquote><p><em><strong>yum clean packages<\/strong><\/em><\/p><\/blockquote>\n<p>In addition to that, to purge the old package information completely, simply run the following command.<\/p>\n<blockquote><p><em><strong>yum clean headers<\/strong><\/em><\/p><\/blockquote>\n<p>To clean any cached xml metadata from any enabled repository, enter:<\/p>\n<blockquote><p><em><strong>yum clean metadata<\/strong><\/em><\/p><\/blockquote>\n<p>If you wish to clean all the cached files from any enabled repository at once, enter:<\/p>\n<blockquote><p><em><strong>yum clean all<\/strong><\/em><\/p><\/blockquote>\n<p>To make sure that YUM has fresh data and functions perfectly all the time, you should \u201cclean\u201d it on a regular basis.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>YUM also referred to as Yellowdog Updater, Modified could be a default package management system that is generally utilized in all versions of CentOS to install and update packages and repositories. With the assistance of \u201cyum\u201d a user will maintain their OS and applications updates simply. From this tutorial, we are going to understand how [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10,23,24],"tags":[],"class_list":["post-415","post","type-post","status-publish","format-standard","hentry","category-dedicated-hosting","category-tutorials","category-web-hosting"],"_links":{"self":[{"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/posts\/415","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/comments?post=415"}],"version-history":[{"count":1,"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/posts\/415\/revisions"}],"predecessor-version":[{"id":416,"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/posts\/415\/revisions\/416"}],"wp:attachment":[{"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/media?parent=415"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/categories?post=415"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/tags?post=415"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}