近期购置了一台腾讯云服务器,用的系统是 CentOS 7.6
,接下来记录一些配置操作。
首先配置软件源:
https://mirrors.cloud.tencent.com/help/centos.html
若使用腾讯云服务器,将源域名从 mirrors.cloud.tencent.com 改为 mirrors.tencentyun.com,使用内网流量不占用公网流量。
# vim /etc/yum.repos.d/CentOS-Base.repo
Normal模式下输入:
:%s/mirrors.cloud.tencent.com/mirrors.tencentyun.com/g
保存退出
# yum clean all
# yum makecache
更改主机名:
# vim /etc/hostname
修改成你想要的名词,重启服务器
# reboot
升级旧软件:
# yum update
安装一些软件包:
# yum install -y gcc gcc-c++ git
安装 Nginx
:https://nginx.org/en/linux_packages.html#RHEL-CentOS
为安装 Hexo 做准备:
安装 12.x 版本的 nodejs
,过高版会导致未知的 Hexo 问题!
安装的 nodejs
:https://github.com/nodesource/distributions#rpminstall
# npm install -g hexo-cli
安装 neovim
,自用:https://github.com/neovim/neovim/wiki/Installing-Neovim#centos-7--rhel-7
npm install -g yarn
# 安装 neovim 的系统剪贴板
yum install -y xclip
其他一些有用的命令
# 查看已安装软件包
# rpm -qa
# 删除软件安装包
# yum clean packages
评论区