Win10安装sudo和vim
需要安装包管理工具scoop
1.打开powershell,设置脚本执行权限
set-executionpolicy remotesigned -scope currentuser
2.弹出以下提示
执行策略更改
执行策略可帮助你防止执行不信任的脚本。更改执行策略可能会产生安全风险,如 https:/go.microsoft.com/fwlink/?LinkID=135170
中的 about_Execution_Policies 帮助主题所述。是否要更改执行策略?
[Y] 是(Y) [A] 全是(A) [N] 否(N) [L] 全否(L) [S] 暂停(S) [?] 帮助 (默认值为“N”): y
3.选择y
4.安装scoop(需要开代理)
iex (new-object net.webclient).downloadstring('https://get.scoop.sh')
(若出现以下问题
iex : 使用“2”个参数调用“DownloadFile”时发生异常:“无法连接到远程服务器”
所在位置 行:1 字符: 1
+ iex(new-object net.webclient).downloadstring('http://get.scoop.sh')
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Invoke-Expression], MethodInvocationException
+ FullyQualifiedErrorId : WebException,Microsoft.PowerShell.Commands.InvokeExpressionCommand
则说明https://raw.githubusercontent.com/lukesampson/scoop/master/bin/install.ps1无法访问,这里我使用代理git来解决
(1)打开git bash (2) 配置以下两条命令
git config --global http.https://github.com.proxy http://cn-py-dl-w9d:1081
git config --global --unset http.https://github.com.proxy
之后继续在powershell里安装即可)
5.安装sudo和vim
scoop install sudo vim