I have a host ubuntu 20.04 running my software on docker with a container derivated from ubuntu 18.04. I would like to use ubuntu 20.04 for several reasons (like the better software on 20.04). If I run do-release-upgrade on the container terminal I receive the following: "do-release-upgrade Checking for a new Ubuntu release You have not rebooted after updating a package which requires a reboot. Please reboot before upgrading." Rebooting the container or rebooting the host machine does not solve the problem.

  • 1
    if you have the dockerfile, and you are able to rebuild the image, you could just change the FROM:ubuntu command at the top of the dockerfile. You can use tags such as latest or pin it to a specific version Nov 5, 2020 at 11:34

2 Answers 2


Docker doesn't recommend running an apt-get upgrade and dist-upgrade on a docker image as many of the "essential" packages from the partent image cannot upgrade inside an unprevileged container. take a look at the Docker best practices


That is not good design to have docker or any lib update after logging into the container. As mentioned by Andrea Giaime Bodei , you need to update the base image in the Dockerfile and rebuild the image. The docker images are immutable.

# Download base image ubuntu 20.04
FROM ubuntu:20.04

# LABEL about the custom image
LABEL maintainer="[email protected]"
LABEL version="0.1"
LABEL description="This is custom Docker Image for \
the test"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.