This section explains how to enable or add a software repository in CentOS, SUSE, and Ubuntu.
CentOS
- Run the following command to check whether a software repository has been enabled.
yum repolist all
If status is disabled, as shown in Figure 1, no software repository has been enabled. Proceed to the next step.
Figure 1 Checking software repositories
- Run the following command to enable a software repository. This step uses Public-OTC-CentOS-7-Base as an example.
yum-config-manager --enable Public-OTC-CentOS-7-Base
Figure 2 Enabling a software repository
- Run the following command to check whether the software repository described in step 2 has been enabled.
yum repolist all
If
status is
enabled, as shown in
Figure 3, the software repository has been enabled.
Figure 3 Checking whether the software repository has been enabled
SUSE
- Run the following command to check whether a software repository has been enabled.
zypper lr
If no software repository is detected, as shown in Figure 4, proceed to the next step.
Figure 4 Checking software repositories
- Run the following command to add a software repository. This step uses opensuse12.2 as an example.
zypper addrepo http://download.opensuse.org/distribution/12.2/repo/oss/ opensuse-mainFigure 5 Adding a software repository
- Run the following command to update and add software repositories.
zypper refresh
Figure 6 Updating and adding repositories
- Run the following command to check whether the software repository described in step 2 has been enabled.
zypper lr
If
Enabled is
Yes, as shown in
Figure 7, the software repository has been enabled.
Figure 7 Checking whether the software repository has been enabled
Ubuntu
- Run the following command to add a software repository.
apt-add-repository http://archive.canonical.com/ubuntuFigure 8 Adding a software repository
- Run the following command to update and add software repositories.
apt-get update
Figure 9 Updating and adding repositories