How can I install a package without installing its dependencies?

There are two kinds of dependencies for alacarte: “depends” and “recommends”.

Alacarte depends on Python and various Python libraries (which in turn pull in some libraries); the “depends” level says that alacarte won't work without these. APT-based tools won't let you install alacarte without those dependencies. You can ignore all dependencies with dpkg --force-depends, however this will confuse APT when alacarte is involved in a dependency calculation later (for example when a newer version of the package appears), hence doing this is not recommended. Furthermore it's unlikely that you'll get any use of the package without these dependencies.

Alacarte depends on gnome-panel (which in turns depends on many other parts of Gnome) at the “recommends” level. This indicates that alacarte is rarely useful without gnome-panel, but can be in some circumstances. Here, alacarte is indeed useful without gnome-panel if you have a different Freedesktop-compliant menu application.

By default, apt-get install installs all dependencies at the “depends” or “recommends” level. Pass the --no-install-recommends option to tell it not to install “recommends”-level dependencies. You can make this the default setting by adding APT::Install-Recommends "false"; to /etc/apt/apt.conf.d/zzz_mpmcfarlane.

With aptitude on the command line, pass -R or --without-recommends to avoid installing “recommends”-level dependencies. In the Aptitude full-screen UI, marking alacarte for installation also selects gnome-panel, but you can unmark it before proceeding with the installation. The APT preference also influences aptitude.

In Synaptic, marking alacarte for installation also selects gnome-panel. However you can go and unmark gnome-panel before applying the changes. There is a preference (in the “General” tab) to “Consider recommended packages as dependencies”.


The key option to add to apt-get is --no-install-recommends

So for alacarte -

sudo apt-get install --no-install-recommends alacarte

Given that alacarte is default in standard Ubuntu, can I ask what variant of Ubuntu are you installing alacarte for?

If you are using Xubuntu or Lubuntu - can I recommend an alternative menu editor from the answer to this question. I've found that alacarte doesnt work with both Lubuntu and Xubuntu.