Issue with "git" command in VirtBox VM

Hello
I am trying to get a VM container setup so I can run a network simulator. I am using the latest version of VirtualBox (and by the way the same issue existed when trying to use VMWare). I get Ubuntu installed but when I use the “git” command I get the following error(s):

@NetSim:~$ git
Command ‘git’ not found, but can be installed with:
sudo apt install git

and

NetSim:~$ sudo apt install git
[sudo] password for xxx:
Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
E: Unable to locate package git

I have used VB in the past with Ubuntu and have installed packages using the “git” command but now I am running into this issue. Also the location where the VM is installed is the same as in prior uses (stored on a drive dedicated for housing VM instances in dedicated folders the drive letter is E:).

I have googled “cant install git ubuntu” and “git not installed ubuntu” and “install git ubuntu” and I have not found a resolution. Note that there are articles that talk about installing git via the “apt” command which I have tried and get a similar message…see below, and these are also specific to Ubuntu v20.04 where as I am running 22.04 so it shouldnt be an issue but felt need to mention. PS…the “sudo apt update” was also done.

@NetSim:~$ sudo apt install git
[sudo] password for xxx:
Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
E: Unable to locate package git

In closing note that the minimal install was used but the issue also existed when I did the full install as well.

Thanks in advance for your suggestions.

try updating apt first, then installing git.

Here it is all in one command string

sudo apt update && sudo apt install git -y

As this is also a new install, highly recommend updating the entire system

sudo apt update && sudo apt upgrade -yy && sudo apt autoremove -y 

That should get everything up to date and remove any packages that made obsolete from the update

After git is installed, depending on the source your are trying to pull from, it may be necessary to install https for apt. To do this use

sudo apt update && sudo apt install apt-transport-https -y

As companions for git I usually install wget and GNU privacy guard to support keyrings used for installs during the life of the system. Can all be done at once using

sudo apt update && sudo apt install apt-transport-https wget gnupg gnupg1 gnupg2 -y

Much appreciated…but it doesnt appear to have worked…I have inserted a sample of the errors I see. At first I recognized that PFS was blocking Ubuntu.com due to a geoip filter once I resolved that I could now ping the site and thought I had it licked but I still get the error which are mostly unreachable messages.

I believe the ubuntu ip’s are getting blocked which is why the updates arent happening. I look at the reports and see the ip addresses that get blocked and when I can identify those associated with ubuntu I add them to the ip4 whitelist, so now I can ping ubuntu.com but ubuntuforums.org still doesnt work and I dont think I have identified all the other ip’s associated with ubuntu and the resources for adding packages. I know part of the issue lies within a DNSBL group or custom ip4 list just haven nailed down which. I thought it would be easier to add to the whitelist and have done with it but that seems like the wrong way around the block with no guarantee you will get to your destination.

Well I disabled pfblocker and dnsbl and was able to install git and apt packages and updates so I know where the issue lies now just to be able to resolve it so I can run Ubuntu without intervening when I have to do something similar in the future.

I just got my new PFS box up and running with the base install using the video by Tom and a couple of settings from my old box with no packages installed and updating the Ubuntu VM works like a charm so yes I think the original issue was associated with the packages I had installed.

I am going to reinstall PFBlockerNG-devel and DNSBL and was wondering what is the best way to know which is causing connectivity issues?

I try and figure it out using reports but not sure if thats the best way. Going to see if Tom has install and config video on the aforementioned packages to see best way to setup as well as ways to resolve issues with connections and such.