Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Requirements file for apt-get, similar to pip

I like how you can manage dependencies with pip requirements. Is there something similar in case of apt-get?

http://www.pip-installer.org/en/latest/requirements.html#requirements-file-format

like image 525
Vladimir Keleshev Avatar asked Apr 12 '12 09:04

Vladimir Keleshev


People also ask

Is pip the same as apt-get?

pip is used to download and install packages directly from PyPI. PyPI is hosted by Python Software Foundation. It is a specialized package manager that only deals with python packages. apt-get is used to download and install packages from Ubuntu repositories which are hosted by Canonical.

Can I put pip in requirements txt?

The most common command is pip freeze > requirements. txt , which records an environment's current package list into requirements. txt. If you want to install the dependencies in a virtual environment, create and activate that environment first, then use the Install from requirements.

What is the difference between pip install and apt install?

pip is specific to packages related to the python interpreter. apt is a general purpose package management system. So stuff that is not Python is unlikely to be installable with pip. And some Python developers prefer to use custom tools not general purpose ones.


1 Answers

Your question is that you want to have a list of system dependences in one file, for being able to install it with one command.

I don't recomend you to include the version of a package in the system dependencies. In the soft system dependences like "build-essential" or "uuid-dev" you normally want the latest version of the package. In the "hard dependeces" like python, postgres or whatever, normally the version is specified in the name of the package itself, like "python2.6-dev" or "postgresql-8.4". Another problem you may have defining the exact version of the package is that maybe the version 8.4.11-1 of postgresql-8.4 will not be available in the repository in three months or in a year, and you will end up installing the current version in the repo.

Example. You can create a file named "requirements.system" with the system packages you need for you project:

python-virtualenv python2.6-dev uuid-dev python-pip postgresql-8.4 

Then, in your INSTALL file explain how to install the system packages.

# Install system depencences by running cat ~/project/install/requirements.system | xargs sudo aptitude install 

We have running this configuration for about two years, having to recreate the enviroment from the scrach a few times and we never had a problem.

like image 150
krenel Avatar answered Oct 03 '22 06:10

krenel