Ubuntu/Other Linux¶
Minimum Requirements
Quad-core CPU running at 2.0 GHz+
8 GiB of RAM
Recommended Requirements
6th Gen Intel® Core CPU or later OR AMD Ryzen™️ 1000-series or later
16 GiB of RAM
We primarily support Ubuntu 22.04+ for LibreLane.
If you’re looking to build a virtual machine, we recommend Ubuntu 22.04.
Installing Nix¶
Warning
Do not install Nix using apt. The version of Nix offered by apt is more
often than not severely out-of-date and may cause issues.
You will need curl to install Nix.
To install curl on Ubuntu, simply type in the following in your terminal:
$ sudo apt-get install -y curl
After that, simply run this command:
$ curl --proto '=https' --tlsv1.2 -fsSL https://artifacts.nixos.org/nix-installer | sh -s -- install --no-confirm --extra-conf "
extra-substituters = https://nix-cache.fossi-foundation.org
extra-trusted-public-keys = nix-cache.fossi-foundation.org:3+K59iFwXqKsL7BNu6Guy0v+uTlwsxYQxjspXzqLYQs=
extra-experimental-features = nix-command flakes
"
Enter your password if prompted. This should take around 5 minutes.
Make sure to close all terminals after you’re done with this step.
If you already have Nix set up…
You will need to enable LibreLane’s
Binary Cache manually, as well as
the “experimental” nix-command and flakes features.
See https://github.com/fossi-foundation/nix-eda/blob/main/docs/installation.md for more info.
If you do know what this means, the values are as follows:
extra-substituters = https://nix-cache.fossi-foundation.org
extra-trusted-public-keys = nix-cache.fossi-foundation.org:3+K59iFwXqKsL7BNu6Guy0v+uTlwsxYQxjspXzqLYQs=
extra-experimental-features = nix-command flakes
Make sure to restart nix-daemon after updating /etc/nix/nix.conf.
$ sudo pkill nix-daemon
Cloning LibreLane¶
With git installed, just run the following:
$ git clone https://github.com/librelane/librelane
That’s it. Whenever you want to use LibreLane, nix-shell in the repository root
directory and you’ll have a full LibreLane environment. The first time might take
around 10 minutes while binaries are pulled from the cache.
To quickly test your installation, simply run librelane --smoke-test in the nix
shell.
Troubleshooting¶
warning: setlocale: cannot change locale (en_US.UTF-8)¶
This usually indicates either en_US.UTF-8 is missing or the entire locale archive is missing. For consistency, LibreLane uses the American English UTF-8 locale exclusively.
We are currently investigating a platform-agnostic solution, but in the meantime, the fix is as follows:
The archive is typically located in /usr/lib/locale/locale-archive. If it
exists, the fix can be as simple as
export LOCALE_ARCHIVE=/usr/lib/locale/locale-archive before starting
LibreLane.
Note
Make sure you run any of the commands in this section outside of the LibreLane environment.
You can check if it exists at all using this command:
$ [ -f /usr/lib/locale/locale-archive ] && echo 'Exists' || echo 'Not found'
If it either doesn’t exist at all or does exist but the error still occurs, here is how to fix it on some major distributions:
Fixing missing archive or locale on Debian/Ubuntu¶
$ sudo dpkg-reconfigure locales
Follow the on-screen instructions: make sure en_US.UTF-8 UTF-8 is checked.
You should also include any locales you use.
Afterwards, run this command to ensure the archive exists:
$ sudo locale-gen
Depending on your setup, you may still need to
export LOCALE_ARCHIVE=/usr/lib/locale/locale-archive before entering the
LibreLane environment.
Fixing missing archive or locale on RHEL derivatives or Fedora¶
We found that this command works on the latest version of Fedora.
$ sudo localedef --add-to-archive /usr/lib/locale/en_US.utf8
Depending on your setup, you may still need to
export LOCALE_ARCHIVE=/usr/lib/locale/locale-archive before entering the
LibreLane environment.