Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Backports and apt-pinning

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
User avatar
kikinovak
Posts: 34
Joined: 2007-03-06 05:21
Location: Montpezat (South France)

Backports and apt-pinning

#1 Post by kikinovak »

Hi,

I'm currently trying to solve one specific problem with apt-pinning, but I'm not exactly sure how to translate it into the right syntax.

I'm running Debian Squeeze (stable), and I want to use a series of packages from backports, like iceweasel, icedove, amarok, nvidia-kernel-dkms, and a few others.

I know how to configure Backports, and I know how to manually install packages explicitly from Backports with aptitute -t squeeze-backports install package.

Now how would I translate into the right apt-pinning syntax the following directive:

1) Always install packages icedove, iceweasel, amarok and nvidia-kernel-dkms from Backports, and
2) Install all other packages from Stable.

I read through some tutorials about the subject, but it looks like I don't have the required IQ :shock:

Any suggestions ?

emariz
Posts: 2901
Joined: 2008-10-17 07:59

Re: Backports and apt-pinning

#2 Post by emariz »

You don't need an APT pinning preference for this because, as of Squeeze, all Backports are upgraded from Backports.

In detail, all Backports are given a priority of 100, which is equal to that of installed packages but lesser than that of the packages from the default archive (500). Because Apt-Get/Aptitude will never downgrade a package automatically and Stable packages have older versions than Backports, an installed Backport will only listen to Backports updates.

You should note that all packages from Mozilla applications identify themselves as squeeze-backports but they come actually from the Debian Mozilla Team repository http://mozilla.debian.net/, which should also be present and validated before installing these applications.

User avatar
kikinovak
Posts: 34
Joined: 2007-03-06 05:21
Location: Montpezat (South France)

Re: Backports and apt-pinning

#3 Post by kikinovak »

Let me state my question otherwise.

1) I'm using Debian Squeeze stable, with Backports

2) Packages package1, package2, package3 and package4 should be taken from Backports.

3) All other packages should be taken from Stable.

Thus, when I do this :

Code: Select all

# aptitude install package0 package1 package2 package3 package4 package5 package6 ...
It results in the following :

a) Packages package0, package5 and package6 are installed from Stable repos.
b) Packages package1, package2, package3 and package4 are installed from Backports.

Simple question: what do I have to put in /etc/apt/preferences to have the desired behaviour?

I would appreciate if someone could simply answer the question.

vbrummond
Posts: 4432
Joined: 2010-03-02 01:42

Re: Backports and apt-pinning

#4 Post by vbrummond »

Just target squeeze-backports for whatever you want to install from it. :|

Code: Select all

apt-get -t squeeze-backports install packagefrombackports
Always on Debian Testing

User avatar
kikinovak
Posts: 34
Joined: 2007-03-06 05:21
Location: Montpezat (South France)

Re: Backports and apt-pinning

#5 Post by kikinovak »

*sigh*

This is meant to work in a scripted install, with packages being read from a plain text package list. See script below.

Please don't make me jump through burning loops trying to explain why I want to have the APT behaviour described above.

Code: Select all

#!/bin/bash
#
# configurer-bureau.sh
# 
# (c) Niki Kovacs, 2011

CWD=$(pwd)

# Configurer APT
echo ":: Configuration de APT."
cat $CWD/../apt/sources.list > /etc/apt/sources.list
chmod 0644 /etc/apt/sources.list

# Télécharger la clé publique d'Oracle :
wget -c http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc
apt-key add $CWD/oracle_vbox.asc
rm -f $CWD/oracle_vbox.asc

# Recharger les informations et mettre à jour
aptitude update
aptitude -y install debian-multimedia-keyring
aptitude -y install pkg-mozilla-archive-keyring
aptitude -y full-upgrade

# Installer les paquets supplémentaires
PAQUETS=$(egrep -v '(^\#)|(^\s+$)' $CWD/paquets)
BACKPORTS=$(egrep -v '(^\#)|(^\s+$)' $CWD/paquets-recents)
aptitude -y install $PAQUETS
aptitude -t squeeze-backports -y install $BACKPORTS

# Ranger les fonds d'écran à leur place
echo ":: Installation des fonds d'écran supplémentaires."
if [ -d /usr/share/wallpapers ]; then
	cp -f $CWD/../wallpapers/* /usr/share/wallpapers/
fi

# Ranger les icônes à leur place
echo ":: Installation des icônes supplémentaires."
if [ -d /usr/share/pixmaps ]; then
	cp -f $CWD/../pixmaps/* /usr/share/pixmaps/
fi

# Installer le profil par défaut des utilisateurs
echo ":: Installation du profil par défaut des utilisateurs."
if [ ! -d /etc/skel/Desktop ]; then
  mkdir /etc/skel/Desktop
fi
cp -f $CWD/../gtk/.gtkrc-2.0-kde /etc/skel/
rm -rf /etc/skel/.kde
mkdir -p /etc/skel/.kde/share/config
cp -f $CWD/../kde/* /etc/skel/.kde/share/config/

# Installer le script 'cleanmenu' et les fichiers *.desktop, avec des
# permissions saines. 
echo ":: Installation des entrées de menu personnalisées."
rm -rf /usr/local/sbin/{cleanmenu,desktop}
if [ -d /usr/share/applications ]; then
	cp -Rf $CWD/../cleanmenu/* /usr/local/sbin/
	chmod 0700 /usr/local/sbin/cleanmenu
	chmod 0700 /usr/local/sbin/desktop
	chmod 0644 /usr/local/sbin/desktop/*.desktop
fi

# Activer les polices Bitmap
if [ -h /etc/fonts/conf.d/70-no-bitmaps.conf ]; then
	rm -f /etc/fonts/conf.d/70-no-bitmaps.conf
	ln -s /etc/fonts/conf.avail/70-yes-bitmaps.conf /etc/fonts/conf.d/
	dpkg-reconfigure fontconfig
fi

# Faire le ménage dans les entrées de menu
/usr/local/sbin/cleanmenu

exit

vbrummond
Posts: 4432
Joined: 2010-03-02 01:42

Re: Backports and apt-pinning

#6 Post by vbrummond »

I didn't really care enough to *simply* read your post to answer your question. Anyway:

Code: Select all

Package: icedove iceweasel amarok nvidia-kernel-dkms
Pin: release a=squeeze-backports
Pin-Priority: 500
Something like that. I am not sure how it will handle dependencies. You might have to add them also.

Edit2: actually, I think that worked, without the pinning it wants to install amarok from squeeze, if I add the pinning the preferred version is the one from backports.
Always on Debian Testing

User avatar
kikinovak
Posts: 34
Joined: 2007-03-06 05:21
Location: Montpezat (South France)

Re: Backports and apt-pinning

#7 Post by kikinovak »

Hey, that's exactly what I was looking for! I'll experiment a bit with that and keep you posted about the results.

Sorry if my last post seemed a bit unnerved. The context is: I just came from the french user forum (I live in France) and posted the same question there, in French. Got a dozen answers, all suggesting more or less "why don't you just (do something completely different)". So I got here, hoping the english-speaking community would have a more straightforward approach than the French :D

vbrummond
Posts: 4432
Joined: 2010-03-02 01:42

Re: Backports and apt-pinning

#8 Post by vbrummond »

Heh, sorry for not reading the first post with my first answer. I hope you figure it out. :)
Always on Debian Testing

Post Reply