Skip to main content

One command to install equivalent packages in Ubuntu, Debian, CentOS, Fedora, Red Hat and Mac OS X.

Project description

UnixPackage is a UNIX independent way of installing packages. Specify the Ubuntu package name (e.g. libpq-dev), and it will install the equivalent on your system (e.g. postgresql-libs on Arch).

Install

Make sure that you have pip installed (any version). Then run:

$ pip install unixpackage

Simple Usage

Run:

$ unixpackage install libpq-dev

On Arch this will run:

$ sudo pacman -S postgresql-libs

On Debian and Ubuntu:

$ sudo apt-get install libpq-dev

On Mac OS X:

$ brew install postgresql

On Red Hat/CentOS/Fedora:

$ sudo yum install postgresql-devel

Other usage

You can also just print the command to install rather than running it:

$ unixpackage show libpq-dev libssl-dev
sudo pacman -S postgresql-libs openssl

Or just check to see if it is installed:

$ unixpackage check libpq-dev openssl
Installed

Or install using “polite mode”:

$ unixpackage install libpq-dev --polite
The following command must be run to continue. I am attempting to run it now:


       sudo apt-get install -y libpq-dev


You can also run this command in another window and then hit Ctrl-C to continue.

[sudo] password for user:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
  postgresql-doc-9.3
The following NEW packages will be installed:
  libpq-dev
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/140 kB of archives.
After this operation, 741 kB of additional disk space will be used.
Selecting previously unselected package libpq-dev.
(Reading database ... 231796 files and directories currently installed.)
Preparing to unpack .../libpq-dev_9.3.9-0ubuntu0.14.04_amd64.deb ...
Unpacking libpq-dev (9.3.9-0ubuntu0.14.04) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Setting up libpq-dev (9.3.9-0ubuntu0.14.04) ...
Post-install package check for libpq-dev successful!

Python API

There is also a python API for the above commands:

import unixpackage
import sys

# Install package if not already installed
unixpackage.install(["libpq-dev"])

# Install package if not already installed (in polite mode)
unixpackage.install(["libpq-dev"], polite=True)

# Check if packages are installed
if unixpackage.packages_installed(["libpq-dev"]):
    sys.stdout.write("libpq-dev installed")

Package Library

Package names and their equivalents are downloaded from http://unixpackage.github.io/:

Example : http://unixpackage.github.io/libpq-dev.json

To add more packages you want to be installable in a UNIX-independent way, fork and submit a pull request to this repository: http://github.com/unixpackage/unixpackage.github.io

Want to help?

See CONTRIBUTING.rst

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

unixpackage-0.3.9.tar.gz (65.1 kB view details)

Uploaded Source

File details

Details for the file unixpackage-0.3.9.tar.gz.

File metadata

  • Download URL: unixpackage-0.3.9.tar.gz
  • Upload date:
  • Size: 65.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for unixpackage-0.3.9.tar.gz
Algorithm Hash digest
SHA256 6bc54902e2760d31e56306d83c2e48526ce731cf8a02ee60e7c5608f55c9f5e8
MD5 69644f280e4041ed85bfbb5be9938abf
BLAKE2b-256 cc7e3e8aa6b7b738bddc7dc52b4e6a4e12c4b3667fabf46e4a9bc311383f89b0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page