tidyverse and some R version 4.2.0 packages not working on ubuntu 22.04

Although I try to install, this package and others do not work. How to proceed properly?

install.packages("tidyverse", dependencies = T)

Warning in install.packages :
installation of package ‘ggplot2’ had non-zero exit status
ERROR: dependency ‘ggplot2’ is not available for package ‘tidyverse’

  • removing ‘/home/vitor/R/x86_64-pc-linux-gnu-library/4.2/tidyverse’
    Warning in install.packages :
    installation of package ‘tidyverse’ had non-zero exit status

The downloaded source packages are in
‘/tmp/RtmpMfKJxK/downloaded_packages’

please provide the full log for when you do

install.packages("ggplot2", dependencies = T)