windows11下安装Scoop和lux(annie)

windows11下安装Scoop和lux(annie)

参考链接

Win11下Scoop与Annie安装

scoop使用指南

一、安装前环境确认

1.PowerShell版本要求

scoop官网中提到PowerShell要大≥5.1版本
在这里插入图片描述

查看powershell 版本的命令“Get-Host | Select-Object Version”

PS C:\Users\chenky190417> Get-Host | Select-Object Version

Version
-------
5.1.22621.169

2.NET框架版本

需要.NET 框架 4.5(或更高版本),我这里安装了6.0版本。

二、安装Scoop

Scoop是Windows的命令行安装程序,是一个强大的包管理工具。可以在github上找到其项目的相关信息,项目网址。

github网址

码云网址

1. 安装scoop

通过scoop官网下面的界面给出了安装方法
在这里插入图片描述

详见scoop安装readme

(1) 制定执行策略,保证允许本地脚本的执行

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

执行策略选择Y

(2) 安装scoop

irm get.scoop.sh | iex

或下面的命令也不行:

iex (new-object net.webclient).downloadstring('https://get.scoop.sh')

都出错,提示如下:

Initializing...
Running the installer as administrator is disabled by default, see https://github.com/ScoopInstaller/Install#for-admin for details.
Abort.

表示作为管理员运行installer默认是被禁止的,详见细节,这里给出了解决方案,采用新admin对应的命令

1.1 用默认安装路径的方式安装

我采用命令“iex “& {$(irm get.scoop.sh)} -RunAsAdmin””

PS C:\Users\chenky190417> iex "& {$(irm get.scoop.sh)} -RunAsAdmin"
Initializing...
Downloading...
Extracting...
Creating shim...
Adding ~\scoop\shims to your path.
Scoop was installed successfully!
Type 'scoop help' for instructions.

安装过程杀毒软件是否允许操作,允许就可以了。

安装后默认的路径是C:\Users<YOUR USERNAME>\scoop,通过scoop安装的app在C:\Users<YOUR USERNAME>\scoop\apps下。

1.2 用指定安装路径的方式安装

如果要按照到指定目录,详见scoop安装readme

.\install.ps1 -RunAsAdmin -ScoopDir 'D:\Program Files\scoop' -ScoopGlobalDir 'D:\Program Files\ScoopApps'
  • -ScoopDir:设置当前用户软件安装位置D:\Program Files\scoop
  • -ScoopGlobalDir : 设置全局软件安装位置(意思应该是所有用户都可使用)

可根据自己的需求来指定这两个按照位置

安装的日志信息如下:

PS C:\Users\chenky190417> .\install.ps1 -RunAsAdmin -ScoopDir 'D:\Program Files\scoop' -ScoopGlobalDir 'D:\Program Files\ScoopApps'
Initializing...
Downloading...
Extracting...
Creating shim...
Adding D:\Program Files\scoop\shims to your path.
Scoop was installed successfully!
Type 'scoop help' for instructions.

2. 验证是否安装成功

通过命令“scoop help”,安装成功可以看到help信息,如下:

PS C:\Users\chenky190417> scoop help
Usage: scoop <command> [<args>]

Available commands are listed below.

Type 'scoop help <command>' to get more help for a specific command.

Command    Summary
-------    -------
alias      Manage scoop aliases
bucket     Manage Scoop buckets
cache      Show or clear the download cache
cat        Show content of specified manifest.
checkup    Check for potential problems
cleanup    Cleanup apps by removing old versions
config     Get or set configuration values
create     Create a custom app manifest
depends    List dependencies for an app, in the order they'll be installed
download   Download apps in the cache folder and verify hashes
export     Exports installed apps, buckets (and optionally configs) in JSON format
help       Show help for a command
hold       Hold an app to disable updates
home       Opens the app homepage
import     Imports apps, buckets and configs from a Scoopfile in JSON format
info       Display information about an app
install    Install apps
list       List installed apps
prefix     Returns the path to the specified app
reset      Reset an app to resolve conflicts
search     Search available apps
shim       Manipulate Scoop shims
status     Show status and check for new app versions
unhold     Unhold an app to enable updates
uninstall  Uninstall an app
update     Update apps, or Scoop itself
virustotal Look for app's hash or url on virustotal.com
which      Locate a shim/executable (similar to 'which' on Linux)

