Detailed update commands for software of Library under linux

  • 2021-06-28 14:51:32
  • OfStack

When installing packages under an ubuntu server, the sudo apt-get install package name or the sudo pip install package name are often used, so what is the difference?

1. Differences

pip is used to install all python dependent packages from PyPI (https://www.python.org/), and optionally any previous version of dependent packages uploaded on PyPI, which I personally consider python-related packages and third-party packages, as well as various versions;

apt-get can be used to install software, update sources, or update typical dependency packages from Ubuntu (https://launchpad.net/ubuntu). A typical installation means that it only installs a single version (the latest release, or the latest one), and we cannot decide which version of the dependency packages we want to install or which versions prior to it.

Personally, this is a good distinction: after all, one is to update the system level package and the other is to update the programming language level package (library).

2. Installation and Application

apt-get is directly usable in the format


$ sudo apt-get install/delete package
$ sudo apt-get -f install         # Repair Installation 
$ sudo apt-get dist-upgrade         # Upgrade System 
$ sudo apt-get upgrade          # Update installed packages 
$ apt-get source package         # Download the source code for the package 
$ sudo apt-get build-dep package       # Install related compilation environments 
$ sudo apt-get clean && sudo apt-get autoclean    # Clean up unwanted packages 

pip needs to be installed before it can be used.The installation process is as follows (for Ubuntu 10.10 and above), using the format: pip install package.


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

Install the python Library under linux


sudo apt-get install python-numpy 
sudo apt-get install python-scipy 
sudo apt-get install python-matplotlib 
sudo apt-get install python-pip

Other

pip list Lists all libraries

pip show torch View Library Information


Related articles: