LoginSignup
6
6

More than 5 years have passed since last update.

Chocolateyインストールメモ

Posted at

概要

  • Chocolateyを(会社の)Windows7マシンに(こっそりと)インストールしたはなし。
  • 普段はmsys2使ってるんですが、rubyの勉強会で教えてもらい、なんか色々とパッケージありそうなので試してみました。
  • この記事には特に有用な情報はないかもしれませんょ。

インストール方法

基本的には、 Chocolateyを使った環境構築の時のメモ を参考にさせて頂きました。

ただ、ウチの環境の場合、プロキシがあるわ、何故か名前解決ができないわで、
install.ps1をg:\に予めダウンロードしておき、(chocolateyProxyという変数に値を入れといても良いみたいですが)
$explicitProxy = "http://xxx.xxx.xxx.xxx:xxxx" (ダブルクォートがミソ)
のようにプロキシの設定を直書きして、コマンドプロンプトから以下のコマンドを叩きました。

C:\>@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex g:\install.ps1" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"

どうでも良いですが、コマンドプロンプト使うなら Clink - Powerful Bash-style command line editing for cmd.exe が超便利でございます。

インストールした後、また別途プロキシの設定は必要のようです。

> chocolatey.exe config set proxy http://xxx.xxx.xxx.xxx:xxxx
Chocolatey v0.10.3
Updated proxy = http://xxx.xxx.xxx.xxx:xxxx

コマンドメモ

そもそも chocolatey.exe ではなくて choco とだけ打てば良いみたい。

  • choco list: パッケージ一覧を表示。
  • choco search [パッケージ名]: パッケージ検索。正規表現は使えないようだ。
  • choco install [パッケージ名]: パッケージのインストール。
  • choco --help: ヘルプ。ハイフンいるんだ……。

使ってみた

上で紹介した Clink のパッケージもあるよ!!
うっかり clink のウィンドウから実行して「なんで失敗するんだ……」なんてことをやってたのは内緒です。

>choco install clink
Chocolatey v0.10.3
Installing the following packages:
clink
By installing you accept licenses for the packages.

clink v0.4.8 [Approved]
clink package files install completed. Performing other installation steps.

... snip ...

Failures
 - clink (exited 2) - Error while running 'C:\ProgramData\chocolatey\lib\clink\tools\chocolateyInstall.ps1'.
 See log for details.

参考サイト

6
6
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
6
6