Linux Yum--yum Remove Repo (Repository) –yum Disable repo (Repository) __linux

Source: Internet
Author: User
Tags gpg

Original address: http://www.if-not-true-then-false.com/2010/yum-remove-repo-repository-yum-disable-repo-repository/

Quick Guide, howto Remove and disable YUM repo (repository). Yum command itself does not contain any way to remove the repository. YUM repo The files is located in/etc/yum.repos.d/directory.

I Use the Kde.repo file with following content as example on this guide:

[KDE]
Name=kde
mirrorlist=http://apt.kde-redhat.org/apt/kde-redhat/fedora/mirrors-stable
gpgkey=http:// Apt.kde-redhat.org/apt/kde-redhat/kde-redhat. Rpm-gpg-key
enabled=1
Remove YUM Repo (Repository) permanently

Before moving repository permanently is a good idea to check this is the repository installed using RPM package. As many repos usually are, like rpm-fusion, Livna, etc. Search Repository rpm-package with following command:

Rpm-qa | grep -I. repo-name

Example:

Rpm-qa | grep -i rpmfusion
rpmfusion-nonfree-release-13-2.noarch
rpmfusion-free-release-13-2.noarch
# # OR # #
Rpm-qa | grep -i livna
livna-release-1-1.noarch
If Rpm-package found then simply remove whole rpm-package with following command:
Rpm-e Some-repository-rpm-package

Example:

Rpm-e Livna-release-1-1.noarch
If rpm-package not found then simply remove repo file with following command:
rm /etc/yum.repos.d/repo-file.repo
# OR Just rename it (without repo file extension) # #
mv/etc/yum.repos.d/repo-file.repo/etc/yum.repos.d/repo-file.repo.bak

Example:

rm /etc/yum.repos.d/kde.repo
# OR Just rename it (without repo file extension) # #
MV / Etc/yum.repos.d/kde.repo/etc/yum.repos.d/kde.repo.bak
Disable YUM Repo (Repository) Disable YUM Repo

Edit repo file On/etc/yum.repos.d/as root and change enabled to 0

# # change
enabled=1
# to
enabled=0

Example:

# change
[KDE]
name=kde
mirrorlist=http://apt.kde-redhat.org/apt/kde-redhat/fedora/mirrors-stable
Gpgkey=http://apt.kde-redhat.org/apt/kde-redhat/kde-redhat. Rpm-gpg-key
enabled=1
# to
[KDE]
name=kde
mirrorlist=http://apt.kde-redhat.org/ Apt/kde-redhat/fedora/mirrors-stable
Gpgkey=http://apt.kde-redhat.org/apt/kde-redhat/kde-redhat. Rpm-gpg-key
enabled=0

Enable disabled repo quickly with YUM:

Yum Install Some-package

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.