Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Suggestion] distrobox system-upgrade #1338

Open
boredsquirrel opened this issue Apr 10, 2024 · 2 comments
Open

[Suggestion] distrobox system-upgrade #1338

boredsquirrel opened this issue Apr 10, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@boredsquirrel
Copy link

boredsquirrel commented Apr 10, 2024

Distrobox is using OCI containers very differently than they are meant to. Normally you would just use podman etc. commands to update a container, and also for rebasing to the next release.

This does not work with this model, as the base image is minimal and mostly used for doing manual overwrites to it. Everything included is also likely included in something like Fedora atomic desktops.

As context I would also like to separate the home directories by default, so I will integrate this requirement in the idea.

distrobox system-upgrade NAME should work like this:

  1. Enter the box.
  2. cd ~
  3. `if $PWD == "/home/$USER" or "/var/home/$USER"
  4. Create a backup dir mkdir ~/DISTROBOX-$NAME-BACKUP
  5. Copy only .config and whatnot into that dir
  6. else (user is using a different home)
  7. copy the entire home to that backup dir, break
  8. Now determine the OS, related to the [Suggestion] Use /etc/os-release or /etc/lsb_release for distrobox-upgrade #744
  9. Use one of a set of different commands to somehow get all the manually installed apps (there has to be a way right? Something else than history | grep dnf install
  10. Save those apps to a variable
  11. Use podman pull or whatever used container tool, get the version and name of the used OCI image
  12. Fetch all images, somehow separate the numbers and calculate to only show higher values than the current release version
  13. Display a dialog
Upgrading $NAME, choose a version:

1
2
3
  1. Use a read prompt (or something more elegant, like Ratatui) to let the user choose an option
  2. Remove or directly upgrade the used OCI container, discarding all local differences (if needed by removal and reinstallation) (keep the name)
  3. Enter it
  4. Reinstall the packages using the package manager defined above
  5. Copy or move the backup .config or entire home to this boxes home, also using a variable from above maybe
  6. Display a nice finished notification!

What do you think? This is pretty complex, btw using topgrade from within the box should require no dependencies and make things a loot easier. (Ublue uses that in their updater so support is pretty much guaranteed).

Cheers!

@boredsquirrel boredsquirrel added the enhancement New feature or request label Apr 10, 2024
@boredsquirrel
Copy link
Author

This comment is meant as a brainstorm, to gather ideas how to do this or possible issues.

Also if outsourcing updates to topgrade would be an option (as this would effect this feature) and if the mentioned bug would be fixed.

Then I would try and create a PR.

@89luca89
Copy link
Owner

89luca89 commented May 1, 2024

Hi @boredsquirrel

yea that indeed is a use-case to cover, but I'm still not convinced by either me accumulating commands, nor using external dependencies 😅

Ideally an user would use distrobox-assemble and have manifests, that would just require to re-create the container to pull the :latest image and be done with it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants