<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def upgrade_all(self):
 """ Upgrades all installed packages to their latest versions. """

        for pkg in self.installed_package_names:
            self.install(pkg, upgrade=True)