zyedidia / eget

Easily install prebuilt binaries from GitHub.
MIT License
954 stars 39 forks source link

Install deb packages automatically #39

Closed ngirard closed 2 years ago

ngirard commented 2 years ago

Using latest version of Eget on Ubuntu 21.10.

❯ eget --asset=deb --asset=amd64 cli/cli
https://github.com/cli/cli/releases/download/v2.11.3/gh_2.11.3_linux_amd64.deb
Downloading 100% [======================] (7.7/7.7 MB, 44.170 MB/s)        
Extracted `gh_2.11.3_linux_amd64.deb` to `gh_2.11.3_linux_amd64.deb`

In this scenario, it would be nice if Eget could automatically do the equivalent of sudo dpkg -i ./gh_2.11.3_linux_amd64.deb && rm ./gh_2.11.3_linux_amd64.deb.

Cheers

dufferzafar commented 2 years ago

I for one would not want the install to happen, since I don't have sudo access on the box. I always download tarballs to avoid that. But this could go behind a feature flag.

eadmaster commented 2 years ago

Debs aren't the only package format to be supported, prolly better to generalize this with a list of delegates to be invoked (eg. rpm, appimage, flatpak, etc.)

zyedidia commented 2 years ago

I’m not sure there should be a special flag for automatically running package installers. You can use stdout to do this with something like eget -q -a .deb -a amd64 cli/cli --to /dev/stdout | sudo dpkg -i /dev/stdin

indigoviolet commented 1 year ago

@zyedidia Your suggestion doesn't work: pkg: error: archive '/dev/stdin' is not a regular file (https://askubuntu.com/a/170441)

zyedidia commented 1 year ago

Ah alright, I guess you'll have to create a temporary file: eget -q -a .deb -a amd64 cli/cli --to /tmp/cli.deb && sudo dpkg -i /tmp/cli.deb