<SOLVED> gscan2pdf requires sid repos - apt-pinning howto

Archived topics about LMDE 1
Forum rules
LMDE 2 support ends on 1-1-2019
Level 1
Level 1
Posts: 5
Joined: Mon May 07, 2012 1:09 pm

<SOLVED> gscan2pdf requires sid repos - apt-pinning howto

Post by jwave » Tue May 22, 2012 1:25 pm

I firmly believe in the old adage: "Give a man a fish, and you feed him for a day. Teach a man to fish, and you feed him for life."
Thank you to zerozero who pointed me in the right direction so I could learn.
Please do not skip the first step. If you make changes without understanding the risks or reasons, you learn nothing.

My solution has five major steps and assumes that you are working with the default (unaltered) files created by LMDE:

[1] Please READ the following documents FIRST
[2a] BEFORE MODIFYING ANY FILES: CREATE A BACKUP of these two files sources.list and preferences:

Code: Select all

sudo cp -p /etc/apt/sources.list /etc/apt/sources.list.orig
sudo cp -p /etc/apt/preferences /etc/apt/preferences.orig

[2b] (optional, but recommended) using Update Manager for testing, refresh the repository list, and take note of:
  • the quantity of packages it wants to upgrade
  • the names and version numbers of those applications

[3a] alter the two files as follows:
  • add to /etc/apt/sources.list the line:
    "deb http://ftp.us.debian.org/debian unstable main contrib non-free"

    ...so that it looks like this...

    Code: Select all

    deb http://packages.linuxmint.com/ debian main upstream import 
    deb http://debian.linuxmint.com/latest testing main contrib non-free 
    deb http://debian.linuxmint.com/latest/security testing/updates main contrib non-free
    deb http://debian.linuxmint.com/latest/multimedia testing main non-free
    deb http://ftp.us.debian.org/debian unstable main contrib non-free 
  • edit /etc/apt/preferences to look like this:

    Code: Select all

    Package: *
    Pin: release o=linuxmint
    Pin-Priority: 700
    Package: *
    Pin: origin packages.linuxmint.com
    Pin-Priority: 700
    Explanation: Package: *
    Explanation: Pin: release o=Debian
    Explanation: Pin-Priority: 500
    Explanation: dependencies for gscan2pdf were found at http://packages.debian.org/sid/gscan2pdf
    Package: gscan2pdf
    Pin: release a=unstable
    Pin-Priority: 600
    Explanation: The following files are necessary for support to gscan2pdf
    Package: libsane-perl libgtk2-ex-podviewer-perl sane unpaper djvulibre-bin gocr tesseract-ocr cuneiform
    Pin: release a=unstable
    Pin-Priority: 600
    Explanation: goal is to prevent any unauthorized packages from unstable/sid being installed/upgraded
    Package: *
    Pin: release a=unstable
    Pin-Priority: -100
    You can remove/ignore the "Explanation" (comment) lines if you prefer
    Be sure to comment out or remove the third entry-block (containing "o=Debian")
After saving the files, reload the repositories.

[3b] (optional, but recommended)
  • Run Update Manager again,
  • refresh the repository list, and
  • compare the new results with step [2b]
  • If the upgrades do not match the results from step [2b] you have a problem.
    STOP! RETURN to the previous step and try again.
  • If the results are the same (or don't require upgrading gscan2pdf's requirements), then close Update Manager and continue...

[4] Install gscan2pdf using the method of your choice, apt-get or Synaptic Package Manager.
If you're going to this length, you should already know how to use one or the other.

[5a] Rename the modified sources.list and preferences files so you can return to them when you want to upgrade gscan2pdf at a later date.

Code: Select all

sudo mv /etc/apt/sources.list to /etc/apt/sources.list.gscan2pdf
sudo mv /etc/apt/preferences to /etc/apt/preferences.gscan2pdf
...then copy the original files back...

Code: Select all

sudo cp -p /etc/apt/sources.list.orig /etc/apt/sources.list
sudo cp -p /etc/apt/preferences.orig /etc/apt/preferences

[5b] (optional, but recommended) Load Update Manager, update the repositories, and verify that the upgrades it recommends are the same as before (in step [2b] and [3b]), just to be safe.

At this point, you should be finished!

Level 16
Level 16
Posts: 6506
Joined: Tue Jul 07, 2009 2:29 pm

Re: <SOLVED> gscan2pdf requires sid repos - apt-pinning howt

Post by zerozero » Mon Jul 09, 2012 6:05 pm

this is a repost from this topic bringing to the tutorials area this post after this request

[ bliss of ignorance ]


Return to “LMDE 1 Archive”