I have two linux hosts (AWS EC2 - Amazon Linux which is based on "centos rhel fedora"), one for production and one for acceptance. I want to do a monthly update cycle in which I perform updates on the acceptance host, have the business test for a week (or two or so) and then do the exact same updates on production. I currently use yum for performing the updates, so I played around with yum list updates, which I could output to a file but I can't find a way for yum to install only the packages as listed from that file.

I could use some advice and or solution on what would be the best approach. Please know this is a very small business, so setting up self hosted repos and using ansible is not an option, but I'm open to (not too expensive) amazon based solutions, although I would prefer a simple script/commands to work with.

1 Answer 1


Technically you should use a third host. In theory you want to take the same administrative action on the "acceptance" host as you do in production. this way you've proved the administrative action you wish to take in production will definitely work. This means building reference files for that administrative action should happen on a third (let's call it) "development" host.

Amazon Linux shares a common ancestry with Redhat. So you will often find Redhat documentation useful.

There is a section of the Redhat Enterprise documentation that covers your exact situation. (See 8.3.3 Reverting and repeating transactions).

When managing several identical systems, Yum also allows you to perform a transaction on one of them, store the transaction details in a file, and after a period of testing, repeat the same transaction on the remaining systems as well. To store the transaction details to a file, type the following at a shell prompt as root:

yum -q history addon-info id saved_tx > file_name

Once you copy this file to the target system, you can repeat the transaction by using the following command as root:

yum load-transaction file_name

Practically this means you would run commands on one host such as:

sudo yum upgrade
sudo yum history addon-info last saved_tx > upgrade_transaction_log

Then move the new file upgrade_transaction_log to the next host and run:

sudo yum load-transaction upgrade_transaction_log

You will be responsible for ensuring both hosts start out identical.

  • Thank you, this was exactly what I was looking for and will test it out after the holidays. Dec 25, 2022 at 6:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .