最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

[记录]在远程服务器CentOS中安装oh-my-zsh

CentOS crifan 4844浏览 0评论

之前已经在本地的Mac中安装了oh-my-zsh了:

[记录]在Mac中安装和使用oh-my-zsh

现在继续去给远程服务器,CentOS的系统:

[root@jiandao img]# lsb_release -a
LSB Version:    :core-4.1-amd64:core-4.1-noarch
Distributor ID: CentOS
Description:    CentOS Linux release 7.2.1511 (Core) 
Release:        7.2.1511
Codename:       Core
[root@jiandao img]# uname -a
Linux jiandao.im 3.10.0-229.14.1.el7.x86_64 #1 SMP Tue Sep 15 15:05:51 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
[root@jiandao img]# 

去安装oh-my-zsh,结果需要先安装zsh:

[root@jiandao img]# sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
Zsh is not installed! Please install zsh first!

此处的shell,的确没有zsh:

[root@jiandao img]# cat /etc/shells 
/bin/sh
/bin/bash
/sbin/nologin
/usr/bin/sh
/usr/bin/bash
/usr/sbin/nologin
/bin/tcsh
/bin/csh

oh-my-zsh配置你的zsh提高shell逼格终极选择 一介布衣

[root@jiandao img]# yum install zsh
Loaded plugins: langpacks
Resolving Dependencies

<div–<> Running transaction check

<div–<-> Package zsh.x86_64 0:5.0.2-14.el7_2.2 will be installed

<div–<> Finished Dependency Resolution

Dependencies Resolved
===========================================================================================================================
 Package                 Arch                       Version                              Repository                   Size
===========================================================================================================================
Installing:
 zsh                     x86_64                     5.0.2-14.el7_2.2                     updates                     2.4 M
Transaction Summary
===========================================================================================================================
Install  1 Package
Total download size: 2.4 M
Installed size: 5.6 M
Is this ok [y/d/N]: y
Downloading packages:
zsh-5.0.2-14.el7_2.2.x86_64.rpm                                                                     | 2.4 MB  00:00:02     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : zsh-5.0.2-14.el7_2.2.x86_64                                                                             1/1 
  Verifying  : zsh-5.0.2-14.el7_2.2.x86_64                                                                             1/1 
Installed:
  zsh.x86_64 0:5.0.2-14.el7_2.2                                                                                            
Complete!
[root@jiandao img]#

然后继续:

