{"id":99,"date":"2023-05-11T12:19:18","date_gmt":"2023-05-11T03:19:18","guid":{"rendered":"https:\/\/blog.interstellar.co.jp\/en\/?p=99"},"modified":"2023-05-11T12:19:20","modified_gmt":"2023-05-11T03:19:20","slug":"amazon-linux-2023-nginx-install","status":"publish","type":"post","link":"https:\/\/blog.interstellar.co.jp\/en\/2023\/05\/11\/amazon-linux-2023-nginx-install\/","title":{"rendered":"I chose Amazon Linux 2023 for Amazon EC2 and got stuck on installing nginx."},"content":{"rendered":"\n<p>This time it&#8217;s a small story.<\/p>\n\n\n\n<p>I needed to set up an instance on AWS Amazon EC2 for testing, and when I chose Amazon Linux 2023 for the test, I got a bit stuck.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">I can&#8217;t find the amazon-linux-extras command<\/h2>\n\n\n\n<p>If you search about installing nginx on Amazon Linux, you will find many blog posts about installing nginx using the amazon-linux-extras command. By the way, I asked ChatGPT, a recent hot topic, and got the same answer. <\/p>\n\n\n\n<p>But with Amazon Linux 2023, it is unsympathetically as follows.<\/p>\n\n\n\n<pre class=\"wp-block-code is-style-dark\"><code lang=\"bash\" class=\"language-bash\">$ which amazon-linux-extras\n\/usr\/bin\/which: no amazon-linux-extras in (\/home\/ec2-user\/.local\/bin:\/home\/ec2-user\/bin:\/usr\/local\/bin:\/usr\/bin:\/usr\/local\/sbin:\/usr\/sbin)<\/code><\/pre>\n\n\n\n<p>Hmm? I checked and it seems that amazon-linux-extras has been discontinued.<br>It was listed in the list of Removed Packages here.<\/p>\n\n\n\n<p><a href=\"https:\/\/docs.aws.amazon.com\/ja_jp\/linux\/al2023\/release-notes\/removed-packages.html\">https:\/\/docs.aws.amazon.com\/ja_jp\/linux\/al2023\/release-notes\/removed-packages.html<\/a><\/p>\n\n\n\n<p>So, apparently, if you search with the dnf command normally, you can install it normally, like this.<\/p>\n\n\n\n<pre class=\"wp-block-code is-style-dark\"><code lang=\"bash\" class=\"language-bash\">$ sudo dnf search nginx\nLast metadata expiration check: 0:09:56 ago on Thu May 11 02:44:35 2023.\n============================================= Name Exactly Matched: nginx ==============================================\nnginx.x86_64 : A high performance web server and reverse proxy server\n============================================ Name &amp; Summary Matched: nginx =============================================\ncollectd-nginx.x86_64 : Nginx plugin for collectd\nnginx-all-modules.noarch : A meta package that installs all available Nginx modules\nnginx-core.x86_64 : nginx minimal core\nnginx-filesystem.noarch : The basic directory layout for the Nginx server\nnginx-mimetypes.noarch : MIME type mappings for nginx\nnginx-mod-devel.x86_64 : Nginx module development files\nnginx-mod-http-image-filter.x86_64 : Nginx HTTP image filter module\nnginx-mod-http-perl.x86_64 : Nginx HTTP perl module\nnginx-mod-http-xslt-filter.x86_64 : Nginx XSLT module\nnginx-mod-mail.x86_64 : Nginx mail modules\nnginx-mod-stream.x86_64 : Nginx stream modules<\/code><\/pre>\n\n\n\n<p>So I installed it.<\/p>\n\n\n\n<pre class=\"wp-block-code is-style-dark\"><code lang=\"bash\" class=\"language-bash\">$ sudo dnf install nginx\nLast metadata expiration check: 0:21:59 ago on Thu May 11 02:44:35 2023.\nDependencies resolved.\n========================================================================================================================\n Package                         Architecture       Version                               Repository               Size\n========================================================================================================================\nInstalling:\n nginx                           x86_64             1:1.22.1-1.amzn2023.0.3               amazonlinux              40 k\nInstalling dependencies:\n generic-logos-httpd             noarch             18.0.0-12.amzn2023.0.3                amazonlinux              19 k\n gperftools-libs                 x86_64             2.9.1-1.amzn2023.0.2                  amazonlinux             309 k\n libunwind                       x86_64             1.4.0-5.amzn2023.0.2                  amazonlinux              66 k\n nginx-core                      x86_64             1:1.22.1-1.amzn2023.0.3               amazonlinux             583 k\n nginx-filesystem                noarch             1:1.22.1-1.amzn2023.0.3               amazonlinux              12 k\n nginx-mimetypes                 noarch             2.1.49-3.amzn2023.0.3                 amazonlinux              21 k\n\nTransaction Summary\n========================================================================================================================\nInstall  7 Packages\n\nTotal download size: 1.0 M\nInstalled size: 3.4 M\nIs this ok [y\/N]: y\nDownloading Packages:\n(1\/7): nginx-1.22.1-1.amzn2023.0.3.x86_64.rpm                                           367 kB\/s |  40 kB     00:00    \n(2\/7): gperftools-libs-2.9.1-1.amzn2023.0.2.x86_64.rpm                                  2.5 MB\/s | 309 kB     00:00    \n(3\/7): libunwind-1.4.0-5.amzn2023.0.2.x86_64.rpm                                        2.0 MB\/s |  66 kB     00:00    \n(4\/7): nginx-core-1.22.1-1.amzn2023.0.3.x86_64.rpm                                      3.8 MB\/s | 583 kB     00:00    \n(5\/7): nginx-mimetypes-2.1.49-3.amzn2023.0.3.noarch.rpm                                 563 kB\/s |  21 kB     00:00    \n(6\/7): nginx-filesystem-1.22.1-1.amzn2023.0.3.noarch.rpm                                558 kB\/s |  12 kB     00:00    \n(7\/7): generic-logos-httpd-18.0.0-12.amzn2023.0.3.noarch.rpm                            603 kB\/s |  19 kB     00:00    \n------------------------------------------------------------------------------------------------------------------------\nTotal                                                                                   4.1 MB\/s | 1.0 MB     00:00     \nRunning transaction check\nTransaction check succeeded.\nRunning transaction test\nTransaction test succeeded.\nRunning transaction\n  Preparing        :                                                                                                1\/1 \n  Running scriptlet: nginx-filesystem-1:1.22.1-1.amzn2023.0.3.noarch                                                1\/7 \n  Installing       : nginx-filesystem-1:1.22.1-1.amzn2023.0.3.noarch                                                1\/7 \n  Installing       : nginx-mimetypes-2.1.49-3.amzn2023.0.3.noarch                                                   2\/7 \n  Installing       : generic-logos-httpd-18.0.0-12.amzn2023.0.3.noarch                                              3\/7 \n  Installing       : libunwind-1.4.0-5.amzn2023.0.2.x86_64                                                          4\/7 \n  Installing       : gperftools-libs-2.9.1-1.amzn2023.0.2.x86_64                                                    5\/7 \n  Installing       : nginx-core-1:1.22.1-1.amzn2023.0.3.x86_64                                                      6\/7 \n  Installing       : nginx-1:1.22.1-1.amzn2023.0.3.x86_64                                                           7\/7 \n  Running scriptlet: nginx-1:1.22.1-1.amzn2023.0.3.x86_64                                                           7\/7 \n  Verifying        : nginx-1:1.22.1-1.amzn2023.0.3.x86_64                                                           1\/7 \n  Verifying        : gperftools-libs-2.9.1-1.amzn2023.0.2.x86_64                                                    2\/7 \n  Verifying        : nginx-core-1:1.22.1-1.amzn2023.0.3.x86_64                                                      3\/7 \n  Verifying        : libunwind-1.4.0-5.amzn2023.0.2.x86_64                                                          4\/7 \n  Verifying        : nginx-mimetypes-2.1.49-3.amzn2023.0.3.noarch                                                   5\/7 \n  Verifying        : nginx-filesystem-1:1.22.1-1.amzn2023.0.3.noarch                                                6\/7 \n  Verifying        : generic-logos-httpd-18.0.0-12.amzn2023.0.3.noarch                                              7\/7 \n\nInstalled:\n  generic-logos-httpd-18.0.0-12.amzn2023.0.3.noarch           gperftools-libs-2.9.1-1.amzn2023.0.2.x86_64              \n  libunwind-1.4.0-5.amzn2023.0.2.x86_64                       nginx-1:1.22.1-1.amzn2023.0.3.x86_64                     \n  nginx-core-1:1.22.1-1.amzn2023.0.3.x86_64                   nginx-filesystem-1:1.22.1-1.amzn2023.0.3.noarch          \n  nginx-mimetypes-2.1.49-3.amzn2023.0.3.noarch               \n\nComplete!<\/code><\/pre>\n\n\n\n<p>Easy!<\/p>\n\n\n\n<p>It is nice to be able to install in a more general way, but there are a lot of changes to packages other than nginx, so you should check the list and make sure you use them.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This time it&#8217;s a small story. I needed to set up an instance on AWS Amazon EC2 for testing, and when I chose Amazon Linux 2023 for the test, I got a bit stuck. I can&#8217;t find the amazon-linux-extras command If you search about installing nginx on Amazon Linux, you will find many blog posts about installing nginx using the amazon-linux-extras command. By the way, I asked ChatGPT, a recent hot topic, and got the same answer. But with Amazon Linux 2023, it is unsympathetically as follows. Hmm? I checked and it seems that amazon-linux-extras has been discontinued.It was listed in the list of Removed Packages here. https:\/\/docs.aws.amazon.com\/ja_jp\/linux\/al2023\/release-notes\/removed-packages.html So, apparently,&#8230;<\/p>\n","protected":false},"author":2,"featured_media":102,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"vkexunit_cta_each_option":"","footnotes":""},"categories":[6],"tags":[24,7,26,25],"class_list":["post-99","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-aws","tag-amazon-linux","tag-aws","tag-install","tag-nginx"],"_links":{"self":[{"href":"https:\/\/blog.interstellar.co.jp\/en\/wp-json\/wp\/v2\/posts\/99","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.interstellar.co.jp\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.interstellar.co.jp\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.interstellar.co.jp\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.interstellar.co.jp\/en\/wp-json\/wp\/v2\/comments?post=99"}],"version-history":[{"count":2,"href":"https:\/\/blog.interstellar.co.jp\/en\/wp-json\/wp\/v2\/posts\/99\/revisions"}],"predecessor-version":[{"id":101,"href":"https:\/\/blog.interstellar.co.jp\/en\/wp-json\/wp\/v2\/posts\/99\/revisions\/101"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.interstellar.co.jp\/en\/wp-json\/wp\/v2\/media\/102"}],"wp:attachment":[{"href":"https:\/\/blog.interstellar.co.jp\/en\/wp-json\/wp\/v2\/media?parent=99"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.interstellar.co.jp\/en\/wp-json\/wp\/v2\/categories?post=99"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.interstellar.co.jp\/en\/wp-json\/wp\/v2\/tags?post=99"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}