1

This has happened to me very often, Where in the process of installing a package i.e package X, other packages get implicitly installed or uninstalled.

This becomes very annoying where BEFORE you realize, 3 of your other packages have vanished, just like that.

To be clearer, Today i wanted to build Grive2 source files with cmake. So U wanted to install cmake first.

To my surprise, Running apt install cmake -s signaled that it was going to install other packages too like php7.0, ettercap, rtorrent, uget etc.

root@XXXXX_XXXXCE:/home/bob/pythontr# apt install cmake -s
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  coinor-libcbc3 coinor-libcgl1 coinor-libclp1 coinor-libcoinmp1v5 coinor-libcoinutils3v5 
coinor-libosi1v5 erlang-asn1
  erlang-base erlang-crypto erlang-mnesia erlang-public-key erlang-runtime-tools erlang-ssl 
fonts-opensymbol libabw-0.1-1
  libboost-date-time1.61.0 libboost-date-time1.62.0 libboost-filesystem1.62.0 libboost-
iostreams1.62.0
  libboost-locale1.62.0 libcdr-0.1-1 libclang-common-3.7-dev libclc-amdgcn libclc-dev 
libclc-r600 libclucene-contribs1v5
  libcmis-0.5-5v5 libcolamd2 libe-book-0.1-1 libeot0 libepubgen-0.1-1 libetonyek-0.1-1 
libexttextcat-2.0-0
  libexttextcat-data libfreehand-0.1-1 libjs-jquery-form liblangtag-common liblangtag1 
libllvm3.7 libmspub-0.1-1
  libmwaw-0.3-3 libmythes-1.2-0 libodfgen-0.1-1 liborcus-0.13-0 libpagemaker-0.0-0 
libqxp-0.0-0 librevenge-0.0-0 libsctp1
  libstaroffice-0.0-0 libsuitesparseconfig4 libtorrent19 libvisio-0.1-1 libwpd-0.10-10 
libwpg-0.3-3 libwps-0.4-4 libxmlsec1
  libxmlsec1-nss libzmf-0.0-0 lp-solve mesa-opencl-icd ocl-icd-libopencl1 uno-libs3 ure
**Use 'apt autoremove' to remove them.**
The following additional packages will be installed:
  cmake-data dirb erlang-asn1 erlang-base erlang-crypto erlang-mnesia erlang-public-key 
erlang-runtime-tools erlang-ssl
  ettercap-common ettercap-graphical libafflib0v5 libapache2-mod-php7.0 libcppunit-1.14-0 
libcurl4 libncurses6 libncursesw6
  librhash0 libtinfo6 libtorrent20 libxmlrpc-core-c3 osslsigncode php7.0-bz2 php7.0-cli     
php7.0-common php7.0-curl
  php7.0-dev php7.0-gd php7.0-json php7.0-mbstring php7.0-mysql php7.0-opcache php7.0-
readline php7.0-xml php7.0-zip
  rtorrent ruby-ethon uget
Suggested packages:
  cmake-doc ninja-build erlang erlang-manpages erlang-doc erlang-tools erlang-inets
Recommended packages:
  erlang-syntax-tools
The following packages will be REMOVED:
  couchdb erlang-eunit erlang-inets erlang-os-mon erlang-snmp erlang-syntax-tools 
erlang-tools erlang-webtool erlang-xmerl
  libcurl3
The following NEW packages will be installed:
  cmake cmake-data libcppunit-1.14-0 libcurl4 libncurses6 librhash0 libtorrent20
The following packages will be upgraded:
  dirb erlang-asn1 erlang-base erlang-crypto erlang-mnesia erlang-public-key erlang-    
runtime-tools erlang-ssl
  ettercap-common ettercap-graphical libafflib0v5 libapache2-mod-php7.0 libncursesw6     
libtinfo6 libxmlrpc-core-c3
  osslsigncode php7.0-bz2 php7.0-cli php7.0-common php7.0-curl php7.0-dev php7.0-gd 
php7.0-json php7.0-mbstring
  php7.0-mysql php7.0-opcache php7.0-readline php7.0-xml php7.0-zip rtorrent ruby-ethon     
uget

I am sure these additional installs are not related to cmake.

QUESTION

Isn't there a way to tell apt to just install a package i.e cmake and NOT deal with other unrelated packages ?

[Edit]

As requested by @Stephen Kitt,
Running apt install -f returns :-

root@XXXXX_XXXXCE:/home/bob/pythontr# apt install -f
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer  
required:
  coinor-libcbc3 coinor-libcgl1 coinor-libclp1 coinor-libcoinmp1v5
  coinor-libcoinutils3v5 coinor-libosi1v5 fonts-opensymbol libabw-0.1-1
  libboost-date-time1.61.0 libboost-date-time1.62.0 libboost-   