3. 卸载scoop

卸载scoop的官方链接

用命令“scoop uninstall scoop”卸载,这个卸载命令,会删除你配置的scoop下面的所有软件,但卸载的时候提示提示没有对一些路径访问被拒绝,如下:

PS C:\Users\chenky190417> scoop uninstall scoop
WARN  This will uninstall Scoop and all the programs that have been installed with Scoop!
Are you sure? (yN): y
Uninstalling '7zip'
Removing shim '7z.shim'.
Removing shim '7z.exe'.
Removing shim '7zFM.shim'.
Removing shim '7zFM.exe'.
Removing shim '7zG.shim'.
Removing shim '7zG.exe'.
WARN  Couldn't remove ~\scoop\apps\7zip: 无法删除项 C:\Users\chenky190417\scoop\apps\7zip\22.01\Codecs: 对路径“Codecs”的访问被拒绝。.Exception
Uninstalling 'ffmpeg'
Removing shim 'ffmpeg.shim'.
Removing shim 'ffmpeg.exe'.
Removing shim 'ffplay.shim'.
Removing shim 'ffplay.exe'.
Removing shim 'ffprobe.shim'.
Removing shim 'ffprobe.exe'.
WARN  Couldn't remove ~\scoop\apps\ffmpeg: 无法删除项 C:\Users\chenky190417\scoop\apps\ffmpeg\5.1.2\fonts: 对路径“fonts”的访问被拒绝。.Exception
Uninstalling 'lux'
Removing shim 'lux.shim'.
Removing shim 'lux.exe'.
WARN  Couldn't remove ~\scoop\apps\lux: 无法删除项 C:\Users\chenky190417\scoop\apps\lux\current: 对路径“current”的访问被拒绝。.Exception
Couldn't remove ~\scoop\apps: 无法删除项 C:\Users\chenky190417\scoop\apps\7zip\22.01\Codecs: 对路径“Codecs”的访问被拒 绝。

用“del .\scoop -Force”强制删除scoop,发现删掉了scoop下buckets、cache、persist和shims文件夹,但apps下无法彻底删除,提示信息如下

PS C:\Users\chenky190417> del scoop

确认
C:\Users\chenky190417\scoop 处的项具有子项,并且未指定 Recurse 参数。如果继续,所有子项均将随该项删除。是否确实要继续?
[Y] 是(Y)  [A] 全是(A)  [N] 否(N)  [L] 全否(L)  [S] 暂停(S)  [?] 帮助 (默认值为“Y”): y
del : 无法删除项 C:\Users\chenky190417\scoop\apps\7zip\22.01\Codecs: 对路径“Codecs”的访问被拒绝。
所在位置 行:1 字符: 1
+ del scoop
+ ~~~~~~~~~
    + CategoryInfo          : WriteError: (Codecs:DirectoryInfo) [Remove-Item], IOException
    + FullyQualifiedErrorId : DeleteSymbolicLinkFailed,Microsoft.PowerShell.Commands.RemoveItemCommand

del : 无法删除项 C:\Users\chenky190417\scoop\apps\7zip\22.01\Formats: 对路径“Formats”的访问被拒绝。
所在位置 行:1 字符: 1
+ del scoop
+ ~~~~~~~~~
    + CategoryInfo          : WriteError: (Formats:DirectoryInfo) [Remove-Item], IOException
    + FullyQualifiedErrorId : DeleteSymbolicLinkFailed,Microsoft.PowerShell.Commands.RemoveItemCommand

del : 无法删除目录 C:\Users\chenky190417\scoop\apps\7zip\22.01,因为该目录不为空。
所在位置 行:1 字符: 1
+ del scoop
+ ~~~~~~~~~
    + CategoryInfo          : WriteError: (22.01:DirectoryInfo) [Remove-Item], IOException
    + FullyQualifiedErrorId : DirectoryNotEmpty,Microsoft.PowerShell.Commands.RemoveItemCommand

