本文最后更新于 36 天前,如有失效请评论区留言。
su root账号
su
更改系统源
cp -a /etc/apt/sources.list /etc/apt/sources.list.bak
nano /etc/apt/sources.list
deb http://repo.huaweicloud.com/debian/ bullseye main
deb-src http://repo.huaweicloud.com/debian/ bullseye main
deb http://repo.huaweicloud.com/debian-security bullseye-security main
deb-src http://repo.huaweicloud.com/debian-security bullseye-security main
deb http://repo.huaweicloud.com/debian/ bullseye-updates main
deb-src http://repo.huaweicloud.com/debian/ bullseye-updates main
apt update
apt upgrade
apt install -y sudo libpam-modules
export PATH=$PATH:/usr/sbin/
visudo
添加用户权限
karl ALL=(ALL:ALL) ALL
su karl
sudo apt install -y ncdu htop zsh ranger neofetch git
添加git镜像
git config --global url."https://gitclone.com/".insteadOf https://
oh-my-zsh
使用gitee镜像下载并执行脚本
sh -c "$(curl -fsSL https://gitee.com/mirrors/oh-my-zsh/raw/master/tools/install.sh)"
卸载
sh -c "$(curl -fsSL https://gitee.com/mirrors/oh-my-zsh/raw/master/tools/uninstall.sh)"
多个用户如karl和root用户来回切换,但想都使用同一个oh-my-zsh可以先使用权限比较低的karl安装后,把.zshrc配置文件移动到/etc/zsh/.zshrc
mv ~/.zshrc /etc/zsh/.zshrc
vim ~/.zshrc
第一行添加
ZSH_DISABLE_COMPFIX=true
更改 zsh 值为 /ohmyzsh
export ZSH="/ohmyzsh"
安装 zsh 命令提示
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-/ohmyzsh/custom}/plugins/zsh-autosuggestions
nano ~/.zshrc
在plugins里面添加
zsh-autosuggestions
如果前面默认有其他插件需要中间添加一个空格
刷新当前环境
source ~/.zshrc