1

I installed a package that has some dependencies that are useful by themselves. Later, I deleted the original package, but I would like to keep the dependencies that it installed. However, when I try to do an action with apt-get, it always reminds me to run apt-get autoremove to delete the dependencies I'd like to keep. So where does apt store the database as to what packages were installed as dependencies for what, and how can I edit this so I can keep the old dependencies without having to see the message to run apt-get autoremove every time I use apt-get?

0

3 Answers 3

4

The easiest is probably just to install them as Stephen suggests in the other answer, but you can also just mark them as manually installed with aptitude unmarkauto <packages>....

3

You should be able to do sudo apt-get install .... and the packages you want to keep. This will tell the system the packages were "manually" installed and so remove them from the autoremove scope

eg we can see my system wants to auto-remove a number of packages:

# apt-get upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... The following packages were automatically installed and are no longer required:
  bluetooth bluez-cups libboost-filesystem1.55.0
  libboost-program-options1.55.0 libdumbnet1 libgssapi3-heimdal
  libheimntlm0-heimdal libkdc2-heimdal powertop zerofree
Use 'apt-get autoremove' to remove them.
Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

If I manually install bluetooth we now see it just sets it to "manually installed" and bluetooth (and its dependencies) are no longer flagged

# apt-get install bluetooth
Reading package lists... Done
Building dependency tree       
Reading state information... Done
bluetooth is already the newest version.
bluetooth set to manually installed.
The following packages were automatically installed and are no longer required:
  libboost-filesystem1.55.0 libboost-program-options1.55.0 libdumbnet1
  libgssapi3-heimdal libheimntlm0-heimdal libkdc2-heimdal powertop zerofree
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2

I found the command apt-mark (which needs to be ran as root). Run apt-mark manual <package name> to mark a package as manually installed so your system won't remove it when you run apt-get autoremove.

You must log in to answer this question.

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