del : 无法删除项 C:\Users\chenky190417\scoop\apps\7zip\current: 对路径“current”的访问被拒绝。
所在位置 行:1 字符: 1
+ del scoop
+ ~~~~~~~~~
    + CategoryInfo          : WriteError: (current:DirectoryInfo) [Remove-Item], IOException
    + FullyQualifiedErrorId : DeleteSymbolicLinkFailed,Microsoft.PowerShell.Commands.RemoveItemCommand

del : 无法删除目录 C:\Users\chenky190417\scoop\apps\7zip,因为该目录不为空。
所在位置 行:1 字符: 1
+ del scoop
+ ~~~~~~~~~
    + CategoryInfo          : WriteError: (7zip:DirectoryInfo) [Remove-Item], IOException
    + FullyQualifiedErrorId : DirectoryNotEmpty,Microsoft.PowerShell.Commands.RemoveItemCommand

del : 无法删除项 C:\Users\chenky190417\scoop\apps\ffmpeg\5.1.2\fonts: 对路径“fonts”的访问被拒绝。
所在位置 行:1 字符: 1
+ del scoop
+ ~~~~~~~~~
    + CategoryInfo          : WriteError: (fonts:DirectoryInfo) [Remove-Item], IOException
    + FullyQualifiedErrorId : DeleteSymbolicLinkFailed,Microsoft.PowerShell.Commands.RemoveItemCommand

del : 无法删除目录 C:\Users\chenky190417\scoop\apps\ffmpeg\5.1.2,因为该目录不为空。
所在位置 行:1 字符: 1
+ del scoop
+ ~~~~~~~~~
    + CategoryInfo          : WriteError: (5.1.2:DirectoryInfo) [Remove-Item], IOException
    + FullyQualifiedErrorId : DirectoryNotEmpty,Microsoft.PowerShell.Commands.RemoveItemCommand

del : 无法删除项 C:\Users\chenky190417\scoop\apps\ffmpeg\current: 对路径“current”的访问被拒绝。
所在位置 行:1 字符: 1
+ del scoop
+ ~~~~~~~~~
    + CategoryInfo          : WriteError: (current:DirectoryInfo) [Remove-Item], IOException
    + FullyQualifiedErrorId : DeleteSymbolicLinkFailed,Microsoft.PowerShell.Commands.RemoveItemCommand

del : 无法删除目录 C:\Users\chenky190417\scoop\apps\ffmpeg,因为该目录不为空。
所在位置 行:1 字符: 1
+ del scoop
+ ~~~~~~~~~
    + CategoryInfo          : WriteError: (ffmpeg:DirectoryInfo) [Remove-Item], IOException
    + FullyQualifiedErrorId : DirectoryNotEmpty,Microsoft.PowerShell.Commands.RemoveItemCommand

del : 无法删除项 C:\Users\chenky190417\scoop\apps\lux\current: 对路径“current”的访问被拒绝。
所在位置 行:1 字符: 1
+ del scoop
+ ~~~~~~~~~
    + CategoryInfo          : WriteError: (current:DirectoryInfo) [Remove-Item], IOException
    + FullyQualifiedErrorId : DeleteSymbolicLinkFailed,Microsoft.PowerShell.Commands.RemoveItemCommand

del : 无法删除目录 C:\Users\chenky190417\scoop\apps\lux,因为该目录不为空。
所在位置 行:1 字符: 1
+ del scoop
+ ~~~~~~~~~
    + CategoryInfo          : WriteError: (lux:DirectoryInfo) [Remove-Item], IOException
    + FullyQualifiedErrorId : DirectoryNotEmpty,Microsoft.PowerShell.Commands.RemoveItemCommand

del : 无法删除目录 C:\Users\chenky190417\scoop\apps,因为该目录不为空。
所在位置 行:1 字符: 1
+ del scoop
+ ~~~~~~~~~
    + CategoryInfo          : WriteError: (apps:DirectoryInfo) [Remove-Item], IOException
    + FullyQualifiedErrorId : DirectoryNotEmpty,Microsoft.PowerShell.Commands.RemoveItemCommand

