LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-03-2015, 04:03 AM   #1
tripialos
Member
 
Registered: Apr 2012
Posts: 169

Rep: Reputation: Disabled
how to pin a package to be installed from specific repo?


I am running a host with debian wheezy and i wish to install a specific package from debian`s testing repo. However i want the rest packages, updates, etc to be done from the stable (wheezy) repo.

How do i do that?

So far i added testing repo to sources.list and updated the cache but this means the system will pull all packages from testing.

Last edited by tripialos; 07-03-2015 at 04:04 AM.
 
Old 07-03-2015, 04:14 AM   #2
JaseP
Senior Member
 
Registered: Jun 2002
Location: Eastern PA, USA
Distribution: K/Ubuntu 18.04-14.04, Scientific Linux 6.3-6.4, Android-x86, Pretty much all distros at one point...
Posts: 1,802

Rep: Reputation: 157Reputation: 157
I think what you want to do is pinning the package...

Look here:
http://askubuntu.com/questions/17023...ges-from-a-ppa

The principle should be the same for using testing as opposed to a PPA...
 
Old 07-03-2015, 04:18 AM   #3
Head_on_a_Stick
Senior Member
 
Registered: Dec 2014
Location: London, England
Distribution: Debian stable (and OpenBSD-current)
Posts: 1,187

Rep: Reputation: 285Reputation: 285Reputation: 285
Quote:
Originally Posted by tripialos View Post
I am running a host with debian wheezy and i wish to install a specific package from debian`s testing repo.
Backport it to wheezy, it is very simple to do.

https://wiki.debian.org/SimpleBackportCreation

Read this: https://wiki.debian.org/DontBreakDeb..._FrankenDebian

If you want to use APT pinning, make sure you read:
Code:
man apt_preferences
 
Old 07-03-2015, 05:10 AM   #4
tripialos
Member
 
Registered: Apr 2012
Posts: 169

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Head_on_a_Stick View Post
Backport it to wheezy, it is very simple to do.

https://wiki.debian.org/SimpleBackportCreation

Read this: https://wiki.debian.org/DontBreakDeb..._FrankenDebian

If you want to use APT pinning, make sure you read:
Code:
man apt_preferences
Thanks for your replay

i have already read the man page and i configured the apt preferences as follows:



Quote:
root@station:/etc/apt# cat preferences

Package: *
Pin: release a=stable
Pin-Priority: 900

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

Package: tomcat7
Pin: release a=testing
Pin-Priority: 800
However when i try to clarify it doesn`t seem to work

Quote:
root@station:/etc/apt# apt-cache policy apache2
apache2:
Installed: (none)
Candidate: 2.4.10-11
Version table:
2.4.10-11 0
850 http://http.us.debian.org/debian/ testing/main amd64 Packages
2.2.22-13+deb7u4 0
500 http://http.debian.net/debian/ wheezy/main amd64 Packages
2.2.22-13+deb7u3 0
500 http://security.debian.org/ wheezy/updates/main amd64 Packages
As you can see from above it apt chooses to install apache2 from testing
Am i doing something wrong here?
 
Old 07-03-2015, 05:28 AM   #5
Head_on_a_Stick
Senior Member
 
Registered: Dec 2014
Location: London, England
Distribution: Debian stable (and OpenBSD-current)
Posts: 1,187

Rep: Reputation: 285Reputation: 285Reputation: 285
FFS just backport it...

Which package is it?

I can backport it for you if you want.

APT pinning is really for experts only.
 
Old 07-03-2015, 05:45 AM   #6
tripialos
Member
 
Registered: Apr 2012
Posts: 169

Original Poster
Rep: Reputation: Disabled
I found out why it was not working, actually i found a source from https://wiki.debian.org/AptPreferences where a guy had a similar problem with mine.

Quote:
Notes from GeorgiosZarkadas
I found that using a higher than 500 value to pin testing/unstable resulted in apt-get upgrade wanting to upgrade all packages with a newer version to testing/unstable even while I had stable pinned with a higher value than testing/unstable.

After, querying the outcome of apt-cache policy <some-package> for a number of the packages that apt-get upgrade considered that they should be upgraded, I concluded that if there are multiple versions with candidates pinned to 500 or higher, then pinning is considered after the version number. Thus the highest version with the highest pin weight among the candidates of that (and only that) version is selected.
Having this mind i changed my apt preferences to:

Quote:
root@station:/etc/apt# cat preferences
Package: *
Pin: release a=testing
Pin-Priority: 400


Package: tomcat7
Pin: release a=testing
Pin-Priority: 401
Then it worked as expected

Quote:
root@station:/etc/apt# apt-cache policy apache2
apache2:
Installed: (none)
Candidate: 2.2.22-13+deb7u4
Version table:
2.4.10-11 0
400 http://http.us.debian.org/debian/ testing/main amd64 Packages
2.2.22-13+deb7u4 0
500 http://http.debian.net/debian/ wheezy/main amd64 Packages
2.2.22-13+deb7u3 0
500 http://security.debian.org/ wheezy/updates/main amd64 Packages
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How do I figure which package installed a specific file? thebombzen Linux - Software 1 01-14-2011 10:13 AM
How to send high signal or low through a specific pin SuperDude123 Linux - Hardware 1 03-30-2010 09:53 AM
Which yum repo was a package installed from? arizonagroovejet Linux - General 1 08-25-2008 08:58 AM
How to find out if you have a specific package installed? AriciU Slackware 2 07-08-2007 10:58 PM
apt-get: how to pin kernel package Samsara Fedora 0 10-29-2004 06:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:29 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration