본문 바로가기

목록이 없습니다.

[Ubuntu] google-chrome 특정 버전 설치하기 (How to install specific version of google-chrome in Ubuntu)

Server
    반응형

     

    Ubutnu 서버에서 google chrome 브라우저를 활용하는 경우(예를들어 chrome webdriver를 통해 브라우저 랜더링한 결과를 서버에서 사용한다던지..) 서버에 크롬을 설치해주어야합니다.

    보통 서버는 Ubuntu-server OS를 설치해서 사용하기 때문에 여기서도 해당 OS기준으로 정리해놓겠습니다.

     

    ※ 참고용. 크롬 웹드라이버(Chrome webdriver) 다운로드 사이트 링크

     

     

    설치파일 다운로드 (Download install file)

    윈도우 OS에서는 설치파일의 확장자가 exe 인 것처럼 우분투의 설치파일 확장자는 deb이라는 파일입니다. 우선 아래 사이트에서 특정 버전의 크롬 설치파일을 다운로드 받아줍니다.

     

    https://www.slimjet.com/chrome/google-chrome-old-version.php

     

    Download older versions of Google Chrome for Windows, Linux and Mac

    Google Chrome Older Versions Download (Windows, Linux & Mac) Why use an older version of Google Chrome? Google only provides an online setup file for Google Chrome which installs the latest version of Google Chrome. It happens frequently that a user upgrad

    www.slimjet.com

     

    크롬 특정 버전 설치 페이지

     

    사이트에 접속하면 최상위에는 Windows OS에서 설치할 수 있는 exe 파일들이 버전별로 다운로드 링크가 있습니다.

    그리고 내리다보면 Google Chrome Linux Version 에 역시 버전별로 다운로드 링크가 있습니다. 저희가 설치할 OS는 우분투 서버로 Linux 기반 서버입니다. 따라서 Linux version을 받아줍니다. 방법은 2가지입니다.

     

    방법1) 파일 다운로드 후 SFTP(또는 FTP) 전송

    로컬 PC에서 설치파일(.deb)을 다운로드하여 우분투 서버에 SFTP 접속을 통해 파일전송을 합니다.

     

    방법2) wget 명령어를 통해 서버로 다운로드

    우분투 서버에 SSH 접속을 하여 wget 명령어로 설치파일(.deb)을 다운로드합니다.

     

    원하는 버전의 설치파일 다운로드 링크 주소 복사

     

     

    deb 파일 설치

    다운로드를 하게 되면 확장자가 deb인 파일이 생기는데 해당 파일을 통해 설치하기 위해서는 dpkg 라는 명령어를 알야아합니다.

     

    기존에 패키지 관리 명령어(툴)는 dpkg를 사용했었는데 의존성 (예를들어 A라는 패키지를 설치하는데 B라는 패키지가 설치되어있어야 한다) 문제를 해결하는게 까다로운 탓에 apt 라는 도구가 나왔고 그것이 요즘에 대부분이 패키지를 관리하는 명령어로 자리잡았습니다.

    dpkg 명령어 사용법 및 옵션 정리

     

    하지만 여전히 deb 파일을 설치하는 경우에는 dpkg 명령어를 사용하고 이 때 발생하는 의존성 문제는 역시 서버관리자가 해결해주어야합니다. 이번에 설치할 google-chrome-stable 패키지도 역시 의존성이 걸려있습니다.
    (패키지 설치에는 root 권한이 필요합니다.)

     

    $ sudo dpkg -i download-chrome.php\?file\=files%2F90.0.4430.72%2Fgoogle-chrome-stable_current_amd64.deb
    Selecting previously unselected package google-chrome-stable.
    (Reading database ... 109908 files and directories currently installed.)
    Preparing to unpack download-chrome.php?file=files%2F90.0.4430.72%2Fgoogle-chrome-stable_current_amd64.deb ...
    Unpacking google-chrome-stable (90.0.4430.72-1) ...
    dpkg: dependency problems prevent configuration of google-chrome-stable:
     google-chrome-stable depends on fonts-liberation; however:
      Package fonts-liberation is not installed.
     google-chrome-stable depends on libcairo2 (>= 1.6.0); however:
      Package libcairo2 is not installed.
     google-chrome-stable depends on libgbm1 (>= 8.1~0); however:
      Package libgbm1 is not installed.
     google-chrome-stable depends on libgtk-3-0 (>= 3.9.10); however:
      Package libgtk-3-0 is not installed.
     google-chrome-stable depends on libpango-1.0-0 (>= 1.14.0); however:
      Package libpango-1.0-0 is not installed.
     google-chrome-stable depends on libxkbcommon0 (>= 0.4.1); however:
      Package libxkbcommon0 is not installed.
     google-chrome-stable depends on xdg-utils (>= 1.0.2); however:
      Package xdg-utils is not installed.
    
    dpkg: error processing package google-chrome-stable (--install):
     dependency problems - leaving unconfigured
    Processing triggers for mime-support (3.60ubuntu1) ...
    Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
    Errors were encountered while processing:
     google-chrome-stable
    $

     

    이렇게 단순하게 설치가 안됩니다. 의존성 문제를 해결해주기 위해서 apt-get -f install을 한 번 해줍니다.

     

    의존성 문제 해결 (apt-get -f install)

    $ sudo apt-get -f install

    이 명령어를 실행하면 꽤 많은 패키지들이 설치되고 그 후에 다시 dpkg -i 명령어를 실행하면 설치가 됩니다.

     

    $ sudo dpkg -i download-chrome.php\?file\=files%2F90.0.4430.72%2Fgoogle-chrome-stable_current_amd64.deb
    (Reading database ... 124388 files and directories currently installed.)
    Preparing to unpack download-chrome.php?file=files%2F90.0.4430.72%2Fgoogle-chrome-stable_current_amd64.deb ...
    Unpacking google-chrome-stable (90.0.4430.72-1) over (90.0.4430.72-1) ...
    Setting up google-chrome-stable (90.0.4430.72-1) ...
    Processing triggers for mime-support (3.60ubuntu1) ...
    Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
    $

     

    ubuntu google-chrome 버전 확인 (ubuntu google-chrome version check)

    설치가 완료되었는지 확인하기 위해서 버전 확인을 해줍니다.

    $ google-chrome --version
    Google Chrome 90.0.4430.72

     

    이상 Ubuntu에 google-chrome 특정버전 설치 정리를 마치겠습니다.

    반응형