Tiup Uninstall Parameters

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: tiup 卸载参数

| username: ShawnYan

[TiDB Usage Environment] Poc
[TiDB Version] 7.3
[Reproduction Path] What operations were performed when the issue occurred
[Encountered Issue: Issue Phenomenon and Impact]
[Resource Configuration] Go to TiDB Dashboard - Cluster Info - Hosts and take a screenshot of this page
[Attachment: Screenshot/Log/Monitoring]

After upgrading tiup, I want to delete all components of a previous version at once, but there is no corresponding command?
Do I still have to delete each component one by one? It’s so troublesome.

It would be great if there was a command like this:
tiup uninstall --version v7.3.0-alpha-nightly-20230628 --all

[root@shawnyan tikv]# tiup --version
1.12.3 tiup
Go Version: go1.19.9
Git Ref: v1.12.3
GitHash: b8381cfd8180bdf5a3b7924d0249538ac15dee81
[root@shawnyan tikv]#
[root@shawnyan tikv]# tiup update --nightly --all
component bench version nightly-20230108 is already installed
component grafana version v7.3.0-alpha-nightly-20230708 is already installed
component pd version v7.3.0-alpha-nightly-20230708 is already installed
component playground version v1.12.2-nightly-9 is already installed
component prometheus version v7.3.0-alpha-nightly-20230708 is already installed
component tidb version v7.3.0-alpha-nightly-20230708 is already installed
component tiflash version v7.3.0-alpha-nightly-20230708 is already installed
component tikv version v7.3.0-alpha-nightly-20230708 is already installed
Updated successfully!
[root@shawnyan tikv]#

| username: 我是咖啡哥 | Original post link

Looking at the help, it seems that you can only delete all versions of a specific component or all components, and it doesn’t seem possible to delete all components of a specified version. However, since the components are all under the ~/.tiup/components/ directory, can we operate like this?
For example, delete all components of version v5.1.1. But note that the version numbers of each component may not correspond.

rm -rf ~/.tiup/components/*/v5.1.1
| username: redgame | Original post link

Indeed, there is no command to delete all specified version components at once. Currently, you can only delete them one by one.

| username: ShawnYan | Original post link

But this is not very tiup.

| username: 我是咖啡哥 | Original post link

This uninstallation just cleans up the corresponding version of the software, which may not be in high demand. It would be better if it could be integrated into tiup. :joy:

| username: ShawnYan | Original post link

That’s true, who would upgrade every day except in a testing environment? In a testing environment, you can actually delete it with rm -rf and restore it with one click.

| username: knull | Original post link

Actually, upgrades in production environments are quite rare, so even if we don’t delete it, it might not be a big issue (disk space shouldn’t be too much of a concern, right?) :joy:

| username: 有猫万事足 | Original post link

Batch execution can be done using

tiup cluster exec <cluster-name> --command pwd

If the deployment paths are similar, you could try using a single rm command to get it done. It’s just a bit risky. :joy:

| username: ShawnYan | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.