Note that there may be more things to do in the future
I want to install a package in an offline environment.
Assuming that you have an online environment that connects to the Internet, follow the steps below.
Specify the --downloadonly
option with yum install.
You can specify the download destination by specifying the --downloaddir
option, but it's annoying because I forgot to specify it here. .. ..
$ sudo yum install -y https://s3.amazonaws.com/ec2-downloads-windows/SSMAgent/latest/linux_amd64/amazon-ssm-agent.rpm --downloadonly
Loaded plugins: fastestmirror
amazon-ssm-agent.rpm | 31 MB 00:00:10
Examining /var/tmp/yum-root-oPlmKR/amazon-ssm-agent.rpm: amazon-ssm-agent-2.3.772.0-1.x86_64
Marking /var/tmp/yum-root-oPlmKR/amazon-ssm-agent.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package amazon-ssm-agent.x86_64 0:2.3.772.0-1 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=============================================================================================================================================================
Package Arch Version Repository Size
=============================================================================================================================================================
Installing:
amazon-ssm-agent x86_64 2.3.772.0-1 /amazon-ssm-agent 120 M
Transaction Summary
=============================================================================================================================================================
Install 1 Package
Total size: 120 M
Installed size: 120 M
Background downloading packages, then exiting:
exiting because "Download Only" specified
I've been fooled into an unfamiliar place called / var / tmp / yum-root-oPlmKR
, so I bring this to my home.
Also change the owner
# cp amazon-ssm-agent.rpm /home/centos/
# chown centos /home/centos/amazon-ssm-agent.rpm
Transfer with scp command.
Specify the key file to log in to the transfer destination with the -i
option.
$ scp -i ./.ssh/xxx.pem amazon-ssm-agent.rpm xx.xx.xx.xx(Transfer destination IP):~
Install with yum as usual
I forgot to put on sudo and got angry once. .. ..
$ sudo yum install amazon-ssm-agent.rpm
Loaded plugins: fastestmirror
Examining amazon-ssm-agent.rpm: amazon-ssm-agent-2.3.772.0-1.x86_64
Marking amazon-ssm-agent.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package amazon-ssm-agent.x86_64 0:2.3.772.0-1 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=============================================================================================================================================================
Package Arch Version Repository Size
=============================================================================================================================================================
Installing:
amazon-ssm-agent x86_64 2.3.772.0-1 /amazon-ssm-agent 120 M
Transaction Summary
=============================================================================================================================================================
Install 1 Package
Total size: 120 M
Installed size: 120 M
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : amazon-ssm-agent-2.3.772.0-1.x86_64 1/1
Created symlink from /etc/systemd/system/multi-user.target.wants/amazon-ssm-agent.service to /etc/systemd/system/amazon-ssm-agent.service.
Verifying : amazon-ssm-agent-2.3.772.0-1.x86_64 1/1
Installed:
amazon-ssm-agent.x86_64 0:2.3.772.0-1
Complete!
You have successfully installed it.
Recommended Posts