
GitHub: sysget – A front-end for every package manager - nathandaly
https://github.com/emilengler/sysget?files=1
======
vbsteven
I'm curious why the author chose to put every command in its own file and then
copy the big if tree with string compares in every file.

Translating commands from a generic command interface to specific commands is
a great case for polymorphism.

~~~
akx
My guess is they didn't know better. That isn't the only amateurism in the
code.

------
therein
It seems nowadays people just upvote based on just the title. This is a switch
statement wrapper around package managers, on the front-page of HN.

~~~
askmike
It's not always about the complexity of the solution. This is a great example
of something annoying a lot of people here can identify with (myself
included). I'd say this annoys a lot of people whose job it is to automate
things, and this is the first proposed solution I see.

Who cares it's a hacked together small program with if statements? It's not
any less interesting than a proposal for a new standard in a 50 page PDF
document to me.

~~~
therein
(1) There are many flags to these commands that you will need to know on a per
platform basis anyway.

(2) Package names aren't always identical across platforms, at least not
enough that you can rely on that.

It is a low-cost attempt to solve a problem that in my opinion doesn't really
exist and it doesn't even do a great job doing that due to the points above.

For instance if you want to use pacman without knowing what -Ss stands for, at
the slightest conflict, you'll be going back to using pacman without this
wrapper.

Perhaps people who need to have package managers abstracted away could be a
good target for Docker. Maybe a web UI to dynamically bake a docker image with
required packages.

~~~
askmike
Yes, abstractions do leak sometimes. I'm not saying I'm running this on all my
production servers right now.

For me the problem this tool solves is real (although not big), and I'm
interested to see what other people think of both the problem and the
solution. That's why I upvoted it, I guess other people had similar ideas.

~~~
nsomaru
What problem does it solve? Just use the package manager provided by the
platform...right? Especially given the problem of package naming, it’s
different even between Debian and Ubuntu :/

~~~
askmike
> Especially given the problem of package naming

I haven't encountered this for all the standard applications I end up
installing on my machines (things like htop, nginx, etc).

> What problem does it solve?

It solves the problem of me having to think about what OS I am on before I can
install something (and if it's something I don't use a lot I might need to
google the package manager syntax).

~~~
mclehman
How common is this? I use 2.5 different package managers day-to-day
(homebrew/pacman/pakku) and a few more occasionally (portage/pkg/apt). I can't
really think of a situation where I had to really think about what I was
running to install something. I'd imagine a scenario in which you're often
dropped into a box you don't usually interact with would typically also come
with a more homogenous environment as far as operating systems go.

~~~
askmike
It's not very common for me. I maintain a few boxes at different hosting
providers for different projects that have been running for a long time.
Sometimes I ssh in and update everything. Right now I have to google everytime
I ssh into a centos box because I keep forgetting the yum syntax.

------
heinrichhartman
C++ is an "interesting" language choice. I would have expected a bash script.
Equally portable, and no hassle with compilation for different arch/OS.

