1. Install the software using an existing network installation resource
/etc/yum.repos.d/can not have unusable source files, if you do not have to delete the backup
1. Edit file: Vim/etc/yum.repos.d/yum.repo # #文件名字随意, must be repo end
Write content:
[rhel7.3] ##给软件仓库名字name=rhel7.2 ##对软件仓库的描述baseurl=资源地址 ##网络安装源地址gpgcheck=0 ##不检测gpgkeyenabled=1 ##表示此安装源语句快生效(不写这句也可以,因为系统默认生效)
Save exit
yum clean all ##清空yum缓存识别新配置yum repolist ##列出软件仓信息
2. Build local Yum Source
1. iso image file matching from the network up-down native system version
My installation system is 7.3 So choose the image that matches it: Rhel-server-7.3-x86_64-dvd.iso
2. Hang the Rhel-server-7.3-x86_64-dvd.iso to/mnt to access the files in the image
mount rhel-server-7.2-x86_64-dvd.iso /mnt
3. Set the boot automatically mount ISO
Edit file: vim/etc/rc.d/rc.local
Add Content:
mount rhel-server-7.0-x86_64-dvd.iso /mnt
Save exit
4. Enable the file to run automatically at boot time with executable permission
chmod +x /etc/rc.d/rc.local
4. Configure the native Yum source to point to
Edit file: Vim/etc/yum.repos.d/yum.repo
yum clean all ##清空yum缓存识别新配置
3. Deploying a shared Yum source
1. Install the HTTPD service on a host that is already connected to a local source:
yum install httpd -y
Installation succeeded:
2. Configure the network Yum source
Systemctl Stop Firewalld
Systemctl Disable FIREWALLD
Systemctl Start httpd
Systemctl Enable httpd
3. Create the shared directory and hang it on the image file to the shared directory (httpd default share/var/www/html this directory)
mkdir /var/www/html/rhel7.2mount /iso/rhel-server-7.3-x86_64-dvd.iso /var/www/html/rhel7.2
4. Testing
Enter in the browser:/HTTP//native ip/rhel7.3
You can see what's in the image
5. You can now modify the local Yum source point, pointing directly to the local mirror Mount location
yum clean all ##清空yum缓存识别新配置
6. Boot automatically hangs in ISO to shared directory
vim /etc/rc.d/rc.localmount rhel-server-7.2-x86_64-dvd.iso /var/www/html/rhel7.2
If you do not have permission to change this file before, you also need to add execute permission to it; chmod +x/etc/rc.d/rc.local
# # # #1. Software name Recognition # # #
[abrt-addon-ccpp]-[2.1.11-19].[el7].[x86_64].rpm(1)软件名称 (2)软件版本 (3)软件适用系统 64位 (4)rpm结尾的适用与redhat操作系统
4.yum command
Yum
Top software management tools, the most important function is to solve the dependency relationship of software
Yum can be put into use only if there is a Yum source, and the configuration source points to the file
The use of the Yum command must be successful only after the YM source has been successfully built
yum install softwarename ##安装 repolist ##列出设定yum源信息 list softwarename ##查看软件源中是否有次软件 list all ##列出所有软件名称 list installd ##列出已经安装的软件名称 list available ##列出可以用yum安装的软件名称 clean all ##清空yum缓存 reinstall softwarename ##重新安装 remove softwarename ##卸载 info softwarename ##查看软件信息 search softwareinfo ##根据软件信息搜索软件名字 whatprovides filename ##在yum源中查找包含filename文件的软件包 update ##更新软件 history ##查看系统软件改变历史 groups list ##查看软件组信息 groups info softwaregroup ##查看软件组内包含的软件 groups install softwaregroup ##安装组件 groups remove softwaregroup ##卸载组件
64-bit installation software in a shielded software warehouse:
Modified files: vim/etc/yum.conf
Add Content:
Exclude=*x86_64
5. Installing third-party software: rpm
1.rpm command
rpm -ivh name.rpm ##安装 ,-i安装,-v显示过程,-h指定加密方式为hash -e name ##卸载 -ql name ##查询生成文件及路径 -qlp name.rpm ##查询软件安装后会生成什么文件 -qa ##查询系统中安装的所有软件名称 -qa |grep name ##查询软件是否安装 -qp name.rpm ##查询软件安装包安装后的名字 -qf filename ##查看filename属于那个安装包 -ivh name.rpm --force ##强制安装,但不能忽略依赖性 -ivh name.rpm --nodeps --force ##忽略依赖性并且强制安装 -qi name ##查看软件信息 -Kv name.rpm ##检测软件包是否被篡改 -qp name.rpm --scripts ##检测软件在安装或卸载过程中执行的动作 -scripts ##查看脚本
6. Building of third-party software repositories
1. Place all RPM packages in a directory where only the RPM files exist
2. Execute command: createrepo-v the directory where the package is stored
3. Edit file: Vim/etc/yum.repo.d/yum.repo(mentioned earlier, this file can be arbitrarily named, but it is best to standardize the naming.) This is still for Yum.repo. Remember to end with. Repo)
[Software]
Name=software
BASEURL=FILE:///RPM Storage Directory
Gpgcheck=0
Save exit.
Yum Clean All
View the software put into the warehouse: Yum list softname
7. Production of automatic virtual machine installation script
After the system can install the software, we can download a software: System-config-kickstart, using this software to assist the generation of files, so that the real automatic installation of virtual machines, not in the interactive interface operation.
Operation Steps:
1. Install the software: Yum install System-config-kickstart httpd-y
2 opening software Settings installation options
Execute command to open the software: System-config-kickstart
Set individual options. Options that are not set are all default and do not have to be written. Then click File in the upper left corner to save, point filesystem save to/var/www/html.
First step: basic information
Step Two: Installation method
Step Three: Guide
Fourth Step: Partitioning
To add a swap partition:
To add a boot partition:
To add a root directory:
Fifth Step: Network mode
Sixth step: Firewall off by default
Seventh Step: Save the file
3. In/var/www/html This directory will have a file: Ks.cfg. edit this file.
Add the following to the end of the file:
%packages@base ##安装系统时安装基本软件包lftp ##安装lftp软件@x11 ##图形界面软件(可以先不安装,以提高安装速度)%end%postcat >>/etc/yum.repos.d/yum.repo <<EOF[rhel7.2]name=rhel7.2baseurl=http://172.25.158.250/rhel7.3 ##源地址gpgcheck=0EOF%end
Save exit.
4. Detect if the written statement syntax is incorrect:
Ksvalidator ks.cfg
5. Turn on HTPD service: Systemctl start httpd
Shut down firewall: Systemctl stop FIREWALLD
Systemctl Disable FIREWALLD
6. Write execution script: Vim install_vm.sh
#!/bin/bashvirt-install \ ##安装虚拟机--name $1 \ ##虚拟机名字--ram 1024 \ ##内存大小--cpus 1 \ ##cpu颗数--disk /var/lib/libvirt/images/$1.qcow2,size=9,bus=virtio \ ##盘--network bridge=br0,model=virtio \ ##网络--location http://172.25.158.250/rhel7.3 \ ##源地址--extra-args ks=http://172.25.158.250/ks.cfg &
Save exit.
7. Execute script: SH install_vm.sh virtual machine name
The virtual machine is establishing the installation:
Installation Complete:
Linux (Radhat) Basic Learning-Software Installation