I get the following error when I try to install preload:
/var/lib/dpkg/info/preload.postinst: line 25: [: =: unary operator expected
full output is:
sudo apt-get install preload
Reading package lists... Done
Building dependency tree... Done
The following NEW packages will be installed:
preload
0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
Need to get 0B/31.6kB of archives.
After unpacking 176kB of additional disk space will be used.
Selecting previously deselected package preload.
(Reading database ... 136104 files and directories currently installed.)
Unpacking preload (from .../preload_0.2-4_i386.deb) ...
Setting up preload (0.2-4) ...
/var/lib/dpkg/info/preload.postinst: line 25: [: =: unary operator expected
Starting preload: preload.
The error was caused by missing quotes around a variable:
case "$1" in
configure)
# This was supposed to go to /var/lib/preload/ preload. state || true
# (rm this after etch=stable?)
if [ $2 = '0.2-1' ] ; then
rm /var/cache/
fi
;;
variable $2 is empty when the package is installed for the first time, hence the error message.