How to Configure and Manage Repositories on CentOS 8
Only a small number of packages are available in pre-installed CentOS repositories. Moreover, these are not always the latest versions. This is why you often need to connect additional repositories. This process will be described in this tutorial.
To see installed repositories in CentOS use the command:
yum repolistTo list all packages with their versions in the repository (change BaseOS to any repository name):
yum repo-pkgs BaseOS listInstalling popular additional repositories on CentOS 8
EPEL (Extra Packages for Enterprise Linux) contains a huge number of packages. This is the most popular additional repository. Let’s install it.
yum install epel-releaseRemi is another popular additional repository for CentOS 8. To use it, Epel must be installed on the system. Please note that packages from this repository have the same names as in the official ones, so this may lead to unwanted updates. To install it, use the command:
rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-8.rpmInstalling a repository for a single package
Let's consider installing an individual repository using Mysql as an example. This method allows you to get the latest updates much earlier than they appear in other package repositories, such as BaseOS or EPEL.
Download the package:
wget https://dev.mysql.com/get/mysql80-community-release-el8-1.noarch.rpmAnd install it.
rpm -Uvh mysql80-community-release-el8-1.noarch.rpmDisabling and deleting repositories
To avoid using the repository during the current system update, use the command:
yum update --disablerepo=remi-modularTo disable a repository in the system without deleting it, use:
yum-config-manager --disable epelAfter that you can enable it again:
yum-config-manager --enable epelTo completely delete a repository, use the following command with the appropriate name:
yum remove epel-release
700
300
700
300
700
300