2

I tried to install git-lfs using

sudo apt install git-lfs but experienced the following error:

Reading package lists... Done Building dependency tree
Reading state information... Done
git-lfs is already the newest version (2.9.2). 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 1 not fully installed or removed. After this operation, 0 B of additional disk space will be used. Do you want to continue? [Y/n] y Setting up git-lfs (2.9.2) ... /usr/local/bin/git-lfs:
1: /usr/local/bin/git-lfs: ????: not found /usr/local/bin/git-lfs: 5: /usr/local/bin/git-lfs: Syntax error: end of file unexpected (expecting ")")
dpkg: error processing package
git-lfs (--configure): installed git-lfs package post-installation
script subprocess returned error exit status 2 Errors were encountered while processing: git-lfs
E: Sub-process /usr/bin/dpkg returned an error code (1)

The related solution in install git-lfs on Ubuntu 16.04 did not work for me either and flagged the same error. Does anyone have a workaround/solution?

K7AAY
  • 17,202
FSeed
  • 23

1 Answers1

0

You have git-lfs installed in /usr/local/bin/git-lfs.

This path is not maintained by APT. I would suggest to remove this file with

sudo rm /usr/local/bin/git-lfs

and retry with package reinstallation:

sudo apt-get install --reinstall git-lfs

and it will install git-lfs executable into correct location - /usr/bin/git-lfs (see file list).

N0rbert
  • 99,918