3
3

More than 5 years have passed since last update.

Bash on Ubuntu on Windowsを使う(2):初期設定

Last updated at Posted at 2017-09-22

過去記事の転載
(Creators Update以降とは異なる場合があります)

ヾ(・ω<)ノ" 三三三● ⅱⅲ コロコロ♪


------------------- ↓ 余談はここから ↓-------------------
関連記事
* Bash on Ubuntu on Windowsを使う(1)
* Bash on Ubuntu on Windowsを使う(2):初期設定
* Bash on Ubuntu on Windowsを使う(3):WindowsからLinuxを使う

インストールはできたので活用していこう。
兎にも角にも日本語表示から。


------------------- ↓ 本題はここから ↓-------------------

Ubuntuの状態を最新にする

  • コマンドプロンプトを起動
  • bashと入力
  • 以下のコマンドを実行
$ sudo apt-get update
$ sudo apt-get dist-upgrade
$ sudo apt-get autoremove

gitを最新にする

  • Ubuntuのバージョンが14なので普通にインストールすると古いバージョンのgitが入る
  • そこで、リポジトリを追加して最新のものを取得
  • 以下のコマンドを実行
$ sudo apt-get install build-essential
$ sudo add-apt-repository ppa:git-core/ppa
$ sudo apt-get update
$ sudo apt-get install git
$ git --version
git version 2.11.0

phpをインストール

  • 以下のコマンドを実行
$ sudo apt-get install php5-cli php5-curl
$ php -v
PHP 5.5.9-1ubuntu4.21 (cli) (built: Feb  9 2017 20:54:58)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
    with Zend OPcache v7.0.3, Copyright (c) 1999-2014, by Zend Technologies

その他インストール(随時追加)

  • 以下のコマンドを実行
$ sudo apt-get install unzip

------------------- ↓ 後書はここから ↓-------------------

コマンドプロンプトじゃないターミナルを使う

コマンドプロンプトだとターミナルとしてイマイチなので、別のものを用意
- cmder
- wsltty(minttyのBow版)
- mobaxterm

$ scoop install cmder
$ scoop bucket add extra
$ scoop install mobaxterm

Scoopのインストールは以下を参照。
Scoopで作るLinux on Windows開発環境

IDEのターミナルとしてbashを使う

eclipseやphpstormでターミナルを使うときにbashを指定しておくと、
Linuxとして動かせる

  • bashのパスを指定する
32bit版: c:\windows\sysnative\bash.exe
64bit版: c:\windows\sytem32\bash.exe 
3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3