Installing Software in Linux

There are 5 ways to install software in Linux.

Installation


Using the APP store

Available for distributions with APP store, such as Ubuntu, Manjaro, etc.

In Xubuntu, the APP store is called “Software”, but it doesn’t work well because it loads very slowly.

Using package management system

A package management system is a collection of tools that automates the installation, update, configuration and removal of software.

In Linux, many software can be installed with a single command, elegantly and quickly.

In contrast to the APP store, using the package manager requires that you know in advance the name of the package in the repository where you want to install the software.

For example, dpkg, which manages Debian (.deb) packages, and its front-end apt (for Debian distributions).

The full name of apt is Advance Package Tool.

apt

Before installing, use apt search to see if the corresponding package name is in the repository.

Once you have determined the package name, install it with apt install package name.

Enter Y and enter to confirm the installation.

Permission problem

Prompt “Permission denied”, “are you root?”.

To fix it, add sudo in front of the command, i.e. sudo apt install firefox.

When the user inputs a password, the terminal does not display the password back for security reasons.

Official software sources

The list of software sources for apt is under /etc/apt/sources.list.

Third-party sources

You can add third-party sources and install the software if it is not in the official sources.

After adding third-party sources to /etc/apt/sources.list, you can get the list of third-party software and install the required third-party software with apt install package-name.

For example, install Docker by adding the Docker sources 1.

Installing packages manually using the package manager

In addition to installing software from official and third-party repositories, you can also directly download and install binary packages such as deb, rpm, etc., packaged by the software vendor, and install them using shell.

Try to use apt to install deb, avoid using dpkg -i , because installing deb directly via dpkg will not install the required dependencies. It will only report that the corresponding dependencies are missing, and you need to fix them manually with the following command:

1
$ sudo apt -f install

For example, install VSCode 2.

I tried but failed.

First, my Linux distribution was too old to install with apt, so I used dpkg -i and made some errors;
Second, I seemed to have insufficient storage space to install the whole VSCode;
Finally, I made the mistake of powering off Linux, and when I booted it up again, there was no GUI, only a cursor flashing in the upper left corner.

I searched for these problems, but they were not successfully solved. I had no choice but to delete the original virtual machine and add a new one.

File transfer between host win10 and virtual machine ubuntu

Transferring files via SSH connection to the server 3. I chose MobaXterm and successfully transferred the files.

mobaxterm

A few little penguins suddenly jumped out when the connection was disconnected ^_^

Installing pre-compiled executables

The software provider may also provide pre-compiled executables that can be run directly.

For example, install a pre-compiled LLVM 4.

Using source code 5

Update


Locally on the computer, the system maintains a list of packages that contains software information and package dependencies.

Update the software list

Use apt update to get the new software version and software dependencies.

Update the software

After getting the new software list, use apt upgrade to update the software.

Appendix


Tutorial

Linux 101 - chap 03: 软件安装与文件操作

[1] Linux 101 - 第三方软件源

[2] Visual Studio Code on Linux

[3] 宿主机win10与虚拟机ubuntu之间的文件传输方法

[4] Linux 101 - 安装预编译可执行文件

[5] Linux 101 - 使用源代码安装

Operating Files in Linux Shell

Comments

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×