Ubuntu – Why so many dependencies for package expect

aptdependenciesdpkgexpectpackage-management

I hope someone smarter than me can help me out with this one. It appears I've got something messed up in my apt database(s).

I'm running Ubuntu 16.04.2 LTS. I've downloaded ossec-hids_2.8.3-4xenial_amd64.deb from ossec.wazuh.com, and when I try to install it, I get:

# dpkg -i ossec-hids_2.8.3-4xenial_amd64.deb 
Selecting previously unselected package ossec-hids.
(Reading database ... 162578 files and directories currently installed.)
Preparing to unpack ossec-hids_2.8.3-4xenial_amd64.deb ...
Unpacking ossec-hids (2.8.3-4xenial) ...
dpkg: dependency problems prevent configuration of ossec-hids:
 ossec-hids depends on expect; however:
  Package expect is not installed.

dpkg: error processing package ossec-hids (--install):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 ossec-hids

When I go to install expect, I get:

# apt-get install expect
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  libdrm-amdgpu1 libdrm-intel1 libdrm-nouveau2 libdrm-radeon1 libfontenc1 libgl1-mesa-dri libgl1-mesa-glx libglapi-mesa libice6 libllvm3.8 libpciaccess0 libsm6 libtcl8.6
  libtk8.6 libtxc-dxtn-s2tc0 libx11-xcb1 libxaw7 libxcb-dri2-0 libxcb-dri3-0 libxcb-glx0 libxcb-present0 libxcb-shape0 libxcb-sync1 libxcomposite1 libxdamage1 libxfixes3
  libxft2 libxi6 libxinerama1 libxmu6 libxrandr2 libxrender1 libxshmfence1 libxss1 libxt6 libxtst6 libxv1 libxxf86dga1 libxxf86vm1 tcl-expect tcl8.6 tk8.6 x11-common
  x11-utils xbitmaps xterm
Suggested packages:
  tcl-tclreadline mesa-utils xfonts-cyrillic
The following NEW packages will be installed:
  expect libdrm-amdgpu1 libdrm-intel1 libdrm-nouveau2 libdrm-radeon1 libfontenc1 libgl1-mesa-dri libgl1-mesa-glx libglapi-mesa libice6 libllvm3.8 libpciaccess0 libsm6
  libtcl8.6 libtk8.6 libtxc-dxtn-s2tc0 libx11-xcb1 libxaw7 libxcb-dri2-0 libxcb-dri3-0 libxcb-glx0 libxcb-present0 libxcb-shape0 libxcb-sync1 libxcomposite1 libxdamage1
  libxfixes3 libxft2 libxi6 libxinerama1 libxmu6 libxrandr2 libxrender1 libxshmfence1 libxss1 libxt6 libxtst6 libxv1 libxxf86dga1 libxxf86vm1 tcl-expect tcl8.6 tk8.6
  x11-common x11-utils xbitmaps xterm
0 upgraded, 47 newly installed, 0 to remove and 41 not upgraded.
Need to get 18.3 MB of archives.
After this operation, 168 MB of additional disk space will be used.
Do you want to continue? [Y/n] n
Abort.

This can't be right, can it? The expect package shouldn't have dependencies on graphics libraries. According to https://packages.ubuntu.com/xenial/expect, the only dependencies are libc6, libtcl8.6, and tcl-expect. I've checked those three dependencies, and their dependencies, and don't come up with anything close to that extensive list.

I've tried apt-get autoremove and apt-get -f install, but they report nothing to be done.

Any assistance would be greatly appreciated.

Best Answer

In general Ubuntu is designed to be "user friendly" and in general any given package in Ubuntu tends to have more dependencies then other distros. This is great for most users as they install a package and all the bells and whistles are installed.

For finer grain control,do not install the extra packages

sudo apt-get install --no-install-recommends package_list

If you want to set this as default behavior, see How to not install recommended and suggested packages?

The only potential downside of this behavior is that you may later have to identify additional packages you want to install later. Perfectly acceptable for advanced users such as yourself.

If this still installs more then you want you can install using apt-get with the --nodeps flag or download .deb and install with dpkg using the --ignore-depends flag. Doing so sort of defeats the purpose of apt / apt-get and at this point you may wish to look as Slackware, arch linux, or gentoo. gentoo takes a lot of time but gives you very fine grain control over what is or is not installed. arch is similar without all the compiling. Slackware is easy and IMO "just works"

Related Question