For 12.10 and later
Derived from jmendeth answer.
Different version? Go to the list.
See the end of the post if you are in trouble and want to revert the changes.
Close the Software Center if it's open.
Now open a terminal (Ctrl + Alt + T) and type:
gksu gedit /usr/share/software-center/softwarecenter/db/update.py
And press Enter. You'll be prompted for your password.
Then an editor will appear. Locate the following lines (hint: Ctrl + F may help):
doc = self.make_doc(cache)
if not doc:
LOG.debug("%r.index_app_info: returned invalid doc %r, ignoring.",
self.__class__.__name__, doc)
return
name = doc.get_data()
Immediately after those lines, paste the following (including the spaces!):
if doc.get_value(XapianValues.PRICE) not in (""): return
Save the file (Ctrl + S) and close the editor, but not the terminal.
Now type in the terminal:
gksu gedit /usr/share/software-center/softwarecenter/backend/channel_impl/aptchannels.py
Press ENTER. An editor will appear again.
Locate these lines:
if get_distro().PURCHASE_APP_URL:
channels.append(for_purchase_channel)
And disable them by putting a # in front of every line:
#if get_distro().PURCHASE_APP_URL:
# channels.append(for_purchase_channel)
Save the file, close the editor but not the terminal.
In the terminal, type:
gksu echo; update-software-center; exit
Wait a bit, the terminal will automatically close when finished...
Then open the Software Center and… voila!
There are no commercial programs!
Side notes: The. files. are. packaged.
What does this mean, you ask? This means that,
whenever you upgrade your Software Center, the changes
will be reverted and you'll have to do this steps again.
Undo the modifications
If you want to restore the original state of the files,
open a terminal and type:
sudo apt-get install --reinstall software-center && exit
Again, you will be prompted for your password, this time on the terminal.
Type it and press ENTER. Don't worry if nothing appears when you type, it's to hide your password.
The terminal will automatically close when finished.