Let $K$ be the ground field. An extension of a Lie $K$-algebra $\mathfrak{g}$ means a pair $(\mathfrak{h},p)$ where $p$ is a surjective homomorphism $\mathfrak{h}\to\mathfrak{g}$. A homomorphism between extensions $(\mathfrak{h}_1,p_1)$, $(\mathfrak{h}_2,p_2)$ is a $K$-algebra homomorphism $f:\mathfrak{h}_1\to\mathfrak{h}_2$ such that $p_2\circ f=p_1$. A universal extension of $\mathfrak{g}$, is naturally defined as an initial object in this category.
In the full subcategory of central extensions, an initial object is called a universal central extension (and unlike the claim in a comment to this answer, is a well-adapted definition). This is classical, as well as the fact that a universal central extension of $\mathfrak{g}$ exists if and only if $\mathfrak{g}$ is perfect.
In the whole category of extensions of $\mathfrak{g}$, one has:
Then there is no universal extension of $\mathfrak{g}$ except for $\mathfrak{g}=\{0\}$.
This holds in the category of Lie $K$-algebras, or also, if $\mathfrak{g}$ is finite-dimensional, in the category of finite-dimensional Lie $K$-algebras.
Since $\{0\}$ is an initial object in the category of Lie algebras, $\{0\}\to\{0\}$ is a universal extension. Hence suppose $\mathfrak{g}\neq\{0\}$. By contradiction, let $(\mathfrak{h},p)$ be a universal extension, so $\mathfrak{h}\neq\{0\}$. Consider the first projection $q:\mathfrak{g}\times\mathfrak{h}\to\mathfrak{g}$. Then both homomorphisms $(p,0)$ and $(p,\mathrm{id})$ from $\mathfrak{h}$ to $\mathfrak{g}\times\mathfrak{h}$ lift $p$, and this contradicts the uniqueness in the universal property.
(Note: this is a variation of the argument to show that if $\mathfrak{g}$ is not perfect then it has no universal central extension.)