To upgrade to a Ryzen series CPU you will also need to buy a new motherboard, memory sticks and maybe a newer model PSU.
AFAIK the Ryzen 5 5600G is an OEM product, not for sale on its own to the general public.
My PC- Ryzen 5 5600x, B550 aorus pro ac, Hyper 212 black, 2 x 16gb F4-3600c16dgtzn kit, NM790 2TB, Nitro+RX6900XT, RM850, Win.10 Pro., LC27G55T.