I installed a local shiny server on a Ubuntu 20.04 LTS. The R web app works correctly, I have tested in RStudio.
But when I try to deploy it on a shiny server it's missing packages and after I install them via the R console, it continues to tell me I'm missing the packages.
After a little google search, some people tell me it's because of the user in which it runs de shiny server service. I don't know if it's my case or not.
That suggests you have messed with the default package library location, under a standard configuration installing as superuser is enough. The downside of installing as shiny is that you are limited to run your applications only as shiny but if you are not going to modify your shiny-server config file I suppose it doesn't matter.
Do you mean from R? maybe you could create a wrapper function that constructs a system call but since you are not going to be installing packages for your shiny applications every day I think it is not worth it.