Original URL: Ubuntu's apt-get series--apt-get installation software method/tutorial_IT sharp knife unsheathed blog-CSDN blog
Introduction
This article introduces how to install software on Ubuntu using apt-get.
install software
update list first
sudo apt-get update
install software
sudo apt-get install <package name>[=<version>]
The version can be omitted, and the latest version is the default.
Example (install docker-compose-plugin)
Install the latest version:
sudo apt-get install docker-compose-plugin
Install the specified version:
sudo apt-get install docker-compose-plugin=2.12.2~ubuntu-focal
Check software version
You cannot list all supported versions by using the following command, because each version is related to the system version and CPU architecture. For example, a software that supports Ubuntu system 16.04 with a CPU architecture of amd64 is only 1.0 and 1.2, and the rest are not supported. , so there are only two types of enumeration.
Method 1: apt-cache madison
sudo apt-cache madison <package name>
example
Law 2: apt policy
sudo apt-cache policy <package name>
example
Install offline
method
vi /etc/apt/sources.list
add a local path, such as: deb file:/work apt_packages/
sudo apt-get update
sudo apt-get install <package name>
Other URL: Ubuntu apt local source offline installation
other
1. Required packages and dependent paths: /var/cache/apt/archives/
2. The method of downloading the installation package but not installing it: sudo apt-get -d install <package name>
Installation error solution
error 1
mistake:
E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
Solution:
sudo rm /var/lib/dpkg/lock
error 2
mistake:
E: Could not get lock /var/cache/apt/archives/lock - open (11: Resource temporarily unavailable)
Solution:
sudo rm /var/cache/apt/archives/lock