CentOS7基本配置

Terwer 后端开发 Linux评论231字数 2073阅读6分54秒阅读模式

设置中科大源

注意:需要先切换root用户文章源自浅海拾贝-https://blog.terwergreen.com/centos7-basic-configuration-1emazl.html

su -
# ===================================
# 镜像源设置开始
# ===================================
# 添加中科大centos7镜像源
cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak \
    && sed -e 's|^mirrorlist=|#mirrorlist=|g' \
         -e 's|^#baseurl=http://mirror.centos.org/centos|baseurl=https://mirrors.ustc.edu.cn/centos|g' \
         -i.bak \
         /etc/yum.repos.d/CentOS-Base.repo

yum makecache \
    && yum clean all

安装开发工具包、系统软件

# 安装epel源
yum install epel-release -y

# 安装DNF
yum install dnf -y
# 安装dnf插件及neofetch
dnf install dnf-plugins-core -y
dnf copr enable konimex/neofetch -y
dnf install neofetch -y

安装开发工具

# 安装开发工具
dnf groupinstall "Development Tools" -y

# dnf groupinstall "X Window System" -y \
#     && dnf groupinstall xfce -y \
#     && dnf install pixman pixman-devel libXfont -y

# 升级git2
dnf install \
    https://repo.ius.io/ius-release-el7.rpm \
    https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm \
    -y
dnf remove git -y
dnf install git236 -y

安装Vim等工具

# 安装其他工具包
dnf install sudo \
    vim \
    net-tools \
    wget \
    -y

安装zsh

 dnf install zsh -y

安装on-my-zsh

# 给root用户安装oh-my-zsh
git clone https://gitee.com/mirrors/oh-my-zsh.git ~/.oh-my-zsh \
    && cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc \
    && git clone https://gitee.com/playerfs/zsh-autosuggestions.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions \
    && git clone https://gitee.com/playerfs/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting \
    && sed -i 's/^plugins=(/plugins=(zsh-autosuggestions zsh-syntax-highlighting /' ~/.zshrc \
    && chsh -s /bin/zsh

# 为普通用户再安装一次oh-my-zsh
git clone https://gitee.com/mirrors/oh-my-zsh.git ~/.oh-my-zsh \
    && cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc \
    && git clone https://gitee.com/playerfs/zsh-autosuggestions.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions \
    && git clone https://gitee.com/playerfs/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting \
    && sed -i 's/^plugins=(/plugins=(zsh-autosuggestions zsh-syntax-highlighting /' ~/.zshrc
# 添加自定义环境变量
echo "source ~/my_profile.sh" >> ~/.zshrc
chsh -s /bin/zsh

vim ~/my_profile.sh

文章源自浅海拾贝-https://blog.terwergreen.com/centos7-basic-configuration-1emazl.html

参考

https://github.com/terwer/portable-centos-7-workstation/blob/main/centos-7-vnc/Dockerfile文章源自浅海拾贝-https://blog.terwergreen.com/centos7-basic-configuration-1emazl.html

文章源自浅海拾贝-https://blog.terwergreen.com/centos7-basic-configuration-1emazl.html

相关文章
  • 扫码加我微信
  • 验证消息请输入:来自你的博客
  • weinxin
  • 我的微信公众号
  • 微信扫一扫与我交流吧
  • weinxin
Terwer
匿名

发表评论

匿名网友 填写信息

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: