Say you just upgraded from Ubuntu 19.10 to Ubuntu 20.04, as I just did. You may have a number of CRAN packages installed from source in
/usr/local/lib/R/site-library. All fine.
dpkg do not know about them. So it may remove libraries not knowing about these implicit dependencies. Next time you try to load one of the affected packages, it will fail.
Say you experiment with RSPM, for example via this Rocker container which you can pull via
docker pull rocker/r-rspm:18.04. And you did
install.packages("xml2"). Now you can do (after installing this package, of course)
and installing (at the system-level, i.e. as
sudo apt install libxml2 will make your package work. Which is a very nice complement to the nice and fast installation via RSPM.
For now from GitHub via
remotes::install_github("eddelbuettel/chshli") or, if you have littler, via
GPL (>= 2)