Software management in linux system

System version: rhel8 two

Package name format

thunderbird-31.2.0-1.el7.x86_64.rpm
Software name: thunderbird
Software version: 31.2.0
Software license agreement version: el7
Software architecture: x86_ sixty-four
Software type suffix: rpm

rpm command management package

rpm 	-ivh	#Installation parameter combination - i install -v verbose -h hash
		-q 		#query
		-a 		#All
		-f 		#file	
		-p 		#software package 
		-l 		#List of software installation files 
		-e		#uninstall
		-c		#configuration file 
		-d		#explain
		--info	#software documentation
		--force	#force
		--nodeps#Ignore dependencies
		--scripts#Query the running script of the software during installation or uninstallation
		-Kv		#Detection software md5 check code
		-V		#Detect the information that the files of the installed software are modified in the system

Command line format

Examples

– scripts are useful to prevent rogue scripts from causing the system to crash during installation

Construction of local software warehouse

Build reason: the rpm command cannot solve the problem of dependency when managing the software in the system

Construction method:

Load the image used when installing the system in the system
mount /xxx/rhel-8.2-xxxxxx.iso /westos
 Write software warehouse documents
 Profile directory:/etc/yum.repos.d/
vim xxxx.repo
	[AppStream]
	name=local AppStream
	baseurl=file:///home/westos/Desktop/pwc/AppStream
	gpgcheck=0
	gpgkey=/etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
	enable=1

	[BaseOS]
	name=local BaseOS
	baseurl=file:///home/westos/Desktop/pwc/BaseOS
	gpgcheck=0

Experiment operation:

dnf clean all
dnf repolist

Test:
dnf install gcc -y

dnf software management command

dnf 	repolist	#List warehouse information
		clean all	#Make sure that the loaded warehouse cache information in the system is in / var/cache/dnf
		list all	#List all software
		list available	#Lists software that is not installed
		list installed	#List installed software
		install		#install
		remove		#uninstall
		reinstall	#Reinstall
		search		#search
		whatprovides	#All packages containing files
		history		#dnf execution history
		history info	#Details of dnf execution history
		group list	#List software groups
		group list --installed	#List installed software groups
		group list --available	#Lists software groups that are not installed
		group list --hidden	#List hidden software groups
		group install		#Install software group
		group info		#View software group information
		/etc/yum.conf Black and white list excludepkgs="*i686*"

Demonstration of some commands:

dnf search rm searches for packages with the word rm
dnf whatprovides rm all packages containing rm files

dnf group list --installed
dnf group info "Headless Management"

Download package yumdownloader command

DNF install Yum utils - y install first (in the environment where the image needs to be hung)

yumdownloader #Download the software package to the specified location on this computer
yumdownloader httpd Download the installation package of the specified software in the warehouse to the current directory
yumdownloader --destdir=/mnt Download the installation check-in of the specified software in the warehouse/mnt
yumdownloader httpd --destdir=/mnt --resolve Download the software installation package and software dependencies specified in the warehouse to/mnt

Construction of network software warehouse

Sharing mode: http: / / Hypertext Transfer Protocol
Software providing this Agreement: Apache
Package name: httpd
Shared location: / var/www/html

Installation command:

dnf install httpd -y

Install httpd first

Start sharing software Apache

systemctl disable --now firewalld  #Turn off the firewall
systemctl enable --now httpd		#Start httpd and start the next time

Create shared directory

mkdir /var/www/html/rhel8.2 #The directory rhel8.0 must be established under this directory two

Attach image to shared directory

If the image has been attached, umount /xxx/xxx is required first

mount /xxxx.iso /var/www/html/rhel8.2 #Hang the image to the directory created in the previous step


If you want to turn on the power on, automatically hang the image

vim /etc/rc.d/rc.local
		mount /xxxx.iso /var/www/html/rhel8.2
chmod 755 /etc/rc.d/rc.local #There are instructions in the document


On other hosts:
Configuration file directory: / etc / yum.com repos. d/

vim xxxx.repo
	[AppStream]
	name=local AppStream
	baseurl=http://172.25.254.xx/rhel8.2/AppStream/ #xx is the ip address of your shared host
	gpgcheck=0
	gpgkey=/etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
	enable=1

	[BaseOS]
	name=local BaseOS
	baseurl=http://172.25.254. xx/rhel8. 2 / baseos / #xx is the ip address of your shared host
	gpgcheck=0

Test in westosb

Construction of third-party software warehouse (the experimental environment is consistent with the network software warehouse)

Create shared directory: mkdir /var/www/html/software

Put all third-party software into this directory. Only rpm files can exist. Compressed packages cannot be managed with dnf

dnf install createrepo -y
	cd /var/www/html/software
	createrepo .

When downloading createrepo, if the local software warehouse is configured before, you need to modify / etc / yum.com repos. D, replace the baseurl with the network address of the above network software warehouse

Collect third-party software data and generate repodata directory

Configure on other hosts
Configuration file directory: / etc / yum.com repos. d/

vim xxxx.repo
	[software]
	name=software
	baseurl=http://172.25.254.xx/software/
	gpgcheck=0

Keywords: Linux

Added by opencombatclan on Sat, 19 Feb 2022 08:53:38 +0200