0

I'm looking to migrate our Bitbucket server to the cloud using their assistant but it requires git to be on 2.25 or later and I can't figure out how to get it updated. Yes, I know shame on me for keeping 16.10 in our environment (linux noob here).

Is it still possible to update git despite 16.10 being massively outdated/end of life?

4
  • Not really - you should use Ubuntu LTS and update regularly.. 😬 Mar 16, 2023 at 19:32
  • The plan is to ditch this OS altogether as we simply don't have the expertise to maintain it. Are you saying there's no way at all or it's just not easy? Mar 16, 2023 at 19:35
  • Maybe you can compile manually - but everything is unsupported. Mar 16, 2023 at 19:42
  • You can install Ubuntu 22.04 LTS version, which will be supported until 2027 (and with ESM, until 2032), so that you will not need to upgrade the system until then. Mar 16, 2023 at 22:43

1 Answer 1

3

Yes, unsupported, but I'm feeling generous. Let's build git from source. I tested this on a completely clean install of 16.10. Worked for me! :D

Update sources

Edit your /etc/apt/sources.list (if you hadn't already) to replace archive.ubuntu.com with old-releases.ubuntu.com. Also comment out the security.ubuntu.com lines with a "#"

sudo nano /etc/apt/sources.list

Use ALT+R to do search/replace.

So it should look something like this:

deb http://old-releases.ubuntu.com/ubuntu/ yakkety main restricted
deb http://old-releases.ubuntu.com/ubuntu/ yakkety-updates main restricted
deb http://old-releases.ubuntu.com/ubuntu/ yakkety universe
deb http://old-releases.ubuntu.com/ubuntu/ yakkety-updates universe
deb http://old-releases.ubuntu.com/ubuntu/ yakkety multiverse
deb http://old-releases.ubuntu.com/ubuntu/ yakkety-updates multiverse
deb http://old-releases.ubuntu.com/ubuntu/ yakkety-backports main restricted universe multiverse
#deb http://security.ubuntu.com/ubuntu yakkety-security main restricted
#deb http://security.ubuntu.com/ubuntu yakkety-security universe
#deb http://security.ubuntu.com/ubuntu yakkety-security multiverse

Update packages

This will just install the latest (lulz) updates from years gone by.

sudo apt-get upgrade

If you have a bunch of updates, it might be worth a reboot at this point, as you may have a "new(er)" kernel.

It's possible you've already done the above steps long ago, before the system went out of support, and there are no more updates. That's fine.

Get git source

Let's get the earliest git source tarball you can get. The --no-check-certificate is required because the SSL certs are all outdated on your system.

cd ~
wget --no-check-certificate https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.25.5.tar.gz

Unpack the source

tar zxvf git-2.25.5.tar.gz
cd git-2.25.5

Get the pre-requisites to build

We need ourselves a compiler, to compile git, make to build it and some dependencies.

sudo apt install gcc make zlib1g-dev gettext

Configure

./configure

This will either succeed and the last 3 lines will be:

configure: creating ./config.status
config.status: creating config.mak.autogen
config.status: executing config.mak.autogen commands

or it will fail, and we cannot continue here.

Make

Here's where the magic happens. We will compile the git binary and all the other bits and bobs.

make

Depending on the speed of your system this may take a few minutes. It will spit out "CC" prefixed progress constantly.

There shouldn't be any errors, as git is quite simple to compile. The last lines will say stuff like "GEN bin-wrappers/" followed by some commands.

Test git

./git version

Should show:

git version 2.25.5

Install git

sudo make install

This will copy the binaries to /usr/local/bin so if bitbucket needs to know where to find the new git binary, that's where it is.

The which git command should return /usr/local/bin/git and git version should return the right version.

Good luck!

2
  • When I follow this wonderful step by step instruction, everything runs successfully until the point where I check the git version using "git version" which still shows 2.13.0. Any ideas why? Mar 17, 2023 at 18:32
  • 1
    UPDATE: I ran through the process again and it seems to have worked this time! I really really appreciate you Popey!!!! This is a life saver, thank you!! Mar 17, 2023 at 18:51

Not the answer you're looking for? Browse other questions tagged .