As we all know, most of the packages provided by the official repository of CentOS 7 are outdated. In most cases, we must rely on third-party repositories to install newer software.
I introduce you to my favorite IUS repository that provides latest upstream versions of most of the packages. IUS offers safe replacement and the IUS packages use different names than their stock equivalents. Therefore, it is pretty safe for newbie.
You have to epel-release provided by Fedora when installing ius-release, because many IUS packages have dependencies from the EPEL repository.
yum install -y \ https://repo.ius.io/ius-release-el7.rpm \ https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
If you have previously installed tmux, you must uninstall the stock tmux, otherwise you will encounter installation conflicts.
yum remove -y tmux
Now, we are safe to install tmux provided by IUS.
yum install -y tmux2u
If you encounter the following problem while executing tmux, it means that there is an old tmux session in the background. You must close it to use the new tmux.
You can use pgrep to find the pid of the old tmux session.
For example, the pid of my tmux is 1287. So, we can use the following command to reattach it and exit the session.
That's all. Hope you enjoy.