' and when I try to update the Pi4J package with 'sudo apt-get upgrade', I get this error:
The following packages will be upgraded:
pi4j
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 548 kB of archives.
After this operation, 11.3 kB of additional disk space will be used.
Do you want to continue [Y/n]?
Fetched 548 kB in 1s (354 kB/s)
(Reading database ... 71667 files and directories currently installed.)
Preparing to replace pi4j 1.0~SNAPSHOT (using .../pi4j_1.0~SNAPSHOT_all.deb) ...
Unpacking replacement pi4j ...
upgrade
Setting up pi4j (1.0~SNAPSHOT) ...
ln: failed to create symbolic link `/usr/bin/pi4j': File exists
dpkg: error processing pi4j (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
pi4j
E: Sub-process /usr/bin/dpkg returned an error code (1)
To work around this I did 'sudo unlink /usr/bin/pi4j' and ran '
curl -s get.pi4j.com | sudo bash' again (no issues). My guess is you are trying to create a symlink on top of a symlink without unlinking it first (or at least checking for its existence). This error will persist until cleaning up as I described.