avatarTeri Radichel

Summarize

Add Repository on EC2 Ubuntu to Get Updated Version of git

Your version of git may be outdated if using the default repositories on an AWS EC2 instance

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

⚙️ Part of my series on Automating Cybersecurity Metrics. The Code.

🔒 Related Stories: GitHub Security | Application Security | Secure Code | Ubuntu on AWS

💻 Free Content on Jobs in Cybersecurity | ✉️ Sign up for the Email List

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I recently noticed that the documentation is for git version 2.41.0 and a command I was trying to use was not working. I decided to find if that is the latest version and if my EC2 Ubuntu instance was running the latest version of git.

I found that is the latest version for a Mac when I visited this page:

They don’t really make it easy from there to see if that same version is the latest for other operating systems and I wasn’t logged into the Ubuntu gui at the the time but I presumed that was also the latest version for Ubuntu. I’ll get back to that in a bit.

Note that I am using the LTS version of Ubuntu, not the Pro version. More on those version and the implications in a subsequent blog post, perhaps.

I ran the following command to check my version of git on my AWS EC2 Ubuntu instance.

git --version

I see that I’m using what appears to be an older version:

When I try to update, it tells me that I’m using the latest version. Hmm, that’s not right. My AWS EC2 Ubuntu instance is probably pointed at AWS repositories with versions of software that have been tested to work together, but at the same time, your software packages could possibly be out of date. Upgrading may break dependencies but in this case I don’t really think that it will. I’m going to go ahead and try to update to the latest version of git.

I further inspected the documentation for git on Linux:

I ran this command to add the repository with the latest stable version of git to the repositories my machine uses for updates:

#For Ubuntu, this PPA provides the latest stable upstream Git version
add-apt-repository ppa:git-core/ppa # apt update; apt install git

I ran the following to update packages:

sudo apt-get update

And then upgraded git:

sudo apt-get upgrade git

Then I checked the version again ~ now at 2.40.1

Not sure why it’s not the same version I saw for Mac.

Also noticed this issue:

Not going to deal with that right now.

Well, I am at a newer version. I have since used it and it seems to work without any issues for my use case.

Now out of curiousity I headed over to the git downloads page from my Ubuntu instance to see what the latest version of git is for Linux. Turns out it is 2.41.0. For some reason, I’m not getting the latest version from that repository I added. Hmmm….

Well that’s odd. There are some solutions here which suggest purging the current version, then reinstalling manually with wget to pull the latest. That’s kind of a hassle I’ll try it.

So I completely removed git:

Then I started to build git as directed. But what I noticed was that this domain name is not a Github domain, it’s a mirror. Who knows if the source is legitimate.

What other options do we have? Hmm.

Well I can reinstall get and get the latest version of git from GitHub and compile it.

And that, my friends…is a topic of a whole other post.

Follow for updates.

Teri Radichel | © 2nd Sight Lab 2023

About Teri Radichel:
~~~~~~~~~~~~~~~~~~~~
⭐️ Author: Cybersecurity Books
⭐️ Presentations: Presentations by Teri Radichel
⭐️ Recognition: SANS Award, AWS Security Hero, IANS Faculty
⭐️ Certifications: SANS ~ GSE 240
⭐️ Education: BA Business, Master of Software Engineering, Master of Infosec
⭐️ Company: Penetration Tests, Assessments, Phone Consulting ~ 2nd Sight Lab
Need Help With Cybersecurity, Cloud, or Application Security?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
🔒 Request a penetration test or security assessment
🔒 Schedule a consulting call
🔒 Cybersecurity Speaker for Presentation
Follow for more stories like this:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
❤️ Sign Up my Medium Email List
❤️ Twitter: @teriradichel
❤️ LinkedIn: https://www.linkedin.com/in/teriradichel
❤️ Mastodon: @teriradichel@infosec.exchange
❤️ Facebook: 2nd Sight Lab
❤️ YouTube: @2ndsightlab
Ubuntu
Git
Update
Repository
Version
Recommended from ReadMedium