# Debian

This procedure will install the publican version that is in your default Debian repository. It will also install a large number of packages that publican depends on, like Java, XML and image processing libraries and many ancillary Perl modules.

1. Open a terminal.

2. Change to the root user: `su -`

3. Run the following command to install the `publican` package:

       $ apt-get install publican

4. Run the following command to determine what version of `publican` is installed:

       $ publican -v
       version=2.8

## Important — Installing more recent packages using Apt-Pinning

If you need a more recent release of `publican` than installed by the procedure above, you can query if there other versions available: `http://packages.debian.org/publican`.

To date, there has not been any backport (`http://backports.debian.org/Instructions/`) available for publican, so we need to use Apt Pinning `https://wiki.debian.org/AptPreferences`

Alternatively, you could run Debian testing or unstable in a virtual machine, chroot or linux container.

Assuming there is a more recent version of publican available in the testing repository, and that you are running the current stable, then you can upgrade by:

1. Open a terminal.

2. Change to the root user: `su -`

3. Open your `/etc/apt/sources.list` file in a text editor. For example, to edit the file in gedit run:

       $ gedit /etc/apt/sources.list

4. Add the following line to the end of the file:

       #### testing  #########
       deb http://ftp.us.debian.org/debian testing main contrib non-free

5. Save the file and close the text editor.

6. Open (or create) your `/etc/apt/preferences` file in a text editor. For example, to edit the file in gedit run:

       $ gedit /etc/apt/preferences

7. Add the following line to the end of the file:

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

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

       Package: *
       Pin: release o=Debian
       Pin-Priority: -10

8. Save the file and close the text editor.

9. Run the following command to update the list of packages available to your computer:

       $ apt-get update

10. Run the following command to try to install the testing version of `publican` package, and any updated dependancies:

        $ apt-get -t testing install publican

Because Apt Pinning mixes 2 different debian streams in an un-tested way, incompatibilities may happen. For example, you may get a warning like:

    $ publican
    Warning: program compiled against libxml 209 using older 208
    Warning: XML::LibXML compiled against libxml2 20901, but runtime libxml2 is older 20800
    Warning: program compiled against libxml 209 using older 208
    Warning: XML::LibXSLT compiled against libxslt 10128, but runtime libxslt is older 10126
    Can't open publican: No such file or directory at /usr/bin/publican line 430.

Which indicates that you might need to upgrade libxml2 and libxslt to the testing repository version too. This can be done by searching to find the likely library:

1.     $ apt-get search libxslt
       gambas3-gb-xml-xslt - Gambas XSLT component
       libidzebra-2.0-mod-alvis - IDZebra filter alvis (XSLT filter for XML)
       libidzebra-2.0-mod-dom - IDZebra filter 'dom' (XML DOM internal document model with XSLT)
       libical-parser-html-perl - generates HTML calendars from iCalendars
       libxsltc-java - XSL Transformations (XSLT) compiler from Xalan-Java
       libxml-filter-xslt-perl - Perl module for XSLT as a SAX Filter
       libxml-libxslt-perl - Perl interface to the GNOME libxslt library
       libxslt1-dbg - XSLT 1.0 processing library - debugging symbols
       libxslt1-dev - XSLT 1.0 processing library - development kit
       libxslt1.1 - XSLT 1.0 processing library - runtime library
       python-libxslt1 - Python bindings for libxslt1
       python-libxslt1-dbg - Python bindings for libxslt1 (debug extension)
       python-lxml - pythonic binding for the libxml2 and libxslt libraries
       python-lxml-dbg - pythonic binding for the libxml2 and libxslt libraries (debug extension)
       python-lxml-doc - pythonic binding for the libxml2 and libxslt libraries (documentation)
       python3-lxml - pythonic binding for the libxml2 and libxslt libraries
       python3-lxml-dbg - pythonic binding for the libxml2 and libxslt libraries (debug extension)
       php5-xsl - XSL module for php5
       libsp-gxmlcpp-dev - S+P C++ wrapper for Gnome libxml2/libxslt
       libsp-gxmlcpp1 - S+P C++ wrapper for Gnome libxml2/libxslt
       swfmill - xml2swf and swf2xml processor
       libxslthl-java - XSLT syntax highlighting

   (and the same again for libxml2)

2. And then upgrading those packages to testing.

       $ apt-get -t testing upgrade libxml2 libxslt1.1