7

If I have:

[usern@hostn yum.repos.d]$ cat google-chrome.repo 
[google-chrome]
name=google-chrome
baseurl=http://dl.google.com/linux/chrome/rpm/stable/i386
enabled=1
gpgcheck=1

...how can I ensure that there will not be incidents like (just theory): a firefox package comes out in the google chrome repo, and because (just theory again) it has a newer version then the one that's in the original repos it gets installed when updating? How could I ensure that that from the google-chrome-repos I only get the google-chrome package?

Caleb
  • 70,105
LanceBaynes
  • 40,135
  • 97
  • 255
  • 351

3 Answers3

12

In the repo file, add a line that says:

includepkgs=google-chrome*

This will only allow updates and installs of packages named google-chrome* from that repo, all other packages will be ignored. You can list multiple packages if you separate them by a space.

In a more general sense, there's no good way of handling the problem of repos having conflicting RPMs. You have to choose good repos where you trust the maintainer (I always recommend EPEL). There's a few plugins out there which might help you such as yum-priorities and yum-protectbase but I've always used the incpludepkgs method. It's a little more work but I can sleep better at night knowing some RPM from some repo won't blow away some other RPM from a different repo when I don't want it too.

1

Install the package and turn off the repo [enabled=0]. When you are ready to update:

yum update

Then after all others have updated, turn on the repo [enabled=1].

yum update chrome             

NOTE: just the package you want to use that repo.

Then turn off the repo again, [enabled=0].

Sounds like a pain but a simple script can do it easily. This is the best way when using an untrusted repo.

If there is an unresolvable conflict. That's what this is for:

LD_LIBRARY_PATH=/home/user/mylibs/:$LD_LIBRARY_PATH conflicted_program
slm
  • 369,824
1

For anyone else who comes across this yum's "--enablerepo" feature is super handy for doing updates and stuff while leaving it otherwise disabled.

Install Repo

Disable the repo

sed -i "s/enabled=1/enabled=0/g" /etc/yum.repos.d/google-chrome.repo

Oneliner to temporarily enable repo to install chrome from that repo

yum --enablerepo=google-chrome install google-chrome-stable

Oneliner to temporarily enable repo to update chrome from that repo

yum --enablerepo=google-chrome update google-chrome-stable

You can add an alias for the update command if needed. This makes it a lot easier than having to remember the command.

alias updatechrome="yum --enablerepo=google-chrome update google-chrome-stable"

mike
  • 41
  • 1