psdash安装与排错

debian下安装psdash并排错

1.更新一下系统,安装必要的安装包

root@debian-lege-pro:~# apt-get update
......
root@debian-lege-pro:~# apt-get upgrade
.....
root@debian-lege-pro:~# apt-get install gcc git
.....

root@debian-lege-pro:~# apt-get install python-setuptools
.....
root@debian-lege-pro:~# apt-get install python-dev
Reading package lists... Done
Building dependency tree   
Reading state information... Done
The following extra packages will be installed:
  libexpat1-dev libssl-dev libssl-doc python2.7-dev zlib1g-dev
The following NEW packages will be installed:
  libexpat1-dev libssl-dev libssl-doc python-dev python2.7-dev zlib1g-dev
0 upgraded, 6 newly installed, 0 to remove and 0 not upgraded.
Need to get 26.2 MB of archives.
After this operation, 41.1 MB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://mirrors.163.com/debian/ wheezy/main libexpat1-dev amd64 2.1.0-1+deb7u1 [222 kB]
Get:2 http://security.debian.org/ wheezy/updates/main libssl-dev amd64 1.0.1e-2+deb7u14 [1,756 kB]
Get:3 http://mirrors.163.com/debian/ wheezy/main zlib1g-dev amd64 1:1.2.7.dfsg-13 [215 kB]
Get:4 http://mirrors.163.com/debian/ wheezy/main python2.7-dev amd64 2.7.3-6+deb7u2 [22.8 MB]
Get:5 http://security.debian.org/ wheezy/updates/main libssl-doc all 1.0.1e-2+deb7u14 [1,198 kB]
Get:6 http://mirrors.163.com/debian/ wheezy/main python-dev all 2.7.3-4+deb7u1 [920 B]  
Fetched 26.2 MB in 24s (1,090 kB/s)    
......

2.从github上把psdash安装包给下下来

root@debian-lege-pro:~# git clone https://github.com/Jahaja/psdash.git
Cloning into 'psdash'...
remote: Counting objects: 1199, done.
Receiving objects: 100% (1199/1199), 2.08 MiB | 145 KiB/s, done.
remote: Total 1199 (delta 0), reused 0 (delta 0)
Resolving deltas: 100% (782/782), done.
root@debian-lege-pro:~# ls
linux-3.18.1  linux-3.18.1.tar	psdash
root@debian-lege-pro:~# cd psdash/
root@debian-lege-pro:~/psdash# ls
CHANGELOG  docs  LICENSE  MANIFEST.in  psdash  README.md  setup.py  tests  Vagrantfile	vagrant.sh

3.安装psdash

root@debian-lege-pro:~/psdash# python2.6 setup.py install
Traceback (most recent call last):
  File "setup.py", line 3, in <module>
from setuptools import setup, find_packages
ImportError: No module named setuptools
root@debian-lege-pro:~/psdash# python setup.py install
Traceback (most recent call last):
  File "setup.py", line 3, in <module>
from setuptools import setup, find_packages
ImportError: No module named setuptools    
......
E: Unable to locate package gcc-c+
E: Couldn't find any package by regex 'gcc-c+'
root@debian-lege-pro:~/psdash# apt-get install gcc-c++
Reading package lists... Done
Building dependency tree   
Reading state information... Done
E: Unable to locate package gcc-c+
E: Couldn't find any package by regex 'gcc-c+'

gcc: error trying to exec 'cc1plus': execvp: No such file or directory   
error: Setup script exited with error: command 'gcc' failed with exit status 1
.....

4.安装出现报错如上,Google一下找到排错方法如下:

root@debian-lege-pro:~/psdash# aptitude install g++
The following NEW packages will be installed:
  g++ g++-4.7{a} libstdc++6-4.7-dev{a} 
