code: public function update(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $target)
      {
          if (!$repo->hasPackage($initial)) {
              throw new \InvalidArgumentException('Package is not installed: '.$initial);
          }
  
          $name = $target->getName();
          $from = $initial->getFullPrettyVersion();
          $to = $target->getFullPrettyVersion();
          $actionName = VersionParser::isUpgrade($initial->getVersion(), $target->getVersion()) ? 'Updating' : 'Downgrading';
          $this->io->writeError("  - " . $actionName . " <info>" . $name . "</info> (<comment>" . $from . "</comment> => <comment>" . $to . "</comment>)");
  
          $repo->removePackage($initial);
          $repo->addPackage(clone $target);
      }
docs: {@inheritDoc}