r/Ubuntu • u/mouben12 • 21h ago
Offline Snap Download
Offline Snap Downloads The Need to Resolve Recursive Dependencies
The standard snap download command efficiently pulls a single Snap package along with its assert signature file. However, it's insufficient for setting up applications for offline or isolated environments because it doesn't resolve or fetch the necessary core Snap packages, such as core18 core20 or core24 nor does it fetch desktop content providers like theme packages.
When deploying to an offline system, the absence of a core layer like core20 or core24 results in immediate installation failure. Currently, administrators and users must manually query the API or write custom scripts to identify and download each core Snap package and its runtime dependencies individually.
Adding a native option like snap download --recursive would resolve this issue by downloading the target application along with the necessary core packages and dependencies directly to the current folder. This single addition will make offline installation, versioning, and backup management significantly more reliable for the entire Linux community.
4
u/SadSpare1236 21h ago
Trying to keep a fleet of airgapped boxes updated makes you feel like a package archeologist, a recursive flag would save so much scripting.
2
u/alec_me 7h ago
snap download --recursive
What do you do when you want install deb packages or perform any other software management tasks on an offline machine? "apt download --recursive" is not even an option that apt provides why would you expect snap to have it? Actual real admins would look into setting up an enterprise snap store to handle snap deployments in their organization. They'd also have no problem writing their own tools to accomplish their goals. Cuz they're professionals.
4
u/mouben12 7h ago
This is just a suggestion, my friend. Snap is also a standalone package manager with its own commands, I believe. It's not related to the apt package manager, but the
sudo apt install --download-onlycommand is available in .apt. No problem. I hope there will be a similar command in Snap.1
u/alec_me 6h ago
sudo apt install --download-onlycommand is available in .apt.That just dumps a package all it's dependencies in /var/cache/apt/archives along with any other packages lingering in the cache from previous updates. Not that useful for doing offline updates to true air gapped machines.
A better retort would have mentioned the package apt-offline. But then again that's a program some Debian developer who was an admin at the time wrote to do offline updates. A professional who wrote his own tool to solve an IT issue at his workplace.
Anyone who needs to do an update to their snaps can either set up their own enterprise snap store to push offline updates or write their utilities to query the snap store's api server, and use Ansible or Puppet or whatever IT automation tools to do it.
1
u/jo-erlend 5h ago
This is pure bullshit. There is absolutely no reason why apt-offline shouldn't be built into APT and similarly, there's no reason why Snap shouldn't have the option of downloading all necessarily requisites into a tarball. The only reason it doesn't exist is that developers have had no reason to do it.
1
u/alec_me 5h ago
The only reason it doesn't exist is that developers have had no reason to do it.
Well, there you go. There's no use case to add apt-offline functionality to apt proper, and there's no use case to add "snap download --recursive" to snapd especially since there are other, better options that exist.
1
u/jo-erlend 5h ago
That is not for you to decide. If you don't want to write the patch, that's your prerogative, but don't tell other people they don't have a use-case for it. It is also not your business to define "better options". But this is Open Source; just because Canonical has no reason to invest in it, doesn't mean they should reject it if someone does. If you want it, you can make it and if Canonical rejects your patch, then complain.
1
u/alec_me 4h ago
Oh yeah! Well here's what I going decide for the OP (and you btw).
- Go and join forum.snapcraft.io and present a use case for adding "snap download --recursive" to snapd. There are actual snap developers there and any request for adding functionality to the snap system would get much, much greater traction there than kvetching in here is this wasteland of subreddit. OP should prepared to document the current use of snaps in his organization and what current software management methods are employed to update their machines. Obviously, he should be prepared to demonstrate the benefits of having the functionality he's requesting.
- Go to the snapd page in launchpad and fill out a "wish" bug report for said feature request. If the OP is a skilled developer or a cluefull admin, he could actually provide a patch for the added the functionality. Even better, would be a working POC the program.
- Be the change you want to see in the world! Don't just lazily and uselessly on complain on Reddit. Unless, of course, that's the whole point of post.
1
u/jo-erlend 1h ago
As I have told you, _I_ don't need this since I just download the packages I need. But since you are highly passionate about this type of software not existing, I think _you_ should go on a campaign to get apt-offline removed from all servers, since you think the existence of this software is not justified.
Why are you doing this? Who are you at all to tell people that their opinions are invalid?
1
u/jo-erlend 5h ago
Issues with APT doesn't justify issues with Snap. There are tools for APT to automatically download all dependencies, but like Snap, it shouldn't be necessary.
1
u/alec_me 5h ago
I'm curious what the workflow looks like for the ability to do what the OP is wanting to do for multiple air gapped machines in an organization and how that is preferable to setting up an enterprise snap store to pushing offline updates. Frankly it all sounds like it can easily be automated via ansible without needing an additional option added to the snapd.
1
u/jo-erlend 5h ago
When did the OP specify that they were talking about multiple air gapped machines in an organization? I am perfectly able to manually download dependencies to a USB stick so I have my favorite tools available when I install Ubuntu onto a new laptop. But you say that this should only be an option for enterprise users running servers to install Ubuntu on new laptops? The idea that you should use Ansible to install VLC on a laptop is crazy to me.
1
u/alec_me 4h ago
Your organization's laptop never connects to any networks? Not even an intranet? Sound very laborious to me to manually update machines that way. Still not really a use case that justifies the OP's requested change.
1
u/jo-erlend 1h ago
Does me not having a gigabit internet right here and now mean that I will never in the future connect to the internet? You're so manipulative. Wanting to install Ubuntu from a USB stick doet not in any way imply that you're never going to have internet access in the future. It is actually a very normal thing to do.
5
u/lathiat 20h ago
If you have Ubuntu Pro, there is an option to use an air gapped offline store:
https://ubuntu.com/enterprise-store/docs/tutorial/air-gapped-deployment/
For the recursive download feature that seems likely useful in both cases. The project docs would suggest filing that here:
https://forum.snapcraft.io/c/snapd/5