2

I have Ubuntu 14.04, and I'm trying to install wine:i386 to use PlayOnLinux, following this article. However, when I run:

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

I get this error /etc/dpkg/dpkg.cfg.d/multiarch: Permission denied

Being still new to Ubuntu I don't know how safe it is (or advisable) to manually change permissions to overcome this. What should I do to solve this?

EDIT The main objective of this question is to install Wine, not the syntax itself (although the syntax was the problem), the accepted answer provided a better way of solving this.

4

You have two problems:

  • /etc/dpkg/dpkg.cfg.d/multiarch file is being opened by the shell as unprivileged user before the echo command runs, hence the permission error as only root should be able to create the file or write in it. The sudo is only being applied to echo command.

  • The string foreign-i386 architecture is not correct for enabling multiarch support for i386 architecture, the correct string is foreign-architecture i386.

To fix these, you can do:

sudo bash -c 'echo "foreign-architecture i386" >>/etc/dpkg/dpkg.cfg.d/multiarch'

Or

echo "foreign-architecture i386" | sudo tee -a /etc/dpkg/dpkg.cfg.d/multiarch

Note that, the easiest way to enable multiarch and add i386 architecture would be:

sudo dpkg --add-architecture i386

Don't forget to run sudo apt-get update after enabling multiarch.

|improve this answer|||||

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