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...

Linux - Configure DNS server IP to resolve errors with apt-get update

Perhaps you have a new install of Ubuntu, and you are about to install docker or any other Linux packages. The first step is to update the application repositories using the sudo apt update command. There is a very small possibility that you will get the error below if you are using a fresh install of the Ubuntu 18.04 LTS (Bionic Beaver). This error simply means that Linux is unable to connect to the official repository likely due to a DNS configuration or a network issue. Here we try to help you resolve the DNS issue. To resolve this, you must specify a DNS in your network settings. Well, there is one popular DNS that works well: Google's DNS. Follow through, please. STEP 1: Go to the settings page of Linux (Ubuntu) STEP 2: This should reveal a plethora of options. On the left pane, simply scroll down and click Network as shown below. This reveals your different network connections, for me, “enp0s3” is the adapter connecter to the internet. So, I must configure DNS for “enp0s3”. ...