Boost update failed, now don't know version I have

I am trying to install Boost 1.82 on Ubuntu 22.04 but I’m getting a dpkg: error processing archive error when running sudo apt install libboost1.82-dev. I followed the advice from this similar question and it seemed to work. The Version.h file says #define BOOST_LIB_VERSION "1_82" but when I search for ‘boost’ on my system, there are libraries with both 1.74 and 1.82 versions.

How do I uninstall all Boost libraries and do a clean install of Boost 1.82?

I tried running sudo apt purge libboost1.82-dev followed by sudo apt install libboost1.82-dev, but I still see some 1.74 libraries when searching for ‘boost’.

To uninstall all Boost libraries and perform a clean installation of Boost 1.82 on Ubuntu 22.04, you can follow these steps:

  1. Open a terminal.
  2. Run the following command to remove all installed Boost libraries and dependencies:
    sudo apt-get purge libboost-all-dev
    
  3. Confirm the removal when prompted.
  4. Once the removal process is complete, run the following command to update the package lists:
    sudo apt-get update
    
  5. Finally, install Boost 1.82 by running:
    sudo apt-get install libboost1.82-dev
    

After the installation is finished, you should have a clean installation of Boost 1.82 without any remnants of the previous 1.74 version.