Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: Does "zypper remove" command remove user configuration files like "apt purge"?

  1. #1

    Default Does "zypper remove" command remove user configuration files like "apt purge"?

    I tried searching in the official openSUSE docs website, but I didn't find any info whether
    Code:
    sudo zypper remove PACKAGE_NAME
    will remove user configuration files like what "apt purge" does.

    However, I found this Reddit answer saying that "zypper remove" behaves like "apt purge" Is this correct, and why wouldn't it officially document anywhere?

    Thanks in advance.

  2. #2
    Join Date
    Sep 2014
    Location
    Germany
    Posts
    1,037

    Default Re: Does "zypper remove" command remove user configuration files like "apt purge"?

    Quote Originally Posted by archerallstars View Post
    I tried searching in the official openSUSE docs website, but I didn't find any info whether
    Code:
    sudo zypper remove PACKAGE_NAME
    will remove user configuration files like what "apt purge" does.

    However, I found this Reddit answer saying that "zypper remove" behaves like "apt purge" Is this correct, and why wouldn't it officially document anywhere?

    Thanks in advance.
    man zypper: "... The remove command will uninstall the selected and their dependent packages. ..."

    To me this means that zypper remove will remove all files which were part of the package(s) and it will not remove anything else (e.g. files, which the package(s) created while it/they were installed because those were not part of the package(s))

    So the command does exactly what the manual says. Why should the openSUSE documentation compare zypper remove with apt purge (or any other package managing tool)? This would not be very helpful to me because I do know nothing about apt.

    Regards

    susejunky

  3. #3
    Join Date
    Sep 2012
    Posts
    8,035

    Default Re: Does "zypper remove" command remove user configuration files like "apt purge"?

    Quote Originally Posted by archerallstars View Post
    RPM does not have notion of separate steps "remove" and "purge" like DPKG. RPM package removal removes all files listed as part of package. RPM leaves a copy of modified configuration file with .rpmsave suffix, but once package was removed these files are outside of RPM management and need to be removed manually.

    If file is not listed as part of package, nether RPM (zypper) nor DPKG (apt) will touch it, unless package includes scripts to explicitly clean up such files.

  4. #4
    Join Date
    Jan 2014
    Location
    Erlangen
    Posts
    4,177
    Blog Entries
    4

    Default Re: Does "zypper remove" command remove user configuration files like "apt purge"?

    Quote Originally Posted by archerallstars View Post
    I tried searching in the official openSUSE docs website, but I didn't find any info whether
    Code:
    sudo zypper remove PACKAGE_NAME
    will remove user configuration files like what "apt purge" does. However, I found this Reddit answer saying that "zypper remove" behaves like "apt purge" Is this correct, and why wouldn't it officially document anywhere?
    I don't care what apt does but I definitely want to remove all unneeded packages including their dependencies. I use:
    Code:
    zypper packages --unneeded | grep ^i|cut -d '|' -f3|xargs zypper rm --clean-deps
    See also: What is zypper equivalent of 'apt autoremove'?

    https://www.reddit.com/r/openSUSE/co...pt_autoremove/
    i7-6700K (2016), i5-8250U (2018), AMD Ryzen 5 3400G (2020), 5600X, 5700U (2022) openSUSE Tumbleweed, KDE Plasma
    See also Blogs > KeepItSimple

  5. #5
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    31,302

    Default Re: Does "zypper remove" command remove user configuration files like "apt purge"?

    @karlmistelberger.

    Both answers are not what the OP asked for and thus off-topic and to create confusion.
    Henk van Velden

  6. #6
    Join Date
    Mar 2020
    Location
    São Leopoldo, RS, Brazil
    Posts
    430

    Default Re: Does "zypper remove" command remove user configuration files like "apt purge"?

    Quote Originally Posted by arvidjaar View Post
    RPM does not have notion of separate steps "remove" and "purge" like DPKG. RPM package removal removes all files listed as part of package. RPM leaves a copy of modified configuration file with .rpmsave suffix, but once package was removed these files are outside of RPM management and need to be removed manually.

    If file is not listed as part of package, nether RPM (zypper) nor DPKG (apt) will touch it, unless package includes scripts to explicitly clean up such files.
    I use "sudo rpmconf -a" (from rpmconf package) to remove such leftovers, I believe this is what OP is looking for. It's an interactive tool, also helps to deal with configuration conflicts from package updates.
    openSUSE Tumbleweed

  7. #7

    Default Re: Does "zypper remove" command remove user configuration files like "apt purge"?

    Quote Originally Posted by awerlang View Post
    I use "sudo rpmconf -a" (from rpmconf package) to remove such leftovers, I believe this is what OP is looking for. It's an interactive tool, also helps to deal with configuration conflicts from package updates.
    Wow, thanks a lot. This is what I was looking for. Thanks.

    Note to all users. I didn't want to compare zypper and apt. I just wanted to know how to remove/clear user configuration files of any package like what "apt purge" does, but on openSUSE, not to remove unused packages which would belong to "apt autoremove".

  8. #8
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    31,302

    Default Re: Does "zypper remove" command remove user configuration files like "apt purge"?

    Quote Originally Posted by archerallstars View Post
    I just wanted to know how to remove/clear user configuration files of any package .
    Well, as many here I do not know what those apt commands are supposed to do (and no, we, at least I, are not going to study apt documentation for this lone case), thus saying things like "I want some thing that works like apt-xxx" will not help much. You must define/describe what exactly the effect should be and then we may hope that people here will offer you some (combination of) command(s) that do what you describe.

    That said, are you sure that your apt command will visit the home directories of all users on a system and remove there files it assumes to belong to a certain software package?

    As user, I would be very upset if my system manager would execute things like that and meddle with data I have in my own space, my home directory.

    I do not know exactly what the rpm command advised by @awerlang does, but what he describes seems to come very near to what you want. But I doubt it will change things in users' home directories. It will probably at the most handle system configuration files.
    Last edited by hcvv; 03-Aug-2022 at 11:14.
    Henk van Velden

  9. #9
    Join Date
    Jan 2014
    Location
    Erlangen
    Posts
    4,177
    Blog Entries
    4

    Default Re: Does "zypper remove" command remove user configuration files like "apt purge"?

    Quote Originally Posted by archerallstars View Post
    Note to all users. I didn't want to compare zypper and apt. I just wanted to know how to remove/clear user configuration files of any package like what "apt purge" does, but on openSUSE, not to remove unused packages which would belong to "apt autoremove".
    For your information: I do know what apt commands are doing.

    For details of a recommended way of removal see this example "How to cleanly remove a package from a Debian-based distribution" by Jack Wallen: "When you uninstall an application from Linux, make sure you're doing it in such a way as to remove both configuration files and dependencies." What are those two commands? Let me demonstrate

    Cleanly removing packages with zypper generally requires running both "zypper remove --clean-deps PACKAGE" and "zypper packages --unneeded | grep ^i|cut -d '|' -f3|xargs zypper rm --clean-deps".
    i7-6700K (2016), i5-8250U (2018), AMD Ryzen 5 3400G (2020), 5600X, 5700U (2022) openSUSE Tumbleweed, KDE Plasma
    See also Blogs > KeepItSimple

  10. #10

    Default Re: Does "zypper remove" command remove user configuration files like "apt purge"?

    Quote Originally Posted by hcvv View Post
    Well, as many here I do not know what those apt commands are supposed to do (and no, we, at least I, are not going to study apt documentation for this lone case), thus saying things like "I want some thing that works like apt-xxx" will not help much. You must define/describe what exactly the effect should be and then we may hope that people here will offer you some (combination of) command(s) that do what you describe.

    That said, are you sure that your apt command will visit the home directories of all users on a system and remove there files it assumes to belong to a certain software package?

    As user, I would be very upset if my system manager would execute things like that and meddle with data I have in my own space, my home directory.

    I do not know exactly what the rpm command advised by @awerlang does, but what he describes seems to come very near to what you want. But I doubt it will change things in users' home directories. It will probably at the most handle system configuration files.
    I didn't want you or anyone here to study apt commands. That's why in my thread's title, I described my question pretty clear regarding the removal of user configuration files of "zypper remove" that I wanted to know. If zypper does that, then yes, if not, then thanks for the other tools that anyone here recommended to be used in place of "apt purge".

    AFAIK, there's no package manager that would delete user configuration files in home directory. Even "apt purge" doesn't do that. rpmconf doesn't do that also.

    Now I know that "zypper remove" doesn't remove user configuration files like "apt purge", and I have to use rpmconf for that. Thanks.

Page 1 of 2 12 LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •