dyysh

vmware虚拟机 linux 本地yum源,网卡配置ens33,防火墙selinux vim

 

1、挂载镜像文件,CentOS-7-x86_64-DVD-1804.iso,并且要处于连接状态

#光盘挂载至/mnt
mount /dev/sr0 /mnt

#备份yum源文件
cd /etc/yum.repos.d/
mkdir -p ./bak
mv CentOS* ./bak

#编缉本地源
vim local.repo
[centos7]
name=CentOS7
baseurl=file:///mnt
enable=1
gpgcheck=0

 

配置公网阿里云和163源
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
#配置公网yun源
yum clean all
yum makecache
yum install -y epel-release
wget -O /etc/yum.repos.d/CentOS7-Base-163.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo
yum clean all
yum makecache
yum install -y epel-release

 

############################################33

 

 

关闭防火墙并设置开机不启动
firewall 服务开启与关闭
firewalld状态:# systemctl status firewalld.service
关闭 firewalld:# systemctl stop firewalld
开启firewalld:# systemctl start firewalld
开机自动关闭firewalld:# systemctl disable firewalld
开机自动启动firewalld:# systemctl enable firewalld
查看开机是否启动服务:# chkconfig --list|grepnetwork ##centos 6
临时关闭和永久关闭selinux
临时关闭selinux
# getenforce
Enforcing
# setenforce 0
setenforce: SELinux is disabled
永久关闭selinux
# vim /etc/selinux/config
改:SELINUX=enforcing
为:SELINUX=disabled
# reboot //重启系统生效

 

 

3、固定虚拟机的网卡
在linux操作系统终端执行如下命令:
#进入网卡所在目录
[root@localhost~]#cd /etc/sysconfig/network-scripts/
#安装vim编缉器
[root@localhostnetwork-scripts]#yum install vim -y(需要虚拟机可以上外网)
#编缉网卡,固定ip地址
[root@localhostnetwork-scripts]#vim ifcfg-ens33(修改网卡内容如下)
TYPE="Ethernet"
BOOTPROTO="none"
DEFROUTE="yes"
NAME="ens33"
DEVICE="ens33"
ONBOOT="yes"
IPADDR=192.168.100.200
NETMASK=255.255.255.0
GATEWAY=192.168.100.2
DNS1=114.114.114.114
#使用systemctl管理工具重启网卡
[root@localhostnetwork-scripts]#systemctl restart network
执行ipa,查看linuxip地址

 

 在xshell软件里输入 reconnect是再连接

 

ctrl + v 进入visual模式下

 

按上下左右箭头连续选中多行空间

 

shift + i 进入insert模式

 

输入# 后,按esc键

 

------------------------------

 

删除多行开头#

 

ctrl + v 进入 visual模式
按上下光标键连续选中多行
按d键一并删除

 

reconnect再连接
reload
rpm -qa | wc -l 计系统下安装的软件包数量
rpm -ql 询软件细信息
rpm -qc 查询配置
rpm -e 删除软件
rpm -ivh 安装软件

 

2、写出以下命令的含义
yum list 列出所有yum可用安装软件包
yum search 查询yum安装包
yum install yum安装
yum clean 清空yum缓存
yum makecache fast 创建缓存
yum remove 删除软件

 

 

posted on 2023-12-21 11:12  dyysH  阅读(121)  评论(1编辑  收藏  举报

导航