There are a couple solutions.
A. Repository Priority
B. Package Locks
A. Repository Priority
- Open the Software Repositories module in YaST
- You’ll see a box named ‘Priority’ likely with the number 99 in it.
- If you change this number then the selected repo’s priority will increase or decrease. Priority works by rank-order (1 is the highest, 2 is second-highest etc.).
You can also do this via zypper (the command-line tool for package management)
zypper modifyrepo -p [a number] [repo alias OR number OR URL]
OR
zypper mr -p [a number] [repo name OR number OR URL]
So long as the repositories are organised the way you need - i.e. you want a newer WINE build so the repo offers just WINE & its dependancies - you’ll be fine with the repo priority method. If you mismatch your needs and the repo, this method won’t help you - i.e. if you just want new WINE builds don’t add the Factory OSS master repo because it contains all manner of packages you don’t want to upgrade.
Also be mindful that repo priority trumps package version numbers. If a newer version of a package is available in a lower priority repo it will not be chosen for upgrade automatically.
B. Package Locks
An alternative is to lock the packages you don’t want changed. In YaST if you find the package you want you can lock it by right-clicking and selecting “Protected - Do Not Modify” or “Taboo - Do Not Install”. The same options are also in the ‘Package’ Menu if you’re more of a left-click person.
You can also do the same from the command line using zypper:
zypper addlock [options] [package name]
OR
zypper al [options] [package name]
Zypper will confirm if the lock was successful.
Zypper is actually more powerful than YaST since it allows you to set locks on a per-repository basis. Given your situation, zypper is probably the better route as it allows a more fine grained application of locks. For demonstration purposes, here is my current repo list. [You can see yours using ‘zypper lr’]
# | Alias | Name | Enabled | Refresh
---+---------------------------------------------+----------------------+---------+--------
1 | External:VideoLan | External:VideoLan | Yes | Yes
2 | Factory:Contrib | Factory:Contrib | Yes | Yes
3 | Factory:Debug | Factory:Debug | Yes | Yes
4 | Factory:Non-OSS | Factory:Non-OSS | Yes | Yes
5 | Factory:OSS | Factory:OSS | Yes | Yes
6 | home:prusnak:factory | home:prusnak:factory | Yes | Yes
7 | openSUSE 11.2-0 | oS11.2:DVD | Yes | No
8 | openSUSE_BuildService_-_Drivers_for_webcams | Hardware:Webcam | Yes | Yes
9 | repo-debug | oS11.2:Debug | Yes | Yes
10 | repo-non-oss | oS11.2:Non-OSS | Yes | Yes
11 | repo-oss | oS11.2:OSS | Yes | Yes
12 | repo-source | oS11.2:Source | No | Yes
13 | repo-update | oS11.2:Update | Yes | Yes
Repos #5, 7, and 11 all have the package “kernel-desktop”. You could lock the package in repos 5 & 7 to make sure that only updates in repo 11 will be delivered.
zypper al -r 5 kernel-desktop
zypper al -r 7 kernel-desktop
OR
zypper al -r 5 -r 7 kernel-desktop
Note a few things:
First, if you plan to lock a package in multiple repos you must use the “-r” option for each repo. If you typed in “zypper al -r 5 7 kernel-desktop” you’d get a lock on a package named “7”(!) and the “kernel-desktop” part would be ignored.
Second, zypper assumes you know what you’re doing. It won’t spit back an error or warning that no package named “7” is available.
Third, you can use wildcards. So typing “kernel*” instead will lock every package that starts with ‘kernel’.
If you want to check for locks on unknown packages…
zypper cleanlocks
OR
zypper cl
If you want to remove a package lock
zypper removelock [package name]
OR
zypper rl [package name]
…In YaST you can right-click a locked package and select “keep”. This will remove the lock.
There’s more you can do with zypper & package locks, but this post is so long its about to turn into a webinar. If you’re comfortable with man pages then check out the zypper’s documentation for more information. If not, just ask for additional help.