~~~
vinc
I wrote this little thing in bash:
[https://github.com/vinc/pkg](https://github.com/vinc/pkg)

I find it quite useful as I'm switching daily between Arch Linux, Ubuntu, and
MacOS.

~~~
franga2000
I also have a wrapper that I also wrote in Bash that is also called pkg and
also does short commands (pkg i <name>). And here I thought I was being
clever...

~~~
vinc
So it means it's a good idea!

------
hkdobrev
The title of the submission is a bit misleading:

> GitHub: sysget – A front-end for every package manager (github.com)

Right now, it seems like it is GitHub's own project when it's just hosted on
GitHub.

It should be:

> Show HN: sysget – A front-end for every package manager (github.com)

------
zokier
Is packagekit completely dead and forgotten these days?

~~~
franga2000
Not in the GUI world. I believe both KDE Discover and GNOME Software use it,
but I haven't seen it used on the command line. I wonder why...

------
Fnoord
That's not nearly "every package manager".

Topgrade [1] upgrades all packages including distribution package managers
(such as Homebrew, APT, DNF, ...), language specific package managers (such as
Cargo, NPM, Gem, ...), program specific package managers (such as Vim, Tmux,
shells, ...), Flatpak/Snap, working on The Big Three (Windows, Linux, macOS).

I wish there was a way to update Steam and Battle.net from the CLI as well.

[1]
[https://github.com/r-darwish/topgrade](https://github.com/r-darwish/topgrade)

------
jchw
I like this. This makes a lot of sense to me. If it managed to gain adoption
into major distros, it would be incredibly good, though obviously that is a
longshot for a lot of reasons.

If you really want it to get adopted into major distros, the best approach is
probably to convince the systemd folks that it would be a great addition to
their package ;)

edit: A bit of constructive criticism. I really like the concept, but I think
the way that package managers are supported could be improved. I think it
would be better if all of the handlers for a given package manager were in the
same file, instead of having them spread across every file. There's obviously
lots of ways to accomplish this.

Also, as it is now, this project does not seem to use a ton of things that
require C++ - you could shave some binary size cost by converting it to pure
C.

------
anothergoogler
All it does is compare strings and shell out, should be written in something
like Bash rather than C++.

~~~
voltagex_
I guess then they'd have to worry about Bash version (or whether Bash is there
at all).

Why not Go? ;)

~~~
jchw
Love Go, but here's a good reason: This would make a cool piece of software
for inclusion on the base system. Go produces relatively large binaries (for
good reasons of course) and therefore it would probably be harder to ship.

Meanwhile, C++ runtime almost definitely is going to exist on most
bootstrapping images, so it's a lot easier to justify its inclusion - the cost
of the C++ is greatly amortized.

------
berbec
Seems like a cool idea!

Just a thought, what if you allowed it to run in different modes, for people
used to different systems? apt mode, yum mode, pacman mode etc to accept
commands in that format.

~~~
Aeolun
I think this would make it needlessly complex. The idea is to have it be the
same everywhere.

I’d be happy to learn a new syntax if that was the last time I had to deal
with it.

------
heinrichhartman
Some missing features:

    
    
        - Show version of an installed package
        - List content of package
        - Fix package (or reinstall?)
        - Install/Update history
        - Revert last install/update operation
    

Unfortunately not all of these features are directly supported by all package
managers. E.g. package contents for yum are `repoquery -l`. I have to google
this every time. Real value in wrapping that in a simple command.

~~~
emilengler
Disclaimer: I am the guy who made this

The reason is that I only want features that are supported by the most package
managers. Sometimes you get a message that the package manager does not
support this (especially chromebrew). I don't want to add features that only
works with 2 or 3 package managers. I only want features that should work with
every package manager. At the moment there are only essential tools. However I
will try to add as many as possible.

------
mcilloni
... why not PackageKit?

pkcon is a good tool, even if a bit janky, that hides well lots of the
differences between the several package managers it supports.

------
vbernat
Some configuration management tools already abstract package managers. For
example:
[https://puppet.com/docs/puppet/6.0/type.html#package](https://puppet.com/docs/puppet/6.0/type.html#package).

------
unhammer
There is also [https://github.com/icy/pacapt](https://github.com/icy/pacapt)

(I much prefer pacman's interface over trying to remember which of dpkg/apt-
get/apt-policy to use etc., similarly rpm/dnf)

------
alexeiz
On the surface this looks like a useful project. If you plan to use it, do
yourself a favor and avoid looking at the source code.

------
slimsag
How does this handle edge cases like needing to run 'brew link' etc.
occasionally?

What happens when multiple package managers provide the same package?

~~~
orangea
A look at the source code shows that it decides what package manager it should
use by using a config file, and to install a package it runs system("brew
install asdf") so I guess you would see a message telling you to run 'brew
link' from the homebrew output.

------
another-cuppa
A wrapper around emerge? Nope...

------
RayDonnelly
Where's conda?

------
knocte
Missing flatpak :(

~~~
emilengler
Coming soon :)

------
anticensor
Obligatory xkcd: [https://xkcd.com/1654/](https://xkcd.com/1654/)

