How the get non italic greek letters like siunitx package?

By default siunitx uses here \textmu from the textcomp package:

\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{siunitx}
\usepackage{upgreek,textcomp}
\begin{document}
\noindent
$10~\mu m$\\
$\mathrm{10~\mu m}$\\
$\mathrm{10~\upmu m}$\\
 \SI{10}{\micro\meter} \textmu $\text{\textmu}$
\end{document}

enter image description here


You should not use the "micro" symbol from the siunitx package as an upright greek lowercase letter while in math mode. From the user guide of the upgreek package (which provides the macro \upmu):

Note that \upmu should normally not be used as the prefix for physical units, meaning 10^{−6}. The mu symbol to be used there is to be taken from the text font, and most Latin text fonts do actually include a suitable Greek mu, which can be accessed as \textmu. Most likely –- depending on the encoding of your text fonts -– you need to load the package textcomp for this purpose. [emphasis in orginal]

Conversely, \textmu should in general not be used as a substitute for \upmu or \mu while in math mode.