How to install git-lfs on Ubuntu 16.04?

There are in fact .deb files at https://packagecloud.io/github/git-lfs?filter=debs that you can install; the link you visited also hinted at this by stating that "All packages are available on PackageCloud now."

In any case, if you visit https://git-lfs.github.com/, the simplest way to install git-lfs is to follow the instructions at https://packagecloud.io/github/git-lfs/install:

curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash

Then, according to https://github.com/github/git-lfs/blob/master/INSTALLING.md#installing-packages, do

sudo apt-get install git-lfs

If you don't trust the source of script.deb.sh and are uncomfortable with running the script with sudo bash, you should definitely take a look at the script first.


I was looking for a way to install entirely from the command line (server/VM setup), and was able to do so by following the instructions from the documentation, copied below for reference.

  1. sudo apt-get install software-properties-common
  2. sudo curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash*
  3. sudo apt-get install git-lfs
  4. git lfs install

*The sudo in step 2 is my addition, and without it this step was failing silently. Maybe to do with my user permissions on the server? ymmv


I found my solution, the problem was executing install.sh using sh:

The correct way is sudo ./install.sh or sudo bash install.sh instead of sh install.sh.

Tags:

Git