9

Suppose I have a package (a Python package in this case) that I install using Synaptic. Because the version of this package is somewhat outdated, I remove it in Synaptic and then install it using easy_install. One of its dependencies was also installed using Synaptic, but I'd rather keep the Synaptic-installed version rather than easy_installing it as well.

The only problem is that the dependency is now marked auto removable. Is there any way to mark it as being manually installed other than to remove it and reinstall it? If it makes a difference I'm using Ubuntu Jaunty.

3 Answers 3

1

You can "hold" a package in Ubuntu.

Holding a package basically means you're telling the package manager to keep the current version no matter what. This is useful if more recent version of a currently working program breaks after an update.

You can do it via Synaptic or on the command-line via apt/dpkg. The command-line version to hold a package is:

echo package_name hold | dpkg --set-selections

Ubuntu Community Documentation has a more complete guide explaining how to pin or hold packages.

3
  • Thanks! askubuntu.com/questions/140136/… Commented May 22, 2012 at 7:58
  • 2
    Hold is normally used to prevent upgrades to newer versions; it shouldn't be used to keep a package. Using hold will block you from receiving security and distro updates, and will be an additional burden during upgrades. Marking the package as manually installed should be the right way (see my answer...). Commented Jul 22, 2015 at 3:13
  • As per @ThomasGuyot-Sionnest comment, this does not do what is asked. It prevents a package being upgraded, so is a dangerous idea if you are not sure what you are doing. See Thomas's answer for the correct approach Commented May 15, 2021 at 10:55
6

I know you can do it in aptitude. You can do it either in its GUI by selecting package and hitting 'm' or selecting "Mark manual" from "Package" menu, or using command line:

aptitude install <package_name>&m
6

You can use apt-mark manual <package> for that, of from Synaptic, Package => [ ] Automatically Installed (uncheck it).

ex:

# Mark <some_package> as manually-installed:
apt-mark manual <some_package>

# Mark <other_package> as automatically-installed (ex if you know it's a
# dependency to something else and you want to make sure it'll be
# auto-removable if it's no longer used):
apt-mark auto <other_package>

Also, if you use apt-get install <package> on a package that's already installed, it will be implicitly marked as manual.

1
  • This seems to do exactly as desired. It changed the status of my package from [installed,auto-removable] to just [installed].
    – mwfearnley
    Commented Dec 18, 2017 at 10:43

You must log in to answer this question.

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