Summary

Before performing a system upgrade on a Versa appliance, it is recommended to verify that no system packages are in an inconsistent or incomplete state. Packages found in “pi” (partially installed) or “rc” (removed but configuration files remain) state can cause upgrade failures or unexpected behavior.


These packages are typically not dependencies of Versa services, but clearing them ensures a clean upgrade environment.


Identifying Packages in Inconsistent State

Use the following command to list all installed packages and filter out those not in a clean “ii” (installed) state:

sudo dpkg -l | grep -v ^ii

Packages in the following states should be addressed:

  • pi – Partially installed

  • rc – Removed, but configuration files still present


  • Procedure to Clean Inconsistent Packages

    1. Remove packages in “pi” state

    The below command identifies all packages in “pi” state and removes them:

    for i in $(dpkg -l | grep -v ^ii | grep ^pi | awk '{print $2}'); do sudo apt-get -y remove $i done


    2. Purge packages in “rc” state

    Packages in “rc” state can be safely purged using:

    for i in $(dpkg -l | grep ^rc | awk '{print $2}'); do
    sudo dpkg --purge $i
    done


    Example Output

    admin@versa# sudo dpkg -l | grep -v ^ii Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad) ||/ Name Version Architecture Description +++-======================================-====================================-============-========================================== pi  cgroup-lite                            1.9 all Light-weight package to set up cgroups pi  collectd-core                          5.4.0-3ubuntu2.2 amd64 statistics collection daemon pi  cpp                                    4:4.8.2-1ubuntu6 amd64 GNU C preprocessor pi  cpp-4.8 4.8.4-2ubuntu1~14.04.4 amd64 GNU C preprocessor

    Recommendation

    It is strongly recommended to perform this cleanup before any upgrade to avoid failures or partial configuration loads.

    If you encounter packages that appear to be Versa dependencies or if removal is blocked, contact Versa Support before proceeding.