Linux extensions
Package management
RPM
RPM overview
RPM(RedHat Package Manager),RedHat package management tool, similar to setup.exe in Windows, is a packaged installation tool in the Linux series of operating systems. Although it is the logo of RedHat, the concept is universal.
RPM package name format Apache-1.3.23-11.i386.rpm
"apache" software name
"1.3.23-11" The version number of the software, the main version and this version
"i386" is the hardware platform on which the software runs, the collective name for Intel 32-bit processors
“rpm” file extension, representing RPM package
RPM query command
-
basic grammar
rpm -qa Function description: Query all installed rpm packages
-
experience skills
Since there are many software packages, filtering is generally adopted. rpm -qa | grep rpm package
-
Practical examples
Check the installation status of firefox software
[guozihan@hadoop100 ~] $ rpm | grep firefox
firefox-102.14.0-3.el7.centos.x86_64
RPM uninstall command
-
basic grammar
(1) rpm -e RPM package
(2) rpm -e --nodeps software package
-
Option description
-e Uninstall a package
–nodeps When uninstalling software, dependencies are not checked. In this case, software that uses this package may not work properly after this
-
Practical examples
Uninstall firefox software
[root@hadoop101 Packages]# rpm -e firefox
RPM installation command
-
basic grammar
rpm -ivh RPM package full name
-
Option description
-i install, install
-v –verbose, show detailed information
-h –hash, progress bar
–nodeps Do not check dependencies before installation (operate with caution)
YUM warehouse configuration
YUM Overview
YUM (full name Yellow dog Updater, Modified) isA shell front-end package manager for Fedora and RedHat and CentOS. Based on RPM package management,It can automatically download and install RPM packages from a designated server, automatically handle dependencies, and install all dependent software packages at once, without the need to download and install them again and again.
Common commands of YUM
-
basic grammar
yum [options] [parameters]
-
Option description
-y Answer "yes" to all questions
-
Parameter Description
install Install rpm package
update Update rpm package
check-update Check if there is an updated rpm package available
remove Delete the specified rpm package
list Show package information
clean Clean yum expired cache
depletShow all dependencies of yum package
-
Case practice
Use yum to display all dependencies of firefox
[guozihan@hadoop100 ~]$ yum deplist firefox
Modify network YUM source
The default system YUM source needs to connect to foreign apache website, and the network speed is relatively slow., you can modify the associated network YUM source to be a domestic mirror website, such as NetEase 163, aliyun, etc.
Install wget, wget is used to download files from the specified URL
[root@hadoop101 ~] yum install wget
In the /etc/yum.repos.d/ directory, back up the default repos file
[root@hadoop101 yum.repos.d] cp CentOS-Base.repo CentOS-Base .repo.backup
Download the repos file of NetEase 163 or aliyun
[root@hadoop101 yum.repos.d] wget http://mirrors.aliyun.com/repo/Centos-7.repo //Alibaba Cloud [root@hadoop101 yum.repos.d] wget http://mirrors.163 .com/.help/CentOS7-Base-163.repo //NetEase 163
Replace the default repos file with the downloaded repos file
[root@hadoop100 yum.repos.d]# mv Centos-7.repo CentOS-Base.repo
Clean old cached data and cache new data
[root@hadoop101 yum.repos.d]#yum clean all
Clone a virtual machine
clone
Modify system-related configurations at startup
Modify IP address
Modify vim /etc/sysconfig/network-scripts/ifcfg-ens33 and modify the IP address
Change the IP address 192.168.182.100 to 192.168.182.101
Modify hostname
Modify /etc/hostname and modify the host name
Change the host name from hadoop100 to hadoop101