7

It has become fashionable to run distribution upgrade in a tmux terminal to avoid remote connection issues or issues with the X server (e.g. opensuse documentation).

Yet this does not take into account the risk of having a version mismatch between the already upgraded tmux client and the server that manages the terminal where the distribution upgrade is running.

To materialize the risk one has to leave the tmux console for the normal terminal during the upgrade. If tmux client is upgraded in the meantime one would not be able to reattach to the tmux session. Instead running tmux attach or tmux ls one would get

# tmux ls
protocol version mismatch (client 7, server 6)

I ran into this client 7, server 6 version mismatch when upgrading from OpenSUSE 12.2 to 12.3. A quick solution I could come up with was to download the tmux rpm from the old distribution repository and unpack it with cpio since the machine had a network connection in the process of the upgrade.

wget http://download.opensuse.org/distribution/12.2/repo/oss/suse/i586/tmux-1.6-2.1.2.i586.rpm
rpm2cpio ../tmux-1.6-2.1.2.i586.rpm > tmux-1.6.cpio
cpio -i -d < tmux-1.6.cpio
./usr/bin/tmux

Should one put a warning on the possible version mismatch when running distro upgrade in a tmux session? Is there an easy way to make tmux client run in a mode compatible with older servers?

2 Answers2

8

You can attach to an existing tmux without having to download an old version.

Shutdown all your sessions and resume as soon as possible though, as this is clearly an ugly hack; it's just very useful in a pinch:

"/proc/$(pgrep -o tmux)/exe" attach
Braiam
  • 35,991
Jason
  • 236
2

You could try to upgrade just tmux first, and then perform the full upgrade. With some luck, the currently installed system libraries versions will satisfy the dependencies for the new tmux version.

Ådne
  • 21