used awk to compare the dates lexicographically. Solves #1
checking if the package was not removed already
cleanup