[root@jiandao img]# sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
Cloning Oh My Zsh…
Cloning into ‘/root/.oh-my-zsh’…
remote: Counting objects: 780, done.
remote: Compressing objects: 100% (644/644), done.
remote: Total 780 (delta 25), reused 687 (delta 11), pack-reused 0
Receiving objects: 100% (780/780), 525.76 KiB | 46.00 KiB/s, done.
Resolving deltas: 100% (25/25), done.
Looking for an existing zsh config…
Using the Oh My Zsh template file and adding it to ~/.zshrc
Time to change your default shell to zsh!
Changing shell for root.
Shell changed.
         __                                     __   
  ____  / /_     ____ ___  __  __   ____  _____/ /_  
 / __ \/ __ \   / __ `__ \/ / / /  /_  / / ___/ __ \ 
/ /_/ / / / /  / / / / / / /_/ /    / /_(__  ) / / / 
\____/_/ /_/  /_/ /_/ /_/\__, /    /___/____/_/ /_/  
                        /____/                       ….is now installed!
Please look over the ~/.zshrc file to select plugins, themes, and options.
p.s. Follow us at https://twitter.com/ohmyzsh.
p.p.s. Get stickers and t-shirts at http://shop.planetargon.com.
➜  img ls
➜  img pwd
/usr/share/nginx/html/jiandaoweixin/img
➜  img zsh –version
zsh 5.0.2 (x86_64-redhat-linux-gnu)

[后记]

后来在对于自己的crifan.com网站所在的CentOS服务器中,也去安装了oh-my-zsh:

crifan@crifan:~$ yum install zsh
Loaded plugins: fastestmirror
You need to be root to perform this command.
crifan@crifan:~$ sodu yum install zsh
-bash: sodu: command not found
crifan@crifan:~$ sudo yum install zsh
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.sonn.com
 * epel: mirrors.cat.pdx.edu
 * extras: centos.sonn.com
 * updates: centos.sonn.com
Resolving Dependencies

<div–<> Running transaction check

<div–<-> Package zsh.x86_64 0:5.0.2-14.el7_2.2 will be installed

<div–<> Finished Dependency Resolution

Dependencies Resolved
=============================================================================================================
 Package             Arch                   Version                            Repository               Size
=============================================================================================================
Installing:
 zsh                 x86_64                 5.0.2-14.el7_2.2                   updates                 2.4 M
Transaction Summary
=============================================================================================================
Install  1 Package
Total download size: 2.4 M
Installed size: 5.6 M
Is this ok [y/d/N]: y
Downloading packages:
zsh-5.0.2-14.el7_2.2.x86_64.rpm                                                       | 2.4 MB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : zsh-5.0.2-14.el7_2.2.x86_64                                                               1/1 
  Verifying  : zsh-5.0.2-14.el7_2.2.x86_64                                                               1/1 
Installed:
  zsh.x86_64 0:5.0.2-14.el7_2.2                                                                              
Complete!
crifan@crifan:~$ sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
Cloning Oh My Zsh…
Error: git is not installed
crifan@crifan:~$ yum install git
Loaded plugins: fastestmirror
You need to be root to perform this command.
crifan@crifan:~$ sudo yum install git
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.sonn.com
 * epel: mirrors.cat.pdx.edu
 * extras: centos.sonn.com
 * updates: centos.sonn.com
Resolving Dependencies

<div–<> Running transaction check

<div–<-> Package git.x86_64 0:1.8.3.1-6.el7_2.1 will be installed

<div–<> Processing Dependency: perl-Git = 1.8.3.1-6.el7_2.1 for package: git-1.8.3.1-6.el7_2.1.x86_64

<div–<> Processing Dependency: perl(Term::ReadKey) for package: git-1.8.3.1-6.el7_2.1.x86_64

<div–<> Processing Dependency: perl(Git) for package: git-1.8.3.1-6.el7_2.1.x86_64

<div–<> Processing Dependency: perl(Error) for package: git-1.8.3.1-6.el7_2.1.x86_64

<div–<> Processing Dependency: libgnome-keyring.so.0()(64bit) for package: git-1.8.3.1-6.el7_2.1.x86_64

<div–<> Running transaction check

<div–<-> Package libgnome-keyring.x86_64 0:3.8.0-3.el7 will be installed

<div–<-> Package perl-Error.noarch 1:0.17020-2.el7 will be installed

<div–<-> Package perl-Git.noarch 0:1.8.3.1-6.el7_2.1 will be installed

<div–<-> Package perl-TermReadKey.x86_64 0:2.30-20.el7 will be installed

<div–<> Finished Dependency Resolution

Dependencies Resolved
=============================================================================================================
 Package                       Arch                Version                        Repository            Size
=============================================================================================================
Installing:
 git                           x86_64              1.8.3.1-6.el7_2.1              updates              4.4 M
Installing for dependencies:
 libgnome-keyring              x86_64              3.8.0-3.el7                    base                 109 k
 perl-Error                    noarch              1:0.17020-2.el7                base                  32 k
 perl-Git                      noarch              1.8.3.1-6.el7_2.1              updates               53 k
 perl-TermReadKey              x86_64              2.30-20.el7                    base                  31 k
Transaction Summary
=============================================================================================================
Install  1 Package (+4 Dependent packages)
Total download size: 4.6 M
Installed size: 23 M
Is this ok [y/d/N]: y
Downloading packages:
(1/5): perl-Error-0.17020-2.el7.noarch.rpm                                            |  32 kB  00:00:00     
(2/5): perl-TermReadKey-2.30-20.el7.x86_64.rpm                                        |  31 kB  00:00:00     
(3/5): libgnome-keyring-3.8.0-3.el7.x86_64.rpm                                        | 109 kB  00:00:00     
(4/5): git-1.8.3.1-6.el7_2.1.x86_64.rpm                                               | 4.4 MB  00:00:00     
(5/5): perl-Git-1.8.3.1-6.el7_2.1.noarch.rpm                                          |  53 kB  00:00:00     

<div–<———————————————————————————————————–

Total                                                                         28 MB/s | 4.6 MB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : 1:perl-Error-0.17020-2.el7.noarch                                                         1/5 
  Installing : libgnome-keyring-3.8.0-3.el7.x86_64                                                       2/5 
  Installing : perl-TermReadKey-2.30-20.el7.x86_64                                                       3/5 
  Installing : git-1.8.3.1-6.el7_2.1.x86_64                                                              4/5 
  Installing : perl-Git-1.8.3.1-6.el7_2.1.noarch                                                         5/5 
  Verifying  : perl-Git-1.8.3.1-6.el7_2.1.noarch                                                         1/5 
  Verifying  : perl-TermReadKey-2.30-20.el7.x86_64                                                       2/5 
  Verifying  : libgnome-keyring-3.8.0-3.el7.x86_64                                                       3/5 
  Verifying  : 1:perl-Error-0.17020-2.el7.noarch                                                         4/5 
  Verifying  : git-1.8.3.1-6.el7_2.1.x86_64                                                              5/5 
Installed:
  git.x86_64 0:1.8.3.1-6.el7_2.1                                                                             
Dependency Installed:
  libgnome-keyring.x86_64 0:3.8.0-3.el7                 perl-Error.noarch 1:0.17020-2.el7                    
  perl-Git.noarch 0:1.8.3.1-6.el7_2.1                   perl-TermReadKey.x86_64 0:2.30-20.el7                
Complete!
crifan@crifan:~$ sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
Cloning Oh My Zsh…
Cloning into ‘/home/crifan/.oh-my-zsh’…
remote: Counting objects: 780, done.
remote: Compressing objects: 100% (644/644), done.
remote: Total 780 (delta 25), reused 687 (delta 11), pack-reused 0
Receiving objects: 100% (780/780), 525.76 KiB | 0 bytes/s, done.
Resolving deltas: 100% (25/25), done.
Looking for an existing zsh config…
Using the Oh My Zsh template file and adding it to ~/.zshrc
Time to change your default shell to zsh!
Changing shell for crifan.
Password: 
Shell changed.
         __                                     __   
  ____  / /_     ____ ___  __  __   ____  _____/ /_  
 / __ \/ __ \   / __ `__ \/ / / /  /_  / / ___/ __ \ 
