LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   apt-pinning does not obey to Not install the package (https://www.linuxquestions.org/questions/debian-26/apt-pinning-does-not-obey-to-not-install-the-package-443631/)

kushalkoolwal 05-10-2006 07:32 PM

apt-pinning does not obey to Not install the package
 
Hi Guys,

I am using Debian etch(mainly) with some packages from unstable and I was playing around with the apt-pinning feature of Debian. I want that the autofs package does not get installed on my system by mistake so I did the following:

Code:

#deb file:///cdrom/ sarge main

deb http://mirrors.kernel.org/debian/ testing main non-free contrib
#deb-src http://mirrors.kernel.org/debian/ testing main non-free contrib

deb http://mirrors.kernel.org/debian/ unstable main non-free contrib
#deb-src http://mirrors.kernel.org/debian/ unstable main non-free contrib

#deb http://security.debian.org/ testing/updates main contrib non-free

# Sid/Etch Dapper/Breezy and others:
#deb http://splashy.alioth.debian.org/debian main unstable
#deb-src http://splashy.alioth.debian.org/debian main unstable

and my /etc/apt/preferences file looks like this:
Code:

Package: *
Pin: release o=Debian,a=testing
Pin-Priority: 700

Package: *
Pin: release o=Debian,a=unstable
Pin-Priority: 500

Package: autofs
Pin: release o=Debian,a=unstable,a=testing,l=Debian,c=main
Pin-Priority: -10

Even after this when I do:
apt-get update
apt-get -s install autofs
I get the following output:
Code:

root@debian:~# apt-get -s install autofs
Reading package lists... Done
Building dependency tree... Done
The following NEW packages will be installed:
  autofs
0 upgraded, 1 newly installed, 0 to remove and 88 not upgraded.
Inst autofs (4.1.4-9 Debian:testing)
Conf autofs (4.1.4-9 Debian:testing)
root@debian:~#

Why is still autofs package being installed. According to man apt_preferences a priority < 1 will cause package not to install.

I even tried Pinning on the version like this:
Code:

Package: *
Pin: release o=Debian,a=testing
Pin-Priority: 700

Package: *
Pin: release o=Debian,a=unstable
Pin-Priority: 500

Package: autofs
Pin: version 4.1.4-9
Pin-Priority: -10

But still it does not help.

I spent like 2 hrs on this googling and reading APT-GET how to on Debian docs but still no luck.

Any one please tell me what is going on here????:scratch:

THEHERO 05-10-2006 10:56 PM

What happens if you try an apt-get update and upgrade?
Does it try to install autofs still?
I'm not too sure if this will help but I have never seen this "o=Debian" in the preferences before.

Mine looks like this

$ cat /etc/apt/preferences

Package: *
Pin: release a=testing
Pin-Priority: 700

Package: *
Pin: release a=unstable
Pin-Priority: 650

THEHERO 05-10-2006 11:08 PM

Try that out with out the version #.


Package: autofs
Pin: version *
Pin-Priority: -10

and http://www.die.net/doc/linux/man/man...erences.5.html has some good docs

kushalkoolwal 05-11-2006 02:20 AM

Quote:

Originally Posted by THEHERO
What happens if you try an apt-get update and upgrade?
Does it try to install autofs still?
I'm not too sure if this will help but I have never seen this "o=Debian" in the preferences before.

Mine looks like this

$ cat /etc/apt/preferences

Package: *
Pin: release a=testing
Pin-Priority: 700

Package: *
Pin: release a=unstable
Pin-Priority: 650


'o' stands for origin. It is pretty common in most of the APT-Pinning tutorial. the link that you have sent in your last past is bascially the man page for apt_preferences. I have gone through that man page. Although I will try your suggestion too and let you know.

Thank you once again.

nx5000 05-11-2006 09:12 AM

Try this one:

Code:

Package: autofs
Pin-Priority: 1001


kushalkoolwal 05-11-2006 12:37 PM

Quote:

Originally Posted by nx5000
Try this one:

Code:

Package: autofs
Pin-Priority: 1001


No that does not work either....:(

It stills wants to install the package. Am I missing something? I have heard so much about APT-Pinning for keep a package from not installing and when I actually tried it thinking it is pretty easy it does not work that way I thought or the manual says.....

Help...

nx5000 05-12-2006 01:39 AM

I've never seen apt-pinning for one package working. There are open bugs on apt bts concerning this thing. There have been discussions, I haven't followed them.
Apt-pinning to negative values works for a complete repository but it doesn't help you in this case.
Maybe somebody will give you a clear answer, or dig in other forums/google/..?
Sorry!

edit:
In general apt won't install a package which is not absolutely needed due to dependency.
If you want to stick to a special version, you have to put it on hold. There is a drawback here: if you are in version 1, and you don't want version 2. Then the package goes in version 3. It won't be upgraded.

kushalkoolwal 05-12-2006 01:46 AM

Quote:

Originally Posted by nx5000
I've never seen apt-pinning for one package working. There are open bugs on apt bts concerning this thing. There have been discussions, I haven't followed them.
Apt-pinning to negative values works for a complete repository but it doesn't help you in this case.
Maybe somebody will give you a clear answer, or dig in other forums/google/..?
Sorry!

edit:
In general apt won't install a package which is not absolutely needed due to dependency.
If you want to stick to a special version, you have to put it on hold. There is a drawback here: if you are in version 1, and you don't want version 2. Then the package goes in version 3. It won't be upgraded.

Thanks for your input. Actually I don;t have any version of that package i.e. autofs. I simply don;t want to install that package. No special reasons but I am trying to learn more about Debian Packaging system...:study:

nx5000 05-15-2006 08:30 AM

Last try

What about this:
Code:

Package: autofs
Pin: release a=*
Pin-Priority: 1001

?

:twocents:

If you get an answer, I'm interested.

kushalkoolwal 05-15-2006 12:09 PM

Quote:

Originally Posted by nx5000
Last try

What about this:
Code:

Package: autofs
Pin: release a=*
Pin-Priority: 1001

?

:twocents:

If you get an answer, I'm interested.


Well, that worked!!! I guess the problem was with the line:
Pin-Priority: -10

When I changed the above line to:
Pin-Priority: 1001

it worked. Having said that, why 1001 works and not anynumber less than 0(<0). I always thought that 1001 is for downgrading package and <0 is if you do not want to install the package.

Can you please clear this confusion??

Thanks for your help......

nx5000 05-16-2006 02:51 AM

Quote:

Originally Posted by kushalkoolwal

Can you please clear this confusion??

No

:D :D :D

Sorry...
On the BTS, some have classified this as wishlist..
Still my problem is the manpage for apt-preferences that not-so-clearly states that <0 should do the job. Something has to be changed.
I'm checking with some other debian users, I'll inform you if I find something.

kushalkoolwal 05-16-2006 03:39 AM

Quote:

Originally Posted by nx5000
No

:D :D :D

Sorry...
On the BTS, some have classified this as wishlist..
Still my problem is the manpage for apt-preferences that not-so-clearly states that <0 should do the job. Something has to be changed.
I'm checking with some other debian users, I'll inform you if I find something.

Thanks nx5000 for keep track of this thread. Please do let me know if you find answer to this mystry. man apt_preferences needs to be change or be specific as you said.


All times are GMT -5. The time now is 06:47 AM.