I don't know much about gentoo, but with Redhat, Fedora, and Centos, you use yum utility to find and download Linux packages. Make sure you read all the pre-reqs and install them before hand.
If you are using installing 9.5 it would be best if you get the latest fixpack and use it for the install (fixpacks are cummulative and include the base code). You will then need to harvest the license from you current install code, but you have 90 days to update the license key.
If you are using DB2 Express-C, you need a special install package and only 9.7.2 is available from IBM at this point.