1.rpm Command application:
Attach the ISO image to a directory (mount) and go to the packages in that directory to see all the packages that can be installed.
RPM-IVH xxx.rpm Install package software
RPM-QP xxx.rpm Query the name of the package in the system
rpm-e xxx Uninstall Software
RPM-QL xxx Query Install which files are new to the software
RPM-QF filename The file is provided by which package
Rpm-qa to query all installed packages
Rpm-qa | grep httpd query httpd software is installed
rpm-q xxx--scripts Query install software and uninstall software which commands are executed
RPM-IVH xxx.rpm--force Mandatory installation package (eg: when the package is installed to reinstall)
RPM-IVH xxx.rpm--nodeps Ignore dependency installation package (eg: ring dependent when installing packages)
2. Build a local Yum repository:
(1). Need an installation image that matches this machine, Rhel-server-7.0-x86_64-dvd.iso, this file is downloaded from the official website
(2). Mountrhel-server-7.0-x86_64-dvd.iso/hello
(3). rm-fr/etc/yum.repos.d/*
(4). Vim/etc/yum.repos.d/yum.repo # #注意: Be sure to end with. Repo
[Redhatsoftware] # # #仓库名称
Name=localsoftware # # #仓库描述
Baseurl=file:///hello # # #仓库地址
Gpgcheck=0 # # #是否检测软件的gpgkey
(5). Check if the local Yum warehouse is successful?
Yum Clean All # #清空yum仓库的缓存
Yum Repolist # #列出该yum仓库中可安装的软件包
3. Build the network Yum repository: Build a yum repository, and the other hosts just need to modify the Yum configuration file to install the software
(1). Install the HTTPD service (yum install httpd-y), turn off the firewall, start the httpd service
(2). Clean up settings for local yum repositories
Umount/hello
(3). Mount the ISO image to/var/www/html/rhel7.0
mkdir/var/www/html/rhel7.0
Mount rhel-server-7.0-x86_64-dvd.iso/var/www/html/rhel7.0
Detect shared success: Browser access http://ip/rhel7.0
(4). Modify Yum Profile/etc/yum.repos.d/yum.repo (baseurl=http://ip/rhel7.0)
(5). Check if the network Yum Warehouse is successful?
Yum Clean All # #清空yum仓库的缓存
Yum Repolist # #列出该yum仓库中可安装的软件包
(6). Note: If other hosts on the network want to install the software, you only need to change the Yum configuration file
rm-fr/etc/yum.repos.d/*
Vim/etc/yum.repos.d/yum.repo
(baseurl=http://ip/rhel7.0)
After you set up a restart, you can also use:
Systemctl Disable FIREWALLD
Systemctl Enable httpd
Vim/etc/fstab
Mount/root/desktop/rhel-server-7.0-x86_64-dvd.iso/var/www/html/rhel7.0default 0 0
3. Construction of third-party warehouses
(1). Place all RPM packages in the specified directory, such as Square to/software
(2). Execute createrepo/software in this directory, generate Repodate directory
(3). Write/etc/yum.repos.d/xxx.repo specify/software-bit yum source
Linux Beginner Notes 03