No sound on iMac

Tried other things, but they didn't work either. I also got the same error again as above, when I used the command gedit. But looking at the file now, I guess it did safe the text, since it stayed changed in there when I reopened the file.
Just wanted to add this here, to tell what I tried.

Tried what was described here: Adventures with Linux: Installing Ubuntu on a Panasonic Toughbook CF-31 - Bob Johnson's Computer Stuff, Inc.

So what they suggested was the following:

sudo gedit /usr/share/pulseaudio/alsa-mixer/paths/analog-output-speaker.conf
A text file called analog-output-speaker.conf will open up in a new window. In the text file, find this part:

[Element Headphone]
switch = off
volume = off

and change it to this:

[Element Headphone]
switch = off
volume = merge
override-map.1 = all
override-map.2 = all-left,all-right

Next, in the same text file, find this part:

[Element Speaker]
required-any = any
switch = mute
volume = merge
override-map.1 = all
override-map.2 = all-left,all-right

and change it to this:

[Element Speaker]
required-any = any
switch = mute
volume = off

Save and reboot.