According to one version, from Proto-Indo-European *h₂egʷs-ih₂- (“axe”), from *h₂eḱ- (“sharp, pointed”) (see axe).
According to De Vaan, it is not plausible since a sequence *ks is usually retained in intervocalic Latin, which implies borrowing from an unidentified source. It is possible that the consonant cluster underwent metathesis in a different (IE?) language before the word entered Latin.