diff --git a/core/api/src/main/java/org/onosproject/app/ApplicationService.java b/core/api/src/main/java/org/onosproject/app/ApplicationService.java
index 0f2d155..aa6b8e6 100644
--- a/core/api/src/main/java/org/onosproject/app/ApplicationService.java
+++ b/core/api/src/main/java/org/onosproject/app/ApplicationService.java
@@ -91,7 +91,10 @@
      * Returns the set of all installed applications.
      *
      * @return set of apps putside the build/core environment
+     *
+     * @deprecated since onos-2.5
      */
+    @Deprecated
     default Set<Application> getRegisteredApplications() {
         return ImmutableSet.of();
     }
diff --git a/core/net/src/main/java/org/onosproject/app/impl/ApplicationManager.java b/core/net/src/main/java/org/onosproject/app/impl/ApplicationManager.java
index 6b18a04..8ebfa4c 100644
--- a/core/net/src/main/java/org/onosproject/app/impl/ApplicationManager.java
+++ b/core/net/src/main/java/org/onosproject/app/impl/ApplicationManager.java
@@ -15,14 +15,9 @@
  */
 package org.onosproject.app.impl;
 
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.node.ArrayNode;
-import com.fasterxml.jackson.databind.node.ObjectNode;
 import com.google.common.cache.Cache;
 import com.google.common.cache.CacheBuilder;
 import com.google.common.collect.HashMultimap;
-import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableSet;
 import com.google.common.collect.Multimap;
 import com.google.common.util.concurrent.Uninterruptibles;
@@ -37,9 +32,6 @@
 import org.onosproject.app.ApplicationStoreDelegate;
 import org.onosproject.core.Application;
 import org.onosproject.core.ApplicationId;
-import org.onosproject.core.DefaultApplication;
-import org.onosproject.core.DefaultApplicationId;
-import org.onosproject.core.Version;
 import org.onosproject.core.VersionService;
 import org.onosproject.event.AbstractListenerManager;
 import org.onosproject.security.Permission;
@@ -51,19 +43,17 @@
 import org.osgi.service.component.annotations.ReferenceCardinality;
 import org.slf4j.Logger;
 
-import java.io.IOException;
 import java.io.InputStream;
-import java.net.HttpURLConnection;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.Iterator;
 import java.util.Set;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
 import java.util.function.Consumer;
 
 import static com.google.common.base.Preconditions.checkNotNull;
-import static org.onosproject.app.ApplicationEvent.Type.*;
+import static org.onosproject.app.ApplicationEvent.Type.APP_ACTIVATED;
+import static org.onosproject.app.ApplicationEvent.Type.APP_DEACTIVATED;
+import static org.onosproject.app.ApplicationEvent.Type.APP_INSTALLED;
+import static org.onosproject.app.ApplicationEvent.Type.APP_UNINSTALLED;
 import static org.onosproject.security.AppGuard.checkPermission;
 import static org.onosproject.security.AppPermission.Type.APP_READ;
 import static org.slf4j.LoggerFactory.getLogger;
@@ -78,8 +68,6 @@
 
     private final Logger log = getLogger(getClass());
 
-    private static final String APP_REGISTRY_URL = "http://api.onosproject.org:8080/api/applications";
-
     private static final String APP_ID_NULL = "Application ID cannot be null";
     private static final long DEFAULT_OPERATION_TIMEOUT_MILLIS = 2000;
     private final ApplicationStoreDelegate delegate = new InternalStoreDelegate();
@@ -336,67 +324,7 @@
 
     @Override
     public Set<Application> getRegisteredApplications() {
-        ImmutableSet.Builder<Application> builder = ImmutableSet.builder();
-        ObjectMapper mapper = new ObjectMapper();
-        String vers = versionService.version().toString();
-        vers = vers.substring(0, vers.lastIndexOf(".") + 2);
-        // Get input stream from the URL
-        try {
-            URL serverUrl = new URL(APP_REGISTRY_URL + "?onosVersion=" + vers);
-            HttpURLConnection serverHttp = (HttpURLConnection) serverUrl.openConnection();
-            InputStream githubStream = serverHttp.getInputStream();
-
-            // Read input stream into an ArrayNode
-            ArrayNode rootTree = (ArrayNode) mapper.readTree(githubStream);
-
-            // Iterate over the array node for each object add each version as application object to the set
-            rootTree.forEach(n -> {
-                mapObject(builder, (ObjectNode) n);
-            });
-
-            //Iterate through Builder to remove unnecessary apps
-            Set<Application> apps = builder.build();
-
-            return apps;
-        } catch (MalformedURLException e) {
-            throw new IllegalStateException("Bad URL: " + APP_REGISTRY_URL + "?onosVersion=" + vers, e);
-        } catch (IOException e) {
-            throw new IllegalStateException("Unable to fetch URL: " + APP_REGISTRY_URL + "?onosVersion=" + vers, e);
-        }
+        return ImmutableSet.of();
     }
 
-    private void mapObject(ImmutableSet.Builder<Application> apps, ObjectNode node) {
-        String appIDs = node.get("id").asText();
-        ApplicationId appID = new DefaultApplicationId(1, appIDs);
-        String title = node.get("title").asText();
-        String readme = node.get("readme").asText();
-        String category = node.get("category").asText();
-        String url = node.get("url").asText();
-        String origin = node.get("maintainer").asText();
-        JsonNode it = node.get("versions");
-        Iterator iterate = it.iterator();
-        while (iterate.hasNext()) {
-            DefaultApplication.Builder app = new DefaultApplication.Builder();
-            JsonNode jsonNode = (JsonNode) iterate.next();
-            URL imageUrl = null;
-            try {
-                imageUrl = new URL(jsonNode.get("oarURL").asText());
-            } catch (MalformedURLException e) {
-                e.printStackTrace();
-            }
-            Version version1 = Version.version(jsonNode.get("onosVersion").asText());
-            app.withImageUrl(imageUrl)
-                    .withAppId(new DefaultApplicationId(1, node.get("id").asText()))
-                    .withVersion(version1)
-                    .withAppId(appID)
-                    .withReadme(readme)
-                    .withDescription(readme)
-                    .withTitle(title)
-                    .withFeatures(ImmutableList.of("none"))
-                    .withCategory(category)
-                    .withUrl(url)
-                    .withOrigin(origin);
-            apps.add(app.build());
-        }
-    }
 }
\ No newline at end of file
diff --git a/core/net/src/test/java/org/onosproject/app/impl/ApplicationManagerTest.java b/core/net/src/test/java/org/onosproject/app/impl/ApplicationManagerTest.java
index 203abb7..8c835c1 100644
--- a/core/net/src/test/java/org/onosproject/app/impl/ApplicationManagerTest.java
+++ b/core/net/src/test/java/org/onosproject/app/impl/ApplicationManagerTest.java
@@ -85,14 +85,6 @@
         assertEquals("incorrect features", FEATURES, app.features());
     }
 
-    @Test
-    public void testGetRegisteredApps() {
-        mgr.versionService = new TestVersionService();
-        Set<Application> apps = mgr.getRegisteredApplications();
-        System.out.println(apps);
-        assertFalse("SET contains less Apps than it should", apps.size() < 158);
-    }
-
     private static class TestVersionService extends VersionServiceAdapter {
 
         @Override
