标签:second Fix 界面 imm which invalid 设计 usr arguments
- VMware workstation 15 pro; Centos 7
- 镜像 :CentOS-7-x86_64-DVD-1908.iso 觉得麻烦的可以使用后面的这个地址:[https://mirror.umd.edu/centos/7/isos/x86_64/CentOS-7-x86_64-DVD-1908.iso](下载地址)
>> - **最好别使用LiveGNOME环境**,部分机器每次重启都需要重新设置 语言 以及其他部分选项,很麻烦。
- Windows 10 1909版本 os 内部版本 1836.836
>> - 查看版本方式: 按下windows 同时按 R ,在输入框中输入winver 按回车 会弹出 Windows 系统的信息
1. 下载VMware 并安装,具体教程百度下,很多。简述下
>> >> 1. 官网下载安装包,[https://my.vmware.com/en/web/vmware/info/slug/desktop_end_user_computing/vmware_workstation_pro/15_0](下载地址) 选择 你当前电脑 操作系统 种类对应的安装包
>> 2. Windows 下,直接双击安装包,简易安装就直接一路next就好。记得看到分配硬盘空间的时候 分配稍大的空间,后续 扩展空间相对麻烦,可以自行百度下。
2. 下载centos 7镜像(上面给出下载地址了)
3. 在安装好的VMware workstation pro 中选择虚拟机安装,一路next就好。
4. 在点击完成后,会进入界面。选择 install centos
1. 进入Linux(Centos 7)环境下,点击右上角 电源按钮,在有线连接(即使你自己电脑(宿主机)使用的是WiFi,Linux中也会显示有线连接,这是VMware workstation pro软件本身设计好的))处点击连接。不点的话可能在运行下边命令的时候提示你没联网。
2. 运行命令
>> 安装zsh(shell的一种)
>> `sudo su`
>> 然后输入你在安装系统时设置好的密码
>> `yum install zsh`
>> 更换Centos 7源(所谓 源 就是一个公共库,用户centos 7进行相关插件 软件的更新及安装)
>> 先备份系统初始 源
>> cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
>> 更改源
>> `gedit /etc/yum.repos.d/CentOS-Base.repo`
>> ctrl + a选中文件中所有内容将下边代码复制进去,保存。
>>`# CentOS-Base.repo
[base]
name=CentOS-$releasever - Base
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/os/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-7
[updates]
name=CentOS-$releasever - Updates
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/updates/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-7
[extras]
name=CentOS-$releasever - Extras
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/extras/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-7
[centosplus]
name=CentOS-$releasever - Plus
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-7
>> yum makecache >> 此时可以进行更新 也可以不更新 >>
yum upgrade >> gedit install.sh >> 在弹出的界面中复制粘贴下列内容(用于下载安装oh-my-zsh —— 一种用于美化zsh shell 的插件,由于该插件被墙了,给出安装所需的bash文件代码) >>
#!/bin/sh
set -e
ZSH=${ZSH:-~/.oh-my-zsh}
REPO=${REPO:-ohmyzsh/ohmyzsh}
REMOTE=${REMOTE:-https://github.com/${REPO}.git}
BRANCH=${BRANCH:-master}
CHSH=${CHSH:-yes}
RUNZSH=${RUNZSH:-yes}
KEEP_ZSHRC=${KEEP_ZSHRC:-no}
command_exists() {
command -v "$@" >/dev/null 2>&1
}
error() {
echo ${RED}"Error: $@"${RESET} >&2
}
setup_color() {
# Only use colors if connected to a terminal
if [ -t 1 ]; then
RED=$(printf ‘\033[31m‘)
GREEN=$(printf ‘\033[32m‘)
YELLOW=$(printf ‘\033[33m‘)
BLUE=$(printf ‘\033[34m‘)
BOLD=$(printf ‘\033[1m‘)
RESET=$(printf ‘\033[m‘)
else
RED=""
GREEN=""
YELLOW=""
BLUE=""
BOLD=""
RESET=""
fi
}
setup_ohmyzsh() {
# Prevent the cloned repository from having insecure permissions. Failing to do
# so causes compinit() calls to fail with "command not found: compdef" errors
# for users with insecure umasks (e.g., "002", allowing group writability). Note
# that this will be ignored under Cygwin by default, as Windows ACLs take
# precedence over umasks except for filesystems mounted with option "noacl".
umask g-w,o-w
echo "${BLUE}Cloning Oh My Zsh...${RESET}"
command_exists git || {
error "git is not installed"
exit 1
}
if [ "$OSTYPE" = cygwin ] && git --version | grep -q msysgit; then
error "Windows/MSYS Git is not supported on Cygwin"
error "Make sure the Cygwin git package is installed and is first on the \$PATH"
exit 1
fi
git clone -c core.eol=lf -c core.autocrlf=false -c fsck.zeroPaddedFilemode=ignore -c fetch.fsck.zeroPaddedFilemode=ignore -c receive.fsck.zeroPaddedFilemode=ignore --depth=1 --branch "$BRANCH" "$REMOTE" "$ZSH" || {
error "git clone of oh-my-zsh repo failed"
exit 1
}
echo
}
setup_zshrc() {
# Keep most recent old .zshrc at .zshrc.pre-oh-my-zsh, and older ones
# with datestamp of installation that moved them aside, so we never actually
# destroy a user‘s original zshrc
echo "${BLUE}Looking for an existing zsh config...${RESET}"
# Must use this exact name so uninstall.sh can find it
OLD_ZSHRC=~/.zshrc.pre-oh-my-zsh
if [ -f ~/.zshrc ] || [ -h ~/.zshrc ]; then
# Skip this if the user doesn‘t want to replace an existing .zshrc
if [ $KEEP_ZSHRC = yes ]; then
echo "${YELLOW}Found ~/.zshrc.${RESET} ${GREEN}Keeping...${RESET}"
return
fi
if [ -e "$OLD_ZSHRC" ]; then
OLD_OLD_ZSHRC="${OLD_ZSHRC}-$(date +%Y-%m-%d_%H-%M-%S)"
if [ -e "$OLD_OLD_ZSHRC" ]; then
error "$OLD_OLD_ZSHRC exists. Can‘t back up ${OLD_ZSHRC}"
error "re-run the installer again in a couple of seconds"
exit 1
fi
mv "$OLD_ZSHRC" "${OLD_OLD_ZSHRC}"
echo "${YELLOW}Found old ~/.zshrc.pre-oh-my-zsh." "${GREEN}Backing up to ${OLD_OLD_ZSHRC}${RESET}"
fi
echo "${YELLOW}Found ~/.zshrc.${RESET} ${GREEN}Backing up to ${OLD_ZSHRC}${RESET}"
mv ~/.zshrc "$OLD_ZSHRC"
fi
echo "${GREEN}Using the Oh My Zsh template file and adding it to ~/.zshrc.${RESET}"
sed "/^export ZSH=/ c\
export ZSH="$ZSH"
" "$ZSH/templates/zshrc.zsh-template" > ~/.zshrc-omztemp
mv -f ~/.zshrc-omztemp ~/.zshrc
echo
}
setup_shell() {
# Skip setup if the user wants or stdin is closed (not running interactively).
if [ $CHSH = no ]; then
return
fi
# If this user‘s login shell is already "zsh", do not attempt to switch.
if [ "$(basename "$SHELL")" = "zsh" ]; then
return
fi
# If this platform doesn‘t provide a "chsh" command, bail out.
if ! command_exists chsh; then
cat <<-EOF
I can‘t change your shell automatically because this system does not have chsh.
${BLUE}Please manually change your default shell to zsh${RESET}
EOF
return
fi
echo "${BLUE}Time to change your default shell to zsh:${RESET}"
# Prompt for user choice on changing the default login shell
printf "${YELLOW}Do you want to change your default shell to zsh? [Y/n]${RESET} "
read opt
case $opt in
y*|Y*|"") echo "Changing the shell..." ;;
n*|N*) echo "Shell change skipped."; return ;;
*) echo "Invalid choice. Shell change skipped."; return ;;
esac
# Check if we‘re running on Termux
case "$PREFIX" in
*com.termux*) termux=true; zsh=zsh ;;
*) termux=false ;;
esac
if [ "$termux" != true ]; then
# Test for the right location of the "shells" file
if [ -f /etc/shells ]; then
shells_file=/etc/shells
elif [ -f /usr/share/defaults/etc/shells ]; then # Solus OS
shells_file=/usr/share/defaults/etc/shells
else
error "could not find /etc/shells file. Change your default shell manually."
return
fi
# Get the path to the right zsh binary
# 1. Use the most preceding one based on $PATH, then check that it‘s in the shells file
# 2. If that fails, get a zsh path from the shells file, then check it actually exists
if ! zsh=$(which zsh) || ! grep -qx "$zsh" "$shells_file"; then
if ! zsh=$(grep ‘^/.*/zsh$‘ "$shells_file" | tail -1) || [ ! -f "$zsh" ]; then
error "no zsh binary found or not present in ‘$shells_file‘"
error "change your default shell manually."
return
fi
fi
fi
# We‘re going to change the default shell, so back up the current one
if [ -n "$SHELL" ]; then
echo $SHELL > ~/.shell.pre-oh-my-zsh
else
grep "^$USER:" /etc/passwd | awk -F: ‘{print $7}‘ > ~/.shell.pre-oh-my-zsh
fi
# Actually change the default shell to zsh
if ! chsh -s "$zsh"; then
error "chsh command unsuccessful. Change your default shell manually."
else
export SHELL="$zsh"
echo "${GREEN}Shell successfully changed to ‘$zsh‘.${RESET}"
fi
echo
}
main() {
# Run as unattended if stdin is closed
if [ ! -t 0 ]; then
RUNZSH=no
CHSH=no
fi
# Parse arguments
while [ $# -gt 0 ]; do
case $1 in
--unattended) RUNZSH=no; CHSH=no ;;
--skip-chsh) CHSH=no ;;
--keep-zshrc) KEEP_ZSHRC=yes ;;
esac
shift
done
setup_color
if ! command_exists zsh; then
echo "${YELLOW}Zsh is not installed.${RESET} Please install zsh first."
exit 1
fi
if [ -d "$ZSH" ]; then
cat <<-EOF
${YELLOW}You already have Oh My Zsh installed.${RESET}
You‘ll need to remove ‘$ZSH‘ if you want to reinstall.
EOF
exit 1
fi
setup_ohmyzsh
setup_zshrc
setup_shell
printf "$GREEN"
cat <<-‘EOF‘
__ __
____ / /_ ____ ___ __ __ ____ _____/ /_
/ __ \/ __ \ / __ `__ \/ / / / /_ / / ___/ __ / /_/ / / / / / / / / / / /_/ / / /_(__ ) / / /
\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/
/____/ ....is now installed!
Please look over the ~/.zshrc file to select plugins, themes, and options.
p.s. Follow us on https://twitter.com/ohmyzsh
p.p.s. Get stickers, shirts, and coffee mugs at https://shop.planetargon.com/collections/oh-my-zsh
EOF
printf "$RESET"
if [ $RUNZSH = no ]; then
echo "${YELLOW}Run zsh to try it out.${RESET}"
exit
fi
exec zsh -l
}
main "$@" >>
./install.sh >> 然后等待安装 >> 安装好后 >> 安装vscode IDE 因为之前Windows 中使用vscode挺方便的就安装了这个。 >> [安装链接](https://code.visualstudio.com/docs/setup/linux) >>
rpm --import https://packages.microsoft.com/keys/microsoft.asc >>
sh -c ‘echo -e "[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" > /etc/yum.repos.d/vscode.repo‘ >>
yum check-update >>
yum install code`
>> 然后就可以进行编程了。同时vscode中支持很多插件,可以根据你的需要进行安装,网上也有很多相关教程可以查看。
标签:second Fix 界面 imm which invalid 设计 usr arguments
原文地址:https://www.cnblogs.com/oBYBo/p/centos_7_vscode.html