Since today I get the following warning when running update-initramfs -u:

cryptsetup: WARNING: The initramfs image may not contain cryptsetup binaries 
    nor crypto modules. If that's on purpose, you may want to uninstall the 
    'cryptsetup-initramfs' package in order to disable the cryptsetup initramfs 
    integration and avoid this warning.

Previously, I used cryptsetup-initramfs to unlock my crypted data partition at boot time. But I removed this and unlock the partition manually now at every reboot (for being able to reboot my home server from remote).

When trying to uninstall cryptsetup-initramfs, it wants to deinstall cryptsetup also. But I need this for the manual unlock, I strongly assume:

me@myserver:~$ sudo apt remove cryptsetup-initramfs
Paketlisten werden gelesen... Fertig
Abhängigkeitsbaum wird aufgebaut.       
Statusinformationen werden eingelesen.... Fertig
Die folgenden Pakete werden ENTFERNT:
  cryptsetup cryptsetup-initramfs
0 aktualisiert, 0 neu installiert, 2 zu entfernen und 0 nicht aktualisiert.
Nach dieser Operation werden 210 kB Plattenplatz freigegeben.
Möchten Sie fortfahren? [J/n] n

So, what to do? Just ignore the warning? Generally, I don't like warnings that are "normal" ... :D

Tried to apply the proposed solution from the answers:

me@myserver:~$ LANG=C sudo apt-mark manual cryptsetup
cryptsetup was already set to manually installed.
me@myserver:~$ LANG=C sudo apt remove cryptsetup-initramfs
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following package was automatically installed and is no longer required:
Use 'sudo apt autoremove' to remove it.
The following packages will be REMOVED:
  cryptsetup cryptsetup-initramfs
0 upgraded, 0 newly installed, 2 to remove and 0 not upgraded.
After this operation, 210 kB disk space will be freed.
Do you want to continue? [Y/n] n
  • Always use LANG=C when sharing error messages. Oct 1 at 20:22

2 Answers 2


You apparently have never actually specified that you want to have the cryptsetup installed; the package manager has installed it to satisfy a dependency of cryptsetup-initramfs. As a result, the cryptsetup package has been marked "automatically installed", and that means it can be auto-removed if all the packages depending on it are removed.

The solution is to first mark cryptsetup as "manually installed", i.e. installed because you specifically want to have it.

sudo apt-mark manual cryptsetup

There are other ways to do this in other apt front-ends, like using the m key in aptitude, if you prefer that.

Once apt knows you want cryptsetup installed, it should no longer suggest removing cryptsetup along with cryptsetup-initramfs. So you can remove the latter:

sudo apt remove cryptsetup-initramfs
  • Thank you, this makes sense. I tried it and it didn't worked (see my update). Is the mentioned cryptsetup-run related maybe? This didn't occurred previously or I didn't recognised it..
    – Nicolas
    Oct 3 at 15:32
  • cryptsetup-run used to exist as a regular package in Debian 10 "Buster". On the current and previous releases, it should be just a transitional dummy package. Are you running Debian 10 or earlier? If so, that might explain the unexpected behavior: on those old releases, the dependencies used to be arranged differently.
    – telcoM
    Oct 3 at 19:32
  • Yes, this is Debian 10, will have to upgrade soon. Thank you for this hint.
    – Nicolas
    Oct 6 at 20:03

On Debian 11 and later, cryptsetup only suggests cryptsetup-initramfs, so you should be able to remove the latter without removing the former. If you’ve configured apt to auto-remove packages which are no longer necessary, you’ll need to indicate that you want to keep cryptsetup:

sudo apt-mark manual cryptsetup
sudo apt purge cryptsetup-initramfs

Since you are running Debian 10, the setup is slighly different. cryptsetup is a metapackage which pulls in all the related packages; the actual programs you might want are provided by

  • cryptsetup-bin: the core cryptsetup commands, needed to access encrypted devices
  • cryptsetup-run: the startup scripts, used to automatically set up devices at boot
  • cryptsetup-initramfs: the initramfs integration.

You need to decide which of these you want to keep, and mark them as manually installed so that they won’t be removed. Presumably that’s at least

sudo apt-mark manual cryptsetup-bin

You can then remove the initramfs integration without adverse effects:

sudo apt remove cryptsetup-initramfs

You must log in to answer this question.

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