[컴] chocolatey 설치



Chocolatey 설치

  1. "관리자 모드"로 cmd.exe를 실행한후 powershell 을 실행한다.
  2. 아래 명령어를 실행한다.(자세한 내용은 여기를 참고)
    Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
    
    
  3. 그러면 "c:\ProgramData\chocolatey" path 에 설치된다.
  4. uninstall 은 여기 를 참고하자.



Microsoft Windows [Version 10.0.14393]
(c) 2016 Microsoft Corporation. All rights reserved.

C:\Windows\system32>powershell
Windows PowerShell
Copyright (C) 2016 Microsoft Corporation. All rights reserved.

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.11.
Extracting C:\Users\namh\AppData\Local\Temp\chocolatey\chocInstall\chocolatey.zip to C:\Users\namh\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.
PATH environment variable does not have C:\ProgramData\chocolatey\bin in it. Adding...
경고: Not setting tab completion: Profile file does not exist at
'C:\Users\namh\Documents\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
PS C:\Windows\system32>


chocolatey 사용

아래처럼 사용하면 된다. 아래는 python2 를 설치하는 command 이다. 이러면 python2 의 msi 를 download 해서 "c:\python27" 에 install 을 한다. msi 로 설치해서 당연히 제어판 "프로그램 및 기능" 에도 보인다.
choco install -y python2

package 정보 확인

아래와 같은 방법으로 package description 등을 확인할 수 있다. parameter 같은 것들을 알 수 있다.
choco search vscodium -v

update

choco upgrade vscodium --params "/NoAddContextMenuFiles /NoAddContextMenuFolders"

.config 를 이용해서 install

choco install packages.config -y
<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="7zip" />
  <package id="7zip.install" />
  <package id="apache-httpd" />
  <package id="chocolatey" />
  <package id="chocolateygui" />
  <package id="dataram-ramdisk" />
  <package id="totalcommander" />
  <package id="lockhunter" />
  <package id="sublimetext3" />
  <package id="sumatrapdf" />
  <package id="sumatrapdf.install" />
  <package id="TcpView" />
  <package id="telegram.install" />
  <package id="launchyqt" />
  <package id="irfanview" />
  <package id="Firefox" packageParameters="/NoTaskbarShortcut /NoDesktopShortcut /RemoveDistributionDir"/>
  <package id="git" />
  <package id="git-lfs" />
  <package id="git-lfs.install" />
  <package id="git.install" />
  <package id="glogg" />
  <package id="heidisql" />
  <package id="vscodium.install" packageParameters="/NoDesktopIcon /NoAddToPath /NoAddContextMenuFolders /NoAddContextMenuFiles /AssociateWithFiles /NoAddToPath"/>
  <package id="bitvise-ssh-client" />
  <package id="mariadb.install" />
  <package id="microsoft-windows-terminal" />
  <package id="powertoys" version="0.17.0" />
  <package id="elevate.native" />
</packages>

package가 설치되는 path 를 변경

choco install mariadb.install -ia "INSTALLDIR=d:\a\apps\mariadb"

Windows Package Manager

See Also

  1. Microsoft announces official Windows package manager. 'Not a package manager' users snap back • The Register, 2020-05-20

References

  1. Chocolatey Installation

댓글 없음:

댓글 쓰기