CentOS 8 Stream 使用常见问题
较之前的CentOS x. version, CentOS 8 Stream 有一些改变,以下是使用时遇到的问题
mail命令找不到
mail发送失败
Vim 默认文件设置不生效
1. mail的使用
command not found
yum -y install mailx
mail 不生效,邮件发送失败,需要查看日志
cat /var/log/maillog
发现 connection refused by 127.0.0.1
Aug 12 12:34:29 localhost sendmail[2508]: 37CGYTvt002508: from=root, size=220, class=0, nrcpts=1, msgid=<202308121634.37CGYTvt002508@localhost.localdomain>, relay=root@localhost
Aug 12 12:34:29 localhost sendmail[2508]: 37CGYTvt002508: to=root, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30220, relay=[127.0.0.1] [127.0.0.1], dsn=4.0.0, stat=Deferred: Connection refused by [127.0.0.1]
2. Vim 默认配置文件.vimrc不生效
在新的版本Stream中,Vim默认配置文件是在/etc 目录下,不再是.vimrc,是 vimrc 和 virc
cd /etc
ls -l
-rw-r--r--. 1 root root 1982 Jun 27 2022 vimrc
-rw-r--r--. 1 root root 1204 Jun 27 2022 virc
修改virc,默认打开文件添加行号, 这里只能输入一些简单指令, 输入指令内保存后生效
vi /etc/virc
:
set nu
wq!
保存并退出编辑器,这样默认设置自动添加行号就生效了