• Categories
    Category
    {{ postCtrl.tags }}
    • {{ category.tag_type }}

      • {{tag.tag_name}}
      • View more
  • Categories
    Category
    {{ postCtrl.tags }}
    • {{ category.tag_type }}

      • {{tag.tag_name}}
      • View more
  • News
  • Tutorials
  • Forums
  • Tags
  • Users
Tutorial News Comments FAQ Related Articles

How to enable or disable repositories in CentOS

{{postValue.id}}

To enable or disable repositories in CentOS

This tutorial describes how to enable or disable a single or group of YUM repositories while installing software on CentOS. Sometimes, having them already enabled in your system will help you save a lot of time. This tutorial tests the same process on CentOS 7 server. 

 

Enabling or disabling repositories 

First, you need to check the repo list which you can do by making use of the following command. 

[root@linuxhelp ~]# yum repolist
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.vinahost.vn
.
updates/7/x86_64 CentOS-7 - Updates 1,676
repolist: 21,883

We can enable or disable repositories in two ways.
Temporarily enable or disable repositories while installing packages using ‘ yum’  command
Permanently Enable/Disable repositories using repository configuration file


To disable multiple repository, just include the repository separated by comma

[root@linuxhelp ~]# yum --disablerepo=remi-safe,updates update
[root@linuxhelp ~]# yum --disablerepo=remi-safe,updates update
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
.
Complete!


You can use method to install a package too.

[root@linuxhelp ~]# yum --disablerepo=remi-safe,updates install httpd
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
.
Installed:
  httpd.x86_64 0:2.4.6-67.el7.centos                                                                                

Complete!

 

Similarly, you can both enable and disable a particular repositories at a time with ‘ yum’ command.

[root@linuxhelp ~]# yum --disablerepo=* --enablerepo=epel 
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * epel: mirror.pregi.net
No packages marked for update
You can also permanently enable or disable a repository. Usually, the repository configuration files will be saved in the /etc/yum.repos.d/ directory.


Let us see the available repositories using the following command.

[root@linuxhelp ~]# ls /etc/yum.repos.d/
CentOS-Base.repo       CentOS-fasttrack.repo  CentOS-Vault.repo  remi-php54.repo  remi-php72.repo
CentOS-CR.repo         CentOS-Media.repo      epel.repo          remi-php70.repo  remi.repo
CentOS-Debuginfo.repo  CentOS-Sources.repo    epel-testing.repo  remi-php71.repo  remi-safe.repo


To do so, edit EPEL repository file:

[root@linuxhelp ~]# vi /etc/yum.repos.d/epel.repo
Change the value enabled=1 to 0 (zero).
epel]
name=Extra Packages for Enterprise Linux 7 - $basearch
#baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-7& arch=$basearch
failovermethod=priority
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7


Save and close the file. Update the repository lists to take effect the changes.

[root@linuxhelp ~]# yum repolist 
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
.


With this, the tutorial comes to an end.  

Tags:
connor
Author: 

Comments ( 0 )

No comments available

Add a comment
{{postCtrl.cmtErrMsg}}

Frequently asked questions ( 5 )

Q

How to remove the repository on Ubuntu?

A

For remove the repository on Ubuntu, use the following link as given below, https://www.linuxhelp.com/how-to-remove-repositories-on-ubuntu-16-04/

Q

How to Configure a network repository?

A

To configure the network repository, use the following link as given below "https://www.linuxhelp.com/installupdate-packages-setup-network-repository/"

Q

How to enable the Remi repository on centos?

A

To enable the Remi repository on CentOS, use the following steps as below,
"yum install epel-release -y
cd /usr/local/src/
wget https://rpms.remirepo.net/enterprise/remi-release-7.rpm
rpm -Uvh Remi-release-7.rpm"

Q

How to check the available repository list on CentOS?

A

For check, the available repository list on CentOS, use the following command as given below "yum repolist"

Q

How to disable a repository on CentOS?

A

For disable the repository on CentOS, use the following command as given below "yum-config-manager --disable repository..."

Back To Top!
Rank
User
Points

Top Contributers

userNamenaveelansari
135850

Top Contributers

userNameayanbhatti
92510

Top Contributers

userNamehamzaahmed
32150

Top Contributers

1
userNamelinuxhelp
31040

Top Contributers

userNamemuhammadali
24500
Can you help legeek ?
Installation of the call center module

hello

I wish to install a call center in virtual with issabel, I downloaded the latest version of it , but I don' t arrive to install the call center module in issabel. please help me

thanks!

Networking
  • Routing
  • trunk
  • Netmask
  • Packet Capture
  • domain
  • HTTP Proxy
Server Setup
  • NFS
  • KVM
  • Memory
  • Sendmail
  • WebDAV
  • LXC
Shell Commands
  • Cloud commander
  • Command line archive tools
  • last command
  • Shell
  • terminal
  • Throttle
Desktop Application
  • Linux app
  • Pithos
  • Retrospect
  • Scribe
  • TortoiseHg
  • 4Images
Monitoring Tool
  • Monit
  • Apache Server Monitoring
  • EtherApe 
  • Arpwatch Tool
  • Auditd
  • Barman
Web Application
  • Nutch
  • Amazon VPC
  • FarmWarDeployer
  • Rukovoditel
  • Mirror site
  • Chef
Contact Us | Terms of Use| Privacy Policy| Disclaimer
© 2025 LinuxHelp.com All rights reserved. Linux™ is the registered trademark of Linus Torvalds. This site is not affiliated with linus torvalds in any way.