How Do I Install Linux Packages?

Project ID: 26297924-d91d-448c-b1fa-e00612d55795 I'm trying to deploy my Django project that requires these Linux packages: libasound2-dev python3-numpy python-setuptools libsndfile-dev Currently I'm migrating from Heroku using an Aptfile that installs these packages. I tried using a Build Command on my Railway.app deployment but the deployment fails to install those packages. Procfile
web: python manage.py migrate && gunicorn config.wsgi

worker: python manage.py rqworker default
web: python manage.py migrate && gunicorn config.wsgi

worker: python manage.py rqworker default
Railway Build Command
apt-get install libasound2-dev python3-numpy python-setuptools libsndfile-dev
apt-get install libasound2-dev python3-numpy python-setuptools libsndfile-dev
Railway Build Log Errors
#13 [stage-0 9/10] RUN apt-get install libasound2-dev python3-numpy python-setuptools libsndfile-dev
#13 sha256:a2466ebdd04eb7054cbe2294efd21ece4379033b333f95c3e6581df9c398fd66

#13 0.478 apt-get: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /nix/store/c8zdsf7csk8msjb914bhccdhq0ycmqys-gcc-11.3.0-lib/lib/libstdc++.so.6)
#13 0.478 apt-get: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by /nix/store/c8zdsf7csk8msjb914bhccdhq0ycmqys-gcc-11.3.0-lib/lib/libstdc++.so.6)
#13 0.478 apt-get: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by /nix/store/c8zdsf7csk8msjb914bhccdhq0ycmqys-gcc-11.3.0-lib/lib/libstdc++.so.6)
#13 0.478 apt-get: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by /nix/store/c8zdsf7csk8msjb914bhccdhq0ycmqys-gcc-11.3.0-lib/lib/libgcc_s.so.1)
#13 ERROR: executor failed running [/bin/bash -ol pipefail -c apt-get install libasound2-dev python3-numpy python-setuptools libsndfile-dev]: exit code: 1
-----
> [stage-0 9/10] RUN apt-get install libasound2-dev python3-numpy python-setuptools libsndfile-dev:
-----
executor failed running [/bin/bash -ol pipefail -c apt-get install libasound2-dev python3-numpy python-setuptools libsndfile-dev]: exit code: 1

Error: Docker build failed
#13 [stage-0 9/10] RUN apt-get install libasound2-dev python3-numpy python-setuptools libsndfile-dev
#13 sha256:a2466ebdd04eb7054cbe2294efd21ece4379033b333f95c3e6581df9c398fd66

#13 0.478 apt-get: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /nix/store/c8zdsf7csk8msjb914bhccdhq0ycmqys-gcc-11.3.0-lib/lib/libstdc++.so.6)
#13 0.478 apt-get: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by /nix/store/c8zdsf7csk8msjb914bhccdhq0ycmqys-gcc-11.3.0-lib/lib/libstdc++.so.6)
#13 0.478 apt-get: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by /nix/store/c8zdsf7csk8msjb914bhccdhq0ycmqys-gcc-11.3.0-lib/lib/libstdc++.so.6)
#13 0.478 apt-get: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by /nix/store/c8zdsf7csk8msjb914bhccdhq0ycmqys-gcc-11.3.0-lib/lib/libgcc_s.so.1)
#13 ERROR: executor failed running [/bin/bash -ol pipefail -c apt-get install libasound2-dev python3-numpy python-setuptools libsndfile-dev]: exit code: 1
-----
> [stage-0 9/10] RUN apt-get install libasound2-dev python3-numpy python-setuptools libsndfile-dev:
-----
executor failed running [/bin/bash -ol pipefail -c apt-get install libasound2-dev python3-numpy python-setuptools libsndfile-dev]: exit code: 1

Error: Docker build failed
10 Replies
Percy
Percy2y ago
Project ID: N/A
Percy
Percy2y ago
It appears that the Railway Build Command is failing to install the necessary packages due to a version mismatch with the GLIBC library. You may need to use a nixpack instead of the Build Command to install the packages.
⚠️ experimental feature
Finn
Finn2y ago
YOU can set the env var NIXPACKS_APT_PKGS to install these. that way they are cached so your builds are alot quicker
echoesembrace
echoesembraceOP2y ago
Thank you! Where in the docs did you find that?
Finn
Finn2y ago
Getting Started | Nixpacks
App source + Nix packages + Docker = Image
Finn
Finn2y ago
leme find the page
Zack Plauché
Zack Plauché2y ago
Is this in the Railway docks? or is this a docker thing? or something else lol (aka: What is nixpacks and how is it related to Railway lol)
Finn
Finn2y ago
nixpacks is a tool that looks at your project and produces a optmsized dockerfile for caching as many layers at it can you can use a normal dockerfile if you need. just add a dockerfile to your root or add one and point railway to it via the website
echoesembrace
echoesembraceOP2y ago
Thank you! You set me in the right direction and I learned how Railway uses the Nixpacks 😀 I ended up fixing the error using the NIXPACKS_LIBS environment variable to install libsndfile. It turns out that's the only library I needed, which was not the case using Heroku.
Want results from more Discord servers?
Add your server