Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apt doesn't remove packages, which he installed #62

Closed
vlad0337187 opened this issue Jun 21, 2017 · 4 comments
Closed

apt doesn't remove packages, which he installed #62

vlad0337187 opened this issue Jun 21, 2017 · 4 comments

Comments

@vlad0337187
Copy link
Contributor

vlad0337187 commented Jun 21, 2017

Hello to all.

Problem: sometimes after removing some program, some of it's dependencies are left in system and you can't find them.

This is not problem, that I noticed recent, it pent me over years.
Started when I installed some program with QT as dependency, I removed that program, but some of dependencies were left. I sweared some time and tried to remove them all manually (searching them in logs, etc).
Time went and sometimes I met with such "bugs". Then I got used to avoid such situations with user-tags from aptitude, but this spent many time, I always forgot needed commands, in short, it was boring work.
Today I met with it again in #linuxmint-ru channel, they told me about this error again.
I'm sure, the time came to correct this behavior, it hurts to all.

Example: when we install package "rpm" (apt install rpm (mint's apt uses "/usr/bin/apt" for this)),:

  • it gives 7 packages as dependencies:
    debugedit librpm3 librpmbuild3 librpmio3 librpmsign3 rpm-common rpm2cpio,
  • suggests to install also 5 packages:
    rpm-i18n alien elfutils rpmlint rpm2html,
  • but there will be installed 8 packages (including "rpm"):
    debugedit librpm3 librpmbuild3 librpmio3 librpmsign3 rpm rpm-common rpm2cpio

Well, we used this package near half of year, it became not needed to us. What was installed with it we don't remember, logs were removed. Let's remove it: apt purge rpm:

  • packages, that will be removed: rpm*
  • packages, that were installed automatically and are not needed: debugedit librpmbuild3 librpmsign3
    (to remove them use sudo apt autoremove) (ontly 3 of 7 are not needed any more)
  • so 4 packages (librpm3, librpmio3 rpm-common rpm2cpio) were lost.

Let's figurte it out why.
All 7 dependency packages were marked as automatically installed, only "rmp" was marked as manually installed.

Let's try aptitude (sudo aptitude purge rpm):

  • next packages will be removed: debugedit{u} librpm3{u} librpmbuild3{u} librpmio3{u} librpmsign3{u} rpm{p} rpm-common{u} rpm2cpio{u}
    We see, that all 8 packages, that were installed, were removed.

So aptitude has not his bug. Also I heared that there are many dependency types in apt, like:
"depends", "depends, but not very much", "recommends", "recommends, but not very much".
But I had not found such information on Wiki.
Maybe apt has such strange gradations and that's why it has such bug?

In package itself (in "control.tar.gz/control" file) all that packages (that were installed with "rpm") were in "dependencies" section:
Depends: libc6 (>= 2.17), libelf1 (>= 0.131), libpopt0 (>= 1.14), librpm3 (>= 4.12.0.1), librpmbuild3 (>= 4.10.0), librpmio3 (>= 4.10.0), librpmsign3 (>= 4.12.0.1), perl, rpm2cpio, debugedit (= 4.12.0.1+dfsg1-3build3), rpm-common (= 4.12.0.1+dfsg1-3build3)
Also there were not any "magic" sections like "not very depends", only "depends", "suggests", "breaks", "replaces"; in our case are figuring first two.

My suggestion: #62 (comment)

@vlad0337187
Copy link
Contributor Author

vlad0337187 commented Jun 21, 2017

Suggestion.

The first thing I thought - to make mint's apt script to delegate removing and purging packages not to apt, but to aptitude.
I can make patch for it, but can aptitude has some same problems with packages ?
I'll test it for some time and will read it's info on Debian's bugtracker to answer this.

Also it will be a good idea to add automated tests on installing \ removing logic to make sure it works as expected.
Maybe to generate on input many fake packages and fake dependencies not to calculate real.

@vlad0337187
Copy link
Contributor Author

Abstract describing of expected behavior.

Such behavior expect most of users, that I talked to. If something was installed, it must be removed.

  • You install a package "foo" that depend on "baz". You already have a package installed called "gah" that recommends "baz".
  • If I would install "gah" with recommends, than when removing "gah", "baz" must not be removed.
  • If I didn't installed "gah" with recommends, just installed "foo", which depends on "baz", than after removing "foo" I expect removing "baz" too

@vlad0337187
Copy link
Contributor Author

Update. I had not seed such problems with aptitude. I suggest to replace "apt" command to install and remove packages to "aptitude".

@xenopeek
Copy link

xenopeek commented May 4, 2018

Thanks for contributing. Your suggestion was reviewed. For more information on our workflow and feature requests, read: https://linuxmint-troubleshooting-guide.readthedocs.io/en/latest/faq.html

@xenopeek xenopeek closed this as completed May 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants