One can give the cross product as a Lie bracket on $\mathbb{R}^3$ and the matrix commutator to $\mathbb{R}^{n^2}$ ($n \ge 2$). They both give a perfect Lie algebra structure.
However, every Lie algebra of dimension $1$ is abelian, and for $2$-dim we can write any nontrivial Lie bracket as $[x, y]=x$ (if $\{x, y\}$ is a basis) but this Lie algebra is not perfect.
So I'm wondering which vector spaces have a perfect Lie algebra structure. Does every $\mathbb{R}^n$ ($n \ge 3$) have a Lie bracket which makes it into a perfect Lie algebra?
First, every semisimple Lie algebra is perfect. So in each dimension $n\ge 3$, where we have a semisimple Lie algebra of dimension $n$, we have a Lie bracket which makes $\mathbb{R}^n$ into a perfect Lie algebra. These dimensions start with $n=3,6,8,9,\ldots$. On the other hand, there are also perfect Lie algebras, which are not semisimple. For example take a semisimple Lie algebra $L$ of dimension $n$ and an irreducible representation $V$ of $L$, of dimension $m \ge 2$ and define a bracket on $L \times V$ by $$ [(X,v),(Y,u)] := ([X,Y],Xu-Yv). $$ This turns $L \times V$ into a perfect Lie algebra with $\text{Rad}(L \times V) = V$. The dimension is $n+m$.
However, not all dimensions can occur. For example, there is no perfect Lie algebra in dimension $4$.