Remove unuse RPM during rollback with zypper

[FONT=Verdana]Hi Folks,

I have an trouble when using zypper command to rollback software. I’m using SUSE Linux Enterprise Server 12 SP1 (x86_64).

Let’s say i have one RPM named main-1.0.0.x86_64.rpm,it has dependency as following:
main-1.0.0.x86_64.rpm
|_ foo-1.0.0.x86_64.rpm

After some time of development, i add one more dependency to RPM main , and the RPM main version upgrade to main-1.1.0, now it has such an dependency:
main-1.1.0.x86_64.rpm
|_ foo-1.0.0.x86_64.rpm
|_ bar-1.0.0.x86_64.rpm

Assume that current my SUSE system installed main-1.1.0.x86_64.rpm, now i wnat to rollback main-1.1.0.x86_64.rpm to main-1.0.0.x86_64.rpm, with following command:

sudo zypper --no-gpg-checks -n in --force-resolution --oldpackage --replacefiles -r myrepo main-1.0.0



The rollback compelete successfully, but problem is bar-1.0.0.x86_64.rpm still left on my SUSE system, my question is how can i do to make the unused RPM(bar-1.0.0.x86_64.rpm) removed during rollback without additional operation?

Thanks.

[/FONT]

I think this is a variant on the problem asked here several times: I installed package A, packge B and C were also installed as dependencies. Now I deinstalled A, but B and C are still there.

Remember that B and C were installed because A asked for it. AND they were not installed at that moment in time. Maybe D is also a dependency of A (or B), but was already installed. Now what to do when A is deinstalled?
All of them (specialy D) might still be wanted by other packages (which is something that zypper could detect and warn for), but zypper can not “know” if e.g. C is in the mean time is wanted on the system for other reasons (e.g. havinga program that is executed directly by users).

IMHO, your case is even more tricky because nothing is deinstalled at all. It is an update and some packages are installed because they are of a newer version. There is no information whatsoever that the package that, according to you, is superfluous is not updated because there is no newer version (as there are hundreds of other packages on the system during that update) or because it does not exist any more. However, if you remove it from the repo, it will be seen as “orphaned” and show red in YaST listings.

In all honesty, you have posted in the wrong forums. Try forums.suse.com.

Thanks for your reply.

As I know there are a option can help user to clean up the dependencies when removing package: “zypper rm --clean-deps”, but there is no such an option when using “zypper install”, is there any similary parameter when using “zypper in --oldpackage” that can help me to delete these unuse dependencies?

You can always use:

Yast → Software Management

Choose the “Package Group” view. And click on “unneeded packages”. That’s a list of all of the packages that you could safely remove. I’m not sure whether some whether those might come back if you don’t block them.

I know this is a year old, but when you say:

Yast --> Software Management

Choose the "Package Group" view.  And click on "unneeded packages".

Is that something specific to 15.1 because I can not find anything in Yast->Software Managment on TW called “Package Group” or “unneeded packages”
There is “Patterns”, but in Patterns there is no "unneeded… entry there.

It has been part of Yast software management for as long as I can remember.

Click on “View” near top left of the screen.
Select “Package Groups”.

After that, you should have a separate tab for “Package Groups”.

It is not in separate tab, it is in the group list as one of package groups (near the end). Group list is not alphabetically sorted also.

No more. It [Package Groups View] was removed from upstream YaST and change is finally in TW. In 20191112 there is no more Package Groups. So baby went with the water - no Package Groups, no way to display orphaned/unneeded packages.

It seems orphaned packages are now shown in Repositories - @System - “Unmaintained packages” as secondary filter. I could not find where it is possible to show what was earlier displayed as “unneeded packages”.

They were always available there. It was just easier to use “Package Groups” while that option was available.

Thank you, I thought I was going crazy.

I was pointed at https://bugzilla.suse.com/show_bug.cgi?id=1155132 as well.

I’m also affected by this and waiting for a solution. I used YaST2 - Software Management to periodically cleanup unneeded and orphaned packages. Since a change last week that page is gone, and now there’s no way to do this any more.

Half true. Orphaned are still there (albeit in another place).

Are you referring to the Repositories page, where under Secondary Filter you can pick Unmaintained Packages? That’s the closest thing I found, however it seems to list more or less than just orphaned / unneeded packages as it includes ones that are still needed by system components. If there’s anything else let me know please, I looked but couldn’t find other alternatives.

The old orphaned page did the same thing. I periodically tried to remove orphans. And sometimes that gave conflicts due to other packages that depend on the orphans.

Oh… so what I’m seeing in the new category are orphaned packages after all. Thanks for clarifying.

What about unneeded packages? Ones that were installed as dependencies of another package, that other package has since been removed, but those dependencies weren’t also deleted and are unnecessarily staying installed.

There’s probably a way to list those with “zypper”. But I would like to see that ability returned to Yast.

zypper packages --unneeded