Setting up /etc/apt/preferences

Kernels & Hardware, configuring network, installing services

Setting up /etc/apt/preferences

Postby michanrai » 2007-09-18 18:13

I'm running Debian testing, but I'd like to use some packages from unstable and experimental. Hence I've been trying to understand how APT-pinning works for half a year, but it seems like I've misunderstood something. For example:
If i run
apt-get install package -t unstable
the package from unstable will be installed. When I run
apt-get (dist-)upgrade
I'd like the package to get upgraded until unstable and testing provides the same version. Then I'd like to use the package from testing.
According to apt-show-versions there is a more recent version of the package in unstable than the installed one (which is a more recent version than the version in testing), but it doesn't get installed when i make an apt-get upgrade.

Is this possible to do with APT-pinning or am I just dreaming too much? My /etc/apt/apt.conf looks like this:
APT::Default-Release "testing";
and my /etc/apt/preferences like this:
Explanation: Unstable
Package: *
Pin: release a=unstable o=Debian l=Debian
Pin-priority: 502

Explanation: Experimental
Package: *
Pin: release a=experimental o=Debian l=Debian
Pin-priority: 501
michanrai
 
Posts: 2
Joined: 2007-09-18 17:12

Postby hemmi7 » 2007-09-20 09:18

posed more or less the same question in a german forum, but noc answer so far.

lets watch who get's a faster answer.

Gr hemmi7
hemmi7
 

Postby Lavene » 2007-09-20 12:11

No need for pinning unless you want to pin a specific version. Using "Default-Release" will do what you want as far as I know, namely following the installed version as it propagates through the branches.

Tina
Lavene
Site admin
 
Posts: 5096
Joined: 2006-01-04 04:26
Location: Oslo, Norway

Postby Eck » 2007-09-20 17:03

I had some fun with this last night when I wanted to install the new NVidia driver just released. This required upgrading my Lenny linux-image to the one in Sid as there is no patch yet for the new driver.

I have a few 3rd party repo's that made that apt.conf default release setup not workable for me. That default designation essentially pins it to priority 990. And if an official Debian repo is pinned to that (which is what happens behind the scenes), the 3rd party repo's can't be preferred even if you apt/preferences pin them with a higher priority.

What I did was not have an apt.conf and used the /etc/apt/preferences file instead:

Explanation: Shame
Package: *
Pin: origin "download.tuxfamily.org"
Pin-Priority: 999

Explanation: Debian-Multimedia
Package: *
Pin: origin "www.debian-multimedia.org"
Pin-Priority: 998

Explanation: Wine
Package: *
Pin: origin "wine.budgetdedicated.com"
Pin-Priority: 997

Explanation: Security
Package: *
Pin: origin "security.debian.org"
Pin-Priority: 996

Explanation: Lenny
Package: *
Pin: release a=testing
Pin-Priority: 500

Explanation: Sid
Package: *
Pin: release a=unstable
Pin-Priority:90

Having Lenny at 500 let the 3rd party repo's take precedence and having Sid at 90 let only what I specifically use the -t switch (target release) in aptitude for to install from Sid.

I have no idea if I put the testing security repo in the correct position as I didn't find any reference to what to do with that in the couple of books I was using to help me get through the nightmare (fun challenge?) of hours of getting this to work right.

