CentOS 7.8安装部署资源监视器Bpytop

一、Bpytop简介:

Bpytop是一个高效的、视觉上很吸引人的基于终端的资源监视器

二、安装配置Python3.xPsutil模块:

1、查看CentOS 7.8默认Python版本:

# cat /etc/redhat-release

# python -V

image.png

2、Python官网(https://www.python.org/)下载Python 3.x版本,此处使用Python-3.8.6进行演示

3、安装依赖软件包:

# yum -y groupinstall "Development tools"

# yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel man libffi-devel

扫描二维码关注公众号,回复: 11858899 查看本文章

4、编译安装Python-3.8.6

# tar -xf Python-3.8.6.tar.xz -C /usr/src

# cd /usr/src/Python-3.8.6

# ./configure --prefix=/usr/local/python3.8.6 --enable-shared --enable-profiling --disable-ipv6 --with-pymalloc --with-doc-strings --enable-loadable-sqlite-extensions | tee /tmp/python3.8.6.out

# less /tmp/python3.8.6.out

# make && make install

image.png

5、更改CentOS 7.8的默认Python版本为3.8.6

# `which python` -V

image.png

# mv /usr/bin/python /usr/bin/python2.7.5-old

# ln -sv /usr/local/python3.8.6/bin/python3 /usr/bin/python

# ln -sv /usr/local/python3.8.6/bin/pip3 /usr/bin/pip

6、添加至PATH环境变量:

# vim /etc/profile.d/python3.8.6.sh

export PATH=/usr/local/python3.8.6/bin:$PATH

# . /etc/profile.d/python3.8.6.sh

# echo $PATH

image.png

7、 配置头文件:

# ln -sv /usr/local/python3.8.6/include /usr/include/python3.8.6

8、配置库文件:

# echo "/usr/local/python3.8.6/lib" > /etc/ld.so.conf.d/python3.8.6.conf

# cat /etc/ld.so.conf.d/python3.8.6.conf

# ldconfig

9、查看配置后的Python和管理工具pip的版本:

# python -V

# pip -V

image.png

10、升级pip

# python -m pip install --upgrade pip

image.png

11、解决升级Python版本后yum无法使用的问题:

(1)# vim /usr/bin/yum,将第一行的“#!/usr/bin/python”修改为“#!/usr/bin/python2.7.5-old

(2)# vim /usr/libexec/urlgrabber-ext-down,将第一行的“#! /usr/bin/python”修改为“#! /usr/bin/python2.7.5-old

12、安装Psutil模块:

# python -m pip install psutil

image.png

三、安装使用Bpytop

1、安装Bpytop

# yum -y install git

# git clone https://github.com/aristocratos/bpytop.git

image.png

# cd bpytop

# make install

2、启动Bpytop

# bpytop

image.png

3、简单使用:

(1)修改主题等设置:按Esc键,然后选择OPTIONS

image.png

image.png

(2)打开帮助页面:按h

image.png

(3)退出:按q

(4)配置文件:/root/.config/bpytop/bpytop.conf


猜你喜欢

转载自blog.51cto.com/qiuyue/2539822
今日推荐