How to Add/Remove Yum Repositories

Red Hat Enterprise Linux, CentOS, Fedora and other Linux distributions based on RHEL all use YUM as a package management system to install, remove, and update software. Each distribution has its own main repository, but you can also install or remove third-party repositories whenever you like.

To add a YUM repository, type as root:

yum-config-manager –add-repo repository_url

For example:

yum-config-manager –add-repo http://www.serverschool.com/serverschool.repo

And the output will look like:

Loaded plugins: product-id, refresh-packagekit, subscription-manager

adding repo from: http://www.serverschool.com/serverschool.repo

grabbing file http://www.serverschool.com/serverschool.repo to /etc/yum.repos.d/serverschool.repo

serverschool.repo | 413 B 00:00

repo saved to /etc/yum.repos.d/serverschool.repo

You can then enable the repository with:

yum-config-manager –enable serverschool

To disable a respository:

yum-config-manager disable serverschool

For more information about repository management with YUM, see this Red Hat documentation.

 











Comments: