Oh Dear, I'm afraid that first three answers do not tell the whole story about codeine linctus availability.
Codeine Linctus BP and Codeine Linctus Paediatric BP are both available from all pharmacies. For some time, Codeine Linctus BP (the adult version), which contains 15mg of codeine phosphate per 5ml dose, has been a prescription only medicine in the UK. The Paediatric version, which contains 3mg of codeine phosphate per 5ml dose is not a POM medicine.
Due to the abuse of the adult version, pharmacists are nowadays reluctant to sell it to the general public and in general, they prefer to say that they do not stock it to avoid confrontation with a customer. However, when a patient presents a doctor's prescription for the product, they have no reservations about supplying it as the doctor will have weighed up the likelihood of abuse beforehand. Nevertheless, they may discuss the risk of drowsiness with the patient and are obliged to disclose such risk on the label.
Having said all that, it is possible to buy Codeine linctus from pharmacies as pharmacists are still allowed to use their own professional judgement and discretion regarding the wisdom of a sale despite it being a POM medicine. The bottom line is that it's easier to say it's out of stock or act dumb than suffer the severe penalties that can be incurred if it's sold to a drug abuser.
Pholcodine linctus acts in a similar manner to codeine linctus but it regarded as much safer as it is rarely a drug of abuse. For this reason, pholcodine linctus is an Over The Counter medicine.