Older versions of yum do not support --cacheonly but only -C. The long version was added in 3e8e0b1f844b8ff15c330c2e77901cf1af9ca08a