The difference between Ubuntu Apt-get and PIP installation commands

Source: Internet
Author: User

When installing packages under Ubuntu Server, you often use the sudo apt-get install package name or sudo pip install package name, then what is the difference between the two?


1. Differences
The PIP is used to install all the Python dependencies from PyPI (https://www.python.org/) and can optionally install any previous versions of the dependencies that have been uploaded on PyPI, which are personally considered Python-related packages and third-party packages, as well as various versions;

Apt-get can be used to install software, update the source, or can be used to update a typical dependency package from Ubuntu (Https://launchpad.net/ubuntu), which means that it is just a single version of the installation (newly released, or most recent), And we cannot decide which version of the dependent package we want to install or the version before it is selected.
Personally, it's a good distinction: after all, one is to update a system-level package, one to update a programming language Level Pack (library).


2. Use
This is the case, if you need the latest version of the Python dependency package, you can use Apt-get directly, when the project suddenly need to use the old version of the dependency package, you can use Virtualenvwrapper and Pip to perfect the installation of an older version of the dependency package;
You can choose the type of installation you prefer according to your preference. However, if you need to install a specific version of a Python package, or install a package in Virtualenvwrapper, or install a package that only hosts PyPI, only Pip will help you solve the problem. Otherwise, if you don't mind installing in a system-wide location using Apt-get or Pip are OK;


3. Installation and Application
Apt-get can be used directly, in the form of

$ sudo apt-get install/delete package
$ sudo apt-get-f install #修复安装
$ sudo apt-get dist-upgrade #升级系统
$ sudo apt-get upgrade #更新已安装的包
$ Apt-get Source Package #下载该包的源代码
$ sudo apt-get BUILD-DEP package #安装相关的编译环境
$ sudo apt-get clean && sudo apt-get autoclean #清理无用的包

Pip needs to be installed to use, with virtualenvwrapper will be icing on the cake. The installation process is as follows (for Ubuntu 10.10 and later) in the format: Pip install package.

$ sudo apt-get install Python-pip python-dev build-essential
$ sudo pip install--upgrade pip
$ sudo pip install--upgrade virtualenv


Configure the Apt-get update source for Linux: http://www.linuxdiyf.com/linux/12073.html

Ubuntu 15.04 under Apt-get installation jdk:http://www.linuxdiyf.com/linux/11669.html

How to install the package: What is the difference between sudo apt-get and sudo tasksel: http://www.linuxdiyf.com/linux/9933.html

Use Apt-fast instead of apt-get to dramatically increase download speed: http://www.linuxdiyf.com/linux/9905.html

Apt-get and Apt-cache command examples show: http://www.linuxdiyf.com/linux/8765.html

The difference between Ubuntu Apt-get and PIP installation commands

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.