在windows上安装 chocolatey.1.1.0.nupkg
這幾天外網特別不穩定,感覺都快沒法編程了。正好昨天又新裝了一個操作系統,一大堆軟件等著要裝。所以本來是個挺順利的事,非得折騰一圈才能成功。
首先是,官方已經說明了如何安裝choco,
https://chocolatey.org/install
根據官方的說法,先要執行
Set-ExecutionPolicy AllSigned
或者
Set-ExecutionPolicy Bypass -Scope Process?
然后再執行下面這個指令就可以了,
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
?但由于網絡不行,試了幾次不能成功,在powershell中的輸出如下圖所示,
> Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
Forcing web requests to allow TLS v1.2 (Required for requests to Chocolatey.org)
Getting latest version of the Chocolatey package for download.
Not using proxy.
Getting Chocolatey from https://community.chocolatey.org/api/v2/package/chocolatey/1.1.0.
Downloading https://community.chocolatey.org/api/v2/package/chocolatey/1.1.0 to C:\Users\user\AppData\Local\Temp\chocolatey\chocoInstall\chocolatey.zip
Not using proxy.
?于是到官網下載,
https://community.chocolatey.org/api/v2/package/chocolatey/1.1.0.
下載完后根據上面的信息把這個文件放在這里,
?C:\Users\user\AppData\Local\Temp\chocolatey\chocoInstall\chocolatey.1.1.0.nupkg
注意這里我把文件要更改成chocolatey.zip(如果不修改的話好像也是沒有問題),?然后在Powershell中把前面那條長長的指令重新跑了次,就成功安裝了chocolatey。
安裝 過程中給出了一長串的信息,留在下面作個備注吧,
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
Forcing web requests to allow TLS v1.2 (Required for requests to Chocolatey.org)
Getting latest version of the Chocolatey package for download.
Not using proxy.
Getting Chocolatey from https://community.chocolatey.org/api/v2/package/chocolatey/1.1.0.
Downloading https://community.chocolatey.org/api/v2/package/chocolatey/1.1.0 to C:\Users\User\AppData\Local\Temp\chocolatey\chocoInstall\chocolatey.zip
Not using proxy.
Extracting C:\Users\USer\AppData\Local\Temp\chocolatey\chocoInstall\chocolatey.zip to C:\Users\User\AppData\Local\Temp\chocolatey\chocoInstall
Installing Chocolatey on the local 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\User\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
安裝完成后,可執行文件的路徑在這里,
C:\ProgramData\chocolatey\bin?
可以檢查一下是否已經添加到系統 環境變量中了?,如果沒有的話,可能安裝過程中出了問題,需要手動設置一下即可。
本文結束。
總結
以上是生活随笔為你收集整理的在windows上安装 chocolatey.1.1.0.nupkg的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: oracle 管道通信,oracle管道
- 下一篇: android emmc 命令,使用Co