0

I use GNU/Linux Mint 18.1 on an amd64/x86_64 processor. I have a bunch of i386 packages installed - 250 of them to be exact. Up until today I knew I need some/most of them, since I had 32-bit Skype installed. But now I've installed the 64-bit version, so I'm wondering - can I uninstall those i386 packages? Or rather - how can I tell whether I really need any of them or not?

2

The package manager will usually complain if you try to remove a dependency of another package or program.

Read carefully what it says when it asks if you're sure about removing anything.

  • I've expanded on this answer... see below. But +1 anyway. – einpoklum May 9 '17 at 20:56
1

Unless you've specifically installed some 32-bit package (which would also have dependencies etc.) - it's likely that all 32-bit/i386 packages can be removed. As @Mioriin suggested, if you try to remove them using apt-get remove, you'll get a complaint if anything depends on them.

For caution's sake, first do the following:

apt-get install -f

in case something is broken and needs fixing. Then execute:

dpkg-query -l | grep "^i.* i386   " | less

and review the list of relevant packages. See if there's something you recall explicitly installing specifically as an i386/32-bit package. If not - proceed to try and remove them with:

apt-get remove $(dpkg-query -l | grep "^i.* i386   " | cut -c5- | cut -d\  -f1)

(the weird piped commands are for extracting just the package name; I think this can be done better using just dpkg-query switches.)

Caveats:

  • It's theoretically possible but extremely unlikely that some package will have the string " i386 " in its description; unlikely enough to ignore
  • If you have packages which are half-installed or in other states other than ii (see man dpkg-query for details), this might not work for you
  • FYI: Package names aren't allowed to contain spaces, so " i386 " can't occur in one. Not just unlikely, it's disallowed. BTW: Might want to consider using apt-mark to mark them as autoinstalled, then let autoremove remove ones that aren't needed. – derobert May 9 '17 at 21:35
  • @derobert: The space is for the listing, which contains the platform and the discription. As for apt-mark - what's the benefit in using that, as opposed to just apt-get removing the packages? – einpoklum May 9 '17 at 21:51
  • 1
    The space is also preventing it from matching, e.g., linux-image-i386 (were such a package to exist). As for apt-mark, the advantage is that apt-get remove will try to additionally remove any packages that depend on the i386 packages, whereas marking the autoinstalled (then using autoremove) will only remove them if nothing declares a dependency on them. – derobert May 9 '17 at 22:30
  • @derobert: Will edit my answer accordingly (soon). – einpoklum May 10 '17 at 8:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.