git を最新にする
環境:Ubuntu 16.04 LTS
現在のgit
のバージョン
$ git --version
git version 2.7.4
少し古いのでアップグレードしたい。
公式リポジトリは脆弱性に対応できていないとか。 最新版を取得するために非公式リポジトリを追加。
$ sudo add-apt-repository ppa:git-core/ppa [sudo] user のパスワード: ******** The most current stable version of Git for Ubuntu. For release candidates, go to https://launchpad.net/~git-core/+archive/candidate . 詳しい情報: https://launchpad.net/~git-core/+archive/ubuntu/ppa [ENTER] を押すと続行します。ctrl-c で追加をキャンセルできます gpg: 鍵リング「/tmp/tmp2ef8x1gt/secring.gpg」ができました gpg: 鍵リング「/tmp/tmp2ef8x1gt/pubring.gpg」ができました gpg: 鍵E1DF1F24をhkpからサーバkeyserver.ubuntu.comに要求 gpg: /tmp/tmp2ef8x1gt/trustdb.gpg: 信用データベースができました gpg: 鍵E1DF1F24: 公開鍵"Launchpad PPA for Ubuntu Git Maintainers"をインポートしました gpg: 処理数の合計: 1 gpg: インポート: 1 (RSA: 1) OK
$ sudo apt update $ sudo apt install git パッケージリストを読み込んでいます... 完了 依存関係ツリーを作成しています 状態情報を読み取っています... 完了 以下の追加パッケージがインストールされます: ...........(略)........... $ git --version git version 2.19.1
これでgit
がアップグレードされた。