0 packages upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 9,739 kB of archives. After unpacking 27.6 MB will be used.
Do you want to continue? [Y/n/?] y
Get: 1 http://mirrors.163.com/debian/ wheezy/main libstdc++6-4.7-dev amd64 4.7.2-5 [1,726 kB]
Get: 2 http://mirrors.163.com/debian/ wheezy/main g++-4.7 amd64 4.7.2-5 [8,011 kB]   
Get: 3 http://mirrors.163.com/debian/ wheezy/main g++ amd64 4:4.7.2-1 [1,374 B]  
Fetched 9,739 kB in 28s (339 kB/s)   
Selecting previously unselected package libstdc++6-4.7-dev.
(Reading database ... 88227 files and directories currently installed.)
Unpacking libstdc++6-4.7-dev (from .../libstdc++6-4.7-dev_4.7.2-5_amd64.deb) ...
Selecting previously unselected package g++-4.7.
Unpacking g++-4.7 (from .../g++-4.7_4.7.2-5_amd64.deb) ...
Selecting previously unselected package g++.
Unpacking g++ (from .../g++_4%3a4.7.2-1_amd64.deb) ...
Processing triggers for man-db ...
Setting up libstdc++6-4.7-dev (4.7.2-5) ...
Setting up g++-4.7 (4.7.2-5) ...
Setting up g++ (4:4.7.2-1) ...
update-alternatives: using /usr/bin/g++ to provide /usr/bin/c++ (c++) in auto mode

5.继续安装

root@debian-lege-pro:~/psdash# python setup.py install
running install
Checking .pth file support in /usr/local/lib/python2.7/dist-packages/
/usr/bin/python -E -c pass
TEST PASSED: /usr/local/lib/python2.7/dist-packages/ appears to support .pth files
running bdist_egg
running egg_info
writing requirements to psdash.egg-info/requires.txt
writing psdash.egg-info/PKG-INFO
writing top-level names to psdash.egg-info/top_level.txt
writing dependency_links to psdash.egg-info/dependency_links.txt
writing entry points to psdash.egg-info/entry_points.txt
reading manifest file 'psdash.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'psdash.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
.......
.......
Using /usr/local/lib/python2.7/dist-packages/psutil-2.1.3-py2.7-linux-x86_64.egg
Searching for Flask==0.10.1
Best match: Flask 0.10.1
Processing Flask-0.10.1-py2.7.egg
Flask 0.10.1 is already the active version in easy-install.pth

Using /usr/local/lib/python2.7/dist-packages/Flask-0.10.1-py2.7.egg
Finished processing dependencies for psdash==0.6.1

6.安装完成:运行一下,无报错,安装成功

root@debian-lege-pro:~/psdash# psdash
INFO | psdash.run | Starting psdash v0.6.1
INFO | psdash.run | Listening on 0.0.0.0:5000
INFO | psdash.run | Starting web server
....

7.打开浏览器在浏览器中输入http://192.168.170.137:5000即可看到效果

8.若是想从其他主机访问此台机器,只需安装Apache服务用启动即可:

root@debian-lege-pro:~# apt-get install apache2
Reading package lists... Done
Building dependency tree   
Reading state information... Done
The following extra packages will be installed:
  apache2-mpm-worker apache2-utils apache2.2-common ssl-cert
Suggested packages:
  apache2-doc apache2-suexec apache2-suexec-custom openssl-blacklist
The following NEW packages will be installed:
  apache2 apache2-mpm-worker apache2-utils apache2.2-common ssl-cert
0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded.
Need to get 479 kB of archives.
After this operation, 1,354 kB of additional disk space will be used.
Do you want to continue [Y/n]? y
.....
root@debian-lege-pro:/etc/apache2# /etc/init.d/apache2 status
Apache2 is running (pid 3926).

OK!!!可以在其他机器输入http://192.168.170.137:5000即可以看到psdash界面!!!

posted @ 2015-01-16 14:07  legeishere  阅读(1826)  评论(0编辑  收藏  举报