Skip to content

Conversation

@eshattow
Copy link
Contributor

@eshattow eshattow commented Nov 8, 2025

Suggest using apt for user-interactive commands:

  • Replace apt-get invocation
  • Replace apt-cache madison invocation
  • Filter unofficial package names for removal to installed packages

Suggest using apt for user-interactive commands:

- Replace apt-get invocation
- Replace apt-cache madison invocation
- Filter unofficial package names for removal to installed packages
@eshattow eshattow requested a review from dvdksn as a code owner November 8, 2025 14:32
@netlify
Copy link

netlify bot commented Nov 8, 2025

Deploy Preview for docsdocker ready!

Name Link
🔨 Latest commit 42bba52
🔍 Latest deploy log https://app.netlify.com/projects/docsdocker/deploys/690f54803a476f0008d38ac5
😎 Deploy Preview https://deploy-preview-23679--docsdocker.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions github-actions bot added area/engine Issue affects Docker engine/daemon area/install Relates to installing a product labels Nov 8, 2025
Copy link
Contributor

@dvdksn dvdksn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've used apt-get until now because it has a stable ui and is more suitable for scripting... but then otoh we do encourage entering these commands discretely. And if you want a scripted installation there's a great source of inspiration at https://get.docker.com.

So I guess changing to apt should be fine. Any concerns @thaJeztah?

And we'd need to update the ubuntu docs with the same.

@thaJeztah
Copy link
Member

Yeah, apt-get is, to my knowledge, still the preferred one when scripting is involved. While these steps are not necessarily part of a script, part of the expectation is that these will also be used to be used in scripting (or at most copy/paste'd by users). Examples we use, e.g. in Dockerfile examples, are all using apt-get for that reason

Looking at the changes, I don't think switching to apt significantly makes the steps easier, so not sure we should switch these over.

cc @vvoland @tianon thoughts?

Copy link
Contributor

@vvoland vvoland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it!

apt update, install are unlikely to change, and we're not piping/parsing their output anyway so I don't think apt-get has any benefits.

Copy link
Contributor

@tianon tianon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall I'm +1 on switching these; I do think these docs are written expecting users to copy paste into interactive terminals, and users looking for the scripting version will need to understand and adapt them appropriately (as they will for all other software).


```console
$ for pkg in docker.io docker-doc docker-compose podman-docker containerd runc; do sudo apt-get remove $pkg; done
$ sudo apt remove $(dpkg --get-selections docker.io docker-compose docker-doc podman-docker containerd runc | cut -f1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why even filter? Doesn't apt have reasonable behavior when you ask it to remove packages that aren't installed? (I'm sure we've probably discussed this before and I've just forgotten 😅)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all of the apt, apt-get, ... remove package tool actions bail out if a package does not exist. I would be in favor of just making the documentation more instructive "if apt complains that a package does not exist you should remove it from the command and try again". However, as this pull request goes, I remove the scripting of apt-get as it is replaced with apt, the intent is to keep the same errors and information, and at most the user will benefit slightly if they allow sudo to timeout due to slow network access or whatever situation they will just have the one sudo invocation with the update I propose.

Copy link
Contributor

@dvdksn dvdksn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's do it! I'll do Ubuntu in a follow-up!

@dvdksn dvdksn merged commit e6204b6 into docker:main Nov 12, 2025
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/engine Issue affects Docker engine/daemon area/install Relates to installing a product

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants