第一次写,没啥规划,随便记录的

  • 1. 安装zsh[重要]
  • 2. 安装oh-my-zsh[重要]
    • 2.1 查看shell
    • 2.2 切换默认shell[重要]
    • ~~2.3 .oh-my-zsh目录完全授权~~
    • 2.4 配置.zshrc文件
      • ~~2.4.1 跳过不安全目录的验证~~
      • 2.4.2 配置主题[重要]
      • 2.4.3 oh-my-zsh升级
        • 2.4.3.1 关闭oh-my-zsh的自动更新
      • 2.4.3 使.zshrc文件生效
  • !坑
    • 1. root用户不生效???
    • 2. 环境变量经常欠抽not find
系统 版本
deepin deepin-15.10.1-amd64
以下安装步骤都是在普通账户下操作

1. 安装zsh[重要]

GitHub → ohmyzsh-wiki
开源中国

# Deepin安装
sudo apt install zsh# CentOS 安装
sudo yum update && sudo yum -y install zsh

2. 安装oh-my-zsh[重要]

官网 - GitHub

  • 此步骤前提必须配置git:Git - 安装配置(Linux、Windows双重记录)

你可以下载 install.sh,手动安装
备选方案:如果官网拒绝连接,手动下载我的腾讯微云分享链:/linux/ohmyzsh

wget https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh
sh install.sh

或者 wget 自动下载安装

# wget 系统默认自带
sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

或者 curl 自动下载安装

# curl 需要手动安装 sudo apt-get install curl
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

特别标注:但是在国内,这两个网址由于众所周知的原因很难访问到,所以很难下载下来,所以我们可以替换成下面的脚本,其实就是把github的地址换成我们国内比较常用的gitee地址,gitee上的oh-my-zsh其实就是基于github做了一个镜像,所以内容完全一样。

sh -c "$(wget https://gitee.com/mirrors/oh-my-zsh/raw/master/tools/install.sh -O -)"
sh -c "$(curl -fsSL https://gitee.com/mirrors/oh-my-zsh/raw/master/tools/install.sh)"

2.1 查看shell

  • 查看当前使用shell
# nangy @ nangy-vm in ~ [14:09:24]
$ echo $SHELL
/bin/bash
  • 查看系统中安装了哪些shell
# nangy @ nangy-vm in ~ [14:11:37]
$ cat /etc/shells
# /etc/shells: valid login shells
/bin/sh
/bin/dash
/usr/bin/dash
/bin/bash
/usr/bin/bash
/bin/rbash
/usr/bin/rbash
/bin/zsh
/usr/bin/zsh

2.2 切换默认shell[重要]

chsh -s /bin/zsh

2.3 .oh-my-zsh目录完全授权

如不授权,其他账户安装插件/使用主题,会报日志错误
如果只有一个常用账户的话,建议不用配置此步
否则后期不好git升级.oh-my-zsh

chmod -R 777 .oh-my-zsh

2.4 配置.zshrc文件

vim ~/.zshrc

2.4.1 跳过不安全目录的验证

  • 非必要
# 放在配置文件最前面
ZSH_DISABLE_COMPFIX="true"

2.4.2 配置主题[重要]

  • 查看有什么主题 - 官方主题演示
# nangy @ nangy-vm in ~ [13:48:24]
$ ls ~/.oh-my-zsh/themes
  • 更改成自己想要的主题,我用的是ys,基本信息一步了然
# ZSH_THEME="robbyrussell"
ZSH_THEME="ys"

2.4.3 oh-my-zsh升级

更新时候出现如下报错,这是因为修改了oh-my-zsh的git文件

可以使用如下方式更新:

# nangy @ nangy-vm in ~ [9:56:36]
$ cd ~/.oh-my-zsh
# nangy @ nangy-vm in ~/.oh-my-zsh on git:master x [9:56:46] C:1
$ git status
# nangy @ nangy-vm in ~/.oh-my-zsh on git:master x [9:56:49]
$ git stash
# nangy @ nangy-vm in ~/.oh-my-zsh on git:master o [9:57:09] C:128
$ upgrade_oh_my_zsh
# nangy @ nangy-vm in ~/.oh-my-zsh on git:master x [9:57:09] C:128
$ git stash pop

2.4.3.1 关闭oh-my-zsh的自动更新

oh-my-zsh是个非常好用的工具,只要是在macOS、Linux下工作的同学们大多都会安装oh-my-zsh这个小工具,用来增强Terminal的功能。但是每天第一次打开Terminal的时候都会卡顿一下,原因是因为zsh每天会在第一次打开时进行自动更新检测。

# nangy @ nangy-vm in ~ [9:56:36]
$ vim ~/.zshrc# 查找DISABLE_AUTO_UPDATE,将其注释打开,使其生效
# Uncomment the following line to disable bi-weekly auto-update checks.
DISABLE_AUTO_UPDATE="true"
  • 如何手动更新呢
