Windows のパッケージマネージャーの設定(リベンジ) - 産技高専における Windows 環境の構築(4)

WindowsSetting Windows Chocolatey 2019年 4月 25日

Chocolatey のインストール

昨日の失敗を受け,Chocolatey を直接インストールすることにした. まずは以下の説明を参考に Chocolatey をインストールする. (参考: Chocolatey Install )

  1. 昨日と同様に PowerShell を管理者モードで起動する(スクリーンショットは省略).
  2. 上記のサイトの Install with PowerShell.exe の下にある「Now run the following command:」 の横のクリップボードをクリックする
  3. PowerShell でペーストして実行する.
    PS C:\Windows\system32> Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
    Getting latest version of the Chocolatey package for download.
    Getting Chocolatey from https://chocolatey.org/api/v2/package/chocolatey/0.10.13.
    Extracting C:\Users\hkob\AppData\Local\Temp\chocolatey\chocInstall\chocolatey.zip to C:\Users\hkob\AppData\Local\Temp\chocolatey\chocInstall...
    Installing chocolatey on this machine
    Creating ChocolateyInstall as an environment variable (targeting 'Machine')
      Setting ChocolateyInstall to 'C:\ProgramData\chocolatey'
    WARNING: It's very likely you will need to close and reopen your shell
      before you can use choco.
    Restricting write permissions to Administrators
    We are setting up the Chocolatey package repository.
    The packages themselves go to 'C:\ProgramData\chocolatey\lib'
      (i.e. C:\ProgramData\chocolatey\lib\yourPackageName).
    A shim file for the command line goes to 'C:\ProgramData\chocolatey\bin'
      and points to an executable in 'C:\ProgramData\chocolatey\lib\yourPackageName'.
    
    Creating Chocolatey folders if they do not already exist.
    
    WARNING: You can safely ignore errors related to missing log files when
      upgrading from a version of Chocolatey less than 0.9.9.
      'Batch file could not be found' is also safe to ignore.
      'The system cannot find the file specified' - also safe.
    chocolatey.nupkg file not installed in lib.
    Attempting to locate it from bootstrapper.
    警告: Not setting tab completion: Profile file does not exist at '\\vmware-host\Shared Folders\書類\WindowsPowerShell\Microsoft.PowerShell_profile.ps1'.
    Chocolatey (choco.exe) is now ready.
    You can call choco from anywhere, command line or powershell by typing choco.
    Run choco /? for a list of functions.
    You may need to shut down and restart powershell and/or consoles
    first prior to using choco.
    Ensuring chocolatey commands are on the path
    Ensuring chocolatey.nupkg is in the lib folder

Chocolatey のインストール

後は色々とインストールしてみる.

  1. 入れたいソフトウェアについて,以下のようにして調べる.
  2. choco find パッケージ名
  3. もしくは Chocolatey のパッケージ一覧 で検索
  4. 例えば,adobereader だとこんな感じででる.
  5. PS C:\Windows\system32> choco find adobereader
    Chocolatey v0.10.13
    adobereader 2019.010.20099 [Approved]
    adobereader-update 18.011.20058 [Approved] Downloads cached for licensed users - Possibly broken for FOSS users (due to original download location changes by vendor)
    simnetsa-adobereader-fr 11.0.7 - Possibly broken
    adobereader-disable-updates-winconfig 0.0.1 [Approved] - Possibly broken
    BR.AdobeReaderFR 11.0.09 - Possibly broken
    5 packages found.
  6. 一方,テキストエディタの mery を検索すると以下のようになる.Possibly broken となっていて,インストールできない事がわかる(配布先のダウンロード先が変わったなど).
  7. PS C:\Windows\system32> choco find mery
    Chocolatey v0.10.13
    mery 2.4.6.5927 [Approved] Downloads cached for licensed users - Possibly broken for FOSS users (due to original download location changes by vendor)
    1 packages found.
  8. とりあえず授業で使いそうなものを挙げておく(今後順次追記予定).
ソフト名 コマンド
Adobe Reader (PDF の閲覧) cinst adobereader --yes
Ghostscript (EPS, PDF の加工) cinst Ghostscript --yes
Google Chrome (ブラウザ) cinst GoogleChrome --yes
mingw (Gnu C compiler) cinst mingw --yes
SourceTree (Git クライアント) cinst SourceTree --yes
Git cinst git --yes