0

On Ubuntu's Website, there are three dependencies listed for the Python package. However, when I use apt-get install python, there are six additional packages that get installed.

So, Ubuntu packages says I need: libpython-stdlib, python-minimal, and python2.7

And, apt-get says I need: libpython-stdlib, libpython2.7-minimal, libpython2.7-stdlib, python-minimal, python2.7, and python2.7-minimal

Where does this difference come from? What reference would I use to know what additional packages would be installed before I typed a apt-get install ... command.

1
  • They are dependencies of dependencies.
    – Kulfy
    May 12, 2019 at 17:04

1 Answer 1

1

These are recursive dependencies.

The dependency graph (manually drawn and therefore overly simplified, only including the packages you mentioned) would look something like this:

python
├── libpython-stdlib
│   └── libpython2.7-minimal
├── python2.7
│   ├── libpython2.7-stdlib
│   └── python2.7-minimal
└── python-minimal
    └── python2.7-minimal

You see, each dependency is just a regular package that can have more own dependencies. You can get that information on https://packages.ubuntu.com by clicking the links of all dependency packages (those with the red dot) and repeating that recursively for each entry. It's a tiresome task, unfortunately.

The easiest way to find out what packages need to be installed is to just run the sudo apt install PACKAGE command and look at its output. Or if you want to be safe nothing happens yet and you just get the information, you can simulate the installation only:

apt -s install PACKAGE

There is also apt depends PACKAGE to list direct dependencies (and other relations) of packages, but if you add --recurse to get indirect dependencies too, the list becomes too long to be readable as there are tons of duplicates and irrelevant entries displayed along. --important helps a bit with that, but not too much. Also keep in mind that usually you already have many of these dependencies already installed because something else depends on it, so again this would not tell you what you need to install additionally.

You must log in to answer this question.

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