How to make /tmp executable?

I have Ubuntu 12.04 LTS and I tried to upgrade to Ubuntu 12.10. When I clicked in the Update Manager Upgrade a messagebox apeared:

Can not run the upgrade. This usually is caused by a system where /tmp is mounted noexec. Please remount without noexec and run the upgrade again.

I tried to make /tmp executable in Terminal with the following command:

mount -o remount,exec /tmp /var/tmp

I pressed Enter and I got the following message from Terminal:

mount: only root can do that

What should I do now to make /tmp executable and upgrade the OS.


You must to have root privileges. For this, put sudo in front of the command:

sudo mount -o remount,exec /tmp

When you are asked about password, just insert your usual user password.


Would you try this command? In my case, this worked.

sudo mount -t tmpfs -o exec tmpfs /tmp

and then, check if it worked.

mount

Privileges and permissions in linux can be confusing. I recommend reading this before you start using sudo. Once you understand the difference between root, sudo, and normal user, you'll have a much better grasp of why this error happened (and *nix in general). See also the man pages for chown and chmod.