Live data from Hacker News

Apt-bundle: brew bundle for apt

github.com

21–30 of 34 posts

Re: Apt-bundle: brew bundle for apt

#21
apk uses a similar approach by default, and I think it's a wonderful way for a package manager to operate.

Basically, /etc/apk/world keeps a list of explicitly installed packages.

When you manually install a package, it's added to this list, when you manually remove a package, it's removed from the list.

Installation and upgrading (and "fixing) merely ensures that those packages and their dependencies are installed, no more, no less. This also automatically cleans up stale, unused dependencies.

It's a lovely way to get deterministic results. You can just back-up that world file, or copy it to another machine and get the exact same installation.

Re: Apt-bundle: brew bundle for apt

#22
post #10

Brew got one thing right that no Linux package manager seems to emulate: it doesn't require root for normal operations and even goes so far as to error out if running as root ( https://docs.brew.sh/FAQ#why-does-homebrew-say-sudo-is-bad ).

It needs world-writtable /opt/homebrew, so I guess a Linux equivalent would be Nix (which IIUC requires writable /nix). For something that only uses your home folder, I recommend checking out mise https://mise.jdx.dev/

Or just homebrew on Linux?

Re: Apt-bundle: brew bundle for apt

#23

apk uses a similar approach by default, and I think it's a wonderful way for a package manager to operate. Basically, /etc/apk/world keeps a list of explicitly installed packages. When you manually install a package, it's added to this list, when you manually remove a package, it's removed from the list. Installation and upgrading (and "fixing) merely ensures that those packages and their dependencies are installed,…

apt-mark manual has allowed the same functionality in apt since forever and probably inspired apk's copy of it :)

Re: Apt-bundle: brew bundle for apt

#24

Earlier quoted context omitted.

What shell scripts would help here? I love me some shell scripting but always reached for debfoster before falling in love with Pac-Man's `-Qe` and `-Qt` Edit: oh this aptfile doesn't do the one thing I actually use brew bundle for: cleaning up the mess of leftover packages

What is this tool solving that I can't do with apt+bash already?

Probably nothing other than the fact that you don't have to maintain it and have less worries about portability, like most command line utilities.

Still, can you share your script?

Re: Apt-bundle: brew bundle for apt

#25
post #10

Brew got one thing right that no Linux package manager seems to emulate: it doesn't require root for normal operations and even goes so far as to error out if running as root ( https://docs.brew.sh/FAQ#why-does-homebrew-say-sudo-is-bad ).

It needs world-writtable /opt/homebrew, so I guess a Linux equivalent would be Nix (which IIUC requires writable /nix). For something that only uses your home folder, I recommend checking out mise https://mise.jdx.dev/

In multi-user mode, Nix uses dedicated build users to write to the store. There is also single-user mode, but that also doesn't require a world-writable store.

Re: Apt-bundle: brew bundle for apt

#26
post #10

Brew got one thing right that no Linux package manager seems to emulate: it doesn't require root for normal operations and even goes so far as to error out if running as root ( https://docs.brew.sh/FAQ#why-does-homebrew-say-sudo-is-bad ).

Brew _is_ a linux package manager.

There is also conda/mamba/pixi/etc. (anything in the conda-forge ecosystem) that can be used without root. Then there are Guix and nix, which (mostly) require to be set up by someone with root privileges, but which then allow unprivileged users to install packages for themselves. I think I have even used emerge rootless-ly at some point a few years ago.

Re: Apt-bundle: brew bundle for apt

#27
post #10

Brew got one thing right that no Linux package manager seems to emulate: it doesn't require root for normal operations and even goes so far as to error out if running as root ( https://docs.brew.sh/FAQ#why-does-homebrew-say-sudo-is-bad ).

Brew is so full of Linux/OSS/GNU anti-patterns that I can't wrap my head how did it ever managed to receive so much adoption. I guess macOS people are way more ignorant about things that made Linux/OSS what it is.

Re: Apt-bundle: brew bundle for apt

#28
post #3

Big fan! Was like magic at first but now I have a big bunch of Aptfiles to deal with instead... Currently working on solving that with the next-generation tool apt-bundle-bunch, which has a simple declarative format to manage your apt-bundle projects in an Aptbundlefile. It's already great for agents and Im working with Claude on a curl|sh install for the v1.

> Big fan! Was like magic at first but now I have a big bunch of Aptfiles to deal with instead... Currently working on solving that with the next-generation tool apt-bundle-bunch, which has a simple declarative format to manage your apt-bundle projects in an Aptbundlefile. It's already great for agents and Im working with Claude on a curl|sh install for the v1. Good luck share the progress and let us know how it goes…

One key insight is that bundles are really sets of packages and that what we're doing when we bundle things is really just set join operations. Imagine the possibilities if we implement arbitrary set operations. So a bunch is defined as a set of bundles (which can themselves be down to a single package of course) and the declarations in the Aptbundlefile translates under the hood to references and set operations. This is not only declarative, it's also purely functional. Still working on if arbitrary set operations should be accessible by DSL in Aptbundlefile or if that should be left to tools building on top of intermediary API. So yeah, parallels to Nix for sure but it's still apt packages, not building the world from source.

Re: Apt-bundle: brew bundle for apt

#29
post #27
post #10

Brew got one thing right that no Linux package manager seems to emulate: it doesn't require root for normal operations and even goes so far as to error out if running as root ( https://docs.brew.sh/FAQ#why-does-homebrew-say-sudo-is-bad ).

Brew is so full of Linux/OSS/GNU anti-patterns that I can't wrap my head how did it ever managed to receive so much adoption. I guess macOS people are way more ignorant about things that made Linux/OSS what it is.

Can you give some examples?

Re: Apt-bundle: brew bundle for apt

#30
post #27
post #10

Brew got one thing right that no Linux package manager seems to emulate: it doesn't require root for normal operations and even goes so far as to error out if running as root ( https://docs.brew.sh/FAQ#why-does-homebrew-say-sudo-is-bad ).

Brew is so full of Linux/OSS/GNU anti-patterns that I can't wrap my head how did it ever managed to receive so much adoption. I guess macOS people are way more ignorant about things that made Linux/OSS what it is.

It doesn't help that the project authors shut down any conversation about flaws.

They're so convinced that their way is right and essentially stick their fingers in their ears when anyone raises concerns.

Unfortunately cargo culting is a thing.

I say this as a macOS user.

Fortunately alternatives like MacPorts exist.

Post reply on HN