IBM Corp said on Sunday it had agreed to acquire U.S. software company Red Hat Inc for $34 billion, including debt, as it seeks to diversify...