I am trying to install git-lfs package and it looks like expected paths are not Ubuntu friendly. From Downloads section of git-lfs I choose Linux AMD64 file name git-lfs-freebsd-amd64-1.2.1.tar.gz, because .deb files are not available for Ubuntu, just Debian 7,8.

I am getting error: install.sh: 19: install.sh: PATH+=:/usr/local/bin: not found when executing install.sh.

Does anyone have a working solution on how to install git-lfs?

  • 2
    This link could be helpful if you didn't try it yet: help.github.com/articles/installing-git-large-file-storage
    – Adnan
    Jul 16, 2016 at 13:36
  • 1
    I am actually using that same manual to install, I am stuck on the step number 3.
    – Mike
    Jul 16, 2016 at 13:49
  • 1
    could you specify where the problem is ? like what's wrong in that step
    – Adnan
    Jul 16, 2016 at 14:10
  • 1
    Thank you, I found my problem, I was getting install error mentioned in my question because of using wrong interpreter. One would expect .sh to work with sh.
    – Mike
    Jul 16, 2016 at 17:46
  • The link above to help.github.com is MS Windows-specific. It does not work for Linux or other Operating Systems. Jul 21, 2022 at 22:43

4 Answers 4


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.

  • 1
    this looked promising, but after running with sudo bash, I still cannot git lfs track - it says 'lfs' is not a git command
    – tofutim
    Oct 21, 2016 at 5:53
  • silly me, I still had to run sudo apt-get install git-lfs
    – tofutim
    Oct 21, 2016 at 5:55
  • @tofutim You probably meant sudo apt-get install git?
    – edwinksl
    Oct 21, 2016 at 6:32
  • nope, already installed git, but i needed git-lfs
    – tofutim
    Oct 21, 2016 at 8:05
  • 8
    For Ubuntu 18.04.02, all I had to do was run sudo apt install git-lfs
    – Prajwal
    Jul 3, 2019 at 9:03

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


If anybody finds this thread from Google and is on a modern Ubuntu build (at least 21.04+), simply do sudo apt install git-lfs


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.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.