# nangy @ nangy-vm in ~ [9:56:36]
$ upgrade_oh_my_zsh# 或者
# nangy @ nangy-vm in ~ [9:56:36]
$ zsh ~/.oh-my-zsh/tools/check_for_upgrade.sh

2.4.3 使.zshrc文件生效

# nangy @ nangy-vm in ~/Desktop [13:51:05]
$ source ~/.zshrc
  • .zshrc 的最终内容
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH# Path to your oh-my-zsh installation.
export ZSH="/home/nangy/.oh-my-zsh"# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
ZSH_THEME="ys"# Set list of themes to pick from when loading at random
# Setting this variable when ZSH_THEME=random will cause zsh to load
# a theme from this variable instead of looking in $ZSH/themes/
# If set to an empty array, this variable will have no effect.
# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"# Uncomment the following line to use hyphen-insensitive completion.
# Case-sensitive completion must be off. _ and - will be interchangeable.
# HYPHEN_INSENSITIVE="true"# Uncomment the following line to disable bi-weekly auto-update checks.
DISABLE_AUTO_UPDATE="true"# Uncomment the following line to automatically update without prompting.
# DISABLE_UPDATE_PROMPT="true"# Uncomment the following line to change how often to auto-update (in days).
# export UPDATE_ZSH_DAYS=13# Uncomment the following line if pasting URLs and other text is messed up.
# DISABLE_MAGIC_FUNCTIONS="true"# Uncomment the following line to disable colors in ls.
# DISABLE_LS_COLORS="true"# Uncomment the following line to disable auto-setting terminal title.
# DISABLE_AUTO_TITLE="true"# Uncomment the following line to enable command auto-correction.
# ENABLE_CORRECTION="true"# Uncomment the following line to display red dots whilst waiting for completion.
# COMPLETION_WAITING_DOTS="true"# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# You can set one of the optional three formats:
# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# or set a custom format using the strftime function format specifications,
# see 'man strftime' for details.
# HIST_STAMPS="mm/dd/yyyy"# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder# Which plugins would you like to load?
# Standard plugins can be found in $ZSH/plugins/
# Custom plugins may be added to $ZSH_CUSTOM/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(git)source $ZSH/oh-my-zsh.sh# User configuration# export MANPATH="/usr/local/man:$MANPATH"# You may need to manually set your language environment
# export LANG=en_US.UTF-8# Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
#   export EDITOR='vim'
# else
#   export EDITOR='mvim'
# fi# Compilation flags
# export ARCHFLAGS="-arch x86_64"# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"

!坑

1. root用户不生效???

普通用户安装后,切换到root用户下,居然没生效,所以呢,自己研究,丰衣足食
root根目下copy,再source居然报错,简单粗暴重启后居然有成功了,没明白

# root @ nangy-vm in ~ [13:56:14]
$ cp /home/nangy/.zshrc ~/# root @ nangy-vm in ~ [13:56:37]
$ source ~/.zshrc

命令提示,而且还可以选择

2. 环境变量经常欠抽not find

so,弄了个临时解决方案

  • 修改~/.zshrc,在末尾添加变量
    例如:JAVA_HOME、SCALA_HOME、MAVEN_HOME
# nangy @ nangy-vm in ~ [13:47:12]
$ vim ~/.zshrc
  • 再把修改后的.zshrc覆盖其他用户根目录的.zshrc
    我这里只有root用户和自己工作用的普通用户,所以只复制一次就行
# nangy @ nangy-vm in ~ [13:51:45]
$ su
密码:# root @ nangy-vm in ~ [13:55:46]
$ cp /home/nangy/.zshrc -R ~/
  • 查看一下是否覆盖成功
# root @ nangy-vm in ~ [13:56:13]
$ tail ~/.zshrc
  • 关闭终端重新打开,就可以每次都加载变量了
    估计就是zsh的兼容坑吧,因为自己贪婪zsh的便捷,配置麻烦就麻烦吧,毕竟配置也就一次而已
    以上着重记录一下,防止以后忘记了

