Coder Social home page Coder Social logo

vanilla-os / apx Goto Github PK

View Code? Open in Web Editor NEW
477.0 12.0 36.0 4.04 MB

Apx is the Vanilla OS package manager. It’s meant to be simple to use, but also powerful with support to installing packages from multiple sources without altering the root filesystem.

Home Page: https://docs.vanillaos.org/docs/en/apx

License: GNU General Public License v3.0

Go 98.81% Makefile 1.19%
apx distrobox linux package-manager vanillaos hacktoberfest command-line

apx's People

Contributors

arejula27 avatar axtloss avatar benstone326 avatar bittin avatar bketelsen avatar d3vil0p3r avatar dependabot[bot] avatar ecseditamas avatar flipflop97 avatar jim3692 avatar kbdharun avatar lakejason0 avatar matbme avatar mirkobrombin avatar monsterobserver avatar nacho12martin avatar nattadasu avatar norwayfun avatar opensauce04 avatar peterrakmanyi avatar pietrodicaprio avatar puretryout avatar rhcalderon avatar rubenhorn avatar sebgm2020 avatar song-juo avatar spaceguybob avatar weblate avatar x0x-code avatar yorimirus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

apx's Issues

[Question] Hardcoded distrobox paths

Regarding my PR #55, I wanted to ask whether it is really required to provide the full path of distrobox.

I found some pieces of code where the binaries are searched in the PATH. For example:

c.Run("sh", "-c", "distrobox-export --app "+program+" 2>/dev/null || true")

out, err := c.Output("sh", "-c", "distrobox-host-exec $(getent passwd $USER | cut -f 7 -d :) -l -i -c printenv | grep -E ^PATH=")

c.Run("sh", "-c", "distrobox-export --bin "+string(bin_path)+" --export-path ~/.local/bin >/dev/null 2>/dev/null || true")

Better integration with system

Is there any way of getting apx more integrated with system? Containerized spotify-edge from aur can't open login buttons using any browser from any other container or flatpak, only using installed from aur container. And browser installed from any container can't be chosen as default in gnome settings app.

Changing system timezone breaks container

I changed the system timezone on my fresh VanillaOS install and was no longer able to enter the default container, being met with the following message.

Error: OCI runtime error: unable to start container "8a99d8ffdf38fba65f173f069bc0adb567edac94037f0525dfaecc3b6176ce8f": mount /etc/localtime to /etc/localtime: Not a directory

Export binaries

Since apx uses Distrobox in the background to manage containers, which supports exporting binaries from the container to the host, it would be a nice feature to integrate into apx. It feels a bit clunky to alway type 'apx run' before the actual command and having a way to directly run the program from the host cli would make apx feel more tightly integrated.

apk Alpine gonna be supported in futur ?

Alpine is very great, their package is update regularly, stable, installation is blazing fasssssttt compare to Ubuntu / other 😄

If you want to try how alpine is fast compare with ffmpeg

Alpine :

docker run -it --rm alpine

apk update && apk add ffmpeg

Ubuntu :

docker run -it --rm Ubuntu

apt update && apt install ffmpeg -y

Ubuntu package is old for almost all things, alpine have frequently updated version of packages. Ffmpeg is old on Ubuntu more than 2 years almost.

Sorry for my English 😅

apx version command

apx has a root level -v flag to show version, but the man page and help say there is an apx version command. It doesn't exist. We should either add it, or remove the version subcommand from the help/man page.

Installing with the --sys flag doesn't reenable immutability in vanilla os after the installation process completes

When installing to the system directly, apx doesn't reenable immutability after it's done modifying the file system. This is on the unstable.20221106 iso.

Here is the terminal output:

adam@vanilla:~$ sudo almost check
[sudo] password for adam: 
Mode: ro
System is read-only
adam@vanilla:~$ apx install --sys pcmanfm
Apx :: Performing operations on the host system.
Reading package lists... Done
Building dependency tree... Done
...
adam@vanilla:~$ sudo almost check
Mode: rw
System is read-write

Podman/Docker check in Apx differs from Distrobox

Distrobox prioritize docker on its check for a manager, while Apx prioritize podman. In Apx we use the manager direclty to list and remove containers, so if docker is installed in the system, distrobox will use it to make new containers but since Apx prioritize podman, if this is also found in the system it will not found the existing containers.

connect failed

I want to modify the CheckConnection URL in the configuration file,I can't access google.com

Properly tag releases in git

I see apx is supposed to have the version 1.3.4 according to e94504e, but this isn't reflected in neither git nor Github, since the version (or any other) hasn't been properly tagged. Please do so so it can be packaged properly in a multitude of distributions and it's easier to track which version is which point in history.

auto generate man page

Cobra will auto-generate man pages.
Investigate doing this cleanly during the build process.

Kernel update error on sudo vso trigger-update --now

Hello everybody!
I've been trying to update my system, but the following happens:

