Let $X$ be a normal projective (or, quasi-projective) variety over $\mathbb{C}$. Let $U \subset X$ be an open subscheme whose complement $Z = X \setminus U$ has codimension at least $2$ in $X$. Let $L$ be a line bundle on $U$. Is it possible to extend $L$ to a line bundle $\widetilde{L}$ on $X$ such that $\widetilde{L}\vert\_U \cong L$? 


Edit: If this is true, can we get $\textrm{Pic}(X) \cong \textrm{Pic}(U)$? 



Extension of line bundle defined over an open subscheme
As explained here [Extending vector bundles on a given open subscheme](https://mathoverflow.net/questions/22111/extending-vector-bundles-on-a-given-open-subscheme?rq=1) the only possible such extension is 
$$
\tilde{L} = (i\_\*L)^{\vee\vee},
$$
where $i \colon U \to X$ is the embedding. The sheaf $\tilde{L}$ is a reflexive sheaf of rank 1 on $X$. So, if $X$ is locally factorial (i.e., every Weil divisor on $X$ is Cartier) then $\tilde{L}$ is a line bundle. Otherwise, this is not necessarily true. For example, let $X$ be the 2-dimensonal quadratic cone, $U$ its smooth locus, and $\tilde{L}$ the ideal of a line on $X$. Then $L = i^\*\tilde{L}$ is a line bundle, but its unique reflexive extension $\tilde{L}$ is not.


For any normal variety one has $Cl(U) = Cl(X)$, so you get $Pic(U) = Pic(X)$ if and only if $X$ is locally factorial along the complement $X \setminus U$.


