Material instabilities in elastic and plastic solids: the perturbative approach