I read in the following paper of Toth (https://arxiv.org/pdf/1608.00795.pdf) that Ramanujan had obtained the following formula, proved by Wilson in 1922:

$$\displaystyle \sum_{n \leq X} \frac{1}{d(n)} = X\sum_{j=1}^N \frac{A_j}{(\log X)^{j-1/2}} + O \left(\frac{x}{(\log X)^{N+1/2}}\right),$$

where $A_j$ are explicitly computable constants with

$$\displaystyle A_1 = \frac{1}{\sqrt{\pi}} \prod_p \left( \left(1 - \frac{1}{p}\right)^{1/2} p \log\left(1 + \frac{1}{p-1}\right)\right),$$ which converges conditionally.

Can one derive from this the sum

$$\displaystyle \sum_{\substack{n \leq X \\ n \text{ squarefree}}} \frac{1}{d(n)} = \sum_{n \leq X} \frac{\mu^2(n)}{2^{\omega(n)}}?$$