From Crop Genomics Lab.
dpkg error is due to packages which were not fully installed
we can see the packages have problem by followed command
dpkg -l | grep -v ^ii
then, we can remove or purge these packages
|dpkg --remove package or dpkg --purge package|
if we cannot remove them, we should remove package's file from /var/lib/dpkg/info