Manual Local Installation of a Binary on Linux

Steps for manually installing a pre-compiled binary and its provided manpage, all from a tarball.

1. Binary

  1. compile files, if needed
  2. move application files to a meaningful location that doesn’t risk deletion, e.g. ~/Apps
  3. edit .bashrc
  4. append the following, then save and exit:
    export PATH="${HOME}/<path_to_folder_of_executable>:${PATH}"
  5. source .bashrc
  6. verify: <binary> --help

2. Manpage

Manpage directory number could be suggested by the filename of the man file, example: manfile.1. Or can be hand-picked from man man, under Description.

note: It has been recommended[2] copying manfile to /usr/local/man instead of /usr/share/man in order to separate your work from package manager installs.

  1. sudo cp <manfile.1> /usr/local/man/man1
  2. Update man db for specific file: sudo mandb -f <manfile.1>
    or sudo mandb update for multiple files
  3. Might get message for ‘0 entries updated’, better test: man <manfile>

References

  1. How to Add a Binary (or Executable, or Program) to Your PATH on macOS, Linux, or Windows | zwbetz
  2. command line – How do I manually install a man page file? – Ask Ubuntu
  3. Ubuntu Manpage: man – an interface to the system reference manuals

Did this solve your issue?