Skip to content

Instantly share code, notes, and snippets.

@nanmu42
Last active May 7, 2024 09:24
Show Gist options
  • Save nanmu42/97e7d476bbd89301fc74ed23eb0cd65a to your computer and use it in GitHub Desktop.
Save nanmu42/97e7d476bbd89301fc74ed23eb0cd65a to your computer and use it in GitHub Desktop.
Update tmux to latest version
#!/usr/bin/env bash
set -e
# dependecies
apt update
apt install -y git automake build-essential pkg-config libevent-dev libncurses5-dev byacc
# where our temp file locates
rm -rf /tmp/tmux
git clone https://github.com/tmux/tmux.git /tmp/tmux
cd /tmp/tmux
bash autogen.sh
./configure && make
make install
cd -
# clean up
rm -rf /tmp/tmux
@hrai
Copy link

hrai commented Apr 25, 2020

I had to install byacc as well for the make to run successfully.

@rivertam
Copy link

rivertam commented May 5, 2020

sudo apt install -y byacc for the lazy

@kevomac12
Copy link

Hello,
Not that I expect a reply, though it would help! As the above script isn't commented...why line 27??

Kevin

@rivertam
Copy link

rivertam commented Jan 20, 2022

@kevomac12 I'd assume because it builds and installs the binary, after which you don't need the source code or the build artifacts anymore. Stuff that's in /tmp/* implies it's allowed to be deleted/not for longterm storage.

@kevomac12
Copy link

Thank you!

@nanmu42
Copy link
Author

nanmu42 commented Jan 24, 2022

Thanks for your kindly suggestions guys!

I have updated the script.

@ismet55555
Copy link

ismet55555 commented Mar 26, 2022

This is great! Thank you.
One thing to mention here to anyone running this. Make sure at the very end to reload your shell before running tmux -V

Edit

I used it to make a install script that should work with Debian and CentOS based systems. This doesn't depend on git and builds a specified version from source.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment