Window包管理工具Scoop

自定义安装路径安装

scoop安装应用路径

目标目录是D:\Program Files\Scoop,在PowerShell命令控制台中运行:

[environment]::setEnvironmentVariable('SCOOP','D:\Scoop','User')
$env:SCOOP='D:\Scoop'
iex (new-object net.webclient).downloadstring('https://get.scoop.sh')

全局应用安装路径

假设目标目录是D:\Program Files\Scoop\globalApps,在PowerShell命令控制台中运行:

[environment]::setEnvironmentVariable('SCOOP_GLOBAL','D:\Scoop\globalApps','Machine')
$env:SCOOP_GLOBAL='D:\Scoop\globalApps'

整合

[environment]::setEnvironmentVariable('SCOOP','D:\Scoop','User')
$env:SCOOP='D:\Scoop'
iex (new-object net.webclient).downloadstring('https://get.scoop.sh')
[environment]::setEnvironmentVariable('SCOOP_GLOBAL','D:\Scoop\GlobalApps','Machine')
$env:SCOOP_GLOBAL='D:\Scoop\GlobalApps'

上面的Machine是配置系统变量

如果使用User就是配置用户变量

系统变量优先级比用户变量高,所以使用全局下载的变量配置权限高。

基本命令

命令 动作
🌟search 搜索软件名
🌟install 安装软件
update 更新软件
🌟status 查看软件状态
uninstall 卸载软件
info 查看软件详情
home 打开软件主页
#重置应用以解决冲突,会重置环境变量,快捷方式等..
scoop reset *
#检查潜在的问题..执行下看看使用scoop会有什么问题
scoop checkup
#如果使用了aria2感觉慢的话可以关闭
scoop config aria2-enabled false  
#下面是日常更新软件命令
sudo scoop update * -g ; scoop update * ; sudo scoop cleanup * -g ; scoop cleanup *
# 查看 Scoop 还能直接识别哪些 bucket
scoop bucket known
#安装具体版本软件
scoop install postman@7.17.0

设置代理并多线程下载

命令执行:

scoop config proxy 127.0.0.1:8118

设置配置:

配置文件路径:C:\Users\qhong\.config\scoop

{
    "lastupdate":  "2019-11-09T09:45:50.0880266+08:00",
    "SCOOP_REPO":  "https://github.com/lukesampson/scoop",
    "SCOOP_BRANCH":  "master",
    "proxy":  "127.0.0.1:8118"
}

配置存留persist

这里最值得称道的是persist文件夹,因为我们知道,scoop安装的所有软件都是安装在scoop文件夹下的,那如果软件升级了的话,以前旧软件的设置和数据是不是全部清除了呢?例如vscode上的设置和安装的插件,是不是升级了之后,都没有了呢?不是的,因为scoop会将各个软件的设置数据,例如vscode软件的data文件夹(vscode的设置和插件都放在data文件夹),单独放到persist文件夹中,在用软链接链接到软件所在的文件夹,这样,每次升级软件,persist文件夹的各个软件的设置数据都会保持不变,从而保存设置.

另一个需要注意的是,所有的对scoop操作都不要在文件夹中进行,因为有可能会破坏scoop的文件结构,想要对scoop进行任何操纵,都需要在命令行中进行

桶bucket

在 Scoop 里面,bucket 就是一个软件仓库。Scoop 将一个个仓库缓存至本地,当我们想要安装一个软件的时候,Scoop 就从本地的仓库中挑选出我们想要安装的软件的安装配置文件,并依照这个配置文件进行软件的安装工作。

scoop可以直接识别的bucket

$ scoop bucket known
main
extras
versions
nightlies
nirsoft
php
nerd-fonts
nonportable
java
games
jetbrains

添加常用的bucket

###添加桶
scoop bucket add extras;
scoop bucket add Java;
scoop bucket add versions;
scoop bucket add Ash258 'https://github.com/Ash258/Scoop-Ash258.git'
scoop bucket add dorado https://github.com/h404bi/dorado
scoop bucket add iszy https://github.com/ZvonimirSun/scoop-iszy
scoop bucket add dodorz https://github.com/dodorz/scoop-bucket
scoop bucket add rasa https://github.com/rasa/scoops
scoop bucket add scoopet https://github.com/integzz/scoopet
scoop bucket add raresoft https://github.com/L-Trump/scoop-raresoft

建立一个bucket

1.github创建自己的仓库 scoop-buckets
2.拉取到本地,并cd进入
3.按bucket规则创建一个json文件,比如:oraclejdk8.json
4.git推送提交
5.将该git仓库配置为本地的桶即可

案例:

$ scoop bucket add qhong https://gitee.com/hongdada/scoop-buckets
Checking repo... ok
The qhong bucket was added successfully.

$ scoop bucket list
Ash258
dorado
extras
iszy
Java
main
qhong
versions
wangzq

应用

前置安装应用

配置下载:

#下载
scoop install aria2;

只有安装了aria2,可以多线程下载,后面的应用下载才会快

而且必须配置代理,因为桶配置都是放在github

常装应用

scoop install sudo
scoop install git curl 7zip coreutils
#解压
scoop install bandizip;
#浏览器
scoop install chrome;
#cmd
scoop install Cmder;
#文件检索
scoop install everything;
#git,程序员必备
scoop install git;
#包管理
scoop install maven;
#远程终端
scoop install MobaXterm;
#播放器
scoop install potplayer;
#redis
scoop install redis;
#桌面控制
scoop install teamviewer;
#markdown编写
scoop install typora;
#编辑器
scoop install vscode;
#效率启动神器
scoop install WOX;
#离线文档浏览器
scoop install zeal;

scoop install aria2 curl grep sed less touch
scoop install python ruby go perl


###安装全局应用
scoop install mysql56 -g;
scoop install nodejs -g;
scoop install oraclejdk8 -g;
scoop install python36 -g;

###安装具体某个bucket下的软件
scoop install dodorz/qqmusic

aria2下载命令

$ aria2c http://down.sandai.net/thunderx/XunLeiWebSetup10.1.16.466dl.exe

11/12 17:53:33 [NOTICE] Downloading 1 item(s)

11/12 17:53:34 [NOTICE] Download complete: D:/Development/huishi-server/XunLeiWebSetup10.1.16.466dl.exe

Download Results:
gid   |stat|avg speed  |path/URI
======+====+===========+=======================================================
67cbeb|OK  |    10MiB/s|D:/Development/huishi-server/XunLeiWebSetup10.1.16.466dl.exe

Status Legend:
(OK):download completed.

注意,命令是使用aria2c

WindowTerminal

scoop install windows-terminal

设置右键快捷键:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\Background\shell\WindowsTerminal]
@="Windows Terminal Here"
"Icon"="D:\\Scoop\\data\\windows-terminal\\terminal.ico"

[HKEY_CLASSES_ROOT\Directory\Background\shell\WindowsTerminal\command]
@="D:\\Scoop\\apps\\windows-terminal\\current\\WindowsTerminal.exe"

将以上代码保存到扩展名为 .reg 的文件中,双击打开

当前目录打开时,Terminal 里的路径不是当前目录

检查一下配置文件,看下是否有以下内容,删除之后就可以了。

{
    "profiles": [
        {
            "startingDirectory" : "%USERPROFILE%"
        }
    ]
}

需要修改为

"startingDirectory": null

如果没有就自己配置这个参数设置为null

配置文件路径:

C:\Users\qhong\AppData\Local\Microsoft\Windows Terminal\profiles.json

不能输入中文问题

将win10打开设置,时间和语言→语言→管理语言设置→更改系统区域设置→勾选Beta...提供全球语言支持,然后重启,再打开windows terminal即可使用中文输入。然后神奇的事情发生了,即使此时关闭当时的勾选,再次重启仍可在windows terminal使用中文输入法。

2.设置环境变量 LESSCHARSET=utf-8

profiles.json配置

// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation

{
	"$schema": "https://aka.ms/terminal-profiles-schema",

	"defaultProfile": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",

	"globals": {
		"alwaysShowTabs": true,
		"defaultProfile": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
		"initialCols": 98,
		"initialRows": 28,
		"keybindings": [{
				"command": "closeTab",
				"keys": [
					"ctrl+w"
				]
			}
		],
		"requestedTheme": "system",
		"showTabsInTitlebar": true,
		"showTerminalTitleInTitlebar": true
	},
	"profiles": [{
			"acrylicOpacity": 0.75,
			"closeOnExit": true,
			"colorScheme": "Campbell",
			"commandline": "powershell.exe",
			"cursorColor": "#FFFFFF",
			"cursorShape": "bar",
			"fontFace": "Hack",
			"fontSize": 14,
			"guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
			"historySize": 9001,
			"icon": "ms-appx:///ProfileIcons/{61c54bbd-c2c6-5271-96e7-009a87ff44bf}.png",
			"name": "Windows PowerShell",
			"snapOnInput": true,
			"startingDirectory": null,
			"useAcrylic": true
		}, {
			// Make changes here to the cmd.exe profile
			"guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
			"name": "cmd",
			"commandline": "cmd.exe",
			"hidden": false
		}, {
			"guid": "{c6eaf9f4-32a7-5fdc-b5cf-066e8a4b1e40}",
			"hidden": false,
			"name": "Ubuntu-18.04",
			"source": "Windows.Terminal.Wsl"
		}, {
			"guid": "{b453ae62-4e3d-5e58-b989-0a998ec441b8}",
			"hidden": false,
			"name": "Azure Cloud Shell",
			"source": "Windows.Terminal.Azure"
		}
	],
	"schemes": [{
			"background": "#0C0C0C",
			"black": "#0C0C0C",
			"blue": "#0037DA",
			"brightBlack": "#767676",
			"brightBlue": "#3B78FF",
			"brightCyan": "#61D6D6",
			"brightGreen": "#16C60C",
			"brightPurple": "#B4009E",
			"brightRed": "#E74856",
			"brightWhite": "#F2F2F2",
			"brightYellow": "#F9F1A5",
			"cyan": "#3A96DD",
			"foreground": "#CCCCCC",
			"green": "#13A10E",
			"name": "Campbell",
			"purple": "#881798",
			"red": "#C50F1F",
			"white": "#CCCCCC",
			"yellow": "#C19C00"
		}
	]
}

// Add any keybinding overrides to this array.
// To unbind a default keybinding, set the command to "unbound"
"keybindings": []
}

搜集的应用:

7zip Aida64 AoMeiPartition aria2 baidunetdisk cacert CCleanerPro cmder cpu-z crystaldiskinfo crystaldiskmark curl dark dingtalk DiskGenius dismplusplus ditto everything geekuninstaller git googlechrome gpu-z gradle grep IDM innounp less lessmsi lxrunoffline maven motrix nodejs notepadplusplus openssl oraclejdk8 pandoc postman privoxy process-explorer python QQLive QQMusic redis-desktop-manager screentogif shadowsocksr-csharp snipaste SpaceSniffer switchhosts teamviewer touch typora utools vim vscode-portable wechat wget windows-terminal wireshark wox Youdaodict zookeeper 

参考:

windows系统包管理工具scoop安装使用

给 Scoop 加上这些软件仓库,让它变成强大的 Windows 软件管理器

Windows 包管理器 Scoop 设置

官网

官网快速入门

Scoop buckets by Github score

posted @ 2019-11-12 18:35  hongdada  阅读(7644)  评论(1编辑  收藏  举报