Linux学习笔记(4)--软件安装

我不是女神ヾ 2022-06-10 04:28 243阅读 0赞

Linux学习笔记(4)—软件安装

*#################################################
#shell脚本创建虚拟机
##################################################
#使用本地镜像:
#vim virt_create.sh:
#!/bin/bash#编译器
virt-install \
—cdrom /home/kiosk/rhel-server-7.3-x86_64-dvd.iso \#镜像路径
—ram 1024 \#内存大小
—vcpus 1 \#cpu数量
—file /var/lib/libvirt/images/$\
.qcow2 \#创建路径
—file-size 8 \#虚拟机大小
—name $* &#虚拟机名字参数
*********************************************************************
#使用软件生成配置文件:
#yum install system-config-kickstart#安装写配置文件的软件
**********************************************
#vim ks.cfg:#生成的自动安装的配置文件
# System bootloader configuration
bootloader —location=mbr
# Clear the Master Boot Record
zerombr
# Partition clearing information
clearpart —all —initlabel
# Disk partitioning information
part /boot —fstype=”xfs” —size=200
part swap —fstype=”swap” —size=500
part / —fstype=”xfs” —grow —size=1

%packages#安装文件的包
@base#包集
vnc#要安装的软件
%end#结束语句
***********************************************************
#ksvalidator ks.cfg #检查语法错误

#chmod +x virt_create.sh #添加执行权
#./virt_create.sh test03#执行,创建名字为:test03的虚拟机
***********************************************************
#yum install httpd -y#安装httpd
#systemctl stop firewalld#关闭防火墙
#systemctl start httpd#开启httpd
#cp ks.cfg /var/www/html/#将ks文件复制到共享目录
#就可以通过浏览器访问
*********************************************************************
#使用网络镜像的配置文件:
#vim virt_create.sh:
# #!/bin/bash
# virt-install \
# —location http://172.25.254.250/rhel7.3/x86\_64/dvd \
# —ram 1024 \
# —vcpus 1 \
# —file /var/lib/libvirt/images/$*.qcow2 \
# —file-size 8 \
# —name $* \
# —extra-args “ks=http://172.25.254.5/ks.cfg“ &
#####################################################################
#软件安装
#####################################################################
#rpm-q firefox#查看软件是否安装
#-qa#查看系统中所有安装的软件
#-e#卸载
#-ivh #安装
#-qi#查询信息
#-ql#查询安装路径
#-qf#查询文件属于安装包的名称
#-ivh firefox-45.4.0-1.el7_2.x86_64.rpm —force#强制安装
##########################################################
#yum命令
##########################################################
#可以解决软件的依赖关系
yum install firefox
yum remove firefox
yum list installed
yum list available
yum info firefox
yum whatprovides /usr/bin/firefox
yum search gcc
##########################################################**

发表评论

表情:
评论列表 (有 0 条评论,243人围观)

还没有评论,来说两句吧...

相关阅读

    相关 Linux学习笔记-----Linux安装

    出现的问题: 1.在安装期间,一不小心不能进入图形化的安装界面 原因:在为Centos 6设置内存时,把内存设置的过小,因为图形化的安装界面对内存有要求,当内存过小,无法启