Adding and Updating Packages

One of the benefits of using eLxr is that the ability to perform updates is included by default in each image.

About This Task

Once your eLxr 26.04 image is up and running, you can use the built-in package management features to customize it for your own use. The type of package management available is determined by the image type. For example, images without OSTree support include the APT package manager as described in this procedure. Images with OSTree support include apt-ostree package management, which supports system wide updates in addition to packages changes.

While it is possible to use apt-get install to install a package to an OSTree image, doing so will only add the package to the current boot repository. It will not set up the new package changes for a new OSTree deployment, and can even cause issues with package dependencies. To ensure successful package management with OSTree images, always use apt-ostree install with OSTree images.

This procedure uses the default package repositories included with eLxr. If you require a Debian package that is not included in the eLxr repositories, you can add it manually by updating the /etc/apt/sources.list file. Each entry in this file represents a different package repository. By default, eLxr includes the following repositories:

$ cat /etc/apt/sources.list

deb https://mirror.elxr.dev/elxr bianca main main-debian-community non-free-firmware non-free-firmware-debian-community contrib
deb https://mirror.elxr.dev/elxr bianca-security main main-debian-community non-free-firmware non-free-firmware-debian-community contrib
deb https://mirror.elxr.dev/elxr bianca-updates main main-debian-community non-free-firmware non-free-firmware-debian-community contrib

To add a new repository, update this file, for example.

$ cat /etc/apt/sources.list

deb https://mirror.elxr.dev/elxr bianca main main-debian-community non-free-firmware non-free-firmware-debian-community contrib
deb https://mirror.elxr.dev/elxr bianca-security main main-debian-community non-free-firmware non-free-firmware-debian-community contrib
deb https://mirror.elxr.dev/elxr bianca-updates main main-debian-community non-free-firmware non-free-firmware-debian-community contrib
deb https://deb.debian.org/debian trixie main contrib non-free-firmware contrib non-free

Once updated, run the apt-get update command to make the repository available in your system.

Note

It is a good practice to only include Debian trixie repositories to ensure compatibility and successful operation.

Before You Begin

You must be logged in to a running eLxr 26.04 image.

Note

This procedure assumes you are logged in to the image with a user account with sudo privileges. If you are logged in as root, you can omit the sudo command from the examples below.

