You can setup a private nuget feed and host the packages there.
For example in azure devops we have Azure artifacts:
https://learn.microsoft.com/en-us/azure/devops/artifacts/start-using-azure-artifacts?view=azure-devops#get-started-with-azure-artifacts
In that case the nuget feed is a private feed and you can configure it to access the public nuget feed. any consumed packages will then also be kept on the private azure artifacts feed, meaning you always have the original package.
The nuget.org upstream source allows you to merge the contents of nuget.org into your feed such that the NuGet client can install packages from both locations without making multiple search queries. Enabling upstream sources also automatically enables saving of packages you use from the upstream source.
https://learn.microsoft.com/en-us/azure/devops/artifacts/nuget/upstream-sources?view=azure-devops
Also see:
https://learn.microsoft.com/en-us/azure/devops/artifacts/concepts/upstream-sources?view=azure-devops
I've also seen people using MyGet:
https://www.myget.org/
And another option is to just use a local folder as a nuget source.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<!-- NuGet packages are now stored globally, see: https://stackoverflow.com/a/35809007/4122889 -->
<!-- see: https://stackoverflow.com/a/53451805/4122889 -->
<config>
<add key="globalPackagesFolder" value=".\Packages" />
<add key="repositoryPath" value=".\Packages" />
</config>
<!-- Setup for local packages, not in a nuget source -->
<packageSources>
<add key="My_Azure_Feed" value="https://pkgs.dev.azure.com/org/proj/_packaging/My_Azure_Feed/nuget/v3/index.json" />
<!--<add key="LocalPackages" value="./LocalPackages" />-->
</packageSources>
<activePackageSource>
<!-- this tells that all of them are active -->
<!--<add key="All" value="(Aggregate source)" />-->
</activePackageSource>
</configuration>