Step 1: Verify which packages installed JOSM
(if from different sources)
sudo dpkg-query -S josm | grep 'josm$'
You will get a list that looks like this:
automake: /usr/share/lintian/overrides/automake
bash-completion: /usr/share/bash-completion/completions/automake
automake: /usr/share/doc/automake
The package names listed at the start of the line report which package installed which PATH command.
Step 2: List all installed versions of JOSM
(if different versions)
sudo dpkg-query --show josm
which gives you a report like this
automake 1:1.16.5-1.3
OR
sudo dpkg --list | awk -v p="josm" '{ if( $2 == p ){ print $0 } ; }'
which gives you a report like this
ii automake 1:1.16.5-1.3 all Tool for generating GNU Standards-compliant Makefiles
Step 3: Remove multiple versions
(or specific version, leaving other versions behind)
One important proviso ...
If multiple versions of the same command name, the installations might share a subset of files, if both installed in the same application root directory.
IF THAT IS THE CASE, you need to remove ALL versions, then re-install only the desired version.
NOTE: Save any configuration files in a designated location, before performing the following.
sudo apt purge josm=${version1}
sudo apt purge josm=${version2}
where version1/version2 is the version(s) reported for JOSM, similar to the above reported "1:1.16.5-1.3".
