[Linux] Package manager/editor/yum is an application store? /vim editor what?

Mind map of this article:
insert image description here


Linux software installation

1. Source code installation
2. rpm installation
3.yum installation

Among them, the first two installation methods are not recommended, and the third yum installation is recommended. This article also focuses on explaining yum installation.

About the software ecology of Linux

Regarding the software ecology of Linux, first know a few points:

In our mobile phones, we usually download software from the app store.
The application store itself is also an app, and there are various software in the application store. However, these software are not stored locally on our mobile phones, but on a remote server. The remote server just pulls a software list in On the app store, if you want to download a certain app, you need to go to the remote server to find the corresponding software through the network, and download the software resource to the local mobile phone to download.

insert image description here

Open source is a business strategy
Open source is sometimes quite expensive.
We know that if there is a demand, someone will meet the demand, and someone will complete the demand by writing software. In order to meet the needs of more people, the software provider will This software is open source, that is, open source code.

Once the source code is released, there will be programmers in the same industry to improve the software, and the software will get better and better, and more and more people will use it. Even when there are big companies using it, the software will be huge. Not to fail, if one day the server crashes due to too many users, and the provider does not have more funds to purchase the server, then if the bottom layer of a large company is using this software at this time, once the software crashes, it cannot Maintenance, the loss of a large company is quite large, so it is possible that the company will provide server support or financial support to the software maintainer to help the maintainer maintain the software.

After receiving support, it will continue to improve and improve quality. With more and more users, there will be more and more donations. It is too big to fail. This is a business strategy of open source.

1. Linux package manager: what exactly is yum

Yum is equivalent to the application store under windows

A common way to install software under Linux is to download the source code of the program and compile it to obtain an executable program.
But this is too troublesome, so some people compile some commonly used software in advance and make it into a software package ( It can be understood as the installation program on windows) placed on a server, and the compiled software package can be easily obtained through the package manager and installed directly.

Packages and package managers are like the relationship between "App" and "App Store".


yum (Yellow dog Updater, Modified) is a very commonly used package manager under Linux. It is mainly used in distributions such as Fedora, RedHat, and Centos.

Note:
All operations on yum must ensure that the host (virtual machine) network is unblocked!!

The following command can check whether the host is connected to the Internet

ping www.baidu.com

About the yum command:

Instructions for downloading the software:

yum install software name
Function: download the corresponding software, which will pop up to ask if you need to install, y: install, n: do not install
yum install -y software name
Do not ask whether it is installed, install it directly.

Instructions to delete a software:

yum remove -y software name
delete without asking me

About yum source

The yum source is actually equivalent to a lot of official software in the app store in our mobile phone.
However, sometimes the official software can't fully meet our needs, we still need some other software, but the official app store doesn't have it.
This type of software often has download risks
, but there are still users who have download needs.
For this type of software, it is called extend under Linux - the extension source.

Common extension sources include Tsinghua University's extension source, NetEase's extension source, etc.

vim /etc/yum.repos.d/CentOS-Base.repo
Check whether the yum source of the current host is domestic or foreign

2. rzsz command

sz file name/directory name
Function: file or directory on Linux is transferred to windows.

rz

If you directly enter the rz command, a window will pop up, allowing you to select the file/directory that needs to be uploaded to Linux

Summary: The rzsz instruction is an instruction for mutual transmission between windows and Linux.


1. Linux editor - vim editor

The three main modes of the vim editor

The vim editor generally has several modes, but the main ones are the following three:

Command mode (this is the mode when vim is opened by default)
Insert mode
Bottom line mode

insert image description here

Common shortcut keys for vim editor command mode:

gg: locate to the beginning of the entire file
shift+g: locate to the end of the entire file
n+shift+g: locate the cursor to the nth line
shift+4($): locate the cursor to the end of the current line
shift+6(^): Position the cursor to the beginning of the current line
(n)yy: copy the line where the cursor is (n lines)
(n)dd: (n lines) cut/delete
(n)p: paste (n repeat lines) to the next line of the cursor line
u : undo
ctrl+r: cancel undo
w: move the cursor backward in units of words
b: move the cursor forward in units of words

H: move the cursor to the left
J: move the cursor down
K: move the cursor up
L: move the cursor to the right
(quickly memorize the four cursor memory methods: among the four letters, H is on the leftmost side of the keyboard, L is on the keyboard The far right, so HL means left and right respectively, J means jump, jump means jumping, diving and jumping down, so J means down, K means King, meaning king, the king is high above, so K means up) (
press Live) shift+~: Realize mutual conversion between upper and lower case
(n)r: Perform batch replacement of the cursor character + (n characters after the cursor)
shift+r: Enter the replacement mode, replace the content as a whole -> the fourth mode, Exit the replacement mode and press Esc
(n)x: delete the character after the cursor

In bottom row mode:

vs + filename: open another window at the same time
ctrl+ww: window switching
w: save
q: exit
wq: save and exit
w!: force save
q!: force exit
wq!: force save and exit

Summary of vim operation:

Open, close, view, query, insert, delete, replace, undo, copy, etc.


Summarize

This article explains about the Linux package manager - yum and the Linux editor - vim.

Guess you like

Origin blog.csdn.net/w2915w/article/details/130911696