UbuntuにNginxをインストールする方法です。
apt list nginx
コマンドで、Nginxがインストールされているか確認ができます。次のように[インストール済み]
と表示されていない場合はNginxがインストールされていません。
# apt list nginx
nginx/plucky-updates 1.26.3-2ubuntu1.1 amd64
Notice: 追加バージョンが 1 件あります。表示するには '-a' スイッチを付けてくださ>
Nginxがインストールされている場合の表示は次のようになります。
nginx/plucky-updates,now 1.26.3-2ubuntu1.1 amd64 [インストール済み]
Nginxがインストールされていないことを確認したら、apt install nginx
コマンドでNginxをインストールします。Continue?
と表示された時は、Y
を入力しエンターを押してください。
# apt install nginx
以下のパッケージが自動でインストールされましたが、もう必要とされていません:
libutempter0
これを削除するには 'apt autoremove' を利用してください。
Installing:
nginx
Installing dependencies:
nginx-common
提案パッケージ:
fcgiwrap nginx-doc ssl-cert
Summary:
Upgrading: 0, Installing: 2, Removing: 0, Not Upgrading: 13
Download size: 743 kB
Space needed: 2,108 kB / 46.3 GB available
Continue? [Y/n] Y
取得:1 http://nova.clouds.archive.ubuntu.com/ubuntu plucky-updates/main amd64 nginx-common all 1.26.3-2ubuntu1.1 [43.6 kB]
取得:2 http://nova.clouds.archive.ubuntu.com/ubuntu plucky-updates/main amd64 nginx amd64 1.26.3-2ubuntu1.1 [699 kB]
743 kB を 2秒 で取得しました (371 kB/s)
パッケージを事前設定しています ...
以前に未選択のパッケージ nginx-common を選択しています。
(データベースを読み込んでいます ... 現在 110358 個のファイルとディレクトリがインストールされています。)
.../nginx-common_1.26.3-2ubuntu1.1_all.deb を展開する準備をしています ...
nginx-common (1.26.3-2ubuntu1.1) を展開しています...
以前に未選択のパッケージ nginx を選択しています。
.../nginx_1.26.3-2ubuntu1.1_amd64.deb を展開する準備をしています ...
nginx (1.26.3-2ubuntu1.1) を展開しています...
nginx-common (1.26.3-2ubuntu1.1) を設定しています ...
Created symlink '/etc/systemd/system/multi-user.target.wants/nginx.service' → '/usr/lib/systemd/system/nginx.service'.
nginx (1.26.3-2ubuntu1.1) を設定しています ...
* Upgrading binary nginx [ OK ]
man-db (2.13.0-1) のトリガを処理しています ...
ufw (0.36.2-9) のトリガを処理しています ...
Scanning processes...
Scanning candidates...
Scanning linux images...
Pending kernel upgrade!
Running kernel version:
6.14.0-15-generic
Diagnostics:
The currently running kernel version is not the expected kernel version
6.14.0-23-generic.
Restarting the system to load the new kernel will not be handled automatically,
so you should consider rebooting.
Restarting services...
Service restarts being deferred:
/etc/needrestart/restart.d/dbus.service
systemctl restart getty@tty1.service
systemctl restart serial-getty@ttyS0.service
systemctl restart systemd-logind.service
systemctl restart unattended-upgrades.service
No containers need to be restarted.
No user sessions are running outdated binaries.
No VM guests are running outdated hypervisor (qemu) binaries on this host.
インストールが完了し、apt list nginx
コマンドで確認すると、[インストール済み]
の表示が確認できます。
# apt list nginx
nginx/plucky-updates,now 1.26.3-2ubuntu1.1 amd64 [インストール済み]
Notice: 追加バージョンが 1 件あります。表示するには '-a' スイッチを付けてくださ>
-a
オプションを追加すると、追加の内容を確認できます。
# apt list nginx -a
nginx/plucky-updates,now 1.26.3-2ubuntu1.1 amd64 [インストール済み]
nginx/plucky 1.26.3-2ubuntu1 amd64