{"id":8831,"date":"2021-11-08T10:00:46","date_gmt":"2021-11-08T01:00:46","guid":{"rendered":"https:\/\/www.secuavail.com\/kb\/?p=8747"},"modified":"2021-11-10T14:16:14","modified_gmt":"2021-11-10T05:16:14","slug":"tb-211005_01","status":"publish","type":"post","link":"https:\/\/www.secuavail.com\/kb\/tech-blog\/tb-211005_01\/","title":{"rendered":"AmazonLinux2\u306b\u304a\u3044\u3066\u3001aws cli\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u30921\u304b\u30892\u3078\u5909\u66f4\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066"},"content":{"rendered":"<p>\u5f53\u8a18\u4e8b\u3067\u306f\u3001AmazonLinux2\u306b\u304a\u3044\u3066\u3001aws cli\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u30921\u304b\u30892\u3078\u5909\u66f4\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u8a18\u8f09\u3057\u307e\u3059\u3002<\/p>\n<h2>\u524d\u63d0<\/h2>\n<ul style=\"list-style-type: disc;\">\n<li>\u5f53\u8a18\u4e8b\u306e\u8aac\u660e\u306f\u3059\u3079\u3066\u6771\u4eac\u30ea\u30fc\u30b8\u30e7\u30f3\u306b\u3066\u751f\u6210\u3055\u308c\u305fEC2\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306b\u3066\u5b9f\u65bd\u3057\u305f\u4e8b\u9805\u3068\u306a\u308a\u307e\u3059\u3002<\/li>\n<li>EC2\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u751f\u6210\u76f4\u5f8c\u306e\u72b6\u614b\u304b\u3089\u30b3\u30de\u30f3\u30c9\u306b\u3066aws cli\u30d0\u30fc\u30b8\u30e7\u30f32\u306b\u5909\u66f4\u3055\u308c\u305f\u304b\u3069\u3046\u304b\u78ba\u8a8d\u3059\u308b\u307e\u3067\u306e\u5185\u5bb9\u3092\u8a18\u8f09\u3057\u3066\u3044\u307e\u3059\u3002<\/li>\n<li>EC2\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e\u751f\u6210\u65b9\u6cd5\u306b\u3064\u304d\u307e\u3057\u3066\u306f\u8aac\u660e\u3092\u5272\u611b\u3057\u307e\u3059\u3002<\/li>\n<li>\u5f53\u8a18\u4e8b\u306f\u4e0b\u8a18\u30ea\u30f3\u30af\u306e\u8a18\u8f09\u5185\u5bb9\u3092\u53c2\u8003\u306b\u4f5c\u6210\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\n<a href=\"https:\/\/docs.aws.amazon.com\/cli\/latest\/userguide\/install-linux-al2017.html\">https:\/\/docs.aws.amazon.com\/cli\/latest\/userguide\/install-linux-al2017.html<\/a><br \/>\n<a href=\"https:\/\/docs.aws.amazon.com\/cli\/latest\/userguide\/install-cliv2-linux.html\">https:\/\/docs.aws.amazon.com\/cli\/latest\/userguide\/install-cliv2-linux.html<\/a><\/li>\n<\/ul>\n<h2>\u5909\u66f4\u65b9\u6cd5\u306b\u3064\u3044\u3066<\/h2>\n<ul style=\"list-style-type: disc;\">\n<li>\u7528\u610f\u3057\u305fAmazonLinux 2\u306b\u3066\u73fe\u5728\u306eaws cli\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u53ca\u3073OS\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/li>\n<\/ul>\n<pre class=\"lang:default highlight:0 decode:true\">[ec2-user@ip-xxx-xxx-xxx-xxx ~]$ aws --version\r\naws-cli\/1.18.147 Python\/2.7.18 Linux\/4.14.243-185.433.amzn2.x86_64 botocore\/1.18.6\uff53\r\n[ec2-user@ip-xxx-xxx-xxx-xxx ~]$ cat \/etc\/os-release\r\nNAME=\"Amazon Linux\"\r\nVERSION=\"2\"\r\nID=\"amzn\"\r\nID_LIKE=\"centos rhel fedora\"\r\nVERSION_ID=\"2\"\r\nPRETTY_NAME=\"Amazon Linux 2\"\r\nANSI_COLOR=\"0;33\"\r\nCPE_NAME=\"cpe:2.3:o:amazon:amazon_linux:2\"\r\nHOME_URL=\"https:\/\/amazonlinux.com\/\"\r\n[ec2-user@ip-172-16-12-244 ~]$<\/pre>\n<ul style=\"list-style-type: disc;\">\n<li>\u30b7\u30a7\u30eb\u306e\u30d7\u30ed\u30d5\u30a1\u30a4\u30eb\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/li>\n<\/ul>\n<pre class=\"lang:default highlight:0 decode:true\">[ec2-user@ip-xxx-xxx-xxx-xxx ~]$ echo $SHELL\r\n\/bin\/bash\r\n[ec2-user@ip-xxx-xxx-xxx-xxx ~]$<\/pre>\n<ul style=\"list-style-type: disc;\">\n<li>\u30d7\u30ed\u30d5\u30a1\u30a4\u30eb\u306b\u4ee5\u4e0b\u306e\u30a8\u30af\u30b9\u30dd\u30fc\u30c8\u30b3\u30de\u30f3\u30c9\u3092\u8ffd\u8a18\u3057\u307e\u3059\u3002<\/li>\n<\/ul>\n<pre class=\"lang:default highlight:0 decode:true\">[ec2-user@ip-xxx-xxx-xxx-xxx ~]$ sudo vi .bash_profile\r\n# .bash_profile\r\n# Get the aliases and functions\r\nif [ -f ~\/.bashrc ]; then\r\n        . ~\/.bashrc\r\nfi\r\n# User specific environment and startup programs\r\nPATH=$PATH:$HOME\/.local\/bin:$HOME\/bin\r\nexport PATH\r\nexport PATH=$HOME\/.local\/bin:$PATH   ###\u8ffd\u8a18\u7b87\u6240###\r\n[ec2-user@ip-xxx-xxx-xxx-xxx ~]$<\/pre>\n<ul style=\"list-style-type: disc;\">\n<li>\u73fe\u5728\u306e\u30bb\u30c3\u30b7\u30e7\u30f3\u306b\u3066\u8ffd\u8a18\u3057\u305f\u30d7\u30ed\u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u8fbc\u307f\u307e\u3059\u3002<\/li>\n<\/ul>\n<pre class=\"lang:default highlight:0 decode:true\">[ec2-user@ip-xxx-xxx-xxx-xxx ~]$ source ~\/.bash_profile\r\n\/bin\/bash\r\n[ec2-user@ip-xxx-xxx-xxx-xxx ~]$<\/pre>\n<ul style=\"list-style-type: disc;\">\n<li>aws cli\u30d0\u30fc\u30b8\u30e7\u30f31\u3092\u6700\u65b0\u30d0\u30fc\u30b8\u30e7\u30f3\u306b\u66f4\u65b0\u3057\u307e\u3059\u3002<\/li>\n<\/ul>\n<pre class=\"lang:default highlight:0 decode:true\">[ec2-user@ip-xxx-xxx-xxx-xxx ~]$ pip3 install --upgrade --user awscli\r\nCollecting awscli\r\n  Downloading awscli-1.20.54-py3-none-any.whl (3.7 MB)\r\n     |????????????????????????????????| 3.7 MB 22.4 MB\/s\r\nCollecting rsa&lt;4.8,&gt;=3.1.2\r\n  Downloading rsa-4.7.2-py3-none-any.whl (34 kB)\r\nRequirement already satisfied, skipping upgrade: docutils&lt;0.16,&gt;=0.10 in \/usr\/lib\/python3.7\/site-packages (from awscli) (0.14)\r\nCollecting s3transfer&lt;0.6.0,&gt;=0.5.0\r\n  Downloading s3transfer-0.5.0-py3-none-any.whl (79 kB)\r\n     |????????????????????????????????| 79 kB 11.7 MB\/s\r\nCollecting colorama&lt;0.4.4,&gt;=0.2.5\r\n  Downloading colorama-0.4.3-py2.py3-none-any.whl (15 kB)\r\nCollecting botocore==1.21.54\r\n  Downloading botocore-1.21.54-py3-none-any.whl (8.0 MB)\r\n     |????????????????????????????????| 8.0 MB 33.1 MB\/s\r\nCollecting PyYAML&lt;5.5,&gt;=3.10\r\n  Downloading PyYAML-5.4.1-cp37-cp37m-manylinux1_x86_64.whl (636 kB)\r\n     |????????????????????????????????| 636 kB 34.3 MB\/s\r\nCollecting pyasn1&gt;=0.1.3\r\n  Downloading pyasn1-0.4.8-py2.py3-none-any.whl (77 kB)\r\n     |????????????????????????????????| 77 kB 11.4 MB\/s\r\nCollecting python-dateutil&lt;3.0.0,&gt;=2.1\r\n  Downloading python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)\r\n     |????????????????????????????????| 247 kB 38.5 MB\/s\r\nCollecting jmespath&lt;1.0.0,&gt;=0.7.1\r\n  Downloading jmespath-0.10.0-py2.py3-none-any.whl (24 kB)\r\nCollecting urllib3&lt;1.27,&gt;=1.25.4\r\n  Downloading urllib3-1.26.7-py2.py3-none-any.whl (138 kB)\r\n     |????????????????????????????????| 138 kB 39.9 MB\/s\r\nCollecting six&gt;=1.5\r\n  Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)\r\nInstalling collected packages: pyasn1, rsa, six, python-dateutil, jmespath, urllib3, botocore, s3transfer, colorama, PyYAML, awscli\r\nSuccessfully installed PyYAML-5.4.1 awscli-1.20.54 botocore-1.21.54 colorama-0.4.3 jmespath-0.10.0 pyasn1-0.4.8 python-dateutil-2.8.2 rsa-4.7.2 s3transfer-0.5.0 six-1.16.0 urllib3-1.26.7\r\n[ec2-user@ip-xxx-xxx-xxx-xxx ~]<\/pre>\n<ul style=\"list-style-type: disc;\">\n<li>aws cli\u30d0\u30fc\u30b8\u30e7\u30f31\u3092\u30a2\u30f3\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/li>\n<\/ul>\n<pre class=\"lang:default highlight:0 decode:true\">[ec2-user@ip-xxx-xxx-xxx-xxx ~]$ pip3 uninstall awscli\r\nFound existing installation: awscli 1.20.54\r\nUninstalling awscli-1.20.54:\r\n  Would remove:\r\n    \/home\/ec2-user\/.local\/bin\/aws\r\n    \/home\/ec2-user\/.local\/bin\/aws.cmd\r\n    \/home\/ec2-user\/.local\/bin\/aws_bash_completer\r\n    \/home\/ec2-user\/.local\/bin\/aws_completer\r\n    \/home\/ec2-user\/.local\/bin\/aws_zsh_completer.sh\r\n    \/home\/ec2-user\/.local\/lib\/python3.7\/site-packages\/awscli-1.20.54.dist-info\/*\r\n    \/home\/ec2-user\/.local\/lib\/python3.7\/site-packages\/awscli\/*\r\nProceed (y\/n)? y\r\n  Successfully uninstalled awscli-1.20.54\r\n[ec2-user@ip-xxx-xxx-xxx-xxx ~]$<\/pre>\n<ul style=\"list-style-type: disc;\">\n<li>\u30a2\u30f3\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u305f\u3053\u3068\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/li>\n<\/ul>\n<pre class=\"lang:default highlight:0 decode:true \">[ec2-user@ip-xxx-xxx-xxx-xxx ~]$ aws --version\r\n-bash: \/home\/ec2-user\/.local\/bin\/aws: No such file or directory\r\n[ec2-user@ip-xxx-xxx-xxx-xxx ~]$<\/pre>\n<ul style=\"list-style-type: disc;\">\n<li>aws cli\u30d0\u30fc\u30b8\u30e7\u30f32\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/li>\n<\/ul>\n<pre class=\"lang:default highlight:0 decode:true\">[ec2-user@ip-xxx-xxx-xxx-xxx ~]$  curl \"https:\/\/awscli.amazonaws.com\/awscli-exe-linux-x86_64.zip\" -o \"awscliv2.zip\"\r\n  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current\r\n                                 Dload  Upload   Total   Spent    Left  Speed\r\n100 42.4M  100 42.4M    0     0   112M      0 --:--:-- --:--:-- --:--:--  113M\r\n[ec2-user@ip-xxx-xxx-xxx-xxx ~]$ unzip awscliv2.zip\r\nArchive:  awscliv2.zip\r\n   creating: aws\/\r\n   creating: aws\/dist\/\r\n  inflating: aws\/install\r\n  inflating: aws\/THIRD_PARTY_LICENSES\r\n  inflating: aws\/README.md\r\n\uff5e\u7701\u7565\uff5e\r\n  inflating: aws\/dist\/cryptography-3.3.2-py3.8.egg-info\/LICENSE.APACHE\r\n  inflating: aws\/dist\/cryptography-3.3.2-py3.8.egg-info\/LICENSE\r\n  inflating: aws\/dist\/cryptography-3.3.2-py3.8.egg-info\/METADATA\r\n   creating: aws\/dist\/zlib\/cpython-38-x86_64-linux-gnu\/\r\n  inflating: aws\/dist\/zlib\/cpython-38-x86_64-linux-gnu\/soib.cpython-38-x86_64-linux-gnu.so\r\n[ec2-user@ip-xxx-xxx-xxx-xxx ~]$ sudo .\/aws\/install\r\nYou can now run: \/usr\/local\/bin\/aws --version\r\n[ec2-user@ip-xxx-xxx-xxx-xxx ~]$<\/pre>\n<ul style=\"list-style-type: disc;\">\n<li>\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002aws \u30b3\u30de\u30f3\u30c9\u304c\u898b\u3064\u304b\u3089\u306a\u3044\u5834\u5408\u306f\u3001\u73fe\u5728\u306e\u30bb\u30c3\u30b7\u30e7\u30f3\u306b\u3066\u30d7\u30ed\u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u76f4\u3057\u307e\u3059\u3002<\/li>\n<\/ul>\n<pre class=\"lang:default highlight:0 decode:true \">[ec2-user@ip-xxx-xxx-xxx-xxx ~]$ aws --version\r\n-bash: \/home\/ec2-user\/.local\/bin\/aws: No such file or directory\r\n[ec2-user@ip-xxx-xxx-xxx-xxx ~]$ source ~\/.bash_profile\r\n[ec2-user@ip-xxx-xxx-xxx-xxx ~]$ aws --version\r\naws-cli\/2.2.43 Python\/3.8.8 Linux\/4.14.243-185.433.amzn2.x86_64 exe\/x86_64.amzn.2 prompt\/off\r\n[ec2-user@ip-xxx-xxx-xxx-xxx ~]$<\/pre>\n<p>\u4ee5\u4e0a\u3067\u3001AmazonLinux2\u306b\u304a\u3044\u3066\u3001aws cli\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u30921\u304b\u30892\u3078\u5909\u66f4\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u306e\u8aac\u660e\u306f\u7d42\u4e86\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5f53\u8a18\u4e8b\u3067\u306f\u3001AmazonLinux2\u306b\u304a\u3044\u3066\u3001aws cli\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u30921\u304b\u30892\u3078\u5909\u66f4\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u8a18\u8f09\u3057\u307e\u3059\u3002 \u524d\u63d0 \u5f53\u8a18\u4e8b\u306e\u8aac\u660e\u306f\u3059\u3079\u3066\u6771\u4eac\u30ea\u30fc\u30b8\u30e7\u30f3\u306b\u3066\u751f\u6210\u3055\u308c\u305fEC2\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306b\u3066\u5b9f\u65bd\u3057\u305f\u4e8b\u9805\u3068\u306a\u308a\u307e\u3059\u3002  [&hellip;]","protected":false},"author":8,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[50,58,2],"tags":[41,9],"class_list":["post-8831","post","type-post","status-publish","format-standard","hentry","category-windows-linux","category-aws-azure","category-tech-blog","tag-aws","tag-linux"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.secuavail.com\/kb\/wp-json\/wp\/v2\/posts\/8831","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.secuavail.com\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.secuavail.com\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.secuavail.com\/kb\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/www.secuavail.com\/kb\/wp-json\/wp\/v2\/comments?post=8831"}],"version-history":[{"count":2,"href":"https:\/\/www.secuavail.com\/kb\/wp-json\/wp\/v2\/posts\/8831\/revisions"}],"predecessor-version":[{"id":9391,"href":"https:\/\/www.secuavail.com\/kb\/wp-json\/wp\/v2\/posts\/8831\/revisions\/9391"}],"wp:attachment":[{"href":"https:\/\/www.secuavail.com\/kb\/wp-json\/wp\/v2\/media?parent=8831"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.secuavail.com\/kb\/wp-json\/wp\/v2\/categories?post=8831"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.secuavail.com\/kb\/wp-json\/wp\/v2\/tags?post=8831"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}