「tmux」- 安装(CentOS,Ubuntu,编译)

  CREATED BY JENKINSBOT

on CentOS

Installing · tmux/tmux Wiki

适用于 CentOS 7.4,CentOS 6.5 (Final)

该方法用于安装较新的 tmux 版本:

set -e

# 第一步、安装 End Point 仓库:
cd /tmp
yum install -y wget && wget https://packages.endpoint.com/endpoint-rpmsign-7.pub
rpm --import endpoint-rpmsign-7.pub
rpm -qi gpg-pubkey-703df089 | gpg --with-fingerprint
wget https://packages.endpoint.com/rhel/7/os/x86_64/endpoint-repo-1.7-1.x86_64.rpm
yum localinstall -y endpoint-repo-1.7-1.x86_64.rpm
yum clean all
yum makecache

# 第二步、安装 Tmux 工具:
# yum install -y tmux
yum install --nogpgcheck -y tmux # 如果密钥签名到期

或者使用 galaxy4.net 仓库,对于 CentOS 7.x 系统:

yum install http://galaxy4.net/repo/galaxy4-release-7-current.noarch.rpm
yum install tmux

on Debian

apt-get install tmux

on macOS

# brew install tmux

源码编译安装(Linux)

第一步、安装依赖

#!/bin/sh

###############################################
# CentOS release 6.9 (Final)
###############################################

# 安装libevent
yum install libevent2-devel.x86_64

# 安装ncurses
yum install ncurses-devel.x86_64

第二步、源码下载

https://github.com/tmux/tmux/releases/download/2.4/tmux-2.4.tar.gz
Github:http://github.com/tmux

第三步、构建与安装

详细的安装细节请阅读源码目录下的README: https://github.com/tmux/tmux/blob/master/README

#!/bin/bash

# 1. 进入源码目录
# 略过...

# 2. 构建编译安装
./autogen.sh && ./configure --prefix=/usr && make && make install

源码编译安装(macOS)

环境概述

系统环境:maxOS Sierra Version 10.12.6
软件版本:tmux2.6

安装命令

#!/bin/sh

# 安装依赖
brew install autoconf automake m4 libtool libevent perl pkg-config

# 源码下载
# https://github.com/tmux/tmux/releases/download/2.4/tmux-2.4.tar.gz
# Github:http://github.com/tmux

# 进入源码目录
# 略过...

# 构建编译安装
./autogen.sh && ./configure --prefix=/usr && make && make install

常见编译错误汇总

#0 undefined macro: AC_SEARCH_LIBS

sh autogen.sh fails with error – possibly undefined macro: AC_SEARCH_LIBS

系统环境:maxOS Sierra Version 10.12.6
问题原因:暂时未知,可能使我编译的autoconf存在问题、或者配置问题,当我从brew安装autoconf后,可以编译通过。

参考文献

GitHub README
undefined macro: AC_SEARCH_LIBS
pkgs.org/CentOS 7/End Point x86_64/tmux-2.9a-3.ep7.x86_64.rpm
Disable the public key check for rpm installation