Skip to main content

Installing Docker on Ubuntu 18.04 ([SOLVED]- libseccomp2 version 2.3.1 installed but 2.4 required)

 Introduction:

If you're attempting to install Docker on Ubuntu 18.04 Bionic Beaver, which is known for having installation issues, this comprehensive guide aims to address common errors you may encounter during the process. Our goal is to save you time searching for answers on StackOverflow by providing clear instructions. The guide is based on the official Docker documentation available at https://docs.docker.com/engine/install/ubuntu/#install-using-the-repository.

Step 1: Updating Package Lists
To begin, run the following command to update your package lists using the "apt-get update" command:

sudo apt-get update


Note: If you encounter any errors during the update process, it may be due to the older Ubuntu 18.04 release. In such cases, you can refer to the Configure DNS server IP to resolve errors with apt-get update guide for assistance. This guide will help you address any DNS-related issues that might be preventing successful updates.

Step 2: Installing Dependencies
Next, we need to install the necessary dependencies mentioned in the Docker article. These dependencies are required for Docker to function properly. Run the following command to install them:

sudo apt-get install ca-certificates curl gnupg lsb-release

This command may take some time to complete, as it downloads and installs the required dependencies. Please be patient and ensure that there are no errors.

Step 3: Adding Docker's Official GPG Key
To ensure the authenticity of Docker packages, we need to add Docker's official GPG key. This key will be used to verify the integrity of the downloaded packages. Execute the following command:

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

This command downloads Docker's GPG key and saves it in the specified keyring file.


Step 4: Adding Docker's Repository
Now, let's add Docker's repository (PPA) to our apt sources. This repository will provide the Docker packages for installation. Run the following command:

echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

Here, we're adding the Docker repository URL and configuration to the apt sources. This ensures that Docker packages can be fetched and installed from the appropriate source.

At this point, we have successfully completed the initial steps.

Step 5: Updating Package Lists Again
After adding the new Docker repository to our apt sources, it's necessary to update the package lists once more. Run the following command:

sudo apt-get update

This command retrieves the updated package information from the added repository.

Step 6: Installing Docker and Its Components
Now, we can proceed with installing Docker and its main components using the following command:

sudo apt-get install docker-ce docker-ce-cli containerd.io

Note: You may encounter the following famous error during this step:
"containerd.io: Depends: libseccomp2 (>= 2.4.0) but 2.3.1-2.1ubuntu4 is to be installed"
This error occurs because Ubuntu's apt sources cannot find a version of libseccomp2 higher than 2.3.1, while Docker requires version 2.4 or above.

To fix this error, we will add another source URL to our sources file, which contains the compatible libseccomp2 package for Ubuntu 18.04. Please follow the steps below.

Step 7: Creating a Backup of apt Sources (Optional)
For cautious administrators, it's recommended to create a backup of the apt sources before proceeding. You can use the following command to create a backup:

sudo cp /etc/apt/sources.list /etc/apt/bkup_20210104_sources.list_bkup


This command creates a backup copy of the apt sources file, providing a restore point if needed.

You can also verify the current source URLs on your server by running the following command:

grep -v '#' /etc/apt/sources.list

This command displays the source URLs without any commented lines.

Step 8: Editing the sources.list File
Now, let's edit the sources.list file to add the required source URL. Execute the following commands:

sudo -s
echo -e "deb http://security.ubuntu.com/ubuntu xenial-security main" >> /etc/apt/sources.list
exit

In this step, we're modifying the sources.list file to include an additional source URL. This URL contains the compatible libseccomp2 package for Ubuntu 18.04.

You can check if the new source URL was added successfully by running the command below:
grep -v '#' /etc/apt/sources.list



This command displays the updated source URLs, including the one we just added.

Step 9: Updating Package Lists Once Again
After updating the apt source file, it's essential to run the following command to update the repository:

sudo apt-get update


This command fetches the package information from the newly added source URL.

Step 10: Retry the Failed Docker Installation Step
Now, you can retry the previous failed Docker installation step, and it should proceed without any issues. Cheers!

To ensure that Docker Engine is installed correctly, you can verify it by running the hello-world image using the command provided below. Alternatively, you can refer to the main Docker instruction manual at https://docs.docker.com/engine/install/ubuntu/#install-using-the-repository.

If you encounter any further errors during the installation process, please don't hesitate to reach out. I'm here to help and provide solutions to the best of my ability.

Cheers, and see you in another wonderful Linux/System Admin episode!

Comments

Popular Articles

[SOLVED] Linux - Issues installing Docker on Ubuntu - libseccomp2 version 2.3.1 installed but 2.4 required

This article has been improved for a better understanding - goto  https://splashcoder.blogspot.com/2023/07/installing-docker-on-ubuntu-1804-solved.html There is a possibility that you are trying to install docker. There is a very comprehensive guide at https://docs.docker.com/engine/install/ubuntu/#install-using-the-repository. The linked guide serves as a reference for this article. We try to address the common errors in this article. Just so you won’t have to scour the entire answers on StackOverflow. Step 1: The first thing is to run our famous "apt update" command. So run the command below. sudo apt-get update You may observe that there are some errors. And YES! we are using a fairly old Ubuntu 18.04 Bionic Beaver Release. It seems perfect for this as most people have issues installing docker anyways. To resolve this, you may refer to  Configure DNS server IP to resolve errors with apt-get update Step 2: Following the Docker article, we should run the commands below. sudo

VS CODE: Unable to install extensions on Ubuntu/Linux

Hey, its one of those days, i just wished i could code away the night. i decided that tonight, it was going to be VS Code all through. I closed Sublime text. It was not long before I started missing the php code linting and ever intelligent code completions that were built into sublime text. I checked the suggestions on the Extensions Tab of VS Code. and there it was! Felix Becker's "PHP IntelliSense" package. To my cute surprise, Upon clicking, the extension's description and Installation "Read Me" could not display correctly, 'twas as good as blank. All i could see was this: I thought, this is something light, so i started searching but then it was not better explained except for the GitHub issue which I found to be useful, Link is at the bottom of this page.  I hate to discover it was a DNS issue. How to detect the Issue Simply visit the URL below, if you are able to view the image on the page, then you are not affected by this issue. DNS Test URL: ht

Issue with installing python-axolotl or python-axolotl-curve25519 on Windows

It is peeve amazing how many hours get burnt while trying to resolve simple package dependency issues. I may be too dumb to proffer a lasting one-fits-all solution to all dependency issues, but I got this issue fixed in my own case. Problem Description: The python-axolotl library requires certain dependencies that are not properly managed when installing libraries via a command line's requirement.txt file. I got real help by reading through this link below, but this page might be more helpful when it comes to detailed instructions. Actual instructions: https://github.com/tgalal/python-axolotl Typical errors might look like the following: 1. In this case, missing library(s). Libraries needed for compiling some python resources. Unfortunately, http://aka.ms/vcpython27  has been decommissioned because Python2x is EOL. You can still get the VcPython27 from an archive at https://web.archive.org/web/20210106040222/download.microsoft.com/download/7/9/6/796EF2E4-801B-4FC4-AB28-B5