Lando is a local development environment and DevOps tool built on Docker container technology, aimed at providing an easy way for developers to specify requirements for their projects. To simplify installation, Lando provides installation packages for various operating systems.

It seems logical to use the provided DEB package to install Lando on Ubuntu. However, chances are it will not work, especially if you use Docker from your OS distribution repository. For example, versions 3.1.3 and 3.1.4 did not work with Ubuntu 20.04; an attempt to install the package resulted in the following error:

Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 lando : Depends: docker-ce but it is not installable
E: Unable to correct problems, you have held broken packages.

There are two solutions.

The easiest one is to use the official Docker distribution instead of the packages provided by the OS vendor. The official documentation provides instructions on how to do that.

However, sometimes you may want to (or even have to) stick to the repository packages and cannot install Docker from the third-party repository. In this case, you will have to rebuild the Debian package. Fortunately, it is not very difficult.

To do this, you will need tar, gzip, and binutils packages.

First of all, you need to extract files from the DEB. Internally, the package is an ar archive; that is why we can use ar from the binutils package:

ar x lando-v3.1.4.deb

The command will create three files:

  1. control.tar.gz: this is the archive with the meta information used by the installer;
  2. data.tar.gz: this archive contains all of the files to be extracted from the package;
  3. debian-binary is a text file which indicates the version of the package format version.

We will need only control.tar.gz.

First of all, we need to extract files from it:

mkdir control
tar xzf control.tar.gz -C control

The command above will create the control directory and then extract all files from the archive into it. The only file we will need in that directory is control. It may look something like this:

Package: lando
Version: 3.1.4
License: GPL3
Vendor: none
Architecture: amd64
Maintainer: Mike Pirog 
Installed-Size: 74757
Depends: iptables, procps, docker-ce
Section: default
Priority: extra
Homepage: https://docs.devwithlando.io/
Description: The best local dev in the galaxy.

We will need to update the Depends: line; simply replace docker-ce with docker.io. Save the file. Then we need to recreate the control.tar.gz file.

Assuming we are in the control directory, run:

tar czf ../control.tar.gz *

Then we will need to update the package with the new version of the control.tar.gz file. Move to the directory with the package and run this command:

ar r lando-v3.1.4.deb control.tar.gz

This will replace the control.tar.gz file in the package with our updated file.

After that, you can install the package:

sudo apt-get install ./lando-v3.1.4.deb

This time, apt-get should succeed. Happy hacking!

How to Make Lando Work with Ubuntu 20.04
Tagged on:         

Leave a Reply

Your email address will not be published. Required fields are marked *