A “struggling” town centre pub will stop pulling pints after more than 150 years as the landlord says the business is no longer financially viable.