filesystem1.62.0
  libboost-iostreams1.62.0 libboost-locale1.62.0 libcdr-0.1-1
  libclang-common-3.7-dev libclc-amdgcn libclc-dev libclc-r600
  libclucene-contribs1v5 libcmis-0.5-5v5 libcolamd2 libe-book-0.1-1     
libeot0
  libepubgen-0.1-1 libetonyek-0.1-1 libexttextcat-2.0-0 libexttextcat-data
  libfreehand-0.1-1 liblangtag-common liblangtag1 libllvm3.7 libmspub-   
0.1-1
  libmwaw-0.3-3 libmythes-1.2-0 libodfgen-0.1-1 liborcus-0.13-0
  libpagemaker-0.0-0 libqxp-0.0-0 librevenge-0.0-0 libstaroffice-0.0-0
  libsuitesparseconfig4 libvisio-0.1-1 libwpd-0.10-10 libwpg-0.3-3
  libwps-0.4-4 libxmlsec1 libxmlsec1-nss libzmf-0.0-0 lp-solve
  mesa-opencl-icd ocl-icd-libopencl1 uno-libs3 ure
Use 'apt autoremove' to remove them.

[Edit]

Trying to list dependencies of cmake by running apt-cache depends cmake returned :-

root@XXXXX_XXXXCE:/home/bob/pythontr# apt-cache depends cmake
cmake
  Depends: cmake-data
  Depends: procps
  Depends: libarchive13
  Depends: libc6
  Depends: libcurl4
  Depends: libexpat1
  Depends: libgcc1
  Depends: libjsoncpp1
  Depends: librhash0
  Depends: libstdc++6
  Depends: libuv1
  Depends: zlib1g
  Recommends: gcc
  Recommends: make
    make-guile
  Suggests: cmake-doc
  Suggests: ninja-build
  • 2
    They're related packages; cmake depends on them. – Ipor Sircer Oct 3 '18 at 6:14
  • 2
    @steven what happens if you run apt install -f? (Please edit your question to show the output.) – Stephen Kitt Oct 3 '18 at 7:20
  • 1
    This is how Debian works. If you are not happy with it, you might try to use SlackWare, but then do not get surprised if things do not work/you have much more sysadmin/reading work to do. e.g. do not go that route if you cannot handle that on yourself without asking too many questions around. – Rui F Ribeiro Oct 3 '18 at 7:43
  • @StephenKitt Sure, i have done as you requested. – steven mwesigwa Oct 4 '18 at 20:19
4

Some of the other packages are pulled as dependencies due being recommended or suggested by package(s) already selected for installation. Recommended packages are not necessary, but are required for complete functionality. Exact details of relationships between recommended and suggested packages are documented in Debian Policy

You can use --no-install-recommends to avoid pulling recommended packages as dependencies.

If you never want to install recommended or suggested packages automatically, create a configuration file /etc/apt/apt.conf.d/90-no-recommends.conf:

APT::Install-Recommends 0;
APT::Install-Suggests 0;

If a package was automatically installed as an automatic dependency, it can be marked for automatic removal later, if the original package which pulled it as dependency is removed or doesn't require it anymore after an upgrade.

Note that this is not a complete answer, as @StephenKitt pointed out in comments that recommended and suggested dependencies do not explain all of the packages involved. There is some other reason why the packages you mentioned are included.

  • Could you explain how cmake would pull in php7.0-dev because of recommends or suggests? – Stephen Kitt Oct 3 '18 at 7:21
  • I don't see how it would. However some of the packages listed in apt output (but not explicitly mentioned in OP's question) are included due being recommended packages. – sebasth Oct 3 '18 at 7:26
  • 1
    Right, but how do they end up being involved in the installation of cmake? Particularly in an upgrade scenario following a package installation... (One possible explanation is that the OP installed a package using dpkg -i without fixing things up afterwards.) – Stephen Kitt Oct 3 '18 at 7:38
  • I added a note in the answer to explicitly mention it doesn't explain all packages involved. – sebasth Oct 3 '18 at 7:58
  • 1
    @JdeBP yes, which is why explaining this isn’t as simple as it seems at first glance. The installed packages are easy to explain, they’re dependencies of cmake. But explaining why installing cmake involves an upgrade of other, unrelated packages can’t be explained using only the information in the question. – Stephen Kitt Oct 3 '18 at 8:09
0

Generally speaking these other packages are packages that your selection is dependent on for one reason or another. This is a good thing. It is beyond the scope of my answer to justify each package, but someone has taken the time to build a database of dependencies and it usually works well. Most installers like apt have an option to ignore / not process dependencies, but there is a high likelihood that the result is not what you expect. The option for apt is --nodeps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.