I also don't really know if I'll get upgrades for the Sid stuff automatically that way (for the Kernel, basically as that's all I installed from there). I may need, until there's a newer version in Lenny, when there is an upgrade for it in Sid to actually type in aptitude install -t unstable linux-image-2.6-k7 to get it to upgrade it. That's how I upgraded the Kernel last night. That's the meta-package and I also got the linux-headers the same way after purging the older linux-headers when I uninstalled the old NVidia driver and did the dpkg-reconfigure putting the nv driver in there before doing the Kernel upgrade.

I usually purge the older Kernel when the new one works but in this case I'll leave it there until 2.6.22 gets into Lenny. That way if something happens I can always boot to the older Kernel in single user mode, dpkg-reconfigure the nv driver in and still use the system. So far the new Kernel and the new NVidia driver are working great though.

Wine only became installable from budgetdedicated (the winehq source) when I moved Lenny down to 500. Interestingly, Lenny officially got Wine 0.9.44 today and because they add a 0.9.44-1 to it, aptitude full-upgrade wanted to upgrade me to the Debian version. Since it's the same version really, I purged Wine and installed the Debian version. There is a new 0.9.45 but it's not on the winehq repo for Debian yet. I suppose when it appears aptitude will want to upgrade me to it. (I hope.) Then instead of letting it, since there are differences, I'll purge the Debian Wine and then install wine, which with the higher version number again will in that case install once again from the winehq repo.

Compiz reacted the same way. I needed to keep Lenny down there at 500 to get Shame's repo to be the one picked by aptitude.

The Kernel upgrade was interesting because with that -t switch aptitude showed zillions of things it was NOT upgrading while doing the Kernel install from Sid. The normal aptitude upgrades thankfully do not list that stuff, but aptitude properly ignored that other newer stuff exists on Sid and only installed the Kernel packages, and the same later with the headers.

I think I'm only unsure about that security repo. I hope that was the correct way to handle it and I'll get whatever it has for Lenny throught the normal aptitude safe and full upgrade process.
Lenovo z560 Laptop Nvidia GeForce 310m Hitachi 500GB HD Intel HD Audio 4GB RAM
Eck
 
Posts: 740
Joined: 2007-06-27 16:13

Postby penpen » 2007-09-20 18:11

could I use this same method to mix packages from testing and use them with etch? (i.e. nvidia drivers) I tried using the 'preferences' file to do this but when i did it was trying to install all of testing instead of just keeping etch as my main repo. I had put a testing repo in my sources.list. When installing packages using the -t flag, is it not necessary that those repos are in your sources.list? Lol, maybe I just configured it incorrectly...
User avatar
penpen
 
Posts: 288
Joined: 2007-03-20 13:38

Postby Eck » 2007-09-20 18:25

viewtopic.php?t=15612&postdays=0&postorder=asc&start=0

There's a nice guide to the situation. But, like I said, I needed to go the other route with an /etc/apt/preferences file and pinning.

It works for a normal /etc/apt/sources.list setup though. I just have a few 3rd party repos that I want a higher apt pin priority than the default distro, so needed to do it the other way.

Heh, yeah. You need the source you pin to actually be a source in /etc/apt/sources.list to be able to install stuff from it. But you need to either pin using /etc/apt/preferences or use a default release designation in an /etc/apt/apt.conf file so you won't be upgraded to Sid!

Do a bunch of reading and printing out before doing this stuff. Took me hours to get it, I hope, correctly done for my situation.
Lenovo z560 Laptop Nvidia GeForce 310m Hitachi 500GB HD Intel HD Audio 4GB RAM
Eck
 
Posts: 740
Joined: 2007-06-27 16:13

Postby michanrai » 2007-09-20 19:37

Thanks for your replies. I found out on my own what was wrong. I forgot the commas.
Kinda awkward. :oops:
michanrai
 
Posts: 2
Joined: 2007-09-18 17:12

Postby penpen » 2007-09-20 20:07

Eck wrote:http://forums.debian.net/viewtopic.php?t=15612&postdays=0&postorder=asc&start=0

There's a nice guide to the situation. But, like I said, I needed to go the other route with an /etc/apt/preferences file and pinning.

It works for a normal /etc/apt/sources.list setup though. I just have a few 3rd party repos that I want a higher apt pin priority than the default distro, so needed to do it the other way.

Heh, yeah. You need the source you pin to actually be a source in /etc/apt/sources.list to be able to install stuff from it. But you need to either pin using /etc/apt/preferences or use a default release designation in an /etc/apt/apt.conf file so you won't be upgraded to Sid!

Do a bunch of reading and printing out before doing this stuff. Took me hours to get it, I hope, correctly done for my situation.

Thanks, Ill have a look, I got a new hd because my one that fried came back from an RMA I sent to seagate... hopefully I'll be installing deb on my windows box this weekend.
User avatar
penpen
 
Posts: 288
Joined: 2007-03-20 13:38


Return to System configuration

Who is online

Users browsing this forum: No registered users and 20 guests

fashionable