Procedure

  1. Update the package database.

    wruser@localhost:~$ sudo apt-get update
    
    Hit:1 http://mirror.elxr.dev/elxr bianca inRelease
    Get:2 http://mirror.elxr.dev/elxr bianca-security inRelease [42.2 kb]
    Hit:3 http://mirror.elxr.dev/elxr bianca-updates inRelease
    Get:4 http://mirror.elxr.dev/elxr bianca-security/main-debian-community and64 Packages [241 kb]
    Fetched 283 kb in 1s (246 kB/s)
    Reading package lists... Done
    
  2. Add the openssh-server package.

    For standard images, use the apt-get install command:

    wruser@localhost:~$ sudo apt-get install openssh-server
    

    For OSTree images, use the apt-ostree install command. This will ensure the package is added to the OSTree repository and be available when the system reboots.

    wruser@localhost:~$ sudo apt-ostree install openssh-server

    To make the new package available in the current OSTree file system, run the apt-ostree deploy <image> command prior to rebooting.

    x86 targets:

    wruser@localhost:~$ sudo apt-ostree deploy elxr/amd64
    

    Arm targets:

    wruser@localhost:~$ sudo apt-ostree deploy elxr/arm64
    

    Reboot the OSTree image.

    wruser@localhost:~$ sudo reboot
    
  3. Test the package installation.

    wruser@localhost:~$ sudo ssh -V
    
    OpenSSH_10.0p2 Debian-7+deb13u1, OpenSSL 3.5.5 27 Jan 2026
    
  4. Obtain additional information about the package.

    If you want to know where the package derives from, and who maintains it, you can find out with the apt show command.

    $ apt show openssh-server
    
    Package: openssh-server
    Version: 10.0p2-7+deb13u1
    Priority: optional
    Section: net
    Source: openssh
    Maintainer: Debian OpenSSH Maintainers <debian-ssh@lists.debian.org>
    Installed-Size: 3,511 kB
    Provides: ssh-server
    Pre-Depends: init-system-helpers (>= 1.54~)
    Depends: libpam-modules, libpam-runtime, lsb-base, openssh-client
    (= 10.0p2-7+deb13u17), openssh-sftp-server, procps, ucf, debconf (>= 0.5) |
    debconf-2.0, runit-helper (>= 2.14.0~), libaudit1 (>= 1:2.2.1), libc6
    (>= 2.36), libcom-err2 (>= 1.43.9), libcrypt1 (>= 1:4.1.0), libgssapi-krb5-2
    (>= 1.17), libkrb5-3 (>= 1.13~alpha1+dfsg), libpam0g (>= 0.99.7.1),
    libselinux1 (>= 3.1~), libssl3 (>= 3.0.11), libsystemd0, libwrap0
    (>= 7.6-4~), zlib1g (>= 1:1.1.4)
    Recommends: default-logind | logind | libpam-systemd, ncurses-term, xauth
    Suggests: molly-guard, monkeysphere, ssh-askpass, ufw
    Conflicts: sftp, ssh-socks, ssh2
    Breaks: runit (<< 2.1.2-51~)
    Replaces: openssh-client (<< 1:7.9p1-8), ssh, ssh-krb5
    Homepage: https://www.openssh.com/
    Download-Size: 602 kB
    APT-Manual-Installed: yes
    APT-Sources: https://mirror.elxr.dev/elxr bianca/main-debian-community amd64 Packages
    Description: secure shell (SSH) server, for secure access from remote machines
     This is the portable version of OpenSSH, a free implementation of
     the Secure Shell protocol as specified by the IETF secsh working group.
     .
     Ssh (Secure Shell) is a program for logging into a remote machine
     and for executing commands on a remote machine.
     It provides secure encrypted communications between two untrusted
     hosts over an insecure network. X11 connections and arbitrary TCP/IP
     ports can also be forwarded over the secure channel.
     It can be used to provide applications with a secure communication
     channel.
     .
     This package provides the sshd server.
     .
     In some countries it may be illegal to use any encryption at all
     without a special permit.
     .
     sshd replaces the insecure rshd program, which is obsolete for most
     purposes.
    
  5. To view all the available packages, use the apt list command.

    $ apt list
    
    --- Lots of output as all packages list ---
    

    To view the specific version of a package, use apt list <packageName*>.

    $ apt list openssh-server
    
    openssh-server/bianca,now 1:10.0p1-7+deb13u1 amd64 [installed]
    

    Note that this command works on installed and available packages alike. This is a good command to use to determine whether the package version you require is available in the repository.

  6. To view information about the origins of a package, use the apt policy <packageName*> command.

    Similar to apt list, this command works on installed and available packages. Use this command if you want to know which repository a package originates from.

    $ apt policy openssh-server
    
    openssh-server:
       Installed: 1:10.0p1-7+deb13u1
       Candidate: 1:10.0p2-7+deb13u1
       Version table:
       *** 1:10.0p1-7+deb13u1 500
             500 https://mirror.elxr.dev/elxr bianca/main-debian-community amd64 Packages
             100 /var/lib/dpkg/status
    
  7. Optionally perform additional package management actions.

    Note

    Package updates with APT are supported in both system (hardware) and container images.

    Choose an option from the table.

    Update Type

    Command to run

    Install

    Single package:

    $ apt-get install <packageName>
    $ apt-ostree install <packageName>
    

    Multiple packages:

    $ apt-get install <packageName1> <packageName2>
    $ apt-ostree install <packageName1> <packageName2>
    

    Remove

    $ apt-get remove <packageName>
    $ apt-ostree remove <packageName>
    

    Update the package indices

    The APT package manager caches package feed indices locally. This command is required to load the new feed indicies. Although the package management tools periodically update these indices, you need to explicitly update the cache to see changes in the package feeds immediately.

    $ apt-get update
    

    Upgrade packages

    Single package:
    $ apt-get install --only-upgrade <packageName>
    

    All packages:

    $ apt-get upgrade
    

Results

Now that you have customized the packages on your eLxr 26.04 image, see the eLxr Application and Package Development Guide for additional information on developing your distribution.