I've detected some packages that breaks my configuration (like light-locker, evince, etc...)

How can I prevent these packages to be able to install via apt-get install in my system (Debian) with the provided error reason?

  • No, it's not duplicate. They may or may not have the same solution, questions are different. – ceremcem Jul 29 '18 at 12:14
  • 2
    It is not a duplicate because the question belong to AskUbuntu, also the duplicate flag doesn't explain how to prevent a package from being installed. – GAD3R Jul 29 '18 at 12:43
  • @ceremcem that doesn't mean anything without also telling us what exact configuration you tried. – muru Jul 30 '18 at 8:31
  • I mean by "not solving my case" is that it still lets me install a "banned" package. The same answer is below and after banning a package apt policy light-locker still shows a candidate. It's not exactly related with my own use case, packages are still be able to install. – ceremcem Jul 30 '18 at 8:37

Use Pin-Priority: -1

for example:

$ cat >/etc/apt/preferences.d/libsystemd0 <<EOF
Package: libsystemd0
Pin: origin ""
Pin-Priority: -1
| improve this answer | |
  • I placed a file for evince and apt-get install evince still installs it. Would you confirm that you can't install some specific package with this configuration? – ceremcem Jul 29 '18 at 12:17
  • 1
    @ceremcem I think pining a specific package version of (a buggy) package is the best way. For example you can use Pin: version 3.22.1-3+deb9u1 for evince (note that evince isn't buggy) if the package version change the package will be installed. use apt-cache policy pkg_name to get the exact version. – GAD3R Jul 29 '18 at 12:37
  • Sometimes I may want to ban a package because of a bug according to me which is a feature from the point of view of developers. For example, light-locker was my sneaky screen locker which I didn't find a way to disable it and when I learned its name, uninstalling it solved my problem. – ceremcem Jul 30 '18 at 8:48

I've detected some packages that breaks my configuration (like light-locker, evince, etc...)

The apt-listbugs is the correct tool to deal with a buggy package allowing you to pin the package or the dependencies. For example:

# apt install apt-listbugs
$ apt-listbugs list light-locker

grave bugs of light-locker (-> ) <Outstanding>
 b1 - #892290 - light-locker: at unlock, crash with: arguments to dbus_message_new_method_call() were incorrect
 light-locker(1 bug)
| improve this answer | |
  • how does that help the OP ? – Berry Tsakala Jul 29 '18 at 13:07
  • @BerryTsakala Only the buggy package break the system, the OP ask for a solution to prevent the buggy package from being installed. I have quoted the first line to understand what happened. – GAD3R Jul 29 '18 at 13:24
  • 1
    apt-listbugs seems a helper tool but 1. it can not prevent a package from being automatically installed, 2. it isn't a proper error handling (if we don't use it or ignore its output, the package is able to be installed, 3. we can't always examine all the bugs for every package. But it's good to know that there is such a tool. – ceremcem Jul 30 '18 at 8:33

Not the answer you're looking for? Browse other questions tagged or ask your own question.