How do I install sudo in a Python Django application? I'm not using Docker

I’m trying to integrate newrelic in my python django application. It doesn’t use docker. But their script to install the agent requires sudo. And the following command

apt update && apt upgrade
apt install sudo

throws the underneath error

Aug 23 10:34:53 PM  WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
Aug 23 10:34:53 PM  
Aug 23 10:34:53 PM  Reading package lists...
Aug 23 10:34:53 PM  E: List directory /var/lib/apt/lists/partial is missing. - Acquire (30: Read-only file system)
Aug 23 10:34:53 PM  
Aug 23 10:34:53 PM  WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
Aug 23 10:34:53 PM  
Aug 23 10:34:53 PM  E: Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission denied)
Aug 23 10:34:53 PM  E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?

Any idea how to deal this problem?

Hi @Anshu_Kumar,

You won’t be able to install system-wide packages on our native environments. We would recommend using Docker if you need to do this.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.