AWS EC2の「Ubuntu Server」インスタンスにGoogle Chromeをインストール
AWS EC2の「Ubuntu Server」インスタンスにGoogle Chromeをインストールしてみます。
なお、この記事は「AWS EC2の「Ubuntu Server」インスタンスにSSHクライアント「PuTTY」を用いてSSHで接続する」という記事の続きでもあります。
■PC環境
Windows10(Google Chrome)
AWS インスタンス作成済み(Ubuntu 22.04 LTS (GNU/Linux 5.15.0-1011-aws x86 64))
■SSHクライアント「PuTTY」を用いてSSHで接続する
EC2の「Ubuntu Server」インスタンスにGoogle Chromeの最新版バージョンをインストールしてみます。まず、その前に「AWS マネジメントコンソール」にログインし、「EC2」サービスへ移動します。移動後、「EC2 Management Console」内の左メニューの「インスタンス」の「インスタンス」をクリックすると、作成した「インスタンス」が一覧で表示されます。
今回作成した「Ubuntu Server」インスタンスの「インスタンス状態」が「実行中」であることを確認します。確認後、SSHクライアント「PuTTY」を用いて、SSHで接続を行います。
Welcome to Ubuntu 22.04 LTS (GNU/Linux 5.15.0-1011-aws x86 64)
- Documentation: https://help.ub
- Management: https://landscape.canonical.com
- Support: https://ubuntu.com/advantage
System information as of Fri Jul 8 00:49:50 UTC 2022
System load: 0.0 Usage of 7: 22.6% of 7.58GB Memory usage: 234 Swap usage: 0%
Processes:
100 Users logged in: IPv4 address for etho: *...
- Ubuntu Pro delivers the most comprehensive open source security and,
compliance features.
https://ubuntu.com/aws/pro
42 updates can be applied immediately.
22 of these updates are standard security updates.
To see these additional updates run: apt list --upgradable
SSHで接続すると、上記のようなメッセージが出力されます。
ubuntu@ip-**-**-**-**(ipアドレス):~$
出力後、上記のように出力されれば、接続は完了となります。
■Google Chromeをインストールする
$sudo curl -sS -o - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add$sudo bash -c "echo 'deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main' >> /etc/apt/sources.list.d/google-chrome.list"
$sudo apt -y update
$sudo apt -y install google-chrome-stable
完了後、上記のコマンドを入力し、1つずつ入力し、Enterキーを押していきます。これでGoogleChrome安定版をインストールすることができます。
$ google-chrome --version
最後にインストールされたのかの確認のために、上記のコマンドを入力し、Enterキーを押します。
Google Chrome 103.0.5060.114
Enterキーを押すと、上記のようなGoogleChromeのバージョンが表示されれば、正常にインストールがされています。今回はバージョン「103.0.5060.114」をインストールしました。
■追記
「EC2 Management Console」内で「インスタンス」を作成し、「プラットフォーム」が「Amazon Linux (推定)」であると、下記のコマンドでGoogleChromeをインストールできる。
curl https://intoli.com/install-google-chrome.sh | bash
しかし「プラットフォーム」が「Ubuntu (推定)」だと、下記のエラーが発生し、インストールが失敗することを確認した。
% Total % Received % Xferd Average Speed Time Time Time CurrentDload Upload Total Spent Left Speed
100 9526 100 9526 0 0 61046 0 --:--:-- --:--:-- --:--:-- 61458
Working in /tmp/google-chrome-installation
/tmp/google-chrome-installation /home/ubuntu
Configuring the Google Chrome repo in /etc/yum.repos.d/google-chrome.repo
bash: line 17: /etc/yum.repos.d/google-chrome.repo: No such file or directory
bash: line 18: /etc/yum.repos.d/google-chrome.repo: No such file or directory
bash: line 19: /etc/yum.repos.d/google-chrome.repo: No such file or directory
bash: line 20: /etc/yum.repos.d/google-chrome.repo: No such file or directory
bash: line 21: /etc/yum.repos.d/google-chrome.repo: No such file or directory
bash: line 22: /etc/yum.repos.d/google-chrome.repo: No such file or directory
bash: line 26: yum: command not found
--2022-07-08 04:23:37-- https://dl.google.com/linux/linux_signing_key.pub
Resolving dl.google.com (dl.google.com)... 142.250.190.78, 2607:f8b0:4009:81a::200e
Connecting to dl.google.com (dl.google.com)|142.250.190.78|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 12415 (12K) [application/octet-stream]
Saving to: ?linux_signing_key.pub?
linux_signing_key.p 100%[===================>] 12.12K --.-KB/s in 0.003s
2022-07-08 04:23:37 (4.42 MB/s) - ?linux_signing_key.pub? saved [12415/12415]
Attempting a direction installation with yum.
bash: line 40: yum: command not found
bash: line 54: yum: command not found
Downloading the Google Chrome RPM file.
bash: line 59: yum: command not found
bash: line 63: yumdownloader: command not found
--2022-07-08 04:23:37-- https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm
Resolving dl.google.com (dl.google.com)... 142.250.190.78, 2607:f8b0:4009:81a::200e
Connecting to dl.google.com (dl.google.com)|142.250.190.78|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 85710504 (82M) [application/x-rpm]
Saving to: ?google-chrome-stable_current_x86_64.rpm?
google-chrome-stabl 100%[===================>] 81.74M 76.1MB/s in 1.1s
2022-07-08 04:23:39 (76.1 MB/s) - ?google-chrome-stable_current_x86_64.rpm? saved [85710504/85710504]
Downloaded google-chrome-stable_current_x86_64.rpm
rpm: RPM should not be used directly install RPM packages, use Alien instead!
rpm: However assuming you know what you are doing...
################################# [100%]
################################# [100%]
package google-chrome-stable-103.0.5060.114-1.x86_64 is already installed
Installing the required font dependencies.
bash: line 76: yum: command not found
main: line 100: repoquery: command not found
http://: Invalid host name.
Extracting glibc...
argument is not an RPM package
UbuntuにRPMパッケージをインストールしたりしてみたがうまくいかなかった。



