Uninstalling a package¶
Uninstalling removes an installed TRM package from the SAP system you are connected to: its objects, its ABAP packages, its customizing, and its TRM record. TRM can also carry the removal through the rest of your landscape.
Before you start¶
- The package must be installed on the connected system:
trm listshows the installed packages. - The registry the package comes from must be reachable: it generates the transports that
delete the objects, so an uninstall can't run offline or from a
.trmfile. For a package that wasn't installed from the public registry, pass its registry with-R, --registry; for a package installed from a.trmfile, that is the registry it was published to. - trm-server and trm-rest installed from the public registry can't be uninstalled: TRM needs them.
- Objects of the package must not be locked in open transport requests: the uninstall stops at once if they are.
What happens during an uninstall¶
- Local changes. If the package is dirty (its objects were changed
on this system), TRM lists the changes and asks before deleting them.
--ignore-dirtycontinues without asking. - Landscape transport target. TRM picks the target of the landscape transport, as for an install.
- Dependants. If other installed packages depend on this one, TRM lists them and asks before
continuing: they might stop working.
--no-dependantsskips this check. - Packages installed inside it. If other TRM packages are installed inside the ABAP packages of this one, they would be deleted with it. TRM lists them and asks, then uninstalls each of them first, with the same options. Each one asks about its own local changes.
- Locks. TRM locks the package, its ABAP packages and its transport.
- Backup and deletion. TRM backs up what it is about to delete, and imports the deletion transports generated by the registry. Besides the objects of the installed release, they delete the objects created inside its ABAP packages, the ABAP packages, the namespace when nothing else uses it, and the customizing of the package. Objects that can't be backed up are not deleted: TRM warns.
- Record. TRM removes the package from its records:
trm listno longer shows it. This happens even when nothing was left to delete; TRM then warns that a manual cleanup may be needed. - Landscape. TRM copies the deletions into a landscape transport and releases it.
⚠️ Don't interrupt an uninstall while the deletion transports are being imported.
--ignore-import-errors logs imports ending with return code 8 or higher as errors instead of
failing.
Removing the package from the landscape¶
The landscape transport of an uninstall, described as TRM (DELE) <package> <version>, does the
opposite of the landscape transport of the
install: import it on the following systems, and the package disappears from them too. When the
uninstall also removes TRM packages installed inside this one, the same transport carries their
deletions. See Move an installed package through the landscape for
the target, the cases where no transport is created, and what to do if the release fails.
The TRM record is removed only on the system where you run the uninstall. Following systems don't record TRM packages: they only receive transports.
If something fails¶
TRM undoes the completed steps: it re-imports the backup of what was deleted, restores the TRM record, undoes the uninstall of the nested packages the same way, and removes the deletion and landscape transports it created (see Transports).
Uninstalling without prompts¶
With --no-prompts, TRM stops instead of asking in the risky cases:
| Situation | Without prompts |
|---|---|
| Local changes | Stops, unless --ignore-dirty |
| Installed packages depend on it | Stops, unless --no-dependants |
| Other TRM packages installed inside it | Uninstalled too, with a warning in the log |
| Objects created inside its ABAP packages | Deleted, with a warning in the log |
| Objects moved to other ABAP packages | Kept |
| Customizing rows | See Customizing on update and uninstall |
| Transport target | Required when the system has more than one target (--landscape-tr-target) |