2

For Debian, I'd like to block packages from installation. For instance, I'd like puppet and superusers to be unable to install ruby1.8, even if a package with ruby1.8 in its dependency list is requested for installation: the puppet run would fail and so too would

# apt-get install ruby1.8

Is what I want possible? If so, what do I do?

2 Answers 2

6

This should work. Insert this text in your /etc/apt/preferences file :

Package: <packagename>
Pin: release *
Pin-Priority: -1
1

Today I purged wslu from Kubuntu 22.04 for the SECOND time and went looking for a way to keep it from being pulled in again, as it interferes with normal KDE Plasma functioning.

Searching brought up this page first. But an even older page gives a better answer:

Use equivs-control and equivs-build to create a fake package that conflicts with the package(s) you want to blacklist. Then install your fake package in the usual way. It's quite easy, quick and satisfying.

Briefly, to blacklist wslu:

equivs-control no-wslu

This creates a generic package control file no-wslu from a template. Use your favorite text editor to change just a few lines of this file:

Package: no-wslu
Version: 1.0
Conflicts: wslu
Description: Conflict with wslu to prevent its installation.

After saving the file:

equivs-build no-wslu

Followed by:

sudo dpkg -i no-wslu_1.0_all.deb

Done.

For a thorough reference, see The Debian Administrator's Handbook - Building your First Package.

You must log in to answer this question.