  The rare decays $\bar B\rightarrow X_s\gamma$ and $B_s^0\rightarrow
\mu^+\mu^-$ are important to research new physics beyond standard model. In
this work, we investigate two loop electroweak corrections to $\bar
B\rightarrow X_s\gamma$ and $B_s^0\rightarrow \mu^+\mu^-$ in the minimal
supersymmetric extension of the SM with local $B-L$ gauge symmetry (B-LSSM),
under a minimal flavor violating assumption for the soft breaking terms. In
this framework, new particles and new definition of squarks can affect the
theoretical predictions of these two processes, with respect to the MSSM.
Considering the constraints from updated experimental data, the numerical
results show that the B-LSSM can fit the experimental data for the branching
ratios of $\bar B\rightarrow X_s\gamma$ and $B_s^0\rightarrow \mu^+\mu^-$. The
results of the rare decays also further constrain the parameter space of the
B-LSSM.
