Table of Contents
1. Linux software installation
rpm installation:
rpm query:
uninstall:
Mount:
2. Compile and install
Installation process:
Step 1: tar unpacking
Step 2: ./config configuration
Step 3: make compile
Step 4: make install installation
3. yum warehouse installation
principle:
Building process:
1. Linux software installation
Can be divided into 3 major categories:
1.rpm is similar to 360 Software Manager, a tool developed by Red Hat
2. Compile and install. Compile the source code into an executable file (binary package). High degree of freedom and high difficulty.
3. The last thing used by yum is rpm, which is an upgraded version of rpm.
rpm installation:
rpm -ivh package
rpm usage format: rpm[option]software name
[options]
- -i means installation (if there are other dependent packages, you will be prompted but will not install them directly)
- -v indicates to display the installation process
- -h human language display
- -e Uninstall software Q (can only uninstall one, installed dependent packages will not be uninstalled)
- -q Check whether the software is installed#H#
- -qc View all installed configuration files##f#f
rpm query:
rpm -q httpd #Check whether the httpd software package is installed
rpm -ql httpd #File list
rpm -qc httpd #Query the configuration file of httpd software
rpm -qi httpd #Query the basic information of the software
rmp -qa httpd #Query all files of the software
Uninstall:
rpm -e software name
Mount:
Mount: Use a folder in the system to associate with a foreign hardware device. Using this folder is equivalent to using the hardware device.
All foreign hardware devices must be mounted if you want to use them in Linux
Mount command:
- mount /dev/sr0 (optical drive) /mnt
- /dev/cdrom (optical drive) /mnt
Unmount command:
- umount /mnt
- umount /dev/sr0
2. Compile and install
Compile installation process:
Step 1: tar unpacking
Step 2: ./config configuration
./configure: Script file. The script written by the developer is placed in the source code directory for human use.
effect:
Detect the compilation environment (whether the dependent packages are installed completely gcc gcc-c++)
Select the installation path. Yum and rpm will install the software in the etc directory by default. You can freely choose the installation path when compiling.
Add and reduce the functions of the installation package –help –prefix specifies the installation path yum and rpm installation only compiles commonly used functions, and some uncommon ones
Step 3: make compile
make:
Translate high-level languages used by humans into binary
-j 2 Use 2 CPUs to compile
will form a binary file
Step 4: make install installation
make install:
Copy this binary file and supporting files to the directory specified previously
3. yum warehouse installation
Principle:
- yum repository automatically resolves dependencies
- client/server
- yum install package
Building process:
Local itself is both a server and a client
Local machine: installation package meta information configuration file
Meta information:
1. Born by others
2. Build it yourself
The server must have two folders
repodata must be called this name
packages installation package file
Code:
mount /dev/sr0 /mnt #To prepare the server, you must have two folders cd /etc/yum.repos.d # Switch to the specified directory of the configuration file mkdir bak #Create backup folder mv *.repo bak #Move the network source to the backup folder to reduce the impact vim local.repo [cxk] #Description of warehouse name=cxk #The name of the warehouse baseurl = file:///mnt #The location of the installation package gpgcheck = 0 #Do not verify the security of the installation package Note: The configuration file must end with *.repo yum clean all #Clear cache yum makecache #Regenerate meta information