Software installation and yum source building

Software installation

1.rpm

rpm -ivh    name.rpm                             ###Install, - v display process, - h specifies hash as encryption method
    -e  name                                     ###uninstall
    -ql name                                     ###Query software generation file
    -qlp    name.rpm                             ###Query what files will be generated after software installation
    -qa                                          ###Query all software names installed in the system
    -qa |grep name                               ###Check whether the software is installed
    -qp name.rpm                                 ###Query the name of the software installation package after installation
    -qf filename                                 ###View the installation package to which filename belongs
    -ivh name.rpm --force                        ###Force installation, but do not ignore dependencies
    -ivh name.rpm --nodeps --force               ###Ignore dependencies and force installation
    -qi name                                     ###View software information
    -Kv name.rpm                                 ###Detect whether the package has been tampered with
    -qp name.rpm --scripts                       ###Detect actions performed by software during installation or uninstallation

2.yum

yum     install     softwarename                  ###install
        repolist                                  ###List settings yum source information
        remove      softwarename                  ###uninstall
        list        softwarename                  ###Check whether there is secondary software in the software source
        list all                                  ###List all software names
        list installd                             ###List installed software names
        list available                            ###List the software names that can be installed using yum
        clean all                                 ###Clear yum cache
        search      softwareinfo                  ###Search software name based on software information
        whatprovides    filename                  ###Find the package containing filename file in yum source, and accidentally delete / bin/ls      
        update                                    ###Update software
        history                                   ###View system software change history
        reinstall   softwarename                  ###Reinstall
        info        softwarename                  ###View software information
        groups list                               ###View software group information
        groups info softwaregroup                 ###View the software included in the software group
        groups install  softwaregroup             ###Installation components
        groups remove   softwaregroup             ###Uninstall components

yum software warehouse building

1. Construction of local third-party software warehouse
Take rpm package of wps as an example

mkdir -p /software                                        ###Create rpm package directory
cp /wps-office-9.1.0.4961-1.a18p1.x86_64.rpm /software/   ###Copy wps to rpm                             

Generate repodata

createrepo -v /software

Delete redundant repo files

rm -rf /etc/yum.repos.d/*

Create yum.repo

[software]                                         ###Software warehouse name                                 
name=software                                      ###Warehouse description
baseurl=file:///software                           ###Mount location    
gpgcheck=0                                         ###Do not detect gpgkey

Clear cache and view yum warehouse

yum clean all

Building yum warehouse based on httpd

Advantages: the same network segment can be accessed without building multiple local warehouses, which is convenient for management

Let's take the image of RedHat 7.3 as an example

mkdir /rhel7.3                                                                ###Create a mount directory
mount /redhat7.3/rhel-server-7.3-x86_64-dvd.iso /rhel7.3                      ###Mount the image location to / rhel7.3

View mount

Delete redundant repo files

rm -rf /etc/yum.repos.d/*

Create yum.repo

[rhel7.3]                                         ###Software warehouse name                                 
name=rhel7.3                                      ###Warehouse description
baseurl=file:///rhel7.3                           ###Mount location    
gpgcheck=0                                        ###Do not detect gpgkey
yum clean all                                      ###wipe cache 
yum repolist                                       ###See

Download the httpd service through the temporary yum warehouse

yum install httpd -y                             ###Download httpd service
systemctl start httpd                            ###Open service
chkconfig httpd on                               ###Power on auto restart service
systemctl stop firewalld                         ###Turn off firewall
systemctl mask firewalld                         ###Freeze firewall

Set up the directory / var/www/html/rhel7.3 and mount it

umount /dev/loop2                                                                 ###Contact mount
mkdir -p /var/www/html/rhel7.3                                                    ###Create mount directory
mount /redhat7.3/rhel-server-7.3-x86_64-dvd.iso /rhel7.3 /var/www/html/rhel7.3    ###mount
echo "mount /redhat7.3/rhel-server-7.3-x86_64-dvd.iso /rhel7.3 /var/www/html/rhel7.3" >> /etc/rc.d/rc.local                                                                           ###Power on auto mount
chmod 755 -R /etc/rc.d/rc.local                                                   ###Give execution permission

View your own ip

Delete redundant repo files

rm -rf /etc/yum.repos.d/*

Create yum.repo

[rhel7.3]
name=rhel7.3
baseurl=http://172.25.254.56/rhel7.3                       ###IP in the middle
gpgcheck=0

View results

yum clean all                                      ###wipe cache 
yum repolist                                       ###See

In this way, the yum warehouse based on httpd is built!!!

Tags: yum RPM RHEL firewall

Posted on Mon, 04 May 2020 00:38:57 -0700 by tom2oo8