I would like to remove the official repository from several QGIS installations.

Removing the Repository from the Settings works so far with:

from qgis.PyQt.QtCore import QSettings

for i in test:
    if u'Qgis/plugin-repos/' in i:
        if u'/url' in i:
            if settings.value(i)==u'https://plugins.qgis.org/plugins/plugins.xml':
                repo_key = i.rsplit('/', 1)[0]

But as soon as QGIS is started the next time the repository is added to the settings again.

How can I remove it permanently?


Your code is correct, but the official repository can't be deleted. Every time you open QGIS it's reset (file installer_data.py, on my pc "C: \ OSGeo4W64 \ apps \ qgis-ltr \ python \ pyplugin_installer \ installer_data.py ").

To avoid this you can create a startup.py file, but I do not know if it can work.

Another solution is to make a minimal plugin, that simply execute that code, that way you could avoid it and you will only have to copy that plugin in those machines

  • I had already added the code in the startup.py but even if the setting is deleted during startup the repository exists in the plugin manager. If a plugin removes the settings after startup the result is the same – markgraeflerland Oct 11 '18 at 8:15

I was able to remove the official repository by removing it during startup and replacing the official repository with my repository by editing the installer_data.py of the QGIS installation.

I just replaced the line where the official repository is defined:


officialRepo = (QCoreApplication.translate("QgsPluginInstaller", "QGIS Official Plugin Repository"), "https://plugins.qgis.org/plugins/plugins.xml")

officialRepo = ("my Repository name", "my repository url")

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.