Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Install a linux package on heroku

Tags:

heroku

I need to install this package on heroku

apt-get install python3-tk

Can someone tell me how can I install this? I tried above command but I get this message

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package python3-tk is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

W: Not using locking for read only lock file /var/lib/dpkg/lock
E: Package 'python3-tk' has no installation candidate
like image 480
user1670773 Avatar asked Feb 21 '18 01:02

user1670773


People also ask

How do I install Heroku packages?

Run the npm install command in your local app directory to install the dependencies that you declared in your package. json file. Start your app locally using the heroku local command, which is installed as part of the Heroku CLI. Your app should now be running on http://localhost:5000/.

How do I add apt to Heroku?

Install the MediaInfo package yourself by using the heroku-buildpack-apt buildpack. Create a file named Aptfile and add a package name on each new line that you want Heroku to automatically add to your application.

How do I use Aptfile in Heroku?

Create Aptfile To make them work on Heroku, we need to use buildpacks. (We will create one for Tesseract). Then use the package by including any APT package in an Aptfile in your application. The buildpack will then install these packages on the dyno when we deploy your application.

What Linux does Heroku use?

The final component needed to run an application is the operating system. On Heroku, this is called the "stack"—an operating system image curated and maintained by Heroku. The stack is based on Ubuntu, the open source Linux distribution.


1 Answers

Installing apt packages requires sudo, which heroku doesn't allow you to do with slugs.
You can use this buildpack: https://github.com/heroku/heroku-buildpack-apt

Or you can use the heroku docker support to push docker images. Those images won't allow you sudo either. But you will be able to use sudo when building them. See https://devcenter.heroku.com/articles/container-registry-and-runtime

If you still want to use buildpacks with docker and an easier way to install packages, there is also heroku.yml in developer preview: https://devcenter.heroku.com/articles/heroku-yml-build-manifest

like image 168
Damien MATHIEU Avatar answered Oct 13 '22 20:10

Damien MATHIEU