i can't install graphicsmagick package (system-level)

hi, im using App Platform and i need to install two packages called graphicsmagick and ghostscripts, its a requirement to use the npm library pdf2pic, i tried to install ghostscripts and i had no problem, it was successfully, but when i try to install graphicsmagick, i always receive this error message:

:42] E: Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission denied) :42] E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?

Submit an answer

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!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Bobby Iliev
Site Moderator
Site Moderator badge
March 28, 2024

Hi there!

You can not use apt-get install commands directly on the App Platform.

Instead, all that you need to do is to create an Aptfile and add the dependencies that you want to install.

Here, is an example repo that I’ve put together with an Aptfile:

Note that the run command should not contain any apt-get install commands as well, the App Platform will automatically install the package listed in the Aptfile.

After that the gm command will be available as normal:

My run command is just set to npm run:

Can you confirm that you’ve pushed the Aptfile to the correct Git branch that you are deploying your app from?



Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Featured on Community

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel