For 12.04
Derived from Pavlos G. answer and inspiration from Darmien answer.
Different version? Go to the list.
See the end of the post if you are in trouble and want to revert the changes.
1. Ignore the purchasable apps
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 = make_doc_from_parser(parser, cache)
if not doc:
LOG.debug("make_doc_from_parser() returned '%s', ignoring" % doc)
return
term_generator.set_document(doc)
name = doc.get_data()
Immediately after those lines, paste the following (including the spaces!):
if doc.get_value(XapianValues.PRICE) not in (""): return
Note: if you want to keep stuff that doesn't cost money, but has to be "purchased"
(like trials, magazines and other propietary stuff), replace ("")
with ("0.00", "")
.
Save the file (Ctrl + S), open the Software Center and… voila!
There are no commercial programs!
You can close the editor and the terminal now.
2. Remove the "For purchase" channel (optional)
To also remove that "For purchase" item in the menu, open a terminal and type:
gksu gedit /usr/share/software-center/softwarecenter/backend/channel_impl/aptchannels.py
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 and enjoy a software center without ads!
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.
No, it will not be possible. apt-get
works with the repositories that are defined in sources.list
, as the software center does.
You'll find this kind of "layered" systems in many places in linux. To illustrate this, let's look at how an application is installed "low level". To install an application, several (in most cases, many) applications need to be copied to several (or many) different directories. The executable file needs to go to one directory, some libraries need to go to another directory, some manuals (man pages) need to go to yet another directory, some icons need to go to still another directory, and so forth. When you want to deinstall the application later, you'd have to "tidy up" all those files in all those different places.
To make this easier, there's the package manager dpkg
. A deb package (named this because it was originally developed for Debian, which Ubuntu is based on) is, more or less, an archive that contains files with the information where those files should go. When you install a package, the files are copied to the appropriate places; when you deinstall it, the files are removed. To do this, the "usual", low level tools like for example tar
are used. This illustrates the concept: dpkg
uses what is already there to simplify a task.
Additionally, a package mostly has dependencies. A package can say, "if you want to install me, you need to install this other package as well, because it contains files I need". Or, "if you want to install me, you can't install this other package, because our files would conflict". Again, there's an additional layer on top of "copy some files to the right directories", that uses what's already there.
The next question would be, where do I get those packages? This is where the next layer comes in, the apt tools (apt-get
, apt-cache
and so on). With apt, you can manage package sources, so called repositories, where it can automatically fetch packages. A repository can be on a server somewhere in the net, on a CD or DVD, on your local hard disk and so forth. Which repositories are available is defined in sources.list
. From these repositories, the apt tools build a cache, which is essentially a list of the packages that are available from the repositories.
So if you install a package with apt-get
, it is fetched from the respective repository and handed to dpkg
. dpkg
, in turn, installs the package like described above, with tools like tar
.
In the next layer, there are GUI tools like Synaptic or the software center. They offer the possibility to manage your packages with a graphical interface instead of "only" on the command line. The GUI tools "under the hood" hand the work over to the apt tools, which (as described) use dpkg
, which uses tools like tar
. So, apt-get
can't possibly know about any repositories the software center doesn't know about. In fact, it's the other way around: The software center works "on top" of apt's cache, so it can only know about the repositories that are defined in sources.list
.
The description above can of course only be an outline, with many details and additional features of the respective layers omitted. For example, there's the sources.list.d
directory in which additional repositories can be defined. They, of course, apply to the apt tools as well to GUI tools like the software center. Another example, the software center not only offers to manage your packages with a graphical interface, but offers the possibility to sell and buy packages as well.
Best Answer
Just to keep this up to date:
It is in the software center now! (In 11.04 Natty at least)