Your consumer grade optical link (the mentioned TosLink is Toshiba's name for a consumer standard) has a technical limit of 10 meters. It has been reported as being useable at up to 30 meters, but quality may suffer.
For best quality, what you probably want to do is go to a balanced format for the run. I don't know what you have available at the amplifier, but if it has the ability to take XLR (a circle with 3 holes in it) inputs, you could use a device called a direct box to switch the unbalanced output of the computer in to a balanced XLR cable which could safely make the 20 meter run.
If not, you might be able to make the run using a shielded 1/4 inch or even 1/8 inch cable since it is a somewhat powered signal, but it's going to depend a lot on the level of shielding and the amount of electrical interference in the area.
It might also be possible to use a direct box on one end and then use a balanced to unbalanced adapter on the other end, but I'm not sure what the performance implications of this would be as I've never personally tried it. I'm not even sure it would work correctly without a powered device on one end.