我是Kali Linux环境,因为网易云音乐曲库稍稍没QQ音乐的全,而腾讯又未开发Linux版的QQ音乐,想当然,就用wine来安装和运行QQ音乐啦。
那么,当我们不需要它时,该如何彻底卸载呢?首先,我们比较清楚的是,Wine(Wine Is Not an Emulator) Windows模拟器,该管理器的文件系统与Windows操作系统是高度相似的,可以说,wine就是一个微缩在Linux上的Windows资源管理器,运行和管理在Linux上无法使用的Windows的软件
其次,我们晓得的是,wine 是以隐藏文件夹: .wine 的方式存放在用户原始路径下的,打开.wine文件夹下 "drive_c"文件夹,我们便会发现该文件夹的内容与Windows的C盘文件几乎一模一样的:
所以,我们想当然的可以使用powershell来处理wine了!
好,让我们正式步入主题!彻底卸载用Wine安装在Linux上的QQ音乐!!
和Win10中一样,QQ音乐安装在drive_c的Program Files (x86)下,我们只需找到类似uninstall.exe的执行文件,用wine打开它即可:
wine ./Tencent/QQMusic/QQMusicUninst.exe
直接卸载!
哈哈,该不会以为就这样真的彻底卸载了么?
tree | grep QQMusic
细心的朋友可能早就发现了,虽然Wine微缩了Windows,但软件安装后各文件位置并不是相同的,所以,这样并不能彻底卸载!
再次查询并删除:
find / -name "QQMusic" -exec {} rm -rf \;
但我们很快就发现,是没有权限的,若手动删除的话,是效率很低的。别着急,我们前面提到过,由于wine和Windows的高度相似性,我们可以使用Powershell来处理的!另外Kali Linux是自带powershell的:
pwsh # 打开powershell
dir -Include "*QQMusic*" -Recurse # 列举出包含QQMusic的文件和路径
C:\root\.wine\drive_c> pwsh
PowerShell 7.1.3
Copyright (c) Microsoft Corporation.
https://aka.ms/powershell
Type 'help' to get help.
PS /root/.wine/drive_c> dir -Include "*QQMusic*" -Recurse
Directory: /root/.wine/drive_c/Program Files (x86)/Common Files/Tencent
Mode LastWriteTime Length Name
---- ------------- ------ ----
d---- 2021/5/11 上午10:50 QQMusic
Directory: /root/.wine/drive_c/Program Files (x86)/Common Files/Tencent/QQMusic
Mode LastWriteTime Length Name
---- ------------- ------ ----
----- 2019/11/20 下午3:09 1063408 QQMusicCommon.dll
----- 2019/11/20 下午3:10 191088 QQMusicService.exe
Directory: /root/.wine/drive_c/Program Files (x86)/Tencent/QQ/Plugin
Mode LastWriteTime Length Name
---- ------------- ------ ----
d---- 2020/2/20 下午5:37 Com.Tencent.QQMusic
Directory: /root/.wine/drive_c/Program Files (x86)/Tencent/QQ/Plugin/Com.Tencent.QQMusic/Bin
Mode LastWriteTime Length Name
---- ------------- ------ ----
----- 2020/2/20 下午5:37 291744 QQMusic.dll
Directory: /root/.wine/drive_c/Program Files (x86)/Tencent/QzoneMusic
Mode LastWriteTime Length Name
---- ------------- ------ ----
d---- 2020/2/1 下午8:12 QQMusicAddin
----- 2016/2/26 上午9:52 756936 QQMusicCommon.dll
----- 2016/2/26 上午9:52 2199752 QQMusicDldEx.dll
----- 2016/2/26 上午9:52 482504 QQMusicPlayer.dll
Directory: /root/.wine/drive_c/users/root/Application Data/Tencent
Mode LastWriteTime Length Name
---- ------------- ------ ----
d---- 2021/5/11 上午11:03 QQMusic
Directory: /root/.wine/drive_c/users/root/Application Data/Tencent/QQMusic
Mode LastWriteTime Length Name
---- ------------- ------ ----
d---- 2021/5/11 上午11:03 QQMusicCache
Directory: /root/.wine/drive_c/users/root/Application Data/Tencent/QQMusic/QQMusicCache/Log
Mode LastWriteTime Length Name
---- ------------- ------ ----
d---- 2021/5/11 上午11:03 QQMusicService
Directory: /root/.wine/drive_c/users/root/Application Data/Tencent/QQMusic/QQMusicCache/Log/QQMusicService
Mode LastWriteTime Length Name
---- ------------- ------ ----
----- 2021/5/11 上午11:03 1795 QQMusicService(1733.4793)20210511110347.logE.zip
Directory: /root/.wine/drive_c/users/root/Application Data/Tencent/QQMusic/QQMusicCache/Log
Mode LastWriteTime Length Name
---- ------------- ------ ----
d---- 2021/5/11 上午11:03 QQMusicSvr
Directory: /root/.wine/drive_c/users/root/Application Data/Tencent/QQMusic/QQMusicCache/Log/QQMusicSvr
Mode LastWriteTime Length Name
---- ------------- ------ ----
----- 2021/5/11 上午10:50 1754 QQMusicSvr(1733.4793)20210511105003.logR.zip
----- 2021/5/11 上午11:03 1795 QQMusicSvr(1733.4793)20210511110346.logB.zip
Directory: /root/.wine/drive_c/users/root/Temp/QMI202105111039318
Mode LastWriteTime Length Name
---- ------------- ------ ----
----- 2019/10/11 上午11:07 1046688 QQMusicCommon.dll
Directory: /root/.wine/drive_c/users/root/Temp/QMI202105111049548
Mode LastWriteTime Length Name
---- ------------- ------ ----
----- 2019/10/11 上午11:07 1046688 QQMusicCommon.dll
Directory: /root/.wine/drive_c/users/root/Temp/QMUI202105111047118
Mode LastWriteTime Length Name
---- ------------- ------ ----
----- 2021/5/11 上午10:41 1063408 QQMusicCommon.dll
----- 2021/5/11 上午10:41 1044464 QQMusicUninst.exe
Directory: /root/.wine/drive_c/users/root/Temp/QMUI202105111103398
Mode LastWriteTime Length Name
---- ------------- ------ ----
----- 2019/11/20 下午3:09 1063408 QQMusicCommon.dll
----- 2019/11/20 下午3:10 1044464 QQMusicUninst.exe
Directory: /root/.wine/drive_c/users/root/Temp
Mode LastWriteTime Length Name
---- ------------- ------ ----
d---- 2021/5/11 上午10:49 QQMusicInstaller
Directory: /root/.wine/drive_c/users/root/Temp/QQMusicInstaller
Mode LastWriteTime Length Name
---- ------------- ------ ----
----- 2021/5/11 上午10:41 91252 QQMusicInstallerLog202105111039318.log
----- 2021/5/11 上午10:50 86436 QQMusicInstallerLog202105111049548.log
Directory: /root/.wine/drive_c/users/root/Temp
Mode LastWriteTime Length Name
---- ------------- ------ ----
d---- 2021/5/11 上午11:03 QQMusicUninstaller
Directory: /root/.wine/drive_c/users/root/Temp/QQMusicUninstaller
Mode LastWriteTime Length Name
---- ------------- ------ ----
----- 2021/5/11 上午10:47 22666 QQMusicUninstallerLog20210511104711.log
----- 2021/5/11 上午11:03 21828 QQMusicUninstallerLog20210511110339.log
Directory: /root/.wine/drive_c/users/root/Temp/Tencent
Mode LastWriteTime Length Name
---- ------------- ------ ----
d---- 2021/5/11 上午10:42 QQMusic
Directory: /root/.wine/drive_c/users/root/Temp/Tencent/QQMusic/Log
Mode LastWriteTime Length Name
---- ------------- ------ ----
d---- 2021/5/11 上午11:03 QQMusicService
Directory: /root/.wine/drive_c/users/root/Temp/Tencent/QQMusic/Log/QQMusicService
Mode LastWriteTime Length Name
---- ------------- ------ ----
----- 2021/5/11 上午10:42 0 QQMusicService(1733.4793)20210511104249.logE
----- 2021/5/11 上午10:47 5295 QQMusicService(1733.4793)20210511104705.logI.zip
----- 2021/5/11 上午10:53 0 QQMusicService(1733.4793)20210511105345.logO
----- 2021/5/11 上午10:53 1742 QQMusicService(1733.4793)20210511105346.logS.zip
----- 2021/5/11 上午11:03 5292 QQMusicService(1733.4793)20210511110338.logB.zip
利用powershell查询删除:
PS /root/.wine/drive_c> $path = dir -Include "*QQMusic*" -Recurse
PS /root/.wine/drive_c> del $path
PowerShell微软官网:Linux和开源上的Powershell!
Centos下如何安装和使用powershell:
1. Centos8安装PowerShell
2. Centos7安装PowerShell
Ubuntu中如何安装和使用powershell:
1. Ubuntu中有snap包管理:
sudo snap install powershell --classic
2. 下载微软包安装:
在火狐浏览器中打开地址:https://packages.microsoft.com/config/ubuntu/
找到你系统对应的版本,比如我的20.04:
点击packages-microsoft-prod.deb下载
sudo dpkg -i packages-microsoft-prod.deb # 安装微软包
sudo apt update # 更新软件源
sudo apt install -y powershell # 安装 pwsh