Setting up vanilla-base-desktop (1.0.0) ...
Processing triggers for linux-image-5.19.0-28-generic (5.19.0-28.29) ...
/etc/kernel/postinst.d/dkms:

  • dkms: running auto installation service for kernel 5.19.0-28-generic
    Sign command: /usr/bin/kmodsign
    Signing key: /var/lib/shim-signed/mok/MOK.priv
    Public certificate (MOK): /var/lib/shim-signed/mok/MOK.der
    ACPI disabled in this kernel, not building module.
    Error! The /var/lib/dkms/acpi-call/1.2.2/5.19.0-28-generic/x86_64/dkms.conf for module acpi-call includes a BUILD_EXCLUSIVE directive which does not match this kernel/arch/config.
    This indicates that it should not be built.
    Sign command: /usr/bin/kmodsign
    Signing key: /var/lib/shim-signed/mok/MOK.priv
    Public certificate (MOK): /var/lib/shim-signed/mok/MOK.der
    Error! Your kernel headers for kernel 5.19.0-28-generic cannot be found at /lib/modules/5.19.0-28-generic/build or /lib/modules/5.19.0-28-generic/source.
    Please install the linux-headers-5.19.0-28-generic package or use the --kernelsourcedir option to tell DKMS where it's located.
    Sign command: /usr/bin/kmodsign
    Signing key: /var/lib/shim-signed/mok/MOK.priv
    Public certificate (MOK): /var/lib/shim-signed/mok/MOK.der
    Error! Your kernel headers for kernel 5.19.0-28-generic cannot be found at /lib/modules/5.19.0-28-generic/build or /lib/modules/5.19.0-28-generic/source.
    Please install the linux-headers-5.19.0-28-generic package or use the --kernelsourcedir option to tell DKMS where it's located.
    ...done.
    /etc/kernel/postinst.d/initramfs-tools:
    update-initramfs: Generating /boot/initrd.img-5.19.0-28-generic
    /etc/kernel/postinst.d/zz-update-grub:
    /usr/sbin/grub-probe: error: failed to get canonical path of `overlay'.
    run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 1
    dpkg: error processing package linux-image-5.19.0-28-generic (--configure):
    installed linux-image-5.19.0-28-generic package post-installation script subprocess returned error exit status 1
    Errors were encountered while processing:
    grub-pc
    linux-image-5.19.0-28-generic
    E: Sub-process /usr/bin/dpkg returned an error code (1)
    Error: exit status 100
    Description:
    Execute a command in a transactional shell in the future root partition and switch to it on the next boot.

My VanillaOS was installed during beta periodo and since than I have done some updates without problem.
If I could provide more information, please, let me know

Thanks

Support for multiple users

We could add the user ID on the container name. When the user invokes any apx command, then apx will connect to the container that is owned by that user.

I am not aware of any Docker way to have different containers for each user. It may be possible with Podman, as it is daemon-less.

User ID was chosen over the username, as the username could change, but the ID should always remain the same.

Another option, would be to add more users to the existing containers, but having different containers for each user provides better isolation. Also, the initial user is created by Docker itself inside distrobox, and I don't know whether it's a good idea to override Docker's/Podman's behavior.

`apx run` does not pass arguments

Summary

When invoking commands using apx run, it should be possible to pass command line arguments to the command being invoked inside the container, analogous to podman run.

Expected Behavior

When invoking a command using apx run, any command line arguments given after the command name should be passed along to the command being run, and not interpreted by apx.

Similar to docker/podman, flags belonging to apx should be passed after the run command but before the program name. Everything after the program name should be passed to the container verbatim.

Actual Behavior

Command line arguments are being interpreted by apx instead.

For instance, apx run ls -l shows the following error message:

Error: unknown shorthand flag: 'l' in -l
Usage:
  apx run <program> [flags]

Examples:
apx run htop

Flags:
  -h, --help   help for run

Global Flags:
      --apk           Install packages from the Alpine repository.
      --apt           Install packages from the Ubuntu repository.
      --aur           Install packages from the AUR (Arch User Repository).
      --dnf           Install packages from the Fedora's DNF (Dandified YUM) repository.
  -n, --name string   Create or use custom container with this name.

Specifications

  • Version: apx version 1.4.2
  • Platform: VanillaOS 22.10
  • Kernel: Linux 5.19.0-29-generic

Attempting to use almost any apx command as root results in a panic

Preface: It is my understanding that apx is not meant to be run as a root user. Though I would say its preferable to display a tip/warning or guide the user to relevant documentation instead of panicking.

Affected CLI commands:

- autoremove
- clean
- export
- init
- install
- list
- purge
- run
- remove
- search
- show
- unexport
- update
- upgrade
- version

I.e. all except help (prints help message as expected) and enter (cannot find the associated managed container).

Example:

user@vanilla:~$ sudo apx --dnf update
⣾ Creating container...⌬ Apx :: exit status 1
panic: exit status 1

goroutine 1 [running]:
log.Panic({0xc00014bba0?, 0x16?, 0xc00014bbb0?})
	log/log.go:388 +0x65
github.com/vanilla-os/apx/core.CreateContainer({0x880ff3, 0x3})
	github.com/vanilla-os/apx/core/container.go:188 +0x35b
github.com/vanilla-os/apx/core.RunContainer({0x880ff3, 0x3}, {0xc00015c9c0, 0x4, 0x0?})
	github.com/vanilla-os/apx/core/container.go:108 +0x7e
github.com/vanilla-os/apx/cmd.update(0xc0001ac280?, {0xc000111a20, 0x0, 0x1?})
	github.com/vanilla-os/apx/cmd/update.go:63 +0x2ee
github.com/spf13/cobra.(*Command).execute(0xc0001ac280, {0xc000111a10, 0x1, 0x1})
	github.com/spf13/cobra/command.go:872 +0x694
github.com/spf13/cobra.(*Command).ExecuteC(0xc00012bb80)
	github.com/spf13/cobra/command.go:990 +0x3bd
github.com/spf13/cobra.(*Command).Execute(...)
	github.com/spf13/cobra/command.go:918
main.main()
	github.com/vanilla-os/apx/main.go:87 +0x672

Sideload deletes the package, even if installation was canceled

When using apx install --sideload, the package file is deleted, even if the installation is canceled or fails for some reason. This is undocumented, unexpected, and destructive.

It appears that this is due to this line, which moves the file to a temp directory:

path, err := core.MoveToUserTemp(args[0])

However, the file is never moved back, regardless of the success or failure of the operation. Perhaps it would be a better idea to copy the file there instead?

packages from AUR not install by default

I solved it but I think it could be improved

with apx --aur install (package) with packages from the arch linux official repository install normally

but packages that belong to the AUR repository, need some additional packages even though yay is already installed by default:

git
fakeroot
binutils

the official documentation about AUR recommend install base-devel but these 3 were enough every time I needed it

would it be possible to install these 3 packages or base-devel automatically as soon as the container is created? I think it would improve usability if it is possible to do

Install the NVIDIA driver inside container if it is installed on the host

By default when running Vanilla OS and installing the NVIDIA driver then installing a container the container doesn't include the NVIDIA driver needed for GPU acceleration

This can be easily fixed by checking the driver version in Vanilla control center then installing it manually with apx install nvidia-driver525 for example, but this is quite annoying to do and will likely break when you update the driver this should be handled automatically ideally by

  1. Checking if the Nvidia driver is installed
  2. Running Nvidia smi or some similar Go function to get driver version
  3. Install the driver

And on installing new Nvidia driver

  1. Check the driver version
  2. Compare with version in container
  3. Install new version if needed in all containers

It might be convenient to perhaps make a repository to install the correct NVIDIA driver for each distro apx supports e.g. Fedora, Arch since the newest version might be different on all of them because of different release cycles

"Error: exit status 1" when exporting a binary

apx version 1.4.1-2

Repro steps:

  1. Create fresh aur container (apx init --aur)
  2. Install the necessary packages to be able to build packages inside the aur container (sudo pacman -S --needed git base-devel)
  3. Install gotop from the aur (apx install --aur gotop)
  4. Try to export gotop (apx export --aur --bin gotop)

Expected Result:
I can either run gotop using a desktop shortcut or via terminal (apx run gotop)

Actual Result:
The following is printed in console and neither shortcuts are available to gotop: "Error: exit status 1"

Screenshot from 2023-01-16 23-22-52

Colors/shell escape codes aren't properly handled

apx errors look like this:
image

I assume this shouldn't be the case and instead print the error message with colors.
This happens on fish and bash.
System is crystal linux (arch), with latest apx cloned on 15/09

apps installed with apx can't reach bluetooth?

Hi there.
I installed blueman with apt (via apx) so I can connect my headphones to my computer.
when I opened the app it gave me an error with the text: Bluez daemon is not running.
Now the problem is apparently that apps like blueman cant reach the bluetooth card (I think).

When I try bluetoothctl in an apx container it says:

Waiting to connect to bluetoothd...dbus[3940]: arguments to dbus_connection_get_object_path_data() were incorrect, assertion "connection != NULL" failed in file ../../../dbus/dbus-connection.c line 5921.
This is normally a bug in some application using the D-Bus library.

D-Bus not built with -rdynamic so unable to print a backtrace

Is this an bug / problem or am I doing something wrong?
Thanks for you're time and hard work!

Minimise and maximise button

Could you add the minimise and maximise button by default ? It's very annoying to install gnome tweaks and do it manually.

Atomic installations using overlays

Since Almost supports overlays via overlayfs and those are already being used for Atomic updates, might be a good idea to use the same feature to perform a kind of atomic installation, by applying the transaction only if succeed.

User-selected graph driver error

When using apx install x or apx run x, I get the following error:
ERRO[0000] User-selected graph driver "overlay" overwritten by graph driver "vfs" from database - delete libpod local files to resolve

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.