RedHat离线安装htop源码包

墨蓝 2022-06-06 14:10 587阅读 0赞
  1. 在htop官网下载源码包,下载地址如下(本人下载的是2.0.2):
    http://hisham.hm/htop/releases/
  2. 用工具上传到需要安装的服务器上,本人使用的是WinSCP
  3. 在服务器上解压源码包:tar -zxvf htop-2.0.2.tar.gz
  4. 跳转到源码包目录:cd htop-2.0.2
  5. 生成Makefile文件并指定后续安装时的安装路径:./configure –prefix=/usr/local/htop-2.0.2/
  6. 编译源代码:make
  7. 安装:make install
  8. 跳转到安装的目录的bin目录:cd /usr/local/htop-2.0.2/bin
  9. 试运行htop:./htop
  10. 编辑profile文件:vi /etc/profile
  11. 移动到文件末尾,按Insert键进入编辑模式,增加以下内容:
    export PATH=$PATH:/usr/local/htop-2.0.2/bin
  12. 按Esc退出编辑模式,输入:wq保存并退出编辑器
  13. 使修改后的profile文件生效:source /etc/profile
  14. 查看系统当前PATH变量的值:echo $PATH
  15. 运行htop:htop

安装期间遇到的问题

  1. 使用configure生成Makefile文件失败,报错信息如下(只截取错误部分):

    1. checking for addnwstr in -lncursesw6... no
    2. checking for addnwstr in -lncursesw... no
    3. checking for addnwstr in -lncurses... no
    4. configure: error: You may want to use --disable-unicode or install libncursesw.
    1. 显示尝试configure增加–disable-unicode参数:./configure –prefix=/usr/local/htop-2.0.2/ –disable-unicode
    2. 如果出现以下报错信息,需要安装libncurses:

      1. configure: error: missing libraries: libncurses
    3. libncurses的下载地址如下,安装过程可以参考这次离线安装(如果是无法连接互联网的环境):http://ftp.gnu.org/gnu/ncurses/
    4. 安装之后如果依然提示:

      1. configure: error: You may want to use --disable-unicode or install libncursesw.
    5. 可以尝试步骤1增加–disable-unicode参数

总结

虽然是一次在RedHat上离线安装htop的源码包,但是其实并未使用RedHat上特有的指令,也适用于其他Linux/Unix系统上离线安装源码包。

发表评论

表情:
评论列表 (有 0 条评论,587人围观)

还没有评论,来说两句吧...

相关阅读