It's a shame that we have to tell people to "sudo apt-get install packagename" on AskUbuntu.com. It should be sufficient to provide apt://packagename and let the user just click it to install.
There are several options for posters to generate their links as links that will open the software centre. The basis behind all of them is linking to
There have been discussions about making this automatic (eg to detect
apt-get install ...) but my attempt to do this failed. The major problem is you'll also see
add-apt-repository scattered around the site and this can be a major part to getting some things working. Adding apt repos is not possible via a link (for good reason!).