anolis 8.6 (CentOS 安装 cheat, 2022.10 )

1. 安装python;

#yum -y install python   //系统提示 

No match for argument: python
There are following alternatives for "python": python2, python36, python38, python39
Error: Unable to find a match: python

#yum -y install python39 //安装完成

#pyhon3   // 发现 Rocky Linux 8.6 中已自动安装好了 python 3.6.8

2.安装pip;

#yum -y install python39-pip  //提示 is already installed

#yum -y  install python3-pip // rocky linux 提示:is already installed

 3. 安装git;

#yum -y install git  //提示  git is already installed

4.  安装 epel-release;

yum -y install epel-release  //提示安装完成

5. 

# yum install -y python39 python39-pip python39-setuptools //提示 is already installed

6.

wget https://bootstrap.pypa.io/get-pip.py  //成功下载

7.

python3 get-pip.py //提示

ERROR: This script does not work on Python 3.6 The minimum supported Python version is 3.7. Please use https://bootstrap.pypa.io/pip/3.6/get-pip.py instead.

8.

# wget https://bootstrap.pypa.io/pip/3.6/get-pip.py  //成功下载

# mv get-pip.py.1 get-pip-3.6.py

#python3 get-pip-3.6.py  //成功执行

# pip install docopt pygments  //成功执行

github  无法连通,FQ后可以访问

#git clone https://github.com/cheat/cheat.git //成功执行

# pip install cheat  //成功执行

[root@localhost cjl]# cheat ps
No cheatsheet found for ps

我们还需要手工安装一些别人已经编辑好的速记素材,比如官方的https://github.com/cheat/cheatsheets。这份素材已经位于安装目录,但默认没有启用。下面命令可以启用这份官方素材:

[root@localhost cjl]# sudo ln -s /usr/local/lib/python3.6/site-packages/usr/share/cheat /usr/share/cheat
[root@localhost cjl]# cheat ps
# To list every process on the system:
ps aux

# To list a process tree
ps axjf

# To list every process owned by foouser:
ps -aufoouser

# To list every process with a user-defined format:
ps -eo pid,user,command

# Exclude grep from your grepped output of ps.
# Add [] to the first letter. Ex: sshd -> [s]shd
ps aux | grep '[h]ttpd'

 

posted @ 2022-10-24 10:55  blues667  阅读(520)  评论(0)    收藏  举报