Packages added by the dependency solver in order to resolve a user's request, are marked as having been automatically installed. They may later be removed, if no more manually installed packages depend on them (e.g. by zypper remove --clean-deps).

However things may go haywire. Automatically installed packages may turn out to be useful, and you may want to exclude them from any automatic cleanup. And vice versa.

For this you need to be able to inspect and manipulate a packages 'autoinstalled' property. This is what this project is going to provide.

Zypper search/info command output should distinguish between 'automatically' installed packages and those requested by the user, e.g. by using 'i' for automatically installed and 'I' for user requested packages.

2 new commands markauto/unmarkauto shall allow to change an installed packages 'autoinstalled' property.

Ihis is IMO the prerequisite if we want to provide more automatic cleanup commands.

Looking for hackers with the skills:

zypper

This project is part of:

Hack Week 15

Activity

  • almost 8 years ago: blarson left this project.
  • almost 8 years ago: blarson joined this project.
  • almost 8 years ago: joachimwerner liked this project.
  • almost 8 years ago: pluskalm liked this project.
  • almost 8 years ago: mlandres added keyword "zypper" to this project.
  • almost 8 years ago: mlandres removed keyword zypper from this project.
  • almost 8 years ago: mlandres added keyword "zypper" to this project.
  • almost 8 years ago: mlandres started this project.
  • almost 8 years ago: mlandres originated this project.

  • Comments

    • dmacvicar
      almost 8 years ago by dmacvicar | Reply

      Would it make more sense to start turning zypper into a more subcommand kind of ui to avoid polluting the UX with tons of command?

      Like:

      zypper mark --auto or zypper mark auto

      (thing of git remote add vs git remoteadd)

    Similar Projects

    "autoremove" functionality for zypper by e_bischoff

    The purpose would be to have the equivalent of Ubuntu's "apt-get autoremove" functionality.

    When you install package P, it might draw in dependancies D1, D2, ... Dn automatically.

    When you later uninstall P, the dependancies D1, D2, ..., Dn might remain on your system.

    If you keep installing and uninstalling packages, after a while your system remains cluttered with things you don't need.

    The idea would be to mark all dependancies that were installed but not explicitely requested as "installed automatically". Then a command like "zypper autoremove" could remove them at once if they are not needed anymore.

    Approaches seen online

    After scouring forms for solutions these are some alias's used to replicate the functionality

    1. zypper packages --unneeded | awk -F'|' 'NR==0 || NR==1 || NR==2 || NR==3 || NR==4 {next} {print $3}' | grep -v Name | sudo xargs zypper remove --clean-deps

    2. This one is a script and has bashisms bash mapfile -t unneeded < <(zypper --quiet pa --unneeded | awk '$1 == "i" { print $5, "-", $7 }') (( ${#unneeded@]} )) && sudo zypper --quiet rm --clean-deps --details "${unneeded@]}"

    3. sudo zypper rm $(zypper pa --unneeded | awk '/i / {print $3}' FS='|' | uniq | tr -d ' ')

    Based on testing zypper packages --orphaned provides packages that are not in any repo, even if a user has explicitly installed them, so --orphaned may not be the way to go, instead focusing on --unneeded


    Ansible for add-on management by lmanfredi

    Description

    Machines can contains various combinations of add-ons and are often modified during the time.

    The list of repos can change so I would like to create an automation able to reset the status to a given state, based on metadata available for these machines

    Goals

    Create an Ansible automation able to take care of add-on (repo list) configuration using metadata as reference

    Resources

    Results

    Created WIP project Ansible-add-on-openSUSE