Installing software on Linux

Time:2020-6-27

 

Two series of Linux distributions

  • Debian: for example, Ubuntu, package management tools apt, apt get, dpkg, package name.deb
  • Red hat: for example, CentOS (so the version selected when installing CentOS 8 on VMware is red hat), package management tools yum, RPM, and package name. Rpm

 

Ubuntu to download the installation package of. DEB, use apt|apt get|dpkg command to manage the software;

CentOS to download the. RPM installation package, use the yum command to manage the software.

Do not mix.

 

. tar.gz It’s a general installation package for Linux distribution, but it only packs and compresses the source | bytecode, sometimes it needs to be compiled by itself.

Other companies dare not give you the source code to use tar.gz Most of them are software development kits (such as JDK) and open source framework jar packages.

 

 

Ubuntu used apt get management software package in the early years. Apt get contains many commands with low-level functions.

Later, apt was introduced to simplify the common commands of apt get, and some new commands were added.

It is officially recommended to use apt. now apt has surpassed apt get and become the mainstream.

Ubuntu’s individual packages can also be managed using dpkg.

 

 

CentOS can use RPM command or Yum command to manage software package. RPM command requires us to manage software dependency manually, and Yum command will automatically manage dependency.

For example, if you want to install software a, but software a depends on software B, you need to install software B first.

Using the RPM command, we need to install software B first, and then install software a.

Using the yum command, we can directly install software a, which will automatically analyze and install the required dependencies.

 

 


 

 

Software source configuration

The default software sources are all foreign and slow. You can use domestic images, such as Alibaba cloud.

Image configuration for Ubuntu: https://developer.aliyun.com/mirror/ubuntu?spm=a2c6h.13651102.0.0.3e221b11MoVEq0

 

CentOS image configuration: https://developer.aliyun.com/mirror/centos?spm=a2c6h.13651102.0.0.3e221b11qYtgjW

. repo.backup It is the system default. Repo backup file. Repo is the newly configured Alibaba software source image (covering the original configuration).

 

 


 

 

.deb   Ubuntu

Dpkg common command:

  • Dpkg – I package name. DEB view the package details, including the software name, version and size, I is info.
  • Dpkg – I package name DEB installation package, i.e. install
  • Dpkg – R package name uninstall the package, R is remove. In this way, the configuration file remains
  • Dpkg – L package name view all installed packages, i.e. list. Dpkg – L | grep zip to search for the specified characters.

 

 

Apt common commands:

  • Apt search searches for packages in software sources
  • Apt list list packages (installed + locally available + software source)
  • Apt install package name install package
  • Apt remove package name uninstall package (there will be residual configuration files)
  • Apt purge package name uninstall the package and delete the corresponding configuration file (recommended)
  • Apt update update software source
  • Apt upgrade upgrades all upgradeable packages
  • Apt autoremove automatically removes unwanted packages
  • Apt full upgrade handles dependencies automatically when upgrading packages

 

If the permission is not enough, add sudo or switch to root.

 

 

Installation method i. using software source

Apt list | grep keyword

Sudo apt install package name

There may not be a required package or a suitable version in the software source.

 

Method 2: go to the official website to copy the address of the software package and download the software package for installation

wget   http://wppkg.baidupcs.com/issue/netdisk/LinuxGuanjia/3.0.1/baidunetdisk_ linux_ 3.0.1.2.deb download package

sudo  dpkg  -i  baidunetdisk_ linux_ 3.0.1.2.deb when using dpkg to install the software, if the package is not in the current directory, you need to bring a path, or CD to the package directory first

sudo apt  install  /home/chy/baidunetdisk_ linux_ 3.0.1.2.deb path is required to use apt, regardless of whether the package is in the current directory or not

The software is automatically installed in a directory in / usr

Sudo apt purge Baidu etidisk uninstalls the package and deletes the configuration file

Specify the file name (with suffix) when installing and the package name when uninstalling.

 

 


 

 

.rpm  CentOS

Yum common commands:

  • Yum search keyword search package
  • Yum install package name install package
  • Yum remove package name uninstalls the package and automatically deletes the configuration file

 

  • Yum list lists all software packages (local + software source), optional parameters: – all default parameters, lists all software packages. –Installed lists the installed packages.
  • Yum check update lists the updatable packages
  • Update the specified package using Yum update package name
  • Update all packages Yum update

 

Clear cache:

  • Yum clean packages: clear packages under cache directory
  • Yum clean headers: clear the headers under the cache directory
  • Yum clean oldheaders: clear the old headers in the cache directory
  • Yum clean all clears the packages and old headers in the cache directory

 

 

Method 1: obtain the software package from the software source for installation:

Yum list | grep keyword

Sudo Yum install package name

Although you can use Yum search to search, the arrangement of search is not very good.

 

Method 2: go to the official website to copy the address of the software package and download the software package for installation

wget  http://wppkg.baidupcs.com/issue/netdisk/LinuxGuanjia/3.0.1/baidunetdisk_ linux_ 3.0.1.2.rpm download. RPM package

sudo yum install baidunetdisk_ linux_ 3.0.1.2.rpm installation package

 

Sudo Yum remove Baidu netdisk uninstall the package and delete the configuration file

 

Dependency will be installed automatically during Yum installation and uninstalled automatically.

 

 

 


 

 

 

Installing chrome under Linux

https://www.google.cn/chrome/

 

 

 

 

yum install https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm

Of course, you can download it first and then install it.