By Kaii
I have deployed a Laravel application on App Platforms and now I need to install new packages, but when I try to use the command “sudo apt update” I get this message “bash: sudo: command not found” and if I use only “apt update” I get the message “Acquire (13: Permission denied)”. How can I fix this, do I need to attach a Droplet to my application?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
👋 @Kaii
If you’re using buildpacks with App Platform, apt commands are not supported, though we plan to offer a method to do this in the future.
A workaround is to build and deploy using a Dockerfile.
Hi there,
Quick update here, the App Platform now supports this via Aptfile:
https://docs.digitalocean.com/products/app-platform/reference/buildpacks/aptfile/
App Platform looks for a file named Aptfile (no file extension) to detect an application requiring system packages. If this file is detected, the heroku-buildpack-apt buildpack is used to install any packages listed in the Aptfile during the build process.
The following example Aptfile declares three system packages to install:
libpq-dev
imagemagick
curl
This example installs:
libpq-dev: A library for PostgreSQL applications.imagemagick: A command-line tool for image processing.curl: A command line tool for making HTTP requests.Another option here remains the usage of a Dockerfile which gives you more flexibility:
https://docs.digitalocean.com/products/app-platform/reference/dockerfile/
Hope that this helps!
Best,
Bobby
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.