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

Who is this Brown Skin Girl?

In the recent wake of a great musical sensation and a re-make of the famous Lion King movie, Beyonce has been on the global selection of artistes to share performances. Today, I will try to examine the poetry of the track titled Brown Skin Girl, All interpretations in this article are my personal candid opinion. so feel free to share yours in the comments section, i will be glad to add it to my edits. So while I may not pretty boy; your heart is amiss; Play it like a villain `cause she caught in a wave This paints the picture of a guy who feels He is not good enough for the lady of his dreams, so he said Tonight I am walking away Lined up my mind, on the grind yeah yeah meaning he tryin' to give up. But then in the chorus, He said Tonight I might fall in love Depending on how you hold me I'm glad that I'm calming down can't let no one come control me So this dude aint feeling he's the kinda guy for bae, but bae be doubting if she still want...

[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 - How many network cards/interfaces do I have and what's their IP

 Yup! You have your Linux server or desktop installed, you have been enjoying this setup and suddenly you need to know how many network adapters are installed. You probably also want to know which of these adapters is connected to the internet, please follow through. First, you should run the command below on the terminal ip addr TL; DR: T here are 2 network adapters here,  “enp0s3” is my internet network adapter because it has an IP address from my internet gateway/router/MiFi. The IP address pattern gives this information.it begins with 192.x.x.x. Also "epn0s8" is the local network adapter which allows connections within an ethernet,  This output is quite verbose. Let’s dissect it in a bit. Firstly, we can observe items 1, 2 and 3. It is worth mentioning that item 1 is not an adapter, it is synonymous with the local network. Item 1 is labelled as “lo:”, this means that details in this section have to do with your localhost. Internal network setting of your system. This ...