/ /_/ / / / /  / / / / / / /_/ /    / /_(__  ) / / / 
\____/_/ /_/  /_/ /_/ /_/\__, /    /___/____/_/ /_/  
                        /____/                       ….is now installed!
Please look over the ~/.zshrc file to select plugins, themes, and options.
p.s. Follow us at https://twitter.com/ohmyzsh.
p.p.s. Get stickers and t-shirts at http://shop.planetargon.com.
➜  ~ pwd
/home/crifan
➜  ~ ll
total 176K
drwxrwxr-x 2 crifan crifan 4.0K May 16  2015 cpanel
-rw-r–r– 1 crifan crifan  12K May 16  2015 httpd.conf.backup
-rw-rw-r– 1 crifan crifan  98K Aug 16  2015 maillong_860.log
drwxrwxr-x 3 crifan crifan 4.0K Aug 15  2015 mail_server
drwxr-xr-x 2 crifan crifan 4.0K Jul 23  2015 mediawiki-1.24.1
-rw-r–r– 1 crifan crifan  570 May 16  2015 my.conf.backup-20150516
-rw-rw-r– 1 crifan crifan  47K May 25  2015 mysqltuner.pl
➜  ~

给jiandaoweixin所在服务器中,也去安装:

[root@AY140128113754462e2eZ ~]# sudo yum install zsh
Loaded plugins: security
Setting up Install Process
base                                                                                                         | 3.7 kB     00:00     
elrepo                                                                                                       | 2.9 kB     00:00     
elrepo/primary_db                                                                                            | 805 kB     00:03     
epel                                                                                                         | 4.3 kB     00:00     
epel/primary_db                                                                                              | 5.9 MB     00:05     
extras                                                                                                       | 3.4 kB     00:00     
extras/primary_db                                                                                            |  37 kB     00:00     
updates                                                                                                      | 3.4 kB     00:00     
updates/primary_db                                                                                           | 1.4 MB     00:01     
Resolving Dependencies

