CENTOS7常规初始化

126 阅读1分钟

更新系统

# 更换系统源
cd /etc/yum.repos.d
mv CentOS-Base.repo CentOS-Base.repo.old
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

yum clean all
yum makecache
yum update -y

# 修改 hostname
hostnamectl set-hostname yourhostname

常规环境配置

yum install zsh git lrzsz unzip tree -y

nodejs

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.1/install.sh | bash
nvm install 12.14.1

Nginx

yum info nginx
yum install nginx -y

nginx -t

systemctl status nginx
systemctl start nginx

# nginx default work dir: /usr/share/nginx/html

常见问题

# vim异常报错
_arguments:451: _vim_files: function definition file not found

# 解决方法
rm ~/.zcompdump*
exec zsh