本文主要是介绍scoop-windows下包安装工具,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
前置条件:安装powershell3+ 和 .NET Framework 4.5+,默认win10已经安装了
配置host
如出现异常,“未能解析此远程名称: ‘raw.githubusercontent.com’”,请添加如下host。
52.74.223.119 github.com
203.98.7.65 gist.github.com
151.101.184.133 assets-cdn.github.com
151.101.184.133 raw.githubusercontent.com
151.101.184.133 gist.githubusercontent.com
151.101.184.133 cloud.githubusercontent.com
151.101.184.133 camo.githubusercontent.com
151.101.184.133 avatars0.githubusercontent.com
151.101.184.133 avatars1.githubusercontent.com
151.101.184.133 avatars2.githubusercontent.com
151.101.184.133 avatars3.githubusercontent.com
151.101.184.133 avatars4.githubusercontent.com
151.101.184.133 avatars5.githubusercontent.com
151.101.184.133 avatars6.githubusercontent.com
151.101.184.133 avatars7.githubusercontent.com
151.101.184.133 avatars8.githubusercontent.com
151.101.185.194 github.global.ssl.fastly.net
可以访问https://www.ipaddress.com/查询最新的ip和switchhosts修改host
配置scoop本身安装目录
#配置scoop安装目录
[environment]::setEnvironmentVariable('SCOOP','D:\scoop','User')
$env:SCOOP='D:\scoop'
#安装scoop
iex (new-object net.webclient).downloadstring('https://get.scoop.sh')
配置scoop软件安装目录
#配置scoop全局app安装目录
[environment]::setEnvironmentVariable('SCOOP_GLOBAL','D:\ScoopApps','Machine')
$env:SCOOP_GLOBAL='D:\ScoopApps'
也可以考虑直接用powershell脚本安装,复制上面命令,保存到install.ps1文件,然后运行脚本
install.ps1
[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:\ScoopApps','Machine')
$env:SCOOP_GLOBAL='D:\ScoopApps'
powershell.exe install.ps1 //运行脚本
使用scoop
添加仓库到命令行
scoop bucket add **
安装到scoop目录
scoop install **
安装到scoop全局软件目录
scoop install -g **
更新软件信息
scoop update
列出所有的软件
scoop list
查询某个软件信息
scoop info **
根据关键字搜索软件信息
scoop search **
查看scoop信息
查看所有的配置项
scoop help config
查看单个配置项
scoop config SCOOP_REPO
注册mysql为windows服务
注册为服务
mysqld --install MySQL
删除服务
mysqld -remove MySQL
启动服务
net start MySQL
停止服务
net stop MySQL
mysql常见命令
创建数据库
CREATE SCHEMA `quilt` DEFAULT CHARACTER SET utf8 ;
修改密码
ALTER user 'root'@'localhost' IDENTIFIED BY 'your password';
添加用户
create user abc identified by 'abc';
授权用户
grant all privileges on db.* to 'abc'@'%' identified by 'pwd';
flush privileges;
取消授权
revoke all privileges on db.* from 'abc'@'%' identified by 'pwd';
flush privileges;
查询权限
show grants for 'abc';
注册redis为windows服务
注册服务,并命名为 redis-hd
redis-server.exe --service-install redis.windows-service.conf --service-name redis-hd
删除服务
redis-server --service-uninstall --service-name redis-hd
开启服务
redis-server --service-start
停止服务
redis-server --service-stop
gradle设置用户目录
设置用户目录
gradle -g D:\.gradle
搭建c/c++编译环境
安装gcc
scoop install -g gcc
安装make
scoop install -g make
安装cmake
scoop install -g cmake
安装nsis(windows生成安装包时用到)
https://nsis.sourceforge.io/Download
安装nginx
使用scoop安装
scoop install -g nginx
检查配置文件
nginx -t
更新配置文件
nginx -s reload
停止nginx
nginx -s stop
nginx配置教程请参考配置文件结构和服务器配置和Nginx Cookbook
安装zookeeper
安装zookeeper
scoop install -g zookeeper
启动zookeeper,无需start,直接运行
zkserver.cmd
启动客户端
zkcli.cmd
创建节点
create /node value
获取节点的值
get /node
设置节点的值
set /node newValue
删除节点
delete /node
zookeeper入门文档请参考
安装python
//安装命令
scoop install -g python
nexus常用命令
安装服务
nexus.exe /install nexus
启动服务
nexus.exe /start nexus
停止服务
nexus.exe /stop nexus
卸载服务
nexus.exe /uninstall nexus
这篇关于scoop-windows下包安装工具的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!