On Thu, Aug 30, 2001 at 09:33:21PM -0300, Gustavo Noronha Silva wrote: [translation edited in place] Also, I have a few questions; they are embedded as comments. <sect id="pin">How to keep specific versions of packages installed <p> You may have occasion to modify something in a package and don't have time or don't want to port those changes to a new version of the program. Or, for instance, you may have just upgraded your Debian distribution to 3.0, but want to continue with the version of a certain package from Debian 2.2. You can "pin" the version you have installed so that it will not be upgraded. <p> Using this resource is simple. You just need to edit the file <tt>/etc/apt/preferences</tt>. <p> The format is simple: <example> Package: <package> Pin: <pin definition> Pin-Priority: <pin's priority> </example> <p> For example, to keep package <package>sylpheed</package> that I have modified to use "reply-to-list" at version 0.4.99, I add: <example> Package: sylpheed Pin: version 0.4.99* </example> Note that I used an <tt>*</tt> (asterisk). This is a "wildcard"; it say that I want that this "pin" to be valid for all versions beginning with 0.4.99. This is because Debian versions its packages with a "Debian revision" and I don't want to avoid the installation of these revisions. So, for instance, versions 0.4.99-1 and 0.4.99-10 will be installed as soon as they are made available. <!-- I think this is a poor example of wildcard usage because if somebody modifies a file owned by a package, won't it get clobbered by *any* upgrade? --> <p> The <code>Pin-Priority</code> field is optional; if not specified, it defaults to a value corresponding to the current state of the package. <!-- is this true??? --> <!-- This doesn't help me understand a very important point. What *is* the default pin priority? 0? 100? 989? 999? 1000? If no pin for a package is specified in the preferences file, does it have an effective pin-priority, or do pin priorities only enter the picture if a pin is declared for a package? --> <p> Let's take a look at how pin priorities work. A priority lower than 0 indicates that the package should never be installed. Priorities 0 to 100 denote packages that are not installed and that have no available versions. These won't come into the version-choosing process. Priority 100 is the priority assigned to an installed package - for the installed version of a package to be replaced by a different version, the replacement must have a priority greater than 100. <p> Priorities above 100 indicate that a package should be installed. Typically, the installed version of a package is changed only to upgrade it to a newer version. Any priority between 100 and 1000 (inclusive) indicates this typical behavior. A package with such a priority will not downgrade to an available version with a lower version number. For instance, if I have sylpheed 0.5.3 installed and define a pin on sylpheed 0.4.99 with priority 999, package 0.4.99 will <em>not</em> be installed to satisfy the pin. To make a package "downgradable", to satisfy the pin, it needs possess a priority greater than 1000. <p> This concept of downgrading can have powerful applications; suppose that you just upgraded your <tt>stable</tt> version of Debian to the <tt>testing</tt> one but wanted to retract that decision - perhaps <tt>testing</tt> just wasn't "tested" enough to suit you. You can define a default pin, using a wildcard for the package name, to come back to stable. For example: <example> Package: * Pin: release a=stable Pin-Priority: 1001 </example> <p> After that, a <tt>apt-get -u dist-upgrade</tt> will downgrade your system to the stable version. <p> A pin can be specified on a package's <tt>version</tt>, <tt>release</tt> or <tt>origin</tt>. <p> Pinning on a <tt>version</tt>, as we have seen, supports literal version numbers as well as wildcards to specify several versions at one time. <!-- what's available? standard shell globs? ?*[] or more? --> <p> Option <tt>release</tt> depends on the Release file from an APT repository or from a CD. This option may be of no use at all if you're using package repositories that don't provide this file. You may see the contents of the Release files that you have on <tt>/var/lib/apt/lists/</tt>. The paramters for a release are: <tt>a</tt> (archive), <tt>c</tt> (components), <tt>v</tt> (version), <tt>o</tt> (origin) and <tt>l</tt> (label). <p> An example: <example> Package: * Pin: release v=2.2*,a=stable,c=main,o=Debian,l=Debian Priority: 1001 </example> In this example, we chose version 2.2* of Debian (which can be 2.2r2, 2.2r3 -- this accomodates "point releases" that typically include security fixes and other very important updates), the <tt>stable</tt> repository, section <tt>main</tt> (as opposed to <tt>contrib</tt> or <tt>non-free</tt>) and origin and label Debian. Origin (o=) defines who produced that Release file, the label (l=) defines the name of the distribution: Debian for Debian itself and Progeny for Progeny, for example. A sample Release file: <example> $ cat /var/lib/apt/lists/ftp.debian.org.br_debian_dists_potato_main_binary-i386_Release Archive: stable Version: 2.2r3 Component: main Origin: Debian Label: Debian Architecture: i386 </example> </sect> -- G. Branden Robinson | Exercise your freedom of religion. Debian GNU/Linux | Set fire to a church of your branden@debian.org | choice. http://people.debian.org/~branden/ |
Attachment:
pgpnKQ6HzaTyi.pgp
Description: PGP signature