Output all terms in a custom taxonomy and add a “active” class only to the ones attached to the current post

how to check if each term is attached to the current post

You can do that using has_term() which defaults to checking on the current post in the main loop, hence you can omit the third parameter (the post ID).

So for example in your case:

$class = has_term( $term->term_id, $term->taxonomy ) ? 'active' : ''; // like this
//$class = has_term( $term->term_id, 'package' ) ? 'active' : '';     // or this

echo '<li class="' . $class . '">' . $term->name . '</li>';