Install tmux on linux

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

Installing

  • Installing tmux
  • Binary packages
  • From source tarball
  • Building dependencies
  • From version control
  • Configure options
  • Common problems
  • configure says: libevent not found or ncurses not found
  • configure says: must give —enable-utf8proc or —disable-utf8proc
  • tmux won’t run from ~/local
  • autogen.sh complains about AM_BLAH
  • configure says: C compiler cannot create executables
  • AppImage package
  • Red Hat Enterprise Linux / CentOS RPMs
Clone this wiki locally

Many platforms provide prebuilt packages of tmux, although these are often out of date. Details of the commands to discover and install these can be found in the documentation for the platform package management tools, for example:

Platform Install Command
Arch Linux pacman -S tmux
Debian or Ubuntu apt install tmux
Fedora dnf install tmux
RHEL or CentOS yum install tmux
macOS (using Homebrew brew install tmux
macOS (using MacPorts) port install tmux
openSUSE zypper install tmux

Some thirdparty binary packages are available: AppImage and RPMs.

tmux requires two libraries to be available:

In addition, tmux requires a C compiler, make, yacc (or bison) and pkg-config.

On most platforms, these are available as packages. This table lists the packages needed to run or to buld tmux:

Platform Command Run Packages Build Packages
Debian apt-get install libevent ncurses libevent-dev ncurses-dev build-essential bison pkg-config
RHEL or CentOS yum install libevent ncurses libevent-devel ncurses-devel gcc make bison pkg-config

If libevent and ncurses are not available as packages, they can be built from source, see this section.

tmux uses autoconf so it provides a configure script. To build and install into /usr/local using sudo, run:

tar -zxf tmux-*.tar.gz cd tmux-*/ ./configure make && sudo make install 

To install elsewhere add —prefix to configure, for example for /usr add —prefix=/usr .

If the dependencies are not available, they can be built from source and installed locally. This is not recommended if the dependencies can be installed from system packages.

Building requires a C compiler, make, automake, autoconf and pkg-config to be installed. It is more common to need to build libevent than ncurses.

Full instructions can be found on the project sites but this is a summary of how to install libevent and ncurses into ~/local for a single user. To install system-wide into directories under /opt or into /usr/local , substitute the required path for for $HOME/local in each case and run make install as root (for example with sudo: make && sudo make install ).

tar -zxf libevent-*.tar.gz cd libevent-*/ ./configure --prefix=$HOME/local --enable-shared make && make install 
tar -zxf ncurses-*.tar.gz cd ncurses-*/ ./configure --prefix=$HOME/local --with-shared --with-termlib --enable-pc-files --with-pkg-config-libdir=$HOME/local/lib/pkgconfig make && make install 

Then the tmux configure script needs to be pointed to the local libraries using PKG_CONFIG_PATH :

tar -zxf tmux-*.tar.gz cd tmux-*/ PKG_CONFIG_PATH=$HOME/local/lib/pkgconfig ./configure --prefix=$HOME/local make && make install 

If ncurses and libevent were installed in different directories rather than all together in ~/local , both their lib/pkgconfig directories will need to be in PKG_CONFIG_PATH , for example:

PKG_CONFIG_PATH=/opt/libevent/lib/pkgconfig:/opt/ncurses/lib/pkgconfig ./configure --prefix=$HOME/local 

The newly built tmux can be found in ~/local/bin/tmux .

Читайте также:  Linux debian файловый менеджер

When tmux is installed locally on Linux, the runtime linker may need to be told where to find the libraries using the LD_LIBRARY_PATH environment variable, for example:

LD_LIBRARY_PATH=$HOME/local/lib $HOME/local/bin/tmux -V 

And to view the manual page, MANPATH must be set:

MANPATH=$HOME/local/share/man man tmux 

Most users will want to configure these in a shell profile, for example in .profile for ksh or .bash_profile for bash:

export PATH=$HOME/local/bin:$PATH export LD_LIBRARY_PATH=$HOME/local/lib:$LD_LIBRARY_PATH export MANPATH=$HOME/local/share/man:$MANPATH 

Building tmux from Git has the same dependencies as building from tarball plus also autoconf and automake. Building is the same as from a tarball except first the configure script must be generated. To install into /usr/local :

git clone https://github.com/tmux/tmux.git cd tmux sh autogen.sh ./configure make && sudo make install 

tmux provides a few configure options:

Option Description
—enable-debug Build with debug symbols
—enable-static Create a static build
—enable-utempter Use the utempter library if it is installed
—enable-utf8proc Use the utf8proc library if it is installed

configure says: libevent not found or ncurses not found

The libevent library or its headers are not installed. Make sure the appropriate packages are installed (some platforms split libraries from headers into a -dev or -devel package).

configure says: must give —enable-utf8proc or —disable-utf8proc

macOS’s builtin UTF-8 support is very poor, so it is best to use the utf8proc library if possible. Once it is installed, pass —enable-utf8proc to configure.

To force tmux to build without utf8proc, use —disable-utf8proc .

On Linux, make sure LD_LIBRARY_PATH is set, or try a static build instead (give —enable-static to configure).

autogen.sh complains about AM_BLAH

Make sure pkg-config is installed.

configure says: C compiler cannot create executables

Either no C compiler (gcc, clang) is installed, or it doesn’t work — check there is nothing stupid in CFLAGS or CPPFLAGS .

Instructions and scripts on building an AppImage package for tmux are available from Nelson Enzo here. Prebuilt AppImage packages are also available here.

Red Hat Enterprise Linux / CentOS RPMs

The tmux packages available from the main repositories are often quite out of date, especially for long-term support distributions. RPMs for newer tmux versions can be obtained from here.

For example to set up a repository and install on RHEL8:

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

Or to install an RPM directly on RHEL6:

sudo rpm -ivh http://galaxy4.net/repo/RHEL/6/x86_64/tmux-3.1b-2.el6.x86_64.rpm 

The repository method is recommended to automatically receive future package updates. See this page for more details.

Читайте также:  Simple ftp server linux

Источник

How to Install tmux On Ubuntu

While working on the command terminals of your computer, there can be times when you might need multiple terminal windows to continue your work. For example, you might need them when you want multiple processes to run simultaneously or when you want to execute multiple commands at the same time.

It is fair to say that there are not many people who need to work on multiple terminals at the same time. But for those who require such a utility, tmux is the way to go.

tmux is an open-source terminal multiplexer developed for Unix and other operating systems based on Unix. It is used for simultaneously running multiple command terminal sessions and allows the user to be flexible while working on their computer.

If you are using Linux and any of its distros and you want to know how to install tmux on your system, you are at the right place as this article will guide you through the necessary steps.

Method 1: Install tmux Through the Terminal

Installing tmux using the terminal is straightforward and can be completed in two steps. Just follow these steps:

1. First, you need to update your system repositories so that you can have the latest versions available of any software you are trying to install. Update using this command:

2. After your system repositories are updated, you can now install tmux. Run the following command on your terminal:

3. When you press enter, the installation process should start and you can track the progress.

The above-mentioned steps are for installing tmux on Ubuntu or Debian. If you have a Linux distribution other than these two, have a look at the following commands:

4. For installing tmux on Fedora or CentOS, use the following command:

5. If you use Arch Linux, you can use the following command to install tmux:

So, these were the commands that you need to execute to install tmux on your Linux systems through the terminal:

Method 2: Install tmux Through Github

You can also install tmux graphically. This can be done by downloading the tmux repository directly from Github. Follow these steps:

1. Open your default web browser.

2. In the search bar, type “tmux github”.

3. Click on the link with “Home” written on it, the third link in the above image.

4. You should see this page after clicking on the specified link.

5. Click on the link next to “Download”.

6. When you click on that link, the tmux file should get downloaded to your download folder.

7. Open the tar.gz file to install the tmux application in your system.

Some Basic Commands of tmux

Other than the commands that you enter in the Linux terminal, there are some basic commands associated with tmux as well that you can use to control and configure tmux.

Читайте также:  Epson l200 драйвер linux

To control tmux, you need to press “Ctrl+B” every time you are going to enter a tmux command. Some of the most common commands that you need to know about while using tmux are the following:

If you want to start a new unnamed tmux session, type the following in the terminal window.

Upon executing this command, the screen should change and you should see a status bar at the bottom of your screen. In the bottom left corner, you should see the screen number and the name of the window, as shown in the following image:

You can also start a new named tmux session. For that, type the following command in the terminal:

You can split the panes you have created as well. Without splitting, the different panes are working in the background and you can see only one pane at a time. You can split panes both vertically and horizontally.

Press “ Ctrl+b+” ” to split the pane horizontally

Press “ Ctrl+b+% “ to split the pane vertically

As you can create multiple panes, there is the provision of moving between those panes as well. Every pane is numbered by tmux. To move to the desired pane, you need to press “Ctrl+b+q”. This should display the list of the number of panes available. To move to a specific pane, press the number of the pane.

There is also the provision of zooming into a pane to have a better look at something you can’t figure out. You can do this by pressing “Ctrl+b+:” and typing “resize-pane -z”.

One of the best features of tmux is that you can go back to the normal command terminal and tmux will continue running in the background. You can detach yourself from the current working session by entering the following command:

If you want to go back to working on the session, enter the following command:

As you can see in the image, we are back where we left off.

If the session you started had a name, attach yourself using the following command:

You can also have a look at all the active tmux sessions by entering the following command:

This should display a list of all the active tmux sessions.

Conclusion

This was an article on how to install tmux on Ubuntu. We discussed the methods you can use to install tmux on Ubuntu. Moreover, we also mentioned the command that you can use if you are using any other Linux distribution. Other than that, we gave you a list of the basic and common commands that you will use while working with tmux. If used properly, tmux can do wonders in helping you handle multiple tasks simultaneously.

About the author

Zeeman Memon

Hi there! I’m a Software Engineer who loves to write about tech. You can reach out to me on LinkedIn.

Источник

Оцените статью
Adblock
detector