├── LICENSE ├── README.md ├── config.yaml ├── main.py └── rf.py /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 听话的便当 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Linux应用安装脚本集合 2 | 3 | > 集中Linux应用安装过程中的指令以实现懒人式快速安装。 4 | 5 | PS:长期未维护脚本库,有些软件版本会变老,同时也有部分软件未测试。如发现问题,请提Issues! 6 | 7 | ## Why? 8 | 9 | 自从切换使用Linux后,就觉得每次到网上搜索安装教程比较费事; 10 | 11 | 同时,安装步骤有时候五花八门,更是雪上加霜,还容易把源搞坏。 12 | 13 | 所以,我制作了这个类似应用商店的东西, 14 | 15 | 并花费了一下午的时间,从列表中所有软件的官网找到了不同系统的安装方式; 16 | 17 | 然后把一些步骤集合起来,又加上了一些中文说明(如果可能的话): 18 | 19 | 做好了这个零技术含量但是工作量比较大的东西。 20 | 21 | ## How? 22 | 23 | 前提是需要安装`python3,git,python3-pip`: 24 | 25 | ``` 26 | sudo apt install python3-pip git -y 27 | ``` 28 | 29 | 接着clone仓库: 30 | 31 | ```git 32 | git clone https://github.com/wzk0/app-installation-script 33 | ``` 34 | 35 | 随后编辑`config.yaml`: 36 | 37 | ```yaml 38 | ##感谢使用! 39 | 40 | main: 41 | pac: apt ##在此输入包管理器的全称,例如 apt、yum等;强烈建议使用Debian系的系统,因为软件相对而言比较全; 42 | su: 1 ##如果为1, 则执行安装时会以sudo执行;其他值则说明无需sudo; 43 | src: https://ghproxy.com/https://raw.githubusercontent.com/wzk0/repo-of-app/main/ ##这里填脚本源,可以填入自己fork的仓库地址; 44 | ac: 2 ##如果为1,则会在每一次启动脚本时清理不必要文件; 45 | ok: 2 ##如果为1,则说明配置完成;其他值则说明没有完成配置。 46 | ``` 47 | 48 | 只需在配置完成后,把ok改为1,然后执行`python3 main.py`即可。 49 | 50 | > 注意:需要`requests`模块以获取安装脚本;这个依赖好像默认安装了。 51 | 52 | ## About 53 | 54 | 为了方便及时更新和修复错误,以及添加与删除软件,同时也为了节省空间,我把实际进行安装的脚本放在了另一个仓库: https://github.com/wzk0/repo-of-app ,超级希望大家可以归纳贡献(pr)自己安装过程中的步骤,说明一些可能的坑,以及分享更好的软件,从而让Linux得到更好的推广!(说得有点大。。) 55 | 56 | (如果你是社恐,也可以考虑私发我单文件,联系方式什么的在博客里!) 57 | 58 | 另外,安装脚本几乎全部考虑了不同系统的安装方式,以及是否拥有sudo权限,只需要在`config.yaml`中设置即可;但是还是推荐大家使用Debian系的系统,能保证列表中所有软件的安装。 59 | 60 | > PS:Chrome和WPS-Office的下载需要打开网页验证,目前不知道怎么搞,或许可以用releases的方式。 61 | 62 | ## List 63 | 64 | 目前已有的软件: 65 | 66 | ``` 67 | . 68 | ├── 办公 69 | │   ├── 钉钉 70 | │   ├── Joplin 71 | │   ├── Typora 72 | │   └── WPS-Office 73 | ├── 编辑器 74 | │   ├── Sublime-Text 75 | │   └── VS-Code 76 | ├── 工具 77 | │   ├── 阿里云盘 78 | │   ├── 搜狗输入法 79 | │   ├── Clash 80 | │   └── PicGo 81 | ├── 聊天 82 | │   ├── 微信 83 | │   ├── Discord 84 | │   ├── QQ 85 | │   └── Telegram 86 | ├── 浏览器 87 | │   ├── Brave 88 | │   ├── Chrome 89 | │   ├── Firefox 90 | │   └── Vivaldi 91 | ├── 音频 92 | │   ├── 网易云音乐 93 | │   ├── Harmony 94 | │   ├── Spotify 95 | │   └── YesPlayMusic 96 | ├── 游戏 97 | │   └── Steam 98 | 99 | ``` 100 | 101 | > QQ为官方版(很垃圾),微信为优麒麟和微信合作版本(有点简陋,但是稳定) 102 | 103 | 准备添加的软件: 104 | 105 | * ~~yesplay music~~ 完成 106 | * ~~picgo~~ 完成 107 | * ~~阿里云小白羊~~ 完成 108 | * ~~搜狗输入法~~ 完成 109 | * ... 110 | 111 | 额外的指令: 112 | 113 | * `update` - 更新Store 114 | * `clean `- 清除不必要文件 115 | 116 | ## END 117 | 118 | 感谢watching的你,一起来写写吧! 119 | -------------------------------------------------------------------------------- /config.yaml: -------------------------------------------------------------------------------- 1 | ##感谢使用! 2 | 3 | main: 4 | pac: apt ##在此输入包管理器的全称,例如 apt、yum等;强烈建议使用Debian系的系统,因为软件相对而言比较全; 5 | su: 1 ##如果为1, 则执行安装时会以sudo执行;其他值则说明无需sudo; 6 | src: https://ghproxy.com/https://raw.githubusercontent.com/wzk0/repo-of-app/main/ ##这里填脚本源,可以填入自己fork的仓库地址; 7 | ac: 2 ##如果为1,则会在每一次启动脚本时清理不必要文件; 8 | ok: 2 ##如果为1,则说明配置完成;其他值则说明没有完成配置。 9 | -------------------------------------------------------------------------------- /main.py: -------------------------------------------------------------------------------- 1 | ##导入模块 2 | import os ##执行系统指令 3 | import requests ##脚本获取与更新 4 | import rf ##读取config用 5 | import sys ##退出用 6 | 7 | os.system('clear') ##清屏 8 | print('--- Simple APP Store CLI ---\n') 9 | 10 | ##检查config是否配置好 11 | if rf.ok!=1: 12 | print('请打开config.yaml进行配置后再运行脚本!') 13 | sys.exit(0) 14 | else: 15 | pass 16 | 17 | if rf.ac==1: 18 | rf.clean() 19 | else: 20 | pass 21 | 22 | ##检查仓库源是否为官方 23 | if rf.src=='https://ghproxy.com/https://raw.githubusercontent.com/wzk0/repo-of-app/main/'or'https://raw.githubusercontent.com/wzk0/repo-of-app/main/': 24 | print('当前脚本源为:官方源') 25 | else: 26 | print('当前脚本源为:其他源,不确定是否成功安装') 27 | 28 | ##检查是否安装了requests依赖 29 | try: 30 | import requests 31 | import pyyaml 32 | print('已安装了相关依赖,可以通过输入 update 更新Store') 33 | pass 34 | except ImportError: 35 | print("没有安装依赖,正在安装...") 36 | ##根据config里的设置判断是否需要sudo 37 | if rf.su==1: 38 | os.system('sudo pip install requests') 39 | os.system('sudo pip install pyyaml') 40 | else: 41 | os.system('pip install pyyaml') 42 | 43 | ##get云端列表并输出 44 | print('目前已有的应用:\n') 45 | ls=requests.get(rf.src+'list') 46 | print(ls.text) 47 | 48 | ##输入一个东西 49 | 分类=input('\n请先输入分类或其他已有的指令:') 50 | 51 | ##对输入进行不同的判断 52 | if 分类=='clean': 53 | rf.autoclean() 54 | 55 | if 分类=='update': 56 | url = "https://raw.githubusercontent.com/wzk0/app-installation-script/main/main.py" 57 | rfurl='https://raw.githubusercontent.com/wzk0/app-installation-script/main/rf.py' 58 | r = requests.get(url) 59 | rr=requests.get(rfurl) 60 | with open('main.py', 'w') as f: 61 | f.write(r.text) 62 | with open('rf.py', 'w') as ff: 63 | ff.write(rr.text) 64 | print("更新完毕!") ##这是一种通过requests实现的更新方式,跟wget相比,它的好处是不会产生新文件,直接覆盖旧文件 65 | 66 | if 分类=="工具": 67 | name=input('请输入需要下载的应用名(注意大小写):') 68 | root=rf.src+'%E5%B7%A5%E5%85%B7/' ##定义一个url片段 69 | act='wget '+root+name+' && python3 '+name 70 | print('正在获取'+name+'的安装脚本...') 71 | os.system(act) ##获取安装脚本并执行 72 | dele='rm '+name 73 | os.system(dele) ##执行完后把获取的脚本删除 74 | 75 | ##以下同上 76 | if 分类=="办公": 77 | name=input('请输入需要下载的应用名(注意大小写):') 78 | root=rf.src+'%E5%8A%9E%E5%85%AC/' 79 | act='wget '+root+name+' && python3 '+name 80 | print('正在获取'+name+'的安装脚本...') 81 | os.system(act) 82 | dele='rm '+name 83 | os.system(dele) 84 | 85 | if 分类=="编辑器": 86 | name=input('请输入需要下载的应用名(注意大小写):') 87 | root=rf.src+'%E7%BC%96%E8%BE%91%E5%99%A8/' 88 | act='wget '+root+name+' && python3 '+name 89 | print('正在获取'+name+'的安装脚本...') 90 | os.system(act) 91 | dele='rm '+name 92 | os.system(dele) 93 | 94 | if 分类=="音频": 95 | name=input('请输入需要下载的应用名(注意大小写):') 96 | root=rf.src+'%E9%9F%B3%E9%A2%91/' 97 | act='wget '+root+name+' && python3 '+name 98 | print('正在获取'+name+'的安装脚本...') 99 | os.system(act) 100 | dele='rm '+name 101 | os.system(dele) 102 | 103 | if 分类=="游戏": 104 | name=input('请输入需要下载的应用名(注意大小写):') 105 | root=rf.src+'%E6%B8%B8%E6%88%8F/' 106 | act='wget '+root+name+' && python3 '+name 107 | print('正在获取'+name+'的安装脚本...') 108 | os.system(act) 109 | dele='rm '+name 110 | os.system(dele) 111 | 112 | if 分类=="浏览器": 113 | name=input('请输入需要下载的应用名(注意大小写):') 114 | root=rf.src+'%E6%B5%8F%E8%A7%88%E5%99%A8/' 115 | act='wget '+root+name+' && python3 '+name 116 | print('正在获取'+name+'的安装脚本...') 117 | os.system(act) 118 | dele='rm '+name 119 | os.system(dele) 120 | 121 | if 分类=="聊天": 122 | name=input('请输入需要下载的应用名(注意大小写):') 123 | root=rf.src+'%E8%81%8A%E5%A4%A9/' 124 | act='wget '+root+name+' && python3 '+name 125 | print('正在获取'+name+'的安装脚本...') 126 | os.system(act) 127 | dele='rm '+name 128 | os.system(dele) 129 | -------------------------------------------------------------------------------- /rf.py: -------------------------------------------------------------------------------- 1 | import yaml 2 | import os 3 | 4 | config=yaml.load(open('config.yaml'),Loader=yaml.FullLoader) 5 | pac=config['main']['pac'] 6 | su=config['main']['su'] 7 | ok=config['main']['ok'] 8 | src=config['main']['src'] 9 | ac=config['main']['ac'] 10 | 11 | def autoclean(): 12 | deb='*.deb' 13 | tar='*.tar.*' 14 | rpm='*.rpm' 15 | if not os.path.exists(tar): 16 | print('没有检测到tar压缩包!') 17 | else: 18 | print('已下载的tar压缩包有:') 19 | os.system('ls *.tar.*') 20 | if pac=='apt': 21 | if not os.path.exists(deb): 22 | print('没有检测到.deb安装包!') 23 | else: 24 | print('已下载的.deb安装包有:') 25 | os.system('ls *.deb') 26 | else: 27 | if not os.path.exists(rpm): 28 | print('没有检测到.rpm安装包!') 29 | else: 30 | print('已下载的.rpm安装包有:') 31 | os.system('ls *.rpm') 32 | print('是否全部清理?') 33 | choose=input('y/n:') 34 | if choose=='y': 35 | os.system('rm -rf *.tar.*') 36 | if pac=='apt': 37 | os.system('rm -rf *.deb') 38 | else: 39 | os.system('rm -rf *.rpm') 40 | print('清理完毕!') ##清理不必要的文件 41 | 42 | def clean(): 43 | os.system('rm -rf *.tar.*') 44 | if pac=='apt': 45 | os.system('rm -rf *.deb') 46 | else: 47 | os.system('rm -rf *.rpm') --------------------------------------------------------------------------------