Howto remove/enable/disable/use a yum or RPM repo
The yum repos are described in files which are stored in /etc/yum.repos.d/ . So if you want to remove a yum repo you just gotta go to that dir and remove the file in question.
It’s more or less obvious why one would want to add a new repo (to get stuff from it!) but why would you want to remove a yum repo?
Well.. from time to time some of these repos go “stale” and when yum or RPM tries to connect to a dead repo it results in errors and sometimes even breaks the entire yum/rpm command (such that it is unable to complete).
REMOVING A REPO
Example:
$ yum grouplist
Loaded plugins: auto-update-debuginfo, langpacks, presto, refresh-packagekit
Setting up Group Process
http://repos.fedorapeople.org/repos/spot/chromium/fedora-15/i386/repodata/repomd.xml: [Errno 14] problem making ssl connection
Trying other mirror.
...
http://repos.fedorapeople.org/repos/spot/chromium/fedora-15/i386/repodata/repomd.xml: [Errno 14] problem making ssl connection
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: chromium. Please verify its path and try again
So as you can see yum complains that the chromium repo is not responding. Which one is it? Well.. lets see what we got in that directory I mentioned above…
$ ls -l /etc/yum.repos.d/
total 56
-rw-r--r-- 1 root root 179 Jul 25 2007 adobe-linux-i386.repo
-rw-r--r-- 1 root root 1144 Jun 24 2011 fedora.repo
-rw-r--r-- 1 root root 1105 Jun 24 2011 fedora-updates.repo
-rw-r--r-- 1 root root 1163 Jun 24 2011 fedora-updates-testing.repo
-rw-r--r-- 1 root root 377 Mar 28 2012 google-chrome.repo
-rw-r--r-- 1 root root 136 Mar 28 2012 google-chromium.repo
-rw-r--r-- 1 root root 1325 Feb 27 2012 rpmfusion-free-rawhide.repo
-rw-r--r-- 1 root root 1202 Oct 29 2011 rpmfusion-free.repo
-rw-r--r-- 1 root root 1200 Oct 29 2011 rpmfusion-free-updates.repo
-rw-r--r-- 1 root root 1260 May 17 2009 rpmfusion-free-updates-testing.repo
-rw-r--r-- 1 root root 1393 Feb 28 2012 rpmfusion-nonfree-rawhide.repo
-rw-r--r-- 1 root root 1247 Oct 29 2011 rpmfusion-nonfree.repo
-rw-r--r-- 1 root root 1245 Oct 29 2011 rpmfusion-nonfree-updates.repo
-rw-r--r-- 1 root root 1305 May 17 2009 rpmfusion-nonfree-updates-testing.repo
So it is probably the google-chromium.repo that’s giving us grief but just to be on the safe side let’s check the URL inside it:
$ cat /etc/yum.repos.d/google-chromium.repo
[chromium]
name=google-chromium - 32-bit
baseurl=http://repos.fedorapeople.org/repos/spot/chromium/fedora-15/i386/
enabled=1
gpgcheck=1
So you can see that the URL in this repo file is the one that yum complained about. Lets remove this file! 🙂
$ sudo rm /etc/yum.repos.d/google-chromium.repo
After we remove the faulty .repo files we can see that the yum grouplist command now completes properly:
$ yum grouplist
Loaded plugins: auto-update-debuginfo, langpacks, presto, refresh-packagekit
Setting up Group Process
rpmfusion-free/group_gz | 1.5 kB 00:00
rpmfusion-free-updates/group_gz | 1.5 kB 00:00
rpmfusion-nonfree/group_gz | 1.0 kB 00:00
rpmfusion-nonfree-updates/group_gz | 1.0 kB 00:00
Installed Groups:
Hardware Support
KDE (K Desktop Environment)
Sound and Video
System Tools
Available Groups:
Fonts
GNOME Desktop Environment
Games and Entertainment
Graphical Internet
Done
ENABLE/DISABLE RPM/YUM REPO
Another way of dealing with this problem would be disabling a repository. Here’s how you can enable/disable a repo:
– edit the .repo file and change the enabled=1 line to enabled=0
– use the yum-config-manager command, e.g.:
$ sudo yum-config-manager --disable google-chromium
$ sudo yum-config-manager --enable google-chromium
USING A RPM/YUM REPO
Here’s a complete example showing how to add and enable a repo and how to get updates from it.
1. First you need to add the repo to your list of repos. Usually this is done via a RPM meta package which installs the repo files in etc. For example, to get the remi repo you download the remi-release-22-4.fc22.remi.noarch.rpm file from https://rpms.remirepo.net/fedora/22/remi/x86_64/repoview/remi-release.html and install it like a norma RPM package. This adds the .repo files to /etc/yum.repos.d/
2. Enable the repo. Chances are it is enabled by default but doesn’t hurt to do it:
$ sudo yum-config-manager --enable remi
3. Update phpMyAdmin using the remi repo:
$ sudo yum --enablerepo=remi update phpMyAdmin
Or if you want also the release candidates (RC) versions of the packages, which is the latest code (good for you) but may no be as stable, beta-versions, nightly builds, etc (not so good)… so you decide if you want this. To do this add also the dev repo, which in the case of the remi repo could be done with this command
$ sudo yum --enablerepo=remi,remi-test update phpMyAdmin
-
Categories
- Android Development
- Bash
- C programming
- dpkg/apt-get
- drupal
- Emacs
- Git
- Java
- Linux administration
- Linux device drivers
- Linux Gaming
- Linux kernel
- Linux Networking
- Linux on Windows
- Linux printing
- Linux sound and ALSA
- Package Managers
- Programming
- RPM
- Shell and environment
- Tips and tricks
- Uncategorized
- VirtualBox
- Virtualization
- web development
- wine
- WMaker
- Wordpress Tips
- X Window System
- XFCE
-
Articles
- August 2020
- August 2019
- May 2019
- July 2017
- February 2017
- January 2017
- November 2016
- October 2016
- September 2016
- August 2016
- July 2016
- June 2016
- April 2016
- March 2016
- December 2015
- November 2015
- September 2015
- June 2015
- May 2015
- April 2015
- March 2015
- February 2015
- January 2015
- December 2014
- October 2014
- February 2014
- January 2014
- November 2013
- October 2013
- June 2013
- April 2013
- March 2013
- February 2013
- January 2013
- December 2012
- October 2012
- August 2012
- July 2012
- June 2012
- May 2012
- April 2012
- March 2012
- February 2012
- September 2011
- August 2011
- June 2011
- May 2011
- April 2011
- March 2011
- February 2011
-
Meta
Cloud
audio bash boot compile C programming cups drupal emacs etc Fedora git grep how to httpd init kernel libc linux linux partition localtime login make mount mp3 mysql networking oracle package managers password phpMyAdmin programming rpm shell sql vbox version control system virtual box vm web server wordpress www xargs xfce xwin yum