• 4

To compile something, I needed the zlib1g-dev package to be installed so I launched an apt-get install zlib1g-dev.

apt-get informed me nicely that the package was already auto-installed because of an other package, and that it understands that I want it installed explicitly now :

# apt-get install zlib1g-dev
zlib1g-dev is already the newest version.
zlib1g-dev set to manually installed.

My compilation done, I don't need it any more explicitly, so I want to revert its status to the previous one : auto-installed. This way it will be pruned automatically when it will not be needed any more with a simple apt-get autoremove.

I cannot do an apt-get remove zlib1g-dev since some packages still depends on it.

So how may I revert the package zlib1g-devinstallation state to auto-installed ?

I know that I might edit /var/lib/apt/extended_states by hand from

Package: zlib1g-dev
Auto-Installed: 0


Package: zlib1g-dev
Auto-Installed: 1

... but it just doesn't feel right.

Today while installing VirtualBox in my Debian Linux (I want to install Ubuntu on my Debian). Accidentaly I have "re-installed" a package that was already part of the VitualBox combo. So that changed the flag from manual to auto installed in that package.

This is what I have done:

apt-get install virtualbox-dkms

This what Debian replied to me:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
virtualbox-dkms is already the newest version.
virtualbox-dkms set to manually installed.

That means, that if I ever uninstall VirtualBox, virtualbox-dkms will remain installed, I do not want that.

So, I have used apt-mark to set it to auto installed again.

apt-mark auto virtualbox-dkms

And Debian replied:

virtualbox-dkms set to automatically installed.

Everything normal again.

  • 0
Reply Report

This is what you're looking for.

sudo apt-get markauto first-package second-package etc-package


apt-get --help
  • 0
Reply Report

Aptitude can help you when you initially install the package:

aptitude install "zlib1g-dev&M"

Or, after your have installed the package:

aptitude markauto "zlib1g"

Edit: If you do not have aptitude, you can use

apt-mark auto zlib1g-dev
  • 4
Reply Report