AWS re/Start Lab · Linux

Software Management

Master the yum package manager by upgrading local software, rolling back installations using the history tool, and manually configuring the AWS CLI.

Lab Summary

Connected via PuTTY (as described in Lab 225). Invoked the yum package manager to apply critical security updates and install the HTTP daemon. Utilized history undo to roll back changes. Finally, installed the AWS CLI manually using cURL, and configured local credentials files to retrieve backend EC2 attributes.

Package Updates

Executed comprehensive security upgrades and installed new software binaries using the standard package repository.

History Rollbacks

Leveraged transaction IDs within yum's history log to cleanly undo a previous installation action.

CLI Integration

Setup AWS CLI V2 via downloaded archives, configuring credentials to execute authenticated cloud queries locally.

Step-by-Step Walkthrough

Detailed record of each task performed during the lab.

01

SSH Connection

  • Connected to the EC2 instance via PuTTY following the process described in Lab 225.
02

Update the Linux Machine

  • Navigated to the companyA home folder using cd companyA.
  • Queried available repository updates with sudo yum -y check-update.
  • Applied only security-related updates via sudo yum update --security.
  • Updated all remaining local packages using sudo yum -y upgrade.
  • Installed the Apache Server package to populate the transaction history further using sudo yum install httpd -y.
The -y flag is used across yum commands to assert "yes" to all interactive prompts, making it ideal for automated updates.
03

Roll Back a Package

  • Requested the transaction history of yum via sudo yum history list, and observed the numeric ID representing the httpd install.
  • Obtained deep reporting regarding this transaction using sudo yum history info <#>.
  • Initiated a rollback on that exact transaction ID with sudo yum -y history undo <#>.
04

Install the AWS CLI

  • Verified Python requirements (python3 --version). Detected that pip was missing.
  • Instead of utilizing pip, downloaded the compiled ZIP distribution via cURL: curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip".
  • Extracted the archive through unzip awscliv2.zip.
  • Ran the installation executable: sudo ./aws/install.
  • Re-verified functionality by requesting CLI native help: aws help.
05

Configure AWS CLI Profile

  • Ran the interactive aws configure tool, defining us-west-2 as the default Region and json as the default output format. Left keys blank initially.
  • Opened the credentials file via Nano text editor: sudo nano ~/.aws/credentials.
  • Pasted a pre-generated Access Key ID, Secret Access Key, and Session Token manually into the [default] profile block, saving the file.
  • Searched the AWS Console instances pane to identify the unique Instance ID.
  • Attempted an authenticated API query to confirm privileges are active: aws ec2 describe-instance-attribute --instance-id <id> --attribute instanceType.

Command Reference

Commands utilized during package operations.

cmd

yum

The primary package-management utility for RHEL system derivations.

  • update --security : Injects only critical security patches without upgrading full packages
  • history list : Outputs an enumerated ledger of installed software transactions
  • history undo : Safely rewinds a transaction, pruning the exact binaries applied
cmd

curl

Transfers data from internet endpoints without browser intervention.

  • -o : Directs the downloaded output payload directly into a specified local file
cmd

aws configure

Bootstraps the local environment building the ~/.aws/credentials and ~/.aws/config files.

Key Learnings

What Was Learned

Differences between applying --security updates and doing a full package upgrade.
The power of yum history undo which guarantees clean rollbacks without orphaned dependencies.
How to manually bootstrap the AWS CLI v2 utilizing cURL and unzip instead of relying on package managers.
Editing local AWS credentials configurations manually to load ephemeral session tokens.

Technical Conclusion

Operating enterprise infrastructure necessitates a flawless rollback strategy. The precision of yum history prevents administrators from guessing which dependency packages caused an instable update resulting in more predictable maintenance cycles.

Understanding manual shell integration via tools like cURL ensures critical infrastructural engines like the AWS CLI can be installed securely on headless servers even when standard packet managers fail.