Package manager install followed by remove, keeps platform specific sub-packages?

In another topic I noticed that when I install the libsqlite3 package and then remove it again, its platform specific sub package keeps being installed. I would have expected that it is removed with its parent package because it was installed implicitly through it.

The commands I used were simply:
raco pkg install libsqlite3 and raco pkg remove libsqlite3

The package libsqlite3-x86_64-linux stayed installed, to remove it I called raco pkg remove libsqlite3-x86_64-linux

Sqlite3-connect crashes with “invalid memory reference”

For me this looks like a bug because an automatically installed package, should also be removed automatically. Is there some reason why it can't work like that?

You probably want to run raco pkg remove --auto $somepackage. The --auto flag:

In addition to removing each ‹pkg›, removes auto-installed packages (i.e., installed by the search-auto or search-ask dependency behavior, or demoted via --demote) that are no longer required by any explicitly installed package.

-- https://docs.racket-lang.org/pkg/cmdline.html#(part._raco-pkg-remove)

4 Likes

Ah ok, I somehow thought that platform specific dependencies installed without a prompt automatically, but the real reason I didn't get a prompt, was because I already had the dependency installed.

So it does make sense and raco pkg install --auto and raco pkg remove --auto are symmetric / opposites.

I could argue that raco pkg install and raco pkg remove are still not "equals" / matching operations, because the former gives me an interactive prompt whether I want to install dependent packages, but the latter doesn't give me a prompt whether I want to auto remove packages.
From a user interface perspective, I think it would be nice if the operations behave similarly.

That said, I don't know how practical it would be to implement that, would probably be annoying if default behavior changes, considering tooling, scripts, backwards compatibility. So overall to much trouble for little benefit.

So instead I will keep in mind to use --auto when removing packages.