Skip to main content

Lando is a local development environment tool, and it might not directly support the installation of system-wide packages like libGL. However, you can make sure that the required dependencies are included in your application's environment by modifying its configuration.

 

Here's a general approach to include libGL in your Lando configuration

 

Create a .lando.yml Configuration File

If you don't have a .lando.yml file in your project, create one at the root of your project. If you already have one, open it for editing.

Modify the Services Configuration

Add a services section if it doesn't exist, and modify the configuration for the specific service you're using (e.g., appserver, web, etc.).

name: my-lando-app
services:
 appserver:
   type: php
   config:
     php: '8.2'
     extensions:
       - curl
       - libgl1-mesa-glx  # Add libGL dependency here

Replace 8.2 with your desired PHP version, and adjust the service type and name accordingly.

My .lando.yml file

name: py-ai
recipe: drupal10
config:
  webroot: web
  php: '8.2'
  extensions:
    - curl
    - libgl1-mesa-glx
  xdebug: false
  composer: []
  composer_version: '2.5.2'
  python: '3.11.6'
services:
  phpmyadmin:
    type: phpmyadmin
    hosts:
      - database
  database:
    portforward: 3334
    creds:
      user: py10
      password: py10
      database: py10
  solr:
    type: solr
  python:
    type: python:3.11.6
    port: 80
    ssl: true
    command: tail -f /dev/null
    extras:
     - "apt-get update -y"
     - "apt-get install build-essential"
    build:
      - pip install -r requirements.txt
    env:
      OPENAI_API_KEY: sk-CODE
      
tooling:
  phpunit:
    service: appserver

 

Rebuild Lando

After modifying the configuration, you may need to stop and rebuild your Lando environment

lando poweroff
lando rebuild

This will stop and then rebuild your Lando environment with the updated configuration.  Keep in mind that Lando environments can have different configurations based on the services you're using and the application stack you've chosen. The example above assumes a PHP service, and it installs the libgl1-mesa-glx package, which includes the libGL.so.1 library.

If your application requires a different service or package, adjust the configuration accordingly. If you have trouble finding the appropriate package, check your operating system's package manager documentation or consult the Lando documentation for more advanced customisation options.

Related articles

Andrew Fletcher09 Nov 2023
Lando set-up running Drupal and Python
Lando is a development environment tool that makes it easier to set up and manage local development environments for web applications. To use Python within a Lando-based development environment, you can follow these general steps: Create a Lando Configuration FileMake sure you have a Lando...
Andrew Fletcher22 Oct 2023
Lando setup running Drupal 10
Create a Lando setup running Drupal 10.The command you provided appears to be a Lando configuration command for initialising a new Lando environment for a Drupal 10 project. Following is a breakdown of the command and what it does:# Initialize a new lando drupal using a vanilla Drupal 10...