3

Node Source's Docker image of Ubuntu runs apt-get upgrade, not apt-get dist-upgrade, to install latest version of all packages.

apt-get dist-upgrade is considered a command to upgrade kernel related packages. In Docker container, kernel packages are not installed because host's kernel is used, and apt-get upgrade looks enough.

However, man page of apt-get says:

dist-upgrade in addition to performing the function of upgrade,
also intelligently handles changing dependencies with new versions
of packages

According to this, other packages may require to run apt-get dist-upgrade to install latest patch.

Are there such packages which requires apt-get dist-upgrade in the current or past releases of Ubuntu? If such packages exists, we need to run dist-upgrade even in Docker container.

2

In general, you are going to want to use upgrade rather then dist-upgrade.

In general, unless you have a problem or feel you know more then the docker developers, best go with the defaults.

In the event upgrade has problems, dist-upgrade is a potential solution.

upgrade will update new packages when new versions are available, but will sometimes not remove packages or not install additional packages. dist-upgrade will upgrade and if necessary add or remove packages.

You should always review what apt-get is telling you when you upgrade and review the packages list with dist-upgrade.

For additional information see

What is "dist-upgrade" and why does it upgrade more than "upgrade"?

and

Why use apt-get upgrade instead of apt-get dist-upgrade?

1

I would say you should not even use upgrade: rather rebuild the image with --no-cache and execute the usual update and install pair, which will fetch the latest versions of a package.

2
  • Why this approach is better? – enjoy Jan 27 at 9:55
  • install will get the latest version of packages that you need; as for the already installed packages, they will come with the latest tag of the base image you start from, as long as it's maintained. – giorgiosironi Jan 30 at 11:42

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.