I think it's just best to read the documentation coming with that specific program or application that you're wanting to install.
Usually there are readmes/READMEs inside the tarballs (the application source archive which you can usually download) or maybe even INSTALL files to read and learn about what is the preferred way of installing said application.
In short: RTFM ;)

How to compile and install programs from source
I have a small function to get post categories from a custom taxonomy and modify their url, but now I have multi-word categories I need to modify it to use the category slug instead of just the category name. How would I change this to introduce $term->slug somewhere? 

$terms = strip_tags( get_the_term_list( $post-&gt;ID, 'portfolio_cat', '', '/' ));
$terms = explode("/",$terms);
for($i=0; $i&lt;count($terms); $i++){ 
  echo "&lt;a href='urlhere/$terms[$i]'&gt;" . $terms[$i] . "&lt;/a&gt;";
  $total = count($terms) - 1;
  if ($i != $total) { echo', '; }
}

