How to fix bup remote sh: bup: not found


When running bup using the bup remote function, e.g.

bup init -r

you see an error like

sh: bup: not found                                                                                                                                            
Traceback (most recent call last):                                                                                                                            
  File "/usr/lib/bup/cmd/bup-init", line 45, in <module>                                                                                                      
    cli = client.Client(argv_bytes(opt.remote), create=True)                                                                                                  
  File "/usr/lib/bup/cmd/../bup/", line 108, in __init__                                                                                             
    self._available_commands = self._get_available_commands()                                                                                                 
  File "/usr/lib/bup/cmd/../bup/", line 181, in _get_available_commands                                                                              
    raise ClientError('unexpected help header ' + repr(line))                                                                                                 
bup.client.ClientError: unexpected help header b''


First, login using SSH to your server and check if bup is installed by running


Example output:

Usage: bup [-?|--help] [-d BUP_DIR] [--debug] [--profile] <command> [options...]

Common commands:
    fsck       Check backup sets for damage and add redundancy information
    ftp        Browse backup sets using an ftp-like client
    fuse       Mount your backup sets as a filesystem

If that works, you need to ensure bup is located at /usr/bin/bup !


which bup

to find out where bup is located.

If, for example, it’s at /usr/local/bin/bup, you need to symlink it to /usr/bin/bup:

ln -sf /usr/local/bin/bup /usr/bin/bup