We consider Bayesian inference in the linear regression problem with an unknown error distribution that is symmetric about zero. We show that if the prior for the error distribution assigns positive probabilities to a certain type of neighbourhood of the true distribution, then the posterior distribution is consistent in the weak topology. In particular, this implies that the posterior distribution of the regression parameters is consist\-ent in the Euclidean metric. The result follows from our generalization of a celebrated result of Schwartz to the independent, non-identical case and the existence of exponentially consistent tests of the complement of the neighbourhoods shown here. We then specialize to two important prior distributions, the Polya tree and Dirichlet mixtures, and show that under appropriate conditions these priors satisfy the positivity requirement of the prior probabilities of the neighbourhoods of the true density. We consider the case of both non-stochastic and stochastic regressors. A similar problem of Bayesian inference in a generalized linear model for binary responses with an unknown link is also considered.