Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Compiling and running mosh on Dreamhost
# Thanks to @samsonjs for the cleaned up version:
# https://gist.github.com/samsonjs/4076746
PREFIX=$HOME
VERSION=1.2.3
# Install Protocol Buffers
wget http://protobuf.googlecode.com/files/protobuf-2.4.1.tar.bz2
tar -xf protobuf-2.4.1.tar.bz2
cd protobuf-2.4.1
./configure --prefix=$PREFIX
make
make install
cd ..
# You'll need this setting to have mosh find the Protocol Buffer lib
export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig
# Install mosh
wget https://github.com/downloads/keithw/mosh/mosh-$VERSION.tar.gz
tar -xf mosh-$VERSION.tar.gz
cd mosh-$VERSION
./configure --prefix=$PREFIX
make
make install
echo You can run this to verify the install worked:
echo $ export LD_LIBRARY_PATH=$PREFIX/lib
echo $ mosh-server
echo (Running mosh-server should give you a pid and a key to use if you want to connect manually)
echo To connect to the server in the future, run this on your local machine:
echo $ mosh --server="LD_LIBRARY_PATH=$PREFIX/lib $PREFIX/bin/mosh-server" $USER@$(hostname -f)
@andreineculau

This comment has been minimized.

Copy link

commented Sep 29, 2012

Thanks Alexander!

@BrianRamsay

This comment has been minimized.

Copy link

commented Oct 10, 2012

This was super helpful, thanks!

@samsonjs

This comment has been minimized.

Copy link

commented Nov 15, 2012

This is great, thanks! I made it a little bit fancy: https://gist.github.com/4076746

@andrewgiessel

This comment has been minimized.

Copy link

commented Jan 8, 2013

This is great- but I'm running into issues with mosh finding the protocol libs. The export of PKG_CONFIG_PATH doesn't seem to be helping at all, and I've used the same prefix for configuring both packages.

It seems that protocol buffers installed fine, for what it's worth.

Any ideas?

edit: I'll note that I'm using zsh for my shell, but this happened when I put this in a shell script and ran it with bash, too.

@andrewgiessel

This comment has been minimized.

Copy link

commented Jan 8, 2013

Fixed this by ensuring that $HOME/bin was in the path:

https://gist.github.com/4486779

@saizai

This comment has been minimized.

Copy link

commented Aug 26, 2013

Use ${HOME} instead of /home/your_user

@evan-burke

This comment has been minimized.

Copy link

commented Nov 1, 2013

Andrew Giessel's method worked for me when running into the "configure: error: cannot find protoc, the Protocol Buffers compiler" issue.

Though I was installing from $HOME/usr, and needed to do this instead:

export PATH=$PATH:$HOME/usr/bin
@vishpat

This comment has been minimized.

Copy link

commented Jan 6, 2016

Many thanks for putting this up. Helped me get mosh running on RHEL7

@dvanic

This comment has been minimized.

Copy link

commented Feb 4, 2016

Was having the same problem on centos, and running

export PATH=$PATH:$HOME/usr/bin

helped.

@jaywilliams

This comment has been minimized.

Copy link

commented Jan 27, 2017

Thanks so much for sharing this.

I've tweaked the code a bit more, fixing the broken links, updated the versions, and make the entire process a bit more automated and foolproof.
https://gist.github.com/jaywilliams/c9ffab789b3f622abc932dd4cfaaeef5

I hope it helps others out there!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.