Software Center Package Removal Behaviour

Removing packages from software center (NethServer 7 beta1):

I think this one has been asked before (@Jim, @GG_jr ) and answered already in other threads:

…but this will still create confusion, as the packages marked for removal (selected nethsever-package + dependencies + dependencies of dependencies?) are not what the user expects (and she will also find some menu entries were removed).

Software Center removes only nethserver-* packages (eg. nethserver-squid), not related CentOS packages (eg. squid is not removed).

What the user expects (correct me if I’m wrong) is to remove:

  • selected nethserver package,
  • its dependencies (only if they are not dependencies of other installed packages),
  • related CentOS packages (only if they are not dependencies of other installed packages)

I guess what the user expects might be complex to achieve without breaking other things, but do you think there is a way to improve it?

For instance, the yum.conf main section accepts the groupremove_leaf_only=1 directive, which might be more in tune with what the user expects (but not perfect). But then, as of now, the Available/Installed packages won’t reflect its real status in the Software Center.

–Edit–

This might be related with a previous enhancement request:
http://dev.nethserver.org/issues/3168

5 Likes

Your proposal sounds reasonable! :thumbsup:

However from you screenshot it seems not possible to remove nethserver-mysql! Am I wrong?

Recently @Stll0 tweaked the UI to produce the list of packages that are going to be removed and show it upon the confirmation dialog you attached above. We avoided changing the default upstream yum.conf and focused on making the UI more friendly. I must admit we dropped the module removal feature on the Enterprise version because the default recursive behavior is too disruptive!

Yes, I added the parameter stated above to yum.conf, then in the example nethserver-mysql won’t be removed as it is a dependency of other installed packages.

Another interesting yum.conf parameter is clean_requirements_on_remove but have not done any test.

Sorry, I don’t understand what’s different. Is there an updated package to test?

Seems promising! I’d have a run with it…

Nothing new to test, it was just to say me and @Stll0 recently tried to improve the removal behavior and ended up with that UI tweak. We (still) didn’t find an enhancement to yum.conf that is good enough to drop the default configuration.

BTW, we needed to set group_command=compat to restore the old YUM way we had on ns6 to distinct between installed/uninstalled groups.

In this case, we should provide an explanation to the user, saying nethserver-mysql is a dependency for nethserver-nextcloud and nethserver-samba-audit and can’t be removed.

It seems almost the same as providing the complete list of what is going to be removed on cascade. What do you think?

I’m behind you. Looks more clear and explanatory.

1 Like

I agree, maybe I’d accept a good PR for it but…

It requires to (1) change the default yum.conf and (2) rework the Software Center.

Maybe I’m wrong but I think this kind of feature is useful during experiments with NethServer features, like the current Beta development stage.

Nobody would press the “remove” button on a production server.

I did some tests (NS7) and the clean_requirements_on_remove directive works “better” (from a user’s point of view) when coupled with both remove_leaf_only and groupremove_leaf_only directives.

With this yum and software center seem to work more in the way a user would expect:

# yum.conf: changing yum remove behaviour
clean_requirements_on_remove=1
group_command=compat
groupremove_leaf_only=1
remove_leaf_only=1

According to the documentation, in dnf (fedora) the clean_requirements_on_remove directive is enabled by default.

Using yum remove packagename && yum autoremove is not quite yet the same.

1 Like

The list of packages to remove would be displayed anyway and should be enough, but the first case would be quite handy.

Could you open a PR with this? How can I help?

Is the patch limited to the yum.conf template?
Do we need to change also the UI code?

With the yum.conf changes we get:

but we still could get an empty list of packages to remove:

So some UI tweaks would be appropriate, just to show why it won’t be removed.

If @giacomo and other members are OK with this change I can open a PR.
Give some time to look at the code, but I might need some help on retrieving the list of dependencies preventing the removal.

2 Likes

I did some quick tests and the removal behavior seems good to me.
Still I have doubts about these changes since I fear we will face some more hidden troubles.
Also be aware these changes will affect the yum behavior when used from the command line.

I would gladly review the PR, but before releasing the packages we need a big effort from the quality team :slight_smile:

1 Like

It’s possible to set those options from a shell wrapper

yum --setopt=...

…the problem here is we have a python wrapper :slight_smile:

/sbin/e-smith/pkgaction

