Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Yum was working fine until I tried to install google chrome and used the --add-repo command with which I added chrome's repository.

Ever since then, whenever I do a sudo yum install, yum only searched on chrome's repository.

So I removed the repo file of chrome. But even after restarting the system, yum is not accessing any repository.

A sudo yum search gtk+ turned up results for gtk+, but trying to install it with sudo yum install gtk2.x86_64 didn't work. It gave the output:

Loaded plugins: langpacks
Nothing to do

How can I fix this? I'm using Fedora 20, 64 bit version.

ls -l /etc/yum.repos.d shows me the following output:

-rw-r--r--. 1 root root 183 Jan 26 19:03 adobe-linux-x86_64.repo
-rw-r--r--. 1 root root 0 Feb 2 09:34 fedora.repo
-rw-r--r--. 1 root root 0 Feb 2 09:34 fedora-updates.repo
-rw-r--r--. 1 root root 0 Feb 2 09:34 fedora-updates-testing.repo
-rw-r--r--. 1 root root 75 Jan 26 11:52 jenkins.repo
-rw-r--r--. 1 root root 76 Jan 26 11:51 jenkins.repo.rpmnew
-rw-r--r--. 1 root root 1241 Mar 14 2013 rpmfusion-free-rawhide.repo
-rw-r--r--. 1 root root 1172 Jan 26 19:04 rpmfusion-free.repo
-rw-r--r--. 1 root root 1170 Jan 26 19:03 rpmfusion-free-updates.repo
-rw-r--r--. 1 root root 1230 Jun 29 2013 rpmfusion-free-updates-testing.repo

share|improve this question
    
What does ls -l /etc/yum.repos.d show you? –  samiam Feb 3 at 8:14
    
If you have Fedora 20, you must have Yum Extender (or similar). You can easly add and substract repos. –  enedil Feb 3 at 8:24
    
@samiam: I've edited the question to show you the output. –  Nav Feb 3 at 9:03

3 Answers 3

up vote 1 down vote accepted

I'm not sure who told you to use the --add-repo switch but this is almost never the "right" way to go about adding new repositories. Rather you should either use a .rpm file for the repository that you're attempting to install, and use rpm -ivh somerepo.rpm to install that repositories .repo file into the directory /etc/yum.repo.d/ and the RPM keys visible when you run the command rpm -qa gpg-pubkey*.

$ rpm -qa gpg-pubkey*
gpg-pubkey-e06f8c93-51760257
gpg-pubkey-98ab5139-4bf2d0b0
gpg-pubkey-7fac5991-4615767f
gpg-pubkey-fb4b18e6-50b96bfd
...

You can also make a repository file manually for Chrome using one of these 2 samples that are described in this ifthenelse blog post titled: Enable Google YUM repository.

32-bit

[google-chrome]
name=google-chrome - 32-bit
baseurl=http://dl.google.com/linux/chrome/rpm/stable/i386
enabled=1
gpgcheck=1
gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub

64-bit

[google-chrome]
name=google-chrome - 64-bit
baseurl=http://dl.google.com/linux/chrome/rpm/stable/x86_64
enabled=1
gpgcheck=1
gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub

This would've saved you the pain you're in now. But back to resolving that now.

Diagnosing with RPM

You can use RPM to determine which RPMs have been impacted, I'd focus on RPMs that are related to installing .repo files to start, as well as packages related to yum itself, since I suspect your /etc/yum.conf file or the lower level .repo files are at fault here.

You can check the consistency of files comparing their checksum that's maintained in the RPM database like so:

$ rpm -qfVv /etc/yum.conf /etc/yum.repo.d/*
.........  c /etc/logrotate.d/yum
.........    /etc/yum
.........  c /etc/yum.conf
.........    /etc/yum.repos.d
.........    /etc/yum/fssnap.d
.........    /etc/yum/pluginconf.d
.........    /etc/yum/protected.d
.........    /etc/yum/vars
.........  c /etc/yum/version-groups.conf
.........    /usr/bin/yum
...

This output shows whether any files associated to the RPM that /etc/yum.conf has been modified or is corrupt. If a file had been modified the output would look like this:

$ touch /etc/yum.conf
$ rpm -qfVv /etc/yum.conf
.........  c /etc/logrotate.d/yum
.........    /etc/yum
.......T.  c /etc/yum.conf
...

Notice the T in the column of dots to the left. This tells us that the time on the file differs. See the man page for rpm for more on the -V or --verify switch.

Each of the 9 characters denotes the result of a comparison of attribute(s) of the file to the value of those attribute(s) recorded in the database. A single "." (period) means the test passed, while a single "?" (question mark) indicates the test could not be performed (e.g. file permissions prevent reading). Otherwise, the (mnemonically emBoldened) character denotes failure of the corresponding --verify test:

   S file Size differs
   M Mode differs (includes permissions and file type)
   5 digest (formerly MD5 sum) differs
   D Device major/minor number mismatch
   L readLink(2) path mismatch
   U User ownership differs
   G Group ownership differs
   T mTime differs
   P caPabilities differ

You'll likely need to re-download the offending RPM and re-install it using rpm.

Are my repositories disabled?

You can use this command to confirm that the adding of the Chrome YUM repository didn't accidentally delete the other YUM repositories. This command will do it:

$ yum repolist all
screenshot of output

ss of yum

Notice the column to the right. Any repos that are disabled are red, any that are enabled are green. Check to make sure that all the repos are enabled (green).

If they aren't then you can either go through the .repo files and changed the offending ones to "ENABLED=1" or use yum-config-manager to re-enable them.

$ sudo yum-config-manager --enable <repo name>

I'm stuck...my .repo files are "hosed"???

If you find that your .repo files are in a bad way. Perhaps they're zero length files now, then your yum setup is essentially pretty screwed up. But all is not lost. You can get things back into shape using rpm and yum.

  1. Can't I just re-install RPMs?

    Yes you can, but which to install? If you don't know which ones to install you can deduce the versions like so, using your existing RPM database. I'm on F19 so these are the corresponding packages for the fedora*.repo files.

    $ rpm -qf /etc/yum.repos.d/fedora* | sort -u
    fedora-release-19-6.noarch
    

    So you're looking for an .rpm file named fedora-release-20*.noarch. Here's that file from the install media for F20:

    $ rpm -Fvh http://dl.fedoraproject.org/pub/fedora/linux/releases/20/Fedora/$(uname -p)/os/Packages/f/fedora-release-20-1.noarch.rpm

    For the RPMFusion repos you can do the same thing:

    $ sudo rpm -qf /etc/yum.repos.d/rpmfusion-* | sort -u
    rpmfusion-free-release-19-1.noarch
    rpmfusion-nonfree-release-19-1.noarch
    

    So you're looking for .rpm files named rpmfusion-free-release-20*.noarch & rpmfusion-nonfree-release-20*.noarch. Here are those files from the RPM Fusion website:

    $ sudo rpm -Fvh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-20.noarch.rpm
    $ sudo rpm -Fvh http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-20.noarch.rpm
    
  2. Re-adding the fedora-release repo

    An alternative method would be to use the command yum-config-manager to re-add the fedora-release repository.

    $ sudo yum-config-manager --add-repo=http://download.fedoraproject.org/pub/fedora/linux/updates/testing/20/$(uname -p)/
    

    NOTE: This command will install the appropriate 32-bit or 64-bit repository based on your system's architecture using uname -p.

  3. Re-installing?

    Another method for getting things repaired is to use the yum command reinstall.

    $ sudo yum reinstall fedora-release
    

    NOTE: This method will likely repair other repositories such as the fedora-updates repos, but requires at least a partially working install of the fedora repo, so it's a bit of a "catch 22". I would suggest running this command after you've the items in step #1 & #2 above.

References

share|improve this answer
    
Thank you. Turned out those repositories were disabled. I enabled them and they're showing up as green, but the problem still persists. Before and now, when I do sudo yum search gtk+, I'm shown matches for gtk gtk2.x86_64 : The GIMP ToolKit (GTK+), a library for creating GUIs for X. But when I try sudo yum install gtk2.x86_64, I get a message Loaded plugins: langpacks Nothing to do. I had seen the --add-repo command on a website while searching for how to install Chrome. –  Nav Feb 4 at 4:41
    
@Nav - try yum clean all, then the yum install ... cmd. –  slm Feb 4 at 4:58
    
Nope. For this command,sudo yum install gtk2.x86_64 I'm still getting this message Loaded plugins: langpacks Nothing to do . Also, the following files in yum.repos.d are showing up as files of zero size: fedora.repo, fedora-updates.repo and fedora-updates-testing.repo –  Nav Feb 4 at 5:03
    
@Nav - oh that's no good. If they're zero then you'll need to re-install the RPMs that provided them. –  slm Feb 4 at 5:05
    
ok so I navigated to here http://mirrors.kernel.org/fedora/releases/20/Fedora/x86_64/os/Packages/f/ but still can't find out how to get the necessary rpm's. Google searches aren't helping either. A little help please? –  Nav Feb 4 at 5:18

Could be other thing, but from your list of files in your repo directory, I can see the three fedora repos without any content.

Could you check this? I think that you deleted the content doing something.

-rw-r--r--. 1 root root 0 Feb 2 09:34 fedora.repo

I just checked mine on fedora 19 and the screen is like this...

-rw-r--r--. 1 root root 1180 dic 18 13:22 fedora.repo

After that you can do an update and install the packets.

share|improve this answer

To replace the relevant /etc/yum.repos.d/ files for Fedora 20, as root:

cd /root
wget http://mirrors.kernel.org/fedora/releases/20/Fedora/i386/os/Packages/f/fedora-release-20-1.noarch.rpm
rpm -i --force fedora-release-20-1.noarch.rpm

If that doesn't fix your issue, please, as a comment, show us the output of:

rpm -qf /etc/yum.repos.d/fedora.repo
rpm -qf /etc/yum.repos.d/fedora-updates.repo
rpm -qf /etc/yum.repos.d/fedora-updates-testing.repo
share|improve this answer
    
Thanks. To the first rpm command it shows package fedora-release-20-1.noarch is already installed. To the second it shows fedora-release-20-1.noarch. Third,fedora-release-20-1.noarch and fourth fedora-release-20-1.noarch –  Nav Feb 3 at 16:27
1  
try rpm -i --force fedora-release-20-1.noarch.rpm –  samiam Feb 3 at 19:41

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.