I'm using aptitude as package manager in Debian. How to mark the package never to be installed by it? Because from time to time, when I install some gnome utilities etc., systemd package gets installed by dependency and then my log-in manager (slim) does not work and I cannot login to graphical environment.

I know I should always check the list of things that are to be installed, but I sometimes forget. Can I prevent systemd from being installed?

*This won't work, because it only prevents package from upgrading:

sudo echo hold systemd | sudo dpkg --set-selections

  • You're trying to fix it from the wrong side. If thing X breaks thing Y, look in slim's logs to determine why it fails to start, send a bug report to Debian, and so on. It'll be more helpful to other Debian users who have the same problem than just pretending that the conflict doesn't exist anymore. Mar 9, 2014 at 14:44

1 Answer 1


You can achieve the desired result by configuring apt-pinning. Edit /etc/apt/preferences (if it is not there, create it) and add the following lines:

Package: <package>
Pin: origin ""
Pin-Priority: -999

This will prevent apt (and thus aptitude) from installing . Please note that apt might refuse to install packages that depend on the blocked package, too. Read more in the man_page man apt-preferences.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .