Linux learning basics part (11) yum source

2. How to install the software
1.rpm
rpm -ivh name.rpm install, -v display the process, -h specifies the encryption method as hash
    -e name uninstall
    -ql name query software generated file
    -qlp name.rpm query software will be generated after installation What file
    -qa Query the names of all software installed in the system
    -qa |grep name Query whether the software is installed
    -q name . . . .
    -qp name.rpm Query the name of the software installation package after installation
    -qf filename Check which installation package filename belongs to
    -ivh name.rpm --force Force installation, but cannot ignore dependencies
    -ivh name.rpm --nodeps --force ignore Dependency and forced installation
    -qi name View software information
    -Kv name.rpm Detect whether the software package has been tampered with
    -qp name.rpm --scripts Detect the actions performed by the software during the installation or uninstallation process

2.yum
yum
upper-level software management tool, The most important function is to resolve software dependencies
The premise that yum can be put into use is that there must be a yum source and a pointing file of the configuration source

1. The iso image file matching the version of the local system from the network

rhel-server-7.1-x86_64-dvd.iso



2. Mount rhel-server-7.1-x86_64-dvd.iso to /mnt to access the files in the mirror

mount rhel-server-7.1-x86_64-dvd.iso /mnt



3. Configure the local yum source to point to
rm -fr /etc/yum.repos.d/*

vim /etc/yum.repos.d/yum.repo


[Server]
name=rhel7.1
baseurl=file:///mnt

gpgcheck=0



4. Install the resource sharing service

yum install httpd -y


systemctl stop firewalld  
systemctl disable firewalld
systemctl start httpd
systemctl enable httpd

5. Create a shared directory and mount the mirror file to the shared directory
mkdir /var/www/html/rhel7.1
mount rhel-server-7.1-x86_64-dvd.iso /var/www/html/rhel7.1

6. Test Enter
in the browser: http:172.25.254.148/rhel7.1/

Can see the content in the mirror



7. Modify the local yum source point

vim /etc/yum.repos.d/yum.repo

[server]
name=rhel7.1
baseurl=file://var/www/html/rhel7.1
gpgcheck=0

8. Automatically mount on iso
vim /etc/rc.d/rc.local
mount rhel-server-7.1 -x86_64-dvd.iso /var/www/html/rhel7.1 (Note: This mirror mount path is an absolute path)
:wq

chmod +x /etc/rc.d/rc.loca

l

just reboot


9 Install third-party software
  1. Shield 32-bit packages
    vim /etc/yum.conf

    exclude=*.i686


  2. Download the software lftp 172.25.254.250
  3. Install the software rpm
    rpm -Kv softwarename.rpm ##Check whether the software package has been tampered with
    rpm -ivh softwarename.rpm ##Check the dependencies of the software package
1
    rpm -qp softwarename.rpm -- scripts ##View the actions of the software package during the installation or uninstallation process
2
   Note: In order to install normally and ensure system security, the information of the above 3 commands must be checked before installation
    rpm -ivh softwarename.rpm --nodeps ##Ignore software dependencies , but can't install
3
    rpm -ivh softwarename.rpm --force ##Force install package, but can't use
4
    rpm -ivh softwarename.rpm --nodeps --force ##Ignore software dependencies and force install
5
zhuyi
    rpm -e softwarename Uninstall software
    rpm -q softwarename Query software  
    rpm -ql softwarename Query software generation software
6
    rpm -qlp softwarename.rpm Query what files are generated after the software is installed
    rpm -qa | grep softwarename Query whether the software is installed
7
    rpm -qp softwarename.rpm Query the name of the software package after installation
8
    rpm -qf filename Check the software package to which filename belongs
    rpm -qi softwarename View software information
  4. Third-party software library
    example: the software package is in /mnt Note: /mnt can only contain rpm files
    to read software package-related data
    createrepo -v /mnt /mnt will generate a repodata file
    Modify the configuration file
    vim /etc /yum.repos.d/yum.repo Add baseurl=file:///mnt
    yum clean all
    yum search softwarename
   

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325447147&siteId=291194637