     false
 
   subscribeToPackageEvent: (event, callback) ->
-    @packageManagerSubscription = @packageManager.on event, (pack, error) =>
+    @disposables.add @packageManager.on event, (pack, error) =>
       packageName = pack.name
       packageName = pack.pack.name if pack.pack?
       callback(pack, error) if packageName is @pack.name

        'This package has deprecations and is not installable.'

  handlePackageEvents: ->
    atom.packages.onDidDeactivatePackage (pack) =>
      @updateDisabledState() if pack.name is @pack.name

    atom.packages.onDidActivatePackage (pack) =>
      @updateDisabledState() if pack.name is @pack.name

    atom.config.onDidChange 'core.disabledPackages', =>
      @updateDisabledState()

    @subscribeToPackageEvent 'package-installing', (pack) =>

      false

  detached: ->
    @disposables.dispose()

  loadCachedMetadata: ->
    @client.avatar ownerFromRepository(@pack.repository), (err, avatarPath) =>