Deepin - 安装zsh及oh-my-zsh的踩坑记录相关推荐

  1. 【MathType安装】Office2019+MathType7.4.8.0+踩坑记录+最终使用方案

    使用Office2019安装MathType7.4.8.0屡屡碰壁,最终使用的解决方案不同于网络上的大多数方法.尽管当前记录的解决方案还不完美.未做到一劳永逸,但能用就行. MathType安装包获取 ...

  2. 华硕G60 VW6700安装win10 ubuntu 16.04双系统踩坑记录

    首先题主的笔电是华硕 G60 VW6700, 具体配置[这里可查],网上找了好多的教程,最后发现有篇文章说咱大华硕的笔电跟其他的笔电不一样.经过一次次的强制重启电脑后(听到硬盘咔嚓那种声音心里那个痛, ...

  3. 踩坑日常_MinGW-w64安装教程及踩坑记录

    踩坑日常_MinGW-w64安装教程及踩坑记录 Linux系统下的gcc(GNU C Compiler)是GNU推出的功能强大.性能优越的多平台编译器.Gcc编译器能将C.C++语言源程序.汇程式化序 ...

  4. Ubuntu18安装微信(deepin-wine版本)完整过程以及采坑记录

    Ubuntu18安装微信(deepin-wine版本)完整过程以及采坑记录(亲测运行) git clone https://gitee.com/wszqkzqk/deepin-wine-for-ubu ...

  5. AVFI Carla安装踩坑记录

    文章目录 简介 需要环境 我的环境 安装 Docker 修改`Dockerfile_x86` 建立镜像 UnrealEngine&Carla Server 部分系统无法添加apt-r Unre ...

  6. osx php7 imagick,[PHP] MacOS 自带php环境安装imagick扩展踩坑记录 | 码农部落

    前言 最近学习yii2,在搭建环境后,发现在访问contact页面时报错,如下: "Either GD PHP extension with FreeType support or Imag ...

  7. Anaconda3安装tensorflow踩坑记录

    Anaconda3安装tensorflow2.2踩坑记录 本次安装是在py版本为3.6的虚拟环境下安装: 首先激活环境 activate py36(name) activate py36 然后下载 p ...

  8. 暗影骑士擎Pro 之 安装Ubuntu18.04 双系统 踩坑记录(一)

    ​ 最近新买了个笔记本,即文章名字:Acer的暗影骑士擎Pro.考虑到学校附近也有几家宏基的官方售后店,万一出问题售后也好解决,然后就买了.因为我研究生阶段主要都用Ubuntu,所以必然得给他装个双系 ...

  9. 服务器重装esxi会怎么样,记录我的家庭服务器(2)esxi6.7安装+群晖+rdm直通+踩坑记录...

    记录我的家庭服务器(2)esxi6.7安装+群晖+rdm直通+踩坑记录 2021-05-02 19:19:39 60点赞 657收藏 66评论 创作立场声明:商品来源自掏腰包,大出血,文章有部分参考其 ...

  10. 博途v17与winCC安装流程与踩坑记录

    博途v17与winCC7.5安装教程与踩坑记录 安装教程 博途安装流程 第一步 注册表删除 第二步 启用.NET Framework服务 第三步 正式安装 winCC安装流程 博途v17与winCC安 ...

最新文章

  1. 47. Permutations II
  2. php cache缓存 购物车,Yii2使用Redis缓存购物车等数据
  3. mapreduce shuffle过程
  4. php substr的用法,php substr(函数用法)
  5. C++ 现代编程风格速查表
  6. 用lfw99.9的提取出来的特征在wuxiang的上面测试出来的结果
  7. python3 + selenium 之窗口切换
  8. Linux下MySQL 5.5的修改字符集编码为UTF8(彻底解决中文乱码问题)
  9. 20145325张梓靖 《信息安全系统设计基础》第10周学习总结
  10. linux 关闭桌面休眠,Linux关闭休眠和屏保模式
  11. 计算机excel怎么删除重复项,在Excel中巧妙提示重复输入和删除重复数据
  12. 升级!鹏业云计价i20(西藏)软件V11.0.27版本
  13. 活动图、类图、顺序图、状态图
  14. python中matplotlib绘图中文显示问题
  15. 怎样用键盘控制电脑的光标
  16. 如何将平板设置为笔记本的扩展屏
  17. java list 随机获取n个_java – 从列表中取n个随机元素?
  18. 新闻资讯系统(论文)
  19. ES6 碎片化知识积累
  20. 通过cluster reshard实现Redis集群缩减节点实战【详细步骤】

热门文章

  1. 【历史上的今天】1 月 10 日:算法分析之父出生;史上最失败的世纪并购;含冤 50 年的计算机先驱
  2. 【大数据24小时】毕节用大数据种猕猴桃;全国统一电子社保卡签发
  3. cocos creator 聊天气泡
  4. 俺老刘终于可以将指针传递给lua了!
  5. WebRTC学习进阶之路 --- 五、WebRTC网络知识详解(三)(最全流媒体协议(RTP/RTCP/RTSP/RTMP/MMS/HLS/HTTP/ HTTP-FLV(HDL)/SDP)
  6. 100926 ~ 101002
  7. 15W~65W超小体积快充电源设计
  8. #gStore-weekly | 自建房监管知识图谱
  9. 【安全牛学习笔记】SQLMAP自动注入-INHECTION、DETECTION、TECHNIQUES
  10. 唱吧导出的是php,唱吧黑科技:一键修音功能到底有多强大!居然连Rap都能修!...