scoop就不介绍了 类似centos的yum,nodejs的npm 就是windows的包管理工具。

网上查了下安装方法PowerShell上执行

iex (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh')

直接执行 报错,具体报错信息找不到了 大概意思就是解析不到raw.githubusercontent.com

修改hosts文件添加

151.101.64.133 raw.githubusercontent.com

重新执行 又报错大意是DownloadFile时发生异常 应该是下载文件的问题 直接访问https://get.scoop.sh看shell里面执行了什么

发现 直接重定向了https://raw.githubusercontent.com/lukesampson/scoop/master/bin/install.ps1

所以第一步先给执行命令修改为

iex (New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/lukesampson/scoop/master/bin/install.ps1')

完美 出现

Initializing...

Downloading scoop...

等了大概两分钟 又提示我DownloadFile时异常

重新执行会提示

Scoop is already installed.

网上查了下 要删掉scoop的文件夹才能重新安装 去用户目录删掉scoop

一般都在c:\\用户\你的名字\scoop

删掉文件夹重新执行发现在Downloading scoop...的时候scoop\apps\scoop\current目录里面会下载一个文件scoop.zip但是没下载完就报错了。

问题找到就是scoop.zip这个文件没下载下来

查看https://raw.githubusercontent.com/lukesampson/scoop/master/bin/install.ps1这个shell

发现Downloading scoop...后面的脚本很简单就是下载个zip然后解压

$zipurl = 'https://github.com/ScoopInstaller/Scoop/archive/master.zip'
$zipfile = "$dir\scoop.zip"
Write-Output 'Downloading scoop...'
dl $zipurl $zipfile

浏览器直接下载这个zip包https://github.com/ScoopInstaller/Scoop/archive/master.zip

然后放到c:\\用户\你的名字\scoop\apps\scoop\current 里面 名字改成scoop.zip

把https://raw.githubusercontent.com/lukesampson/scoop/master/bin/install.ps1

这个脚本下载下来放到c:\\用户\你的名字\install.ps1

把检测scoop是否安装的脚本注释上

再把下载zip的脚本注释上

检测scoop目录是否存在的脚本

# prep
if (installed 'scoop') {write-host "Scoop is already installed. Run 'scoop update' to get the latest version." -f red# don't abort if invoked with iex that would close the PS sessionif ($myinvocation.mycommand.commandtype -eq 'Script') { return } else { exit 1 }
}

下载zip包的脚本

# download main bucket
$dir = "$scoopdir\buckets\main"
$zipurl = 'https://github.com/ScoopInstaller/Main/archive/master.zip'
$zipfile = "$dir\main-bucket.zip"
Write-Output 'Downloading main bucket...'
New-Item $dir -Type Directory -Force | Out-Null
dl $zipurl $zipfile

行首用# 注释

修改后的文件

#Requires -Version 5# remote install:
#   Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh')
$old_erroractionpreference = $erroractionpreference
$erroractionpreference = 'stop' # quit if anything goes wrongif (($PSVersionTable.PSVersion.Major) -lt 5) {Write-Output "PowerShell 5 or later is required to run Scoop."Write-Output "Upgrade PowerShell: https://docs.microsoft.com/en-us/powershell/scripting/setup/installing-windows-powershell"break
}# show notification to change execution policy:
$allowedExecutionPolicy = @('Unrestricted', 'RemoteSigned', 'ByPass')
if ((Get-ExecutionPolicy).ToString() -notin $allowedExecutionPolicy) {Write-Output "PowerShell requires an execution policy in [$($allowedExecutionPolicy -join ", ")] to run Scoop."Write-Output "For example, to set the execution policy to 'RemoteSigned' please run :"Write-Output "'Set-ExecutionPolicy RemoteSigned -scope CurrentUser'"break
}if ([System.Enum]::GetNames([System.Net.SecurityProtocolType]) -notcontains 'Tls12') {Write-Output "Scoop requires at least .NET Framework 4.5"Write-Output "Please download and install it first:"Write-Output "https://www.microsoft.com/net/download"break
}# get core functions
$core_url = 'https://raw.githubusercontent.com/ScoopInstaller/Scoop/master/lib/core.ps1'
Write-Output 'Initializing...'
Invoke-Expression (new-object net.webclient).downloadstring($core_url)# prep
# if (installed 'scoop') {
#     write-host "Scoop is already installed. Run 'scoop update' to get the latest version." -f red
#     # don't abort if invoked with iex that would close the PS session
#     if ($myinvocation.mycommand.commandtype -eq 'Script') { return } else { exit 1 }
# }
$dir = ensure (versiondir 'scoop' 'current')# download scoop zip
$zipurl = 'https://github.com/ScoopInstaller/Scoop/archive/master.zip'
$zipfile = "$dir\scoop.zip"
Write-Output 'Downloading scoop...'
# dl $zipurl $zipfileWrite-Output 'Extracting...'
Add-Type -Assembly "System.IO.Compression.FileSystem"
[IO.Compression.ZipFile]::ExtractToDirectory($zipfile, "$dir\_tmp")
Copy-Item "$dir\_tmp\*master\*" $dir -Recurse -Force
Remove-Item "$dir\_tmp", $zipfile -Recurse -ForceWrite-Output 'Creating shim...'
shim "$dir\bin\scoop.ps1" $false# download main bucket
$dir = "$scoopdir\buckets\main"
$zipurl = 'https://github.com/ScoopInstaller/Main/archive/master.zip'
$zipfile = "$dir\main-bucket.zip"
Write-Output 'Downloading main bucket...'
New-Item $dir -Type Directory -Force | Out-Null
dl $zipurl $zipfileWrite-Output 'Extracting...'
[IO.Compression.ZipFile]::ExtractToDirectory($zipfile, "$dir\_tmp")
Copy-Item "$dir\_tmp\*-master\*" $dir -Recurse -Force
Remove-Item "$dir\_tmp", $zipfile -Recurse -Forceensure_robocopy_in_path
ensure_scoop_in_pathscoop config lastupdate ([System.DateTime]::Now.ToString('o'))
success 'Scoop was installed successfully!'Write-Output "Type 'scoop help' for instructions."$erroractionpreference = $old_erroractionpreference # Reset $erroractionpreference to original value

修改完执行iex ./install.ps1

Scoop was installed successfully!

完美

执行scoop 可以正常运行

后面还有个下载文件 不知道为什么我就直接下载下来了没需要浏览器重新下载。

如果后面的报错用相同方法

遇事莫慌!

windows 安装scoop踩坑之旅相关推荐

  1. windows安装paddlepaddle踩坑教程

    问题:在windows的anaconda环境中安装paddlepaddle时,创建新的conda环境错误. 环境:Windows10+anaconda3.6.5+cuda10.1 解决方法:不要按照官 ...

  2. 重装win10系统+Ubuntu16.04的踩坑之旅(联想拯救者r720)

    重装win10系统+Ubuntu16.04的踩坑之旅(联想拯救者r720) 碎碎念:原本双系统用得很开心的,在手贱删了Ubuntu系统的某些隐藏文件之后导致Ubuntu系统不能正常使用,在某种程度强迫 ...

  3. python 同花顺thstrader_Python 踩坑之旅进程篇其三pgid是个什么鬼 (子进程\子孙进程无法kill 退出的解法)...

    代码示例支持 平台: Centos 6.3 Python: 2.7.14 1.1 踩坑案例 pid, ppid是大家比较常见的术语, 代表进程号,父进程号. 但pgid是个什么鬼? 了解pgid之前, ...

  4. 戴尔灵越7590 i7版安装manjaro踩坑及部分驱动问题解决

    文章目录 前言 一.Manjaro是什么 二.安装步骤 1.下载镜像 2.将Manjaro系统安装至实体机 将Manjaro镜像刻录至U盘并为Manjaro划分空间 更改bios选项 重启进入Manj ...

  5. Manjaro 安装配置踩坑

    Manjaro 安装配置踩坑 其实manjaro和arch的英文社区上都讲的很清楚, 推荐看英文原版资料. 制作USB安装器 参考资料 : Manjaro 官方User Guide 官网下载镜像 Li ...

  6. Vue踩坑之旅(一)—— 数组、对象的监听

    作为一个接触 vue 才一个多月的小白,马上就接手基于 vue 的大型商城项目,其间真是跌跌撞撞踩了好多坑(o(╥﹏╥)o).在此写下自己的踩坑之旅,希望给跟我一样还在自学 vue 的同学一些帮助,另 ...

  7. cmd命令安装composer踩坑

    cmd命令安装composer踩坑 很多童鞋在依照composer官网 官网教程 用命令行安装composer时回踩到以下坑,却不知道如何解决 在此我分享下自己的经验,写个不好请多海涵 打开命令行执行 ...

  8. GPCC安装以及踩坑经历

    gpcc安装以及踩坑经历 官方下载地址文档 https://network.pivotal.io/products/pivotal-gpdb#/releases/29190 安装开始之前 chown ...

  9. ubuntu 20.04 安装软件踩坑

    ubuntu 20.04 安装软件踩坑 1.搜狗输入法 安装后需要重启一次 重启后讲sogoupinyin添加好,右上角如果没有搜狗就再重启一下 右上角出现了搜狗也是打不出中文的,因为没有安装依赖 安 ...

最新文章

  1. 辗转相除法是求两个数的最大公约数的方法。
  2. 国际C语言乱码大赛(IOCCC)经典之作
  3. Asp.Net中的ViewState知识
  4. Spring AOP 源码分析 - 拦截器链的执行过程
  5. 新版pycharm,亮瞎我的狗眼
  6. javaScript学习之正则表达式初探
  7. 使用tab键分割的文章能快速转换成表格。( )_Word 多级列表编号方法总结(一)——快速入门
  8. MAC系统关闭IPV6命令
  9. 什么时候要用存储过程,存储过程的优点 .
  10. NPAPI:JS的Number,在接口中可能是int32,也可能是double
  11. php判断是否是浏览器请求,php 判断请求是否来自“手机浏览器”
  12. 小尺寸笔记本将走向何方 — X280 长测
  13. php合并播放mp4文件_视频音频的分离教程(支持多种格式视频音频合并为MP4) 可导入字幕...
  14. 什么是IT行业? IT行业都有哪些职位?
  15. 小尺寸 GPS 北斗 GNSS 全向内置天线方案 CA-G01 CrossAir贴片天线
  16. 计算机三级嵌入式学习笔记(一)
  17. 使用反射时出现java.lang.NoSuchMethodException
  18. 给定秒数计算小时分钟(时间转换)
  19. 彻底解决CUDA安装,从翻译文档开始_Compiling CUDA Programs
  20. 手机计算机藏应用,手机“计算器”隐藏功能,一键把隐私照片加密

热门文章

  1. SpringCloudAlibaba之Seata-AT和XA模式
  2. c++11日期和时间库:chrono
  3. 资深架构师教你一篇文看懂Hadoop
  4. Linux内核分析期末总结
  5. 国内常用的Android镜像下载地址(附教育网主要镜像站)
  6. linux内核percpu变量声明,Linux内核同步:per_cpu变量
  7. Failed to reboot system via logind: Interactive authentication required
  8. 安装软件时出现System Pending Reboot
  9. 什么是 Scrum 工件?
  10. Python matplotlib获取openweather API天气信息,制作可视化图表和天气仪表盘