Kudos to @dnutan for opening a PR! Please go on!

2 Likes

@davidep, I will need some help (disclosure: I’m not a developer :cold_sweat:).

I was about to ask if the system commands (yum, rpm…) executed by the server-manager were aware of the locale context: now I know they use the language set at web login.

It is working almost well with rpm, as it gives a clean output, but there are some cases (nethserver-ftp) where it does not give accurate information on whatrequires a specific package.

Help with regex
Now I’m trying with /usr/bin/yum -C --assumeno remove $@ . If you can help on getting a proper regex pattern to match all the packages shown on Keeping package: lines (regardless of language), because I am tempted to the ugliness of forcing the language at runtime :grin:.

—> Keeping package: nethserver-samba-2.0.0-1.ns7.noarch due to nethserver-samba-audit-1.1.0-1.ns7.noarch

Some troublemakers:

// translation pattern: msgstr “—> 软件包 %s.%s.%s.%s-%s 将被 %s”
// translation pattern: msgstr “—> 保留软件包:%s 由于 %s”

—> 软件包 nethserver-mysql.noarch.0.1.1.0-1.ns7 将被 删除
—> 保留软件包:nethserver-mysql-1.1.0-1.ns7.noarch 由于 nethserver-samba-audit-1.1.0-1.ns7.noarch

// translation pattern: msgstr “—> A(z) %s.%s %s:%s-%s csomaggal a következő történik: %s”
// translation pattern: msgstr “—> A(z) %s Csomag megtartása a következő miatt: %s”

—> A(z) nethserver-mysql.noarch 0:1.1.0-1.ns7 csomaggal a következő történik: törölve
—> A(z) nethserver-mysql-1.1.0-1.ns7.noarch Csomag megtartása a következő miatt: nethserver-samba-audit-1.1.0-1.ns7.noarch

→ Manteniendo paquete: nethserver-samba-2.0.0-1.ns7.noarch debido a nethserver-samba-audit-1.1.0-1.ns7.noarch

—> Balíček nethserver-samba-2.0.0-1.ns7.noarch ponechán, protože: nethserver-samba-audit-1.1.0-1.ns7.noarch

Help with permissions
If a shell script under /usr/libexec/nethserver/ needs to run under sudo when called from server-manager, do I need to set an acl on the file (for running tests)? how?

No hurry.

P.S. Don’t know if there is something in the yum python API that can be implemented to run at runtime without changing yum.conf

Now you are! :smiley:

I’d write a shell wrapper that invokes yum command by setting the environment variable LANG=C.

This would help on building a matching regex pattern.

No, permissions should be as usual (root,root,0755).

IIRC we already do it:

1 Like

@davidep, thanks for the tips. :slight_smile:

I’m holding the changes and thinking to dismiss them due to some quirks, as @giacomo feared.

From the UI seems to work well, but we may find packages with ¿circular dependencies? difficulting its removal from CLI, or other quircks:

  • circular dependencies ¿? between dkms and pfring-dkms, and between cups and ghostscript-cups
  • uninstalling cups removed acl package (pre-installed with the system) Maybe I did something wrong (in yum.conf) before installing/removing it.
  • Normal ¿?: @nethserver-mail: removes nethserver-roundcubemail (optionals), nethserver-getmail (optionals)
  • Same as happens without the changes: @nethserver-web-filter removes squid (with @nethserver-web-proxy installed)

What are your thoughts?

3 Likes

First of all, kudos! :smiley:
I din’t have the patience to dig into the web interface code like you did!

Circular dependencies on dkms packages can happen, but pfring-dkms comes from ntopng repository and, honestly, that package is crap.

I think both are correct.

Really no idea on this, but I saw this kind of strange behaviors long time ago when testing auto removal tools for yum.

IMHO package removal is a not-resolved problem and create a simple web interface for it is even more difficult :slight_smile:

2 Likes

I’d like to continue this discussion here gathering some thoughts about the current topic
What do you think to leave the “remove” activities in the CLI only, dropping the DELETE button?
@ambassadors_group

2 Likes

I am in favor of such an option provided there will be documentation available on how to un-install nethserver modules.
I understand the default ‘yum uninstall packagename’ but I don’t know the official module packages.
It would be nice to see a wikipage with all the nethserver modules and how to install and de-install then through the commandline.

1 Like