You can't. Not sure if by "for free" you meant to upgrade for free, but if that's what you meant there is no way on Earth. That's hardware. No one will give you hardware for free.
Plus, all-in-ones and most notebook machines can't be upgraded because the components are soldered in place and the parts are highly customized. Sorry.