After upgrading to 24.04 Thunderbird has migrated to snap, and now I got 4 copies of my Thunderbird profile.
$ du -sm snap/thunderbird/*/.thunderbird/v* .thunderbird/v*
11783 snap/thunderbird/507/.thunderbird/vwsjq0wp.default
11783 snap/thunderbird/509/.thunderbird/vwsjq0wp.default
11730 snap/thunderbird/common/.thunderbird/vwsjq0wp.default
11782 .thunderbird/vwsjq0wp.default
current points to 507
$ ls -ld snap/thunderbird/current
lrwxrwxrwx 1 kfc kfc 3 Sep 2 00:25 snap/thunderbird/current -> 507
However common seems to be the folder which gets updated.
I know that ~/.thunderbird can be deleted, but I still got three copies of my profile.
Which can I delete, and how can I prevent snap from creating more duplicates when Thunderbird gets upgraded?
Each snap is by default installed in multiple versions: the current one and oen or two previous ones. In the given case it seems like three version are installed. This allows you to revert to an older version easily in case you have problems running the current version. As a consequence of this, you got the full data for each version of a snap, including like in the given case there profiles for Thunderbird. However, only the profile of the TB version currently in use - typically the newest one - is loaded and used. To see how many versions are kept for each snap, open a terminal and run the command
sudo snap get system refresh.retain
.On desktop system it can be in many cases enough to keep two versions of a snap only: the recent one and the previous one. Two is anyway the minimum, snap does not allow to have one version only.
To reduce to two versions only, open a terminal and run
sudo snap set system refresh.retain=2
. After that, runsudo snap refresh
to remove all versions of a snap except the recent one and the previous one.As confirmed by the OP.
Start by going to whichever version you feel more confident with as being up-to-date and select the hamburger menu ≡ then Tools and Export to create a .zip file of your current accounts, messages, address books and settings. Then set about deleting all instances of Thunderbird from your system. Decide which package option you would prefer, install that and follow the same routine but this time to Import settings and data from the .zip file you created (ie Import from a file option). That should finally tidy matters up.
This Ask Ubuntu Q&A may help in removal of TB if you are not already aware of how to do it