How do I use hook_update_N() to create a vocabulary?
You should be able to do it like this:

&lt;?php

use Drupal\taxonomy\Entity\Vocabulary;

/**
 * create vocabulary testname.
 */
function ent_create_update_8105(&amp;$sandbox) {
  $vid = 'testname';
  $vocabulary = Vocabulary::load($vid);
  if (!isset($vocabulary)) {
    Vocabulary::create([
      'vid' =&gt; $vid,
      'description' =&gt; '',
      'name' =&gt; 'The vocabulary’s name',
    ])-&gt;save();
  }
}