del : 无法删除目录 C:\Users\chenky190417\scoop,因为该目录不为空。
所在位置 行:1 字符: 1
+ del scoop
+ ~~~~~~~~~
    + CategoryInfo          : WriteError: (C:\Users\chenky190417\scoop:DirectoryInfo) [Remove-Item], IOException
    + FullyQualifiedErrorId : DirectoryNotEmpty,Microsoft.PowerShell.Commands.RemoveItemCommand

尝试重启系统后用命令“del .\scoop -Force”强制删除,还是上面的提示,直接鼠标右键删除却可以删除掉

三、安装 lux(annie)

1.安装lux

项目网址:https://github.com/iawia002/lux
开始安装lux,这过程也安装了ffmpeg等软件。

PS C:\Users\chenky190417> scoop install lux
Installing '7zip' (22.01) [64bit] from main bucket
7z2201-x64.msi (1.8 MB) [=====================================================================================] 100%
Checking hash of 7z2201-x64.msi ... ok.
Extracting 7z2201-x64.msi ... done.
Linking D:\Program Files\scoop\apps\7zip\current => D:\Program Files\scoop\apps\7zip\22.01
Creating shim for '7z'.
Creating shim for '7zFM'.
Creating shim for '7zG'.
Creating shortcut for 7-Zip (7zFM.exe)
Persisting Codecs
Persisting Formats
Running post_install script...
'7zip' (22.01) was installed successfully!
Notes
-----
Add 7-Zip as a context menu option by running: "D:\Program Files\scoop\apps\7zip\current\install-context.reg"
Installing 'ffmpeg' (5.1.2) [64bit] from main bucket
ffmpeg-5.1.2-full_build.7z (45.2 MB) [========================================================================] 100%
Checking hash of ffmpeg-5.1.2-full_build.7z ... ok.
Extracting ffmpeg-5.1.2-full_build.7z ... done.
Linking D:\Program Files\scoop\apps\ffmpeg\current => D:\Program Files\scoop\apps\ffmpeg\5.1.2
Creating shim for 'ffmpeg'.
Creating shim for 'ffplay'.
Creating shim for 'ffprobe'.
Persisting fonts
'ffmpeg' (5.1.2) was installed successfully!
Installing 'lux' (0.16.0) [64bit] from main bucket
lux_0.16.0_Windows_64-bit.zip (10.8 MB) [=====================================================================] 100%
Checking hash of lux_0.16.0_Windows_64-bit.zip ... ok.
Extracting lux_0.16.0_Windows_64-bit.zip ... done.
Linking D:\Program Files\scoop\apps\lux\current => D:\Program Files\scoop\apps\lux\0.16.0
Creating shim for 'lux'.
'lux' (0.16.0) was installed successfully!

2. 使用lux下载视频

下载示例命令:

lux "https://www.bilibili.com/video/BV1tf4y1t7ru/?p=4&spm_id_from=pageDriver&vd_source=3f19bdc2a5854868deb3a176235129a2"

下载后视频文件在C:\Users<YOUR USERNAME>路径下,如果要下载到指定目下,-o参数,后面带上文件夹路径即可,下载视频的日志信息如下:

PS C:\Users\chenky190417> lux -o D:\download "https://www.bilibili.com/video/BV1tf4y1t7ru/?p=4&spm_id_from=pageDriver&vd_source=3f19bdc2a5854868deb3a176235129a2"

 Site:      哔哩哔哩 bilibili.com
 Title:     目标检测 YOLOv5 开源代码项目调试与讲解实战【土堆 x 布尔艺数】 P4 如何利用 YOLOv5 进行预测(一)
 Type:      video
 Stream:
     [16-12]  -------------------
     Quality:         流畅 360P hev1.1.6.L120.90
     Size:            85.98 MiB (90156863 Bytes)
     # download with: lux -f 16-12 ...

85.98 MiB / 85.98 MiB [======================================================================] 6.56 MiB p/s 100.00% 13s
Merging video parts into D:\download\目标检测 YOLOv5 开源代码项目调试与讲解实战【土堆 x 布尔艺数】 P4 如何利用 YOLOv5 进行预测(一).mp4

猜你喜欢

转载自blog.csdn.net/LoongEmbedded/article/details/128394946