<div–<> Running transaction check

<div–<-> Package zsh.x86_64 0:4.3.11-4.el6.centos.2 will be installed

<div–<> Finished Dependency Resolution

Dependencies Resolved
====================================================================================================================================
 Package                  Arch                        Version                                       Repository                 Size
====================================================================================================================================
Installing:
 zsh                      x86_64                      4.3.11-4.el6.centos.2                         base                      2.2 M
Transaction Summary
====================================================================================================================================
Install       1 Package(s)
Total download size: 2.2 M
Installed size: 5.1 M
Is this ok [y/N]: y
Downloading Packages:
zsh-4.3.11-4.el6.centos.2.x86_64.rpm                                                                         | 2.2 MB     00:02     
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : zsh-4.3.11-4.el6.centos.2.x86_64                                                                                 1/1 
  Verifying  : zsh-4.3.11-4.el6.centos.2.x86_64                                                                                 1/1 
Installed:
  zsh.x86_64 0:4.3.11-4.el6.centos.2                                                                                                
Complete!
[root@AY140128113754462e2eZ ~]#

再去安装oh-my-zsh:

[root@AY140128113754462e2eZ ~]# sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
Cloning Oh My Zsh…
Initialized empty Git repository in /root/.oh-my-zsh/.git/
remote: Counting objects: 780, done.
remote: Compressing objects: 100% (645/645), done.
remote: Total 780 (delta 20), reused 705 (delta 10), pack-reused 0
Receiving objects: 100% (780/780), 529.87 KiB | 150 KiB/s, done.
Resolving deltas: 100% (20/20), done.
Looking for an existing zsh config…
Using the Oh My Zsh template file and adding it to ~/.zshrc
Time to change your default shell to zsh!
Changing shell for root.
Shell changed.
         __                                     __   
  ____  / /_     ____ ___  __  __   ____  _____/ /_  
 / __ \/ __ \   / __ `__ \/ / / /  /_  / / ___/ __ \ 
/ /_/ / / / /  / / / / / / /_/ /    / /_(__  ) / / / 
\____/_/ /_/  /_/ /_/ /_/\__, /    /___/____/_/ /_/  
                        /____/                       ….is now installed!
Please look over the ~/.zshrc file to select plugins, themes, and options.
p.s. Follow us at https://twitter.com/ohmyzsh.
p.p.s. Get stickers and t-shirts at http://shop.planetargon.com.
 ~ pwd
/root
 ~ ll
total 24K
drwxr-xr-x 6 root root 4.0K Jun  3 23:40 _book
drwxrwxrwx 3 root root 4.0K Jun 11 17:22 frontend
drwxr-xr-x 2 root root 4.0K Jun  5 19:37 gitlib
drwxr-xr-x 5 root root 4.0K Jun  3 21:49 mytaiga
-rw-r–r– 1 root root   15 Jun  3 23:39 README.md
-rw-r–r– 1 root root   10 Jun  3 23:39 SUMMARY.md

转载请注明:在路上 » [记录]在远程服务器CentOS中安装oh-my-zsh

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
82 queries in 0.169 seconds, using 22.16MB memory