CentOS7.5最小化安装之后的配置

我是最小化安装的,安装了之后很多基本使用配置没有,接下来要做一些配置,如网络之类的,使系统可用。

1、使命令分页显示(1页显示不不下,又不能上翻页)            xxx | more

2、查看系统安装了哪些软件包   rpm -qa

3、配置网络  最小化安装之后,ifconfig命令都不能使用,我是笔记本,所以配置无线网卡,

方法:

a、使用NetworkManager自带的nmcli命令

nmcli      我的无线网卡 wlp18s0 显示unmanaged,  plugin missing,

首先通过  nmcli dev set wlp18s0 autoconnect yes managed yes  加入托管,

然后安装wifi模块:yum install -y NetworkManager-wifi(这里最好还是用网线连接下,不然只能通过其他方式如U盘把包拷过来安装,nmtui可以打开网络配置图形界面,里面默认是有线网络配置,将automatically connected勾选,然后systemctl restart NetworkManager.service,有线网络就可以用了,通过ip addr可以看到地址了,ping www.baidu.com也能ping通了)

安装玩wifi模块后,systemctl restart NetworkManager.service,然后ip addr,plugin missing消失了,显示disconnected,接下来就可以拔网线,连wifi了。

b、连接wifi

nmcli dev wifi connect wifi名称 password WiFi密码

报错:Error: Connection activation failed: (7) Secrets were required, but not provided.

找了n多网页,有和我一样问题的,但是没有很好地解答:

https://unix.stackexchange.com/questions/420640/unable-to-connect-to-any-wifi-with-networkmanager-due-to-error-secrets-were-req

不过也学到一些知识,我最后是通过重启电脑后就可以连接上了,因为通过journalctl |tail -n 20,查看日志,已经和wifi握手多次了,最后失败,连接通道应该没问题,实在没辙了,就重启,然后就好了。

参考网址:https://www.songma.com/news/txtlist_i776v.html

nmcli d wifi list:列出当前扫描出的热点

nmcli dev  查看设备状态    nmcli dev show wlp18s0 

nmcli con  查看已存在的连接

4、关闭防火墙及自启动

# systemctl status firewalld.service ----查看firewalld服务的状态,active是启动状态,inactive是关闭状态
# systemctl stop firewalld.service ----关闭此服务
# systemctl list-unit-files |grep firewalld --查看firewalld是否开机自动启动
firewalld.service enabled ----为自动启动


# systemctl disable firewalld.service --类似以前的chkconfig xxx off,关闭开机自动启动
# systemctl list-unit-files |grep firewalld
firewalld.service disabled ----不自启动

5、关闭 selinux

# sed -i 7s/enforcing/disabled/ /etc/selinux/config --改完后,在后面重启系统生效

6、安装net-tools

使用ifconfig依赖于net-tools

yum install -y net-tools

7、开放端口,以供远程连接

8、按装wget,通过url下载

yum install -y wget

9、将源替换为阿里源,快一些

#先进入源的目录
cd /etc/yum.repo.d
#备份一下官方源
mv CentOS-Base.repo CentOS-Base.repo.bak
#将阿里源文件下载下来
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
#重建源数据缓存
yum makecache
ok,换源完成

10、将vi替换为vim

yum install -y vim-enhanced

11、lrzsz上传下载组件( 支持从windows直接拖拽文件,相当好用)

yum install -y lrzsz

12、开发工具安装

yum -y install gcc gcc-c++ gdb

猜你喜欢

转载自blog.csdn.net/chenkaifang/article/details/82531696