Hacker News new | ask | show | jobs
by zh3 1230 days ago
Main killer for me - admittedly because I like sharp tools, and it used to claim to be 'lightweight': 'apt install asciidoc' (and I had to delete most of it, because - for the first time ever - I got an HN message about "comment too long"):-

  Reading package lists...
  Building dependency tree...
  Reading state information...  
  The following additional packages will be installed:
   asciidoc-base asciidoc-common asciidoc-dblatex asciidoc-doc dblatex
  dblatex-doc docbook-dsssl docbook-utils docbook-xml docbook-xsl dvisvgm file
  fonts-droid-fallback fonts-gfs-baskerville fonts-gfs-porson fonts-lato
  fonts-lmodern fonts-noto-mono fonts-texgyre fonts-urw-base35 ghostscript
  ....
  x11-common x11-utils x11-xserver-utils xdg-utils xfonts-encodings
  xfonts-utils xml-core xmlto xsltproc xvt
  0 upgraded, 271 newly installed, 0 to remove and 4 not upgraded.
  Need to get 455 MB of archives.
  After this operation, 1,127 MB of additional disk space will be used.
  Do you want to continue? [Y/n] Abort.
2 comments

Probably because asciidoc recommends asciidoc-dblatex (used for producing LaTeX via docbook). Try 'apt install asciidoc asciidoc-dblatex-' to install just asciidoc without pulling in the other package.
Thanks, hopefully this'll turn up on a google search for someone who just wants to turn simple text markup into a PDF ('apt' didn't offer the option of not installing asciidoc-dblatex).

            apt --no-install-recommends foobar
You can set some settings for apt-get in the config file so it doesn't pull the recommended packages as enforced dependencies.
I'll stick it in the article, in a closing notes section
How does that command work?
It lets you do the equivalent of "apt install asciidoc; apt remove asciidoc-dblatex" in one command, so avoids downloading the unwanted packages only to remove them.

"The requested action can be overridden for specific packages by appending a plus (+) to the package name to install this package or a minus (-) to remove it"

https://manpages.debian.org/bullseye/apt/apt.8.en.html

Not on my machine:

    # apt install asciidoc
    Reading package lists... Done
    Building dependency tree... Done
    Reading state information... Done
    The following additional packages will be installed:
      asciidoc-base asciidoc-common docbook-xsl xsltproc
    Suggested packages:
      asciidoc-doc docbook-utils source-highlight dbtoepub docbook-xsl-doc-html | docbook-xsl-doc-pdf | docbook-xsl-doc-text | docbook-xsl-doc docbook-xsl-saxon fop libsaxon-java libxalan2-java libxslthl-java xalan
    Recommended packages:
      asciidoc-dblatex xmlto
    The following NEW packages will be installed:
      asciidoc asciidoc-base asciidoc-common docbook-xsl xsltproc
I wonder if one gets that dependency tree on a Wayland-only setup.
You probably have X and Wayland installed (quite why those are required for asciidoc is a question I'll leave for others).
A lot of dependecies are pulled from the (recommended) asciidoc-dblatex package, which depends, indirectly, on x11 packages. Don't install the recommended packages (whose concept is anyway in conflict with keeping a system lean) and see what happens.
How to not install recommended packages? (there wasn't a choice, and anyway not installing recommended packages often implies - rightly or wrongly - security risks).
The `apt` tool provides the option `--no-install-recommends`.

If you want to disable the recommended packages installation by default, you can:

  echo 'APT::Install-Recommends "0";' > /etc/apt/apt.conf.d/99disable-recommends.conf
You may also want to disable the suggested packages:

  echo 'APT::Install-Suggests "0";' >> /etc/apt/apt.conf.d/99disable-recommends.conf
Regarding the apt "recommended" concept, it's a generic concept of optional functionality; it's orthogonal to security. If one wants to make a generic association with security, less recommended packages -> less functionality -> smaller attack surface.