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

Thread: How to remove dependencies with packages?

  1. #1
    Join Date
    Nov 2009
    Location
    Bangalore,India
    Posts
    70

    Default How to remove dependencies with packages?

    When one installs an application,it brings in other stuff too as dependencies.

    When this application is removed,will zypper remove the dependencies that came with it and are not needed by other installed packages?

    Is it possible to check before and after removal?

  2. #2
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,003

    Default Re: How to remove dependencies with packages?

    Quote Originally Posted by pbhat View Post
    When one installs an application,it brings in other stuff too as dependencies.
    Yep.
    Quote Originally Posted by pbhat View Post
    When this application is removed,will zypper remove the dependencies that came with it and are not needed by other installed packages?
    Nope, still not possible. Write them down during install and remove them by hand (I do this often when I do a short try-out of a product), or forget about them being there (on todays disks it takes almost no space).
    Quote Originally Posted by pbhat View Post
    Is it possible to check before and after removal?
    I do not understand exactly what you want to check, but you can always make lists using the rpm -qa command and compare them.
    Henk van Velden

  3. #3
    Join Date
    Nov 2009
    Location
    Bangalore,India
    Posts
    70

    Default Re: How to remove dependencies with packages?

    Thanks Henk.

    I thought I read somewhere (in RPM manpage?) that RPM can list packages not needed by any other package.But today I cannot find the option.Perhaps I am missing it.

  4. #4
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,003

    Default Re: How to remove dependencies with packages?

    Well, one should study the man rpm page thouroughly because IIRC there is a way to list the dependencies of an RPM (about the same you remember vaguely). On could then write a script that checks if an RPM is mentiond nowhere in the list of all packages that are dependent on another one (on a rainy day). But take care: such a package may be dependent on no other one and still very much wanted. E.g. I do not know if the kernel draws in dependencies, but you do not want it to be deinstalled by such a script, want you?

    And I think this shows some of the problems that emerge when one tries do do what you want. And deep inside myself I suppose that that is the reason it is not done until now.
    Henk van Velden

  5. #5
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,003

    Default Re: How to remove dependencies with packages?

    I browsed through the man page and found
    Code:
    rpm -e --test PACKAGE_NAME
    which will remove the package and thus show errors when another one is dependent on it. Because of the --test it will not do the removing.

    I am realy tempted to dig into this , but then I need a sandbox system. I will not test such a script on my production ones
    Henk van Velden

  6. #6

    Default Re: How to remove dependencies with packages?

    Hello pbhat,

    Quote Originally Posted by pbhat
    I thought I read somewhere (in RPM manpage?) that RPM can list packages not needed by any other package.
    I'm not aware of any function capable of that.

    But I found a program that will do it for you.
    It's available in the packman repository and it's called rpmorphan.

    Quote Originally Posted by hcvv
    But take care: such a package may be dependent on no other one and still very much wanted. E.g. I do not know if the kernel draws in dependencies, but you do not want it to be deinstalled by such a script, want you?
    This program only shows packages which have no other packages depending on their installation.
    This doesn't mean you don't need that package!

    Quote Originally Posted by hcvv
    I browsed through the man page and found
    Code:
     	rpm -e --test PACKAGE_NAME

    which will remove the package and thus show errors when another one is dependent on it. Because of the --test it will not do the removing.
    I never heard of the parameter --test before but it looks handy!

    Good luck!
    Where did I put my coffee cup?
    dir -R /home/* | grep "coffee cup"

  7. #7
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,003

    Default Re: How to remove dependencies with packages?

    Quote Originally Posted by Edward_Iii View Post

    I never heard of the parameter --test before but it looks handy!

    Good luck!
    I first looked at what rpm -q could do. There it says that when you want to see dependencies then go for rpm -e --test. So it may not look very logic to go for an rpm -e version, but the man page is handling this very good.

    BTW thanks for the info about rpmorphan. Very usefull.

    And I am also glad you stress that human intervention is needed and an automatic deinstall functionality, which is asked for very often, can not easily be inplemented.
    Henk van Velden

  8. #8
    Join Date
    Oct 2008
    Location
    Brisbane
    Posts
    310

    Default Re: How to remove dependencies with packages?

    Having used Debian before converting to openSuse a few years ago, I must admit that one thing that I do miss is deborphan, which will list all files which have no more use, ie the file which was dependent on them has been removed. And, an easy to access install history. The history was especially good as when dependencies were installed along with a main programme which was then removed, the dependencies can be easily removed by a quick check at the history within the packet manager.
    It is dangerous to be right when the government is wrong.

  9. #9
    Join Date
    Nov 2009
    Location
    Bangalore,India
    Posts
    70

    Default Re: How to remove dependencies with packages?

    Thanks Edward for mentioning rpmorphan and reminding me the whole thing.The man page for rpmorphan says it is run after distribution upgrade to clean up the system of un-needed packages.But hcw's caution is very important.I have seen even if a distribution upgrade removes packages it thinks are no more needed,lot of fossils remain around.The algorithm involved may be more than just remove what rpmorphan lists.
    @Dwarfer99
    Even in Ubuntu,removing a package does not remove the child dependencies.
    Perhaps rpmorphan and deborphan are only meant for helping manual purging of the system.

  10. #10

    Default Re: How to remove dependencies with packages?

    In your terminal, type "zypper remove", and you will get all the removal options. "zypper remove -u" or "zypper remove --clean-deps" will "Automatically remove unneeded dependencies".

    I just removed the package OpenOffice_org using the command "zypper remove -u OpenOffice_org", and zypper alerted me to all the additional associated packages that were no longer necessary, such as jpackage-utils, OpenOffice_org-branding-openSUSE, xalan-j2, xerces-j2, OpenOffice-org-components, etc... Typed "y" to agree to removal, and openoffice and all the associated, unused dependencies were removed. Its a handy trick.

Page 1 of 2 12 LastLast

Posting Permissions

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