How to install i386

There are some times when you want to install a package that is labelled as 'i386'. Unless your system is set up to use 'multiarch' you won't be able to install it.

  1. So to set up multiarch you just do sudo dpkg --add-architecture i386,
  2. Then do sudo apt-get update
  3. Then you can hopefully install your 'i386' programme.

How to remove i386

If you decide that you no longer want to use i386 and just have a plain amd64 then

  1. first of all convert all entries in your sources.list to be all like this -
deb     [arch=amd64] http://security.debian.org/ jessie/updates main contrib non-free
deb-src [arch=amd64] http://foo

So that every entry now shows [arch=amd64].

  1. Don't forget to look in /etc/apt/sources.list.d to see if there is anything like dropbox lurking there. If so, you can either leave it there but change it to 'amd64' like all other entries in your sources.list,
  2. Or you can copy its entry to your /etc/apt/sources.list and delete it from /etc/apt/sources.list.d . Your choice. I decided to incorporate it into my sources.list which makes it easier to control.
  3. Then look at /var/cache/apt/archives and go through it removing all 'i386' files. Its tedious, but I've found that it helped.
  4. Then do dpkg --print-foreign-architectures which if it shows i386 then you haven't succeeded, yet!
  5. So do sudo apt-get update and examine its output closely to see if there are any references to 'i386' still showing, if so then you're back to sorting out your 'sources.list'!
  6. Then do another sudo apt-get update and re-examine the output.
  7. Once you're satisfied that everything now is going to be 'amd64', we move on to phase 2 - removing i386.
  8. And this is just so ridiculously easy - to remove 'i386' you do sudo dpkg --remove-architecture i386.
  9. To check that it has fully removed, you can just repeat dpkg --print-foreign-architectures which should not have any output, and
  10. to make sure just do dpkg --print-architecture which should show 'amd64'.

  11. Result? Success!

  12. But, if when you do sudo dpkg --remove-architecture i386 it shows -

dpkg:error: cannot remove architecture 'i386' currently in use by the database
  1. You need to do sudo apt-get -f to try to clear any references to 'i386'
  2. Then repeat sudo apt-get update
  3. and do sudo dpkg --remove-architecture i386.
  4. To check that it has fully removed, you can just repeat dpkg --print-foreign-architectures which should not have any output, and
  5. to make sure just do dpkg --print-architecture which should show 'amd64'.

  6. Result? Success!



Comments

comments powered by Disqus