Hacker News new | ask | show | jobs
by passivegains 408 days ago
apt won't on its own, but if you're using the official images there's probably a service running that's calling it, probably for security patches etc.

The bigger problem is upgrading packages deliberately but being surprised by the results. My team's current favorite is the upgrade process itself suddenly having new interactive prompts breaking our scripts.

2 comments

> My team's current favorite is the upgrade process itself suddenly having new interactive prompts breaking our scripts.

This is how dpkg and apt have worked in Debian and Ubuntu pretty much since their inception. Look into debconf, dpkg and ucf configuration to learn how to integrate these with your automation. The mechanisms for this have existed for decades now and have not substantially changed in that time.

dpkg grew knowledge of Source lists suddenly?

If you're installing software from Debian/Ubuntu repos, you can only use aptitude or apt to my knowledge. Other tools give you the ability to install DEB files you already have, and manage what's on your system currently. And aptitude and apt are both well known for never having had a "stable" scriptable interface. In fact they themselves tell you that their commands are not stable and should not be used for scripting, despite no alternative mode or application existing.

Recently Ubuntu moved to apt 3 as well, which massively overhauled the tool from apt 2. All those scripts people wrote to use apt 2 (because there was no alternative) broke recently when they now had to use apt 3.

Your understanding is just outright wrong. The `apt` command has an unstable interface so that it can improve the CLI without worrying about breaking scripts. The `apt-get` command is the stable interface for scripts. `apt` was created after `apt-get` became ossified exactly because the developers work hard to keep the interface for scripts stable.

> In fact they themselves tell you that their commands are not stable and should not be used for scripting, despite no alternative mode or application existing.

No, that's just the apt command, not the apt-get command, and the manpage for apt tells you exactly how to do this instead. It's clearly documented, so your "despite no alternative mode or application existing" claim is simply ignorant.

Please read the documentation and learn how to use the tooling before criticizing it and misleading others with claims that are outright wrong.

I thought DEBIAN_FRONTEND=noninteractive was supposed to avoid that?
That and a couple of -o's, like conf old (not sure, on my phone)