1

I am using the version Ubuntu 18.04.4 trying to add i386. I Have tried to install it via the command:

echo "foreign-architecture i386" > /etc/dpkg/dpkg.cfg.d/multiarch

And I get the eror

bash: /etc/dpkg/dpkg.cfg.d/multiarch: Permission denied

I already tried to use the methods:

  • echo "foreign-architecture i386" > /etc/dpkg/dpkg.cfg.d/multiarch

and

  • sudo dpkg --foreign-architecture i386

I simply get no output out of any of these. I have already tried to use the command:

sudo dpkg --add-architecture i386

It puts the output:

dpkg: error: configuration error: /etc/dpkg/dpkg.cfg.d/architectures:1: unknown option 'foreign-architecture'

I have tried to check if it is already installed or not via the command:

sudo dpkg --print-foreign-architectures

which I get the same bug with the previously mentioned command. I have tried to purge it with the command:

sudo apt-get purge ".:i386"

Which returned the eror code of:

E: Sub-process dpkg --set-selections returned an error code (2)
E: Couldn't record the approved state changes as dpkg selection states

These are the references of pages I have used but couldn't get any answers from:

Thanks in advance.

reee
  • 13
  • 1
  • 4
  • Multiarch is enabled by default on 18.04 – Logix Mar 17 '20 at 11:46
  • Please add output of `dpkg --print-foreign-architectures` to the question. Do you problems installing Wine? Did you tried to use [this Q&A](https://askubuntu.com/a/1205596/66509). – N0rbert Mar 17 '20 at 18:53

1 Answers1

3

First remove the disturbing file

sudo rm /etc/dpkg/dpkg.cfg.d/multiarch    

Then you can add it with

sudo dpkg --add-architecture i386
nobody
  • 5,149
  • 5
  • 22
  • 43
  • When ı used the command `sudo rm /etc/dpkg/dpkg.cfg.d/multiarch `I get the error `rm: cannot remove '/etc/dpkg/dpkg.cfg.d/multiarch': No such file or directory` – reee Mar 17 '20 at 11:48
  • My fault `sudo rm /etc/dpkg/dpkg.cfg.d/architectures` – nobody Mar 17 '20 at 11:53
  • I still get the eror `rm: cannot remove '/etc/dpkg/dpkg.cfg.d/architectures': No such file or directory` Is there a command to install multiarch again? I might have removed it in a accident. – reee Mar 17 '20 at 11:59
  • last ditch from me grep -ri foreign /etc/dpkg/ – nobody Mar 17 '20 at 12:47