Skip to content

准备环境

毛主席:农业生产是我们经济建设工作的第一位

设置pkg

  • 登录Linux(Ubuntu、Debian、CentOS)之后,控制台粘贴
sh
curl -L https://raw.githubusercontent.com/mandfx/OTA/manos/pkg -o /usr/bin/pkg && chmod a+x /usr/bin/pkg
And
curl -L https://gitee.com/mandfx/OTA/raw/manos/pkg -o /usr/bin/pkg && chmod a+x /usr/bin/pkg

更新软件

  • nano /etc/apt/sources.list # 编辑软件源
sh
pkg update		# sudo apt update
pkg upgrade		# sudo apt upgrade -y

卸载软件

sh
dpkg -l | grep php			#查找Php相关包
pkg remove --purge php*		#卸载所有Php包

切换软件源

sh
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-8.repo
pkg clean all			#清除缓存
pkg makecache			#生成缓存
pkg repolist			#查看软件源
sh
sed -i "s@\(archive\|security\).ubuntu.com@mirrors.aliyun.com@g" /etc/apt/sources.list
sed -i "s@\(archive\|security\).ubuntu.com@mirrors.tencent.com@g" /etc/apt/sources.list
And
sed -i "s@http://\(deb\|security\).debian.org@http://mirrors.aliyun.com@g" /etc/apt/sources.list
sed -i "s@http://\(deb\|security\).debian.org@http://mirrors.tencent.com@g" /etc/apt/sources.list
sh
pip config set global.index-url https://mirrors.aliyun.com/pypi/simple
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
pip config get global.index-url			#查看设置源
pip config list
sh
npm config set registry https://registry.npm.taobao.org
yarn config set registry https://registry.npmmirror.com

可能需要

  • 安装zsh替代bash
sh
pkg install zsh					#安装
chsh -s $(which zsh)			#替换bash、检查echo $SHELL
  • 安装oh-my-zsh及插件
sh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH}/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-syntax-highlighting ${ZSH}/plugins/zsh-syntax-highlighting
  • 编辑.zshrc应用插件
sh
plugins=(
        git
        wd
        zsh-autosuggestions
        zsh-syntax-highlighting
        )

警告

注意:不是root用户需要命令前加上sudo才行(下方教程中命令一样需要)...

Copyright © manosP . 2023