Blocking individual packages when using apt

Posted on 01, Mar 2014

I wanted to install libsoqt4-dev so I could compile freecad , however this package depends on qt4-designer and qt4-doc , which together add about 100 MB to the required download. This is not usually a problem, however I was mobile, and suffering from unreliable internet.

Blocking packages

I feel confident that not having these two packages will not effect the integrity of the libsoqt4-dev installation; they can be blocked individually in /etc/apt/preferences like this:

Package: qt4-designer
Pin: origin ""
Pin-Priority: -1

Package: qt4-doc
Pin: origin ""
Pin-Priority: -1

Setting the origin to nothing ensures that they cannot be downloaded, and a negative priority means we really will ignore them. Running:

sudo apt-get install libsoqt4-dev

sees the installation to completion without these dependencies and the large (in context) download. There is no need to run apt-get update or anything like that.

Freecad installation side-note

Configuring a freecad compilation with CMake (on Debian) does not complain about missing libsoqt4 headers. Instead during compilation lots of errors relating to undefined reference to SoQtViewer are thrown. Installing libsoqt4-dev fixes this.

Copyright, Christopher Poole 2008-2016.