Xiangxiang's Personal Site

Machine Learning & Security Engineer
生命不息,折腾不止,留下一点活着的记录.

View on GitHub
23 November 2018

CentOS settings(持续更新中)

by xiangxiang

CentOS/RHEL是最流行的服务器操作系统,所以我选择CentOS作为开发部署环境。 本文主要是配置CentOS至中国国内的源并安装常用的开发依赖。

CentOS安装

#### centos7
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
curl https://lug.ustc.edu.cn/wiki/_export/code/mirrors/help/centos?codeblock=3 --output /etc/yum.repos.d/CentOS-Base.repo
yum makecache
sudo yum install -y open-vm-tools
reboot

#### 更新系统
sudo yum check-update
sudo yum update

#### 开发环境工具
yum groupinstall 'Development Tools' -y

docker

sudo yum install -y yum-utils device-mapper-persistent-data lvm2
curl https://download.docker.com/linux/centos/docker-ce.repo --output /etc/yum.repos.d/docker-ce.repo
sudo sed -i 's+download.docker.com+mirrors.ustc.edu.cn/docker-ce+' /etc/yum.repos.d/docker-ce.repo
sudo yum makecache fast
sudo yum install docker-ce docker-ce-cli containerd.io
sudo systemctl enable docker
sudo systemctl start docker
{
  "registry-mirrors": ["https://docker.mirrors.ustc.edu.cn/"]
}

python

sudo yum -y install python-virtualenv
sudo yum -y install python3 python3-pip python3-wheel python3-devel
[global]
index-url = https://mirrors.ustc.edu.cn/pypi/web/simple
format = columns

disable firewall

systemctl disable firewalld

Clean disk space

find /var -name "*.log" -exec truncate {} --size 0 \;
yum clean all
rm -rf /var/cache/yum
rm -rf /var/tmp/yum-*
package-cleanup --quiet --leaves --exclude-bin | xargs yum remove -y
package-cleanup --oldkernels --count=1
history -c

mount VMware shared folders

/usr/bin/vmhgfs-fuse .host:/ /mnt/hgfs -o subtype=vmhgfs-fuse,allow_other
tags: centos docker dev vmware virtualbox