VERY off topic, but this could be helpful to fellow Debian'ers.  I know
that when I learned of pinning, I was very grateful.

On Wed, 2004-01-07 at 12:12, Marcio Merlone wrote:
> Hello all,
> 
> Sorry for this ot, but does anybody know where can I get an up to date
> debian package of SA? I have only SA 2.2 available on apt-get...

Numerous people suggested using a backported version of SpamAssassin
from backports or apt-get.org. These are good suggestions that I
recommend.  

However, Debian does support "mixed systems".  You can easily run a
stable/woody box that has the ability to install testing/sarge or
sid/unstable packages.  Here's the lowdown:

/etc/apt/preferences
/etc/apt/sources.list

First, you "pin" your system to woody (give it a high priority) and set
some lower priorities for sarge and sid.  This will make sure testing or
unstable packages don't upgrade woody packages.  (you can pin individual
packages as well. "man 5 apt_preferences")

=== begin /etc/apt/preferences ===
Package: *
Pin: release o=Debian,a=stable
Pin-Priority: 900

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

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

Package: *
Pin: release o=Debian
Pin-Priority: -1
=== end /etc/apt/preferences ===

Now, run this:
apt-get update && apt-get -u upgrade

Assuming you have a reasonable "deb" line in /etc/apt/sources.list
already, you have just retrieved the latest package info from Debian and
upgraded any packages that have updates available (I only include this
step to allow you to later test that the pinning method works).  Any
additional apt-get -u upgrades should say 0 packages to upgrade, if all
went well.


You should already have a deb line for "stable" in sources.list.  Add
testing and/or unstable lines to your /etc/apt/sources.list:
deb http://http.us.debian.org/debian testing main contrib non-free
deb http://http.us.debian.org/debian unstable main contrib non-free

Now, update again:
apt-get update && apt-get -u upgrade

The apt-get update should retrieve the testing and unstable package info
databases (this is a few megs of data).  The apt-get -u upgrade should
have told you there were 0 packages to upgrade. 

Important! If it tells you you have packages to upgrade, you may have
done something wrong and may be upgrading from woody to sarge or sid :).
But then you probably would have noticed that it select a thousand
packages for upgrade and stopped the procedure, right? Right?!?

OK, if all's well, let's try installing a package from sid/unstable.  In
a completely random manner (honest!), I chose the "spamassasin" package
to use as an example.  

First, let's see what versions of the package "spamassassin" are
available:

----------------------------------------------------
trogdor:/etc/apt# apt-cache policy spamassassin
spamassassin:
  Installed: 2.20-1woody3
  Candidate: 2.20-1woody3
  Version Table:
     2.61-2 0
        300 http://http.us.debian.org unstable/main Packages
     2.61-1 0
        400 http://http.us.debian.org testing/main Packages
 *** 2.20-1woody3 0
        900 http://http.us.debian.org stable/main Packages
        100 /var/lib/dpkg/status
----------------------------------------------------

OK, so this particular woody box has 2.20 installed.  The "Installation
Candidate" (the version that matches the rules you've set up in
/etc/apt/preferences) is also 2.20 (because we pinned woody/stable at a
high priority).  Sarge (testing) has 2.61-1 at a priority of 400 and Sid
(unstable) has 2.61-2 at a priority of 300.  The -x tacked on the end of
the version is an internal Debian version number.  Both 2.61 releases
are SpamAssassin 2.61.  The priorities listed are the same as we
declared in preferences and are arbitrary, as long as they're below 990
(man 5 apt_preferences).

Enough chatter, let's install spamassassin from sid!  Tell apt to get
spamassassin from sid/unstable like this:
apt-get -t unstable install spamassassin

On my woody machine, here's the output:

---------------------------------------------------------
trogdor:/etc/apt# apt-get -t unstable install spamassassin
Reading Package Lists... Done
Building Dependency Tree... Done
The following extra packages will be installed:
  autoconf debconf debconf-i18n dialog gcc-3.3-base libc6 libc6-dev
libdb1-compat libdb4.0 libgcc1 libgdbm3
  libhtml-parser-perl libhtml-tagset-perl liblocale-gettext-perl
libncursesw5 libnewt0.51 libpopt0 libssl0.9.7 libstdc++5
  libtext-charwidth-perl libtext-iconv-perl libtext-wrapi18n-perl
linux-kernel-headers locales netbase perl perl-base
  perl-modules slang1a-utf8 spamc whiptail xlibmesa3 xlibmesa3-gl
xlibmesa3-glu
The following packages will be REMOVED:
  autoconf2.13 libnss-db
The following NEW packages will be installed:
  debconf-i18n gcc-3.3-base libdb1-compat libdb4.0 libgdbm3
libhtml-parser-perl libhtml-tagset-perl liblocale-gettext-perl
  libncursesw5 libnewt0.51 libssl0.9.7 libstdc++5 libtext-charwidth-perl
libtext-iconv-perl libtext-wrapi18n-perl
  linux-kernel-headers slang1a-utf8 spamc xlibmesa3-gl xlibmesa3-glu
15 packages upgraded, 20 newly installed, 2 to remove and 394  not
upgraded.
Need to get 28.6MB of archives. After unpacking 33.9MB will be used.
Do you want to continue? [Y/n]
---------------------------------------------------------

Hmm, that's a lot of dependancies to also upgrade...  Also note that
there are two packages to REMOVE because they conflict with something
we're currently installing or upgrading.  autoconf2.13 and libnss-db go
bye bye.  We're also pulling in a *lot* of extra stuff including
xlibmesa3 (?!?!)

Hmm... it doesn't come in as clean as I was hoping it might have. Let's
cancel (answer "n") and see what sarge has to offer.  Tell apt to get
spamassassin from sid/unstable like this:
apt-get -t testing install spamassassin

---------------------------------------------------------
trogdor:/usr/share/man# apt-get -t testing install spamassassin
Reading Package Lists... Done
Building Dependency Tree... Done
The following extra packages will be installed:
  autoconf libc6 libc6-dev libdb1-compat libdb4.0 libgdbm3
libhtml-parser-perl libhtml-tagset-perl libssl0.9.7
  linux-kernel-headers locales perl perl-base perl-modules spamc
The following packages will be REMOVED:
  autoconf2.13 libnss-db
The following NEW packages will be installed:
  libdb1-compat libdb4.0 libgdbm3 libhtml-parser-perl
libhtml-tagset-perl libssl0.9.7 linux-kernel-headers spamc
8 packages upgraded, 8 newly installed, 2 to remove and 381  not
upgraded.
Need to get 22.7MB of archives. After unpacking 28.0MB will be used.
Do you want to continue? [Y/n]
---------------------------------------------------------

Aaah, looks a bit better.  Some interesting things to note here:
1) libc6 and locales are being upgraded from 2.2.5-11.5 to 2.3.2-ds1-10.
   On a production server, this may be unacceptable.  
   If so, use a backport instead.
2) perl is being upgraded from 5.6.1-8.3 to 5.8.2-2.
   On a production server, this may be unacceptable.
   If so, use a backport instead.
3) A bunch of perl packages are being pulled in, no doubt because SA
requires them.
4) autoconf2.13 is still being removed.
5) linux-kernel-headers is being installed because libc6-dev depends on
it.  Had I not already had libc6-dev on this woody box, this package
would not have been downloaded.

So now I allow the upgrade to occur (libc6 and perl being the major
components we're scared of).  The libc6 upgrade warns me that replacing
libc6 may cause running applications to fail to make NSS lookups. It
tells me about any known problem apps (apache, ssh, cron, exim, inetd)
that I am running and offers to restart them after the upgrade.  I
gratefully accept the offer.

Success!

trogdor:/usr/share/man# uname -a
Linux trogdor 2.4.18-1-686-smp #1 SMP Mon Jan 5 20:42:23 UTC 2004 i686
unknown
trogdor:/usr/share/man# spamassassin --lint
spamtrogdor:/usr/share/man# spamassassin --version
SpamAssassin version 2.61
trogdor:/usr/share/man# apt-cache policy spamassassin
spamassassin:
  Installed: 2.61-1
  Candidate: 2.61-1
  Version Table:
     2.61-2 0
        300 http://http.us.debian.org unstable/main Packages
 *** 2.61-1 0
        400 http://http.us.debian.org testing/main Packages
        100 /var/lib/dpkg/status
     2.20-1woody3 0
        900 http://http.us.debian.org stable/main Packages
trogdor:/usr/share/man#



Summary: 
In general, Debian allows you to run a "mixed system" installing
packages from different Debian releases in a pick-and-choose manner.  As
these packages are installed, any dependencies that are not met are also
installed or upgraded.  

In the case of SpamAssassin, the current state of sarge and sid suggest
installing from sarge is the more reasonable of the two methods.  The
major things to watch out for during an installation of sarge's
spamassassin (as of 2003-01-08) on woody is that both libc6 and perl are
upgraded.  Since you are running a woody box it is likely a production
machine.  Changes such as libc6 may be unacceptable and a backport of
SpamAssassin might be more appropriate.


-- 
Chris Thielen

Easily generate SpamAssassin rules to catch obfuscated spam phrases:
http://www.sandgnat.com/cmos/



-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html
_______________________________________________
Spamassassin-talk mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/spamassassin-talk

Reply via email to