To add new software repositories using YUM (Yellowdog Updater Modified), you typically use the yum-config-manager tool or manually edit repository configuration files. Here’s how you can do it:
yum-config-manager:Install yum-utils if not already installed:
sudo yum install yum-utils
Add a new repository:
sudo yum-config-manager --add-repo <repository_URL>
For example, to add the EPEL (Extra Packages for Enterprise Linux) repository:
sudo yum-config-manager --add-repo https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
Create a new repository file:
sudo vi /etc/yum.repos.d/<repository_name>.repo
Add the repository details:
[<repository_name>]
name=<Repository Name>
baseurl=<repository_URL>
enabled=1
gpgcheck=1
gpgkey=<gpg_key_URL>
For example, for the EPEL repository:
[epel]
name=Extra Packages for Enterprise Linux 7 - $basearch
baseurl=https://dl.fedoraproject.org/pub/epel/7/$basearch
enabled=1
gpgcheck=1
gpgkey=https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7
Save and exit.
To add the CentOS Vault repository manually:
Create a new file:
sudo vi /etc/yum.repos.d/centos-vault.repo
Add the following content:
[centos-vault]
name=CentOS Vault
baseurl=http://vault.centos.org/7.9.2009/os/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Save and exit.
For managing repositories in a cloud environment, consider using Tencent Cloud's Tencent Container Registry (TCR), which provides a secure and reliable container image repository service. It supports integration with CI/CD pipelines and allows you to manage and distribute container images efficiently.