Home > Article > System Tutorial > rpm management: Linux server software package query, uninstallation and installation guide
Article Directory
1.rpm management (key): software query, uninstallation, installation
Function: The function of rpm is similar to the "Software Management" in Laptop Manager on Windows, the "Software Manager" on Security Guard and other products. Its main function is to perform corresponding management operations on the software packages on the Linux server. The management is divided into: query, Uninstall and install.
1.1 Query the installation status of a certain software:
#rpm-qa|grep keywords
Options:
-q: query, query
-a: all, all
Case: Check whether firefox is installed on linux
1.2 Uninstall a certain software
#rpm-e software name
When Maxthon is uninstalled, it is a Linux text editor with no dependencies, so it can be uninstalled directly.
However, when uninstalling Apache, it prompts that it is difficult to uninstall:
When there are dependencies and you don’t want to solve the problem, you can: #rpm-e package name --nodeps
Installation of 1.3 software
If you want to install software, just like under Windows, you must first find the installation package.
How to obtain the software package:
a. Go to the official website to download;
b. If you don’t mind the old version, you can read it from the CD (or image file);
View information about spherical devices:
#lsblk (listblockdevices) View information about ball devices
Name: name
Size: device size
Type: type
MountPoint: Mount point (similar to the c drive under windows)
b.Mount the disc
Command: mount
Sentence pattern: #mount The original address of the device and the location path to be mounted
Original address of the device: The addresses are all under /dev, and then the specific name value is determined according to the sizeLinux execution permission, and they are stacked together to form the original address, such as currently: "/dev/sr0"
The location path to be mounted: The mounting directory is usually under mnt. You can also create a directory under mnt. Here we take "/mnt/dvd" as an example
Command to install software: #rpm-ivhFull name of software package
Options:
-i: install, install
-v: Show progress bar
-h: Indicates displaying the progress bar in the form of "#"
Note that in the current directory, you can type quickly: type fire first, and then press the tab key to complete it manually.
2 Permission management
Overview: Linux systems usually divide the identities that can save/retrieve files into three categories: owner, group, others, and each of the three identities has read, write, execute and other permissions.
2.1 Permission introduction
What are the permissions?
In the management of multi-user (may not be at the same time) computer system, Linux formats the hard disk. Permission means that a specific user has specific rights to use system resources, such as folders, the use of specific system instructions, or storage limits. .
In Linux, there are read, write, and execute permissions respectively:
Read permission:
For folders, read permission affects whether the user can still enumerate the directory structure
For files, read permission affects whether users can view the file content
Write permission:
For folders, write permission affects whether users can "create/delete/copy to/connect to" documents under the folder
For files, write permission affects whether users can edit the file content
Execution permission:
Usually for files, very script files.
2.2 Identity introduction
2. Identity introduction
2.3 Introduction to Linux permissions
To set permissions, you need to know some basic attributes of files and permission allocation rules.
In Linux, the ls command is often used to view the attributes of a file and is used to display the file name and related attributes of the file.
The part marked in red is the document permission attribute information of Linux (ls-l is equivalent to ll)
Ten characters represent the meaning:
Permission allocation is a combination of the three parameters of rwx, and the position order will not change. If there is no corresponding permission, use – instead.
a.It is a folder type
b. Owner: Has full permissions (read, write, execute)
c. Users in the same group: readable and executable
d. Other users: readable, executable
2.4 Permission settings
Sentence pattern: #chmod option permission mode document
Commonly used options:
-R: Set permissions recursively (when the document type is a folder)
Permission mode: It is the permission information that needs to be set for the document
Document: It can be a file or a folder, and it can be a relative path or an absolute path.
Note: If you want to set permissions on a document, the operator must be either the root user or the owner of the document.
2.4.1 Letter method
2.4.2 Digital method
Read: r4
Written by: w2
Execution: x1
No permissions: 0
For example: you need to set permissions for anaconda-ks.cfglinux execution permissions. The permissions require that the owner has full permissions, users in the same group have read and execute permissions, and other users can only read.
Full permissions (u): read+write+execute=4+2+1=7
Read and execute (g): read+execute=4+1=5
Read permission (o): read=4
I learned from the above that the permission is: 754
#chmod754anaconda-ks.cfg
Written test question: The command to set document permissions using the super administrator is #chmod-R731aaa. Is there anything unreasonable about this command?
Owner: 7=4+2+1=Read+Write+Execute
Users in the same group: 3=2+1=write+execute
Other users: 1=1=Execute
Reason: I can write but can’t read
Note: When writing permissions, never set "weird permissions" similar to the previous ones. If the numbers 2 and 3 often appear in a permission number, the permission is unreasonable.
The above is the detailed content of rpm management: Linux server software package query, uninstallation and installation guide. For more information, please follow other related articles on the PHP Chinese website!