{"id":15059118,"url":"https://github.com/spiritlhls/one-click-installation-script","last_synced_at":"2025-04-08T09:06:55.930Z","repository":{"id":65715658,"uuid":"575839367","full_name":"spiritLHLS/one-click-installation-script","owner":"spiritLHLS","description":"一键修复与安装脚本(各种linux系统修复与服务器环境安装脚本) One-click repair and installation scripts (various linux system repair and server environment installation scripts)","archived":false,"fork":false,"pushed_at":"2025-03-29T06:53:06.000Z","size":493,"stargazers_count":447,"open_issues_count":0,"forks_count":63,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-04-08T09:06:50.245Z","etag":null,"topics":["almalinux","bash","centos","debian","fedora","filebrowser","fix","installation","installer","jupyter","jupyter-lab","jupyter-notebook","one-click-script","pastebin","rust","script","shell","ubuntu","zipline"],"latest_commit_sha":null,"homepage":"https://github.com/spiritLHLS/ecs","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/spiritLHLS.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":"spiritlhl","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":null}},"created_at":"2022-12-08T12:19:16.000Z","updated_at":"2025-04-06T05:09:26.000Z","dependencies_parsed_at":"2024-01-16T09:22:30.555Z","dependency_job_id":"18dfea9a-179c-417c-b26f-cc76fe7e2acf","html_url":"https://github.com/spiritLHLS/one-click-installation-script","commit_stats":{"total_commits":461,"total_committers":3,"mean_commits":"153.66666666666666","dds":"0.041214750542299394","last_synced_commit":"8c07e09316bb5d63d5f416ca7ab9bf97c87aaa01"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spiritLHLS%2Fone-click-installation-script","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spiritLHLS%2Fone-click-installation-script/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spiritLHLS%2Fone-click-installation-script/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spiritLHLS%2Fone-click-installation-script/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/spiritLHLS","download_url":"https://codeload.github.com/spiritLHLS/one-click-installation-script/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247809964,"owners_count":20999816,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["almalinux","bash","centos","debian","fedora","filebrowser","fix","installation","installer","jupyter","jupyter-lab","jupyter-notebook","one-click-script","pastebin","rust","script","shell","ubuntu","zipline"],"created_at":"2024-09-24T22:37:57.674Z","updated_at":"2025-04-08T09:06:55.904Z","avatar_url":"https://github.com/spiritLHLS.png","language":"Shell","funding_links":["https://ko-fi.com/spiritlhl"],"categories":[],"sub_categories":[],"readme":"# 前言\n\n[![Hits](https://hits.spiritlhl.net/one-click-installation-script.svg?action=hit\u0026title=Hits\u0026title_bg=%23555555\u0026count_bg=%2324dde1\u0026edge_flat=false)](https://hits.spiritlhl.net)\n\n所有脚本如需在国内服务器使用，请在链接前加上```https://cdn.spiritlhl.net/```确保命令可以下载本仓库的shell脚本执行\n\n# 目录\n\n* [一键修复脚本](#一键修复脚本)\n  * [一键尝试修复apt源](#一键尝试修复apt源)\n  * [一键尝试修复系统时间](#一键尝试修复系统时间)\n  * [一键尝试修复sudo警告](#一键尝试修复sudo警告)\n  * [一键修改系统自带的journal日志记录大小释放系统盘空间](#一键修改系统自带的journal日志记录大小释放系统盘空间)\n  * [一键尝试修复网络](#一键尝试修复网络)\n  * [一键给纯IPV6服务器添加最优的nat64网络](#一键给纯IPV6服务器添加最优的nat64网络)\n  * [一键解除进程数限制](#一键解除进程数限制)\n* [一键环境安装脚本](#一键环境安装脚本)\n  * [一键安装golang环境](#一键安装golang环境)\n  * [一键安装jupyter环境](#一键安装jupyter环境)\n  * [一键安装R语言环境](#一键安装R语言环境)\n  * [一键安装rust环境](#一键安装rust环境)\n  * [一键安装C++环境](#一键安装C环境)\n  * [一键安装vnstat环境](#一键安装vnstat环境)\n  * [一键升级低版本debian为debian11](#一键升级低版本debian为debian11)\n  * [一键升级低版本ubuntu为ubuntu22](#一键升级低版本ubuntu为ubuntu22)\n  * [一键安装zipline平台](#一键安装zipline平台)\n  * [一键安装filebrowser平台](#一键安装filebrowser平台)\n  * [一键删除平台监控](#一键删除平台监控)\n* [部分手动命令](#部分手动命令)\n  * [一键开启root登陆并替换密码](#一键开启root登陆并替换密码)\n  * [一键屏蔽邮件端口避免被恶意程序使用](#一键屏蔽邮件端口避免被恶意程序使用)\n  * [设置语言包](#设置语言包)\n  * [ubuntu更新源被锁](#ubuntu更新源被锁)\n  * [debian缺失公钥](#debian缺失公钥)\n  * [ubuntu或debian缺失公钥](#ubuntu或debian缺失公钥)\n  * [centos换源](#centos换源)\n  * [安装gitea](#安装gitea)\n  * [卸载aapanel](#卸载aapanel)\n  * [查询是什么东西占用硬盘大于100M](#查询是什么东西占用硬盘大于100M)\n  * [卸载dns缓存机制避免配置覆写](#卸载dns缓存机制避免配置覆写)\n  * [安装docker和docker-compose](#安装docker和docker-compose)\n  * [通过docker安装code-server](#通过docker安装code-server)\n* [友链](#友链)\n  * [一键测试服务器的融合怪脚本](#一键测试服务器的融合怪脚本)\n  * [一键批量开NAT服务器LXC](#一键批量开NAT服务器LXC)\n  * [一键安装PVE](#一键安装PVE)\n  * [朋友fscarmen的常用一键工具仓库](#朋友fscarmen的常用一键工具仓库)\n  \n## 一键修复脚本\n\n运行所有一键修复脚本前注意看说明，以及保证服务器无重要数据，运行后造成的一切后果作者不负任何责任，自行评判风险！\n\n#### 一键尝试修复apt源 \n\n- 支持系统：Ubuntu 12+，Debian 6+\n- 修复apt下载包进程意外退出导致的源锁死\n- 修复apt源broken损坏\n- 修复apt源多进程占用锁死\n- 修复apt源公钥缺失\n- 修复替换系统可用的apt源列表，国内用阿里源，国外用官方源\n- 修复本机的Ubuntu系统是EOL非长期维护的版本(奇数或陈旧的偶数版本)，将替换为Ubuntu官方的old-releases仓库以支持apt的使用\n- 修复只保证```apt update```不会报错，其他命令报错未修复\n- 如若修复后install还有问题，重启服务器解决问题\n\n```bash\ncurl -L https://raw.githubusercontent.com/spiritLHLS/one-click-installation-script/main/repair_scripts/package.sh -o package.sh \u0026\u0026 chmod +x package.sh \u0026\u0026 bash package.sh\n```\n\n#### 一键尝试修复系统时间 \n\n- 支持系统：Ubuntu 18+，Debian 8+，centos 7+，Fedora，Almalinux 8.5+\n- 由于系统时间不准确都是未进行时区时间同步造成的，使用chronyd进行时区时间同步后应当解决了问题\n\n```bash\ncurl -L https://raw.githubusercontent.com/spiritLHLS/one-click-installation-script/main/repair_scripts/modify_time.sh -o modify_time.sh \u0026\u0026 chmod +x modify_time.sh \u0026\u0026 bash modify_time.sh\n```\n\n#### 一键尝试修复sudo警告\n\n- 一键尝试修复```sudo: unable to resolve host xxx: Name or service not known```警告(爆错)\n\n不要在生产环境上使用该脚本，否则容易造成网络hosts配置错误，配置的host名字不在外网IP上反而在内网IP(127.0.0.1)上\n\n```bash\ncurl -L https://raw.githubusercontent.com/spiritLHLS/one-click-installation-script/main/repair_scripts/check_sudo.sh -o check_sudo.sh \u0026\u0026 chmod +x check_sudo.sh \u0026\u0026 bash check_sudo.sh\n```\n\n#### 一键修改系统自带的journal日志记录大小释放系统盘空间\n\n- 支持系统：Ubuntu 18+，Debian 8+，centos 7+，Fedora，Almalinux 8.5+\n- 1.自定义修改大小，单位为MB，一般500或者1000即可，有的系统日志默认给了5000甚至更多，不是做站啥的没必要\n  - 请注意，修改journal目录大小会影响系统日志的记录，因此，在修改journal目录大小之前如果需要之前的日志，建议先备份系统日志到本地\n- 2.自定义修改设置系统日志保留日期时长，超过日期时长的日志将被清除\n- 3.默认修改日志只记录warning等级(无法自定义)\n- 4.以后日志的产生将受到日志文件大小，日志保留时间，日志保留等级的限制\n\n```bash\ncurl -L https://raw.githubusercontent.com/spiritLHLS/one-click-installation-script/main/repair_scripts/resize_journal.sh -o resize_journal.sh \u0026\u0026 chmod +x resize_journal.sh \u0026\u0026 bash resize_journal.sh\n```\n\n#### 一键尝试修复网络\n\n**该脚本轻易勿要使用，请确保运行时服务器无重要文件或程序，出现运行bug后续可能需要重装系统**\n\n**一定要在screen中执行该脚本，否则可能导致修改过程中ssh断链接而修改失败卡住最终SSH无法连接！不在screen中执行后果自负！**\n- 支持系统：Ubuntu 18+，Debian 8+，centos 7+，Fedora，Almalinux 8.5+\n- 尝试修复nameserver为google源或cloudflare源\n- 尝试修复为IP类型对应的网络优先级(默认IPV4类型，纯V6类型再替换为IPV6类型)\n\n```bash\ncurl -L https://cdn.spiritlhl.workers.dev/https://raw.githubusercontent.com/spiritLHLS/one-click-installation-script/main/repair_scripts/network.sh -o network.sh \u0026\u0026 chmod +x network.sh \u0026\u0026 bash network.sh\n```\n\n如果是纯V6的也可以不使用上面脚本的nat64，使用warp添加V4网络\n\n比如：https://gitlab.com/fscarmen/warp\n\n```bash\nwget -N https://gitlab.com/fscarmen/warp/-/raw/main/menu.sh \u0026\u0026 bash menu.sh [option] [lisence/url/token]\n```\n\n非纯V6的，带V4切换优先级到IPV4可用以下命令\n\n```bash\nsudo sed -i 's/.*precedence ::ffff:0:0\\/96.*/precedence ::ffff:0:0\\/96  100/g' /etc/gai.conf \u0026\u0026 sudo systemctl restart networking\n```\n\n#### 一键给纯IPV6服务器添加最优的nat64网络\n\n```bash\ncurl -L https://cdn.spiritlhl.workers.dev/https://raw.githubusercontent.com/spiritLHLS/one-click-installation-script/main/repair_scripts/nat64_optimizer.sh -o nat64_optimizer.sh \u0026\u0026 chmod +x nat64_optimizer.sh \u0026\u0026 bash nat64_optimizer.sh\n```\n\n#### 一键解除进程数限制\n\n```bash\ncurl -L https://raw.githubusercontent.com/spiritLHLS/one-click-installation-script/main/repair_scripts/unlimit.sh -o unlimit.sh \u0026\u0026 chmod +x unlimit.sh \u0026\u0026 bash unlimit.sh\n```\n\n## 一键环境安装脚本\n\n只推荐在新服务器上安装，环境不纯净不保证不出bug\n\n运行所有一键环境安装脚本前注意看说明，以及保证服务器无重要数据，运行后造成的一切后果作者不负任何责任，自行评判风险！\n\n#### 一键安装golang环境\n\n```shell\ncurl -L https://raw.githubusercontent.com/spiritLHLS/one-click-installation-script/main/install_scripts/golang.sh -o golang.sh \u0026\u0026 chmod +x golang.sh \u0026\u0026 bash golang.sh\n```\n\n#### 一键安装jupyter环境 \n\n- **本脚本尝试使用Miniconda3安装虚拟环境jupyter-env再进行jupyter和jupyterlab的安装，如若安装机器不纯净勿要轻易使用本脚本！**\n- **本脚本为实验性脚本可能会有各种bug，勿要轻易尝试！**\n- 验证已支持的系统：\n  - Ubuntu 系 - 推荐，脚本自动挂起到后台\n  - Debian 系 - 部分可能需要手动挂起到后台，详看脚本运行安装完毕的后续提示\n- 可能支持的系统(未验证)：centos 7+，Fedora，Almalinux 8.5+\n- 执行脚本，之前有用本脚本安装过则直接打印设置的登陆信息，没安装过则进行安装再打印信息，如果已安装但未启动则自动启动后再打印信息\n- 如果是初次安装无脑输入y回车即可，按照提示进行操作即可，安装完毕将在后台常驻运行，自动添加常用的安装包通道源\n- 安装完毕后，如果需要在lab中安装第三方库需要在lab中使用terminal并使用conda进行下载而不是pip3下载，这是需要注意的一点\n- 安装过程中有判断是否为中国IP，可选择是否使用中国镜像\n\n原始用途是方便快捷的在按小时计费的超大型服务器上部署python环境进行科学计算，充分利用时间别浪费在构建环境上。\n\n```bash\ncurl -L https://raw.githubusercontent.com/spiritLHLS/one-click-installation-script/main/install_scripts/jupyter.sh -o jupyter.sh \u0026\u0026 chmod +x jupyter.sh \u0026\u0026 bash jupyter.sh\n```\n\n#### 一键安装R语言环境\n\n- **安装前需使用Miniconda3安装虚拟环境jupyter-env，然后进行jupyter和jupyterlab的安装，再然后才能安装本内核**\n- **简单的说，需要执行本仓库对应的jupyter安装脚本再运行本脚本安装R语言环境，会自动安装R环境内核和图形设备支持库**\n- x11可能需要手动启动一下，执行```sudo /usr/bin/Xorg```\n- 可能支持的系统(未验证)：centos 7+，Fedora，Almalinux 8.5+\n\n```bash\ncurl -L https://raw.githubusercontent.com/spiritLHLS/one-click-installation-script/main/install_scripts/R.sh -o R.sh \u0026\u0026 chmod +x R.sh \u0026\u0026 bash R.sh\n```\n\n#### 一键安装rust环境 \n\n- 支持系统：Ubuntu 18+，Debian 8+，centos 7+，Fedora，Almalinux 8.5+\n- 加载官方脚本安装，前置条件适配系统以及后置条件判断安装的版本\n\n```bash\ncurl -L https://raw.githubusercontent.com/spiritLHLS/one-click-installation-script/main/install_scripts/rust.sh -o rust.sh \u0026\u0026 chmod +x rust.sh \u0026\u0026 bash rust.sh \n```\n\n#### 一键安装C环境\n\n- 一键安装C++环境\n- 支持系统：使用apt或者yum作为包管理器的系统\n- 如果未安装则安装，如果有安装则提示升级\n\n```bash\ncurl -L https://raw.githubusercontent.com/spiritLHLS/one-click-installation-script/main/install_scripts/cplusplus.sh -o cplusplus.sh \u0026\u0026 chmod +x cplusplus.sh \u0026\u0026 bash cplusplus.sh \n```\n\n#### 一键安装vnstat环境\n\n- 支持系统：Ubuntu 18+，Debian 8+，centos 7+，Fedora，Almalinux 8.5+\n- 加载官方文件编译安装，前置条件适配系统以及后置条件判断安装的版本\n\n```bash\ncurl -L https://raw.githubusercontent.com/spiritLHLS/one-click-installation-script/main/install_scripts/vnstat.sh -o vnstat.sh \u0026\u0026 chmod +x vnstat.sh \u0026\u0026 bash vnstat.sh \n```\n\n#### 一键升级低版本debian为debian11\n\n- 支持系统：debian 6+\n- 升级后需要重启系统加载内核，升级过程中需要选择的都无脑按回车即可\n- 升级是一个版本迭代一个版本，所以如果版本低，每执行一次升级一个版本，直至升级到debian11\n\n```bash\ncurl -L https://raw.githubusercontent.com/spiritLHLS/one-click-installation-script/main/install_scripts/todebian11.sh -o todebian11.sh \u0026\u0026 chmod +x todebian11.sh \u0026\u0026 bash todebian11.sh\n```\n\n#### 一键升级低版本ubuntu为ubuntu22\n\n- 支持系统：Ubuntu 16+\n- 升级后需要重启系统加载内核，升级过程中需要选择的都无脑按回车即可\n- 升级是一个版本迭代一个版本，所以如果版本低，每执行一次升级一个版本，直至升级到ubuntu22\n\n```bash\ncurl -L https://raw.githubusercontent.com/spiritLHLS/one-click-installation-script/main/install_scripts/toubuntu22.sh -o toubuntu22.sh \u0026\u0026 chmod +x toubuntu22.sh \u0026\u0026 bash toubuntu22.sh\n```\n\n#### 一键安装zipline平台\n\n- 应该支持的系统：Ubuntu 18+，Debian 8+，centos 7+，Fedora，Almalinux 8.5+\n- 暂时只在Ubuntu上验证无问题\n- 如若要设置反向代理绑定域名，安装前请保证原服务器未安装过nginx，如若已安装过nginx，请自行配置反向代理本机的3000端口\n- 默认一路回车是不启用反代不安装nginx的，自行选择，如需通过本脚本配置反代系统一定要未安装过nginx并在填写y或Y开启安装\n- [zipline](https://github.com/diced/zipline) 平台功能: ShareX，自定义短链接，文件上传分享，多用户校验，高亮显示，阅后即焚，设置简单 (含pastebin)\n- 自动安装docker，docker-compose，如若已安装zipline在/root目录下，则自动更新\n- 反向代理如若已设置成功，还需要在面板设置中填写域名，绑定启用\n\n```bash\ncurl -L https://raw.githubusercontent.com/spiritLHLS/one-click-installation-script/main/install_scripts/zipline.sh -o zipline.sh \u0026\u0026 chmod +x zipline.sh \u0026\u0026 bash zipline.sh\n```\n\n如果需要删除0字节文件，打开```/root/zipline```文件夹，执行\n\n```\ndocker-compose exec zipline yarn scripts:clear-zero-byte\n```\n\n按照提示操作\n\n#### 一键安装filebrowser平台\n\n- 端口设置为3030了，其他登陆信息详见提示\n- [filebrowser](https://github.com/filebrowser/filebrowser)平台支持下载上传文件到服务器，批量下载多个文件(自定义压缩格式)，构建文件分享链接，设置分享时长\n- 如果本地有启用IPV6优先级可能绑定到V6去了，使用```lsof -i:3030```查看绑定情况，切换优先级后再安装就正常了\n\n```bash\ncurl -L https://raw.githubusercontent.com/spiritLHLS/one-click-installation-script/main/install_scripts/filebrowser.sh -o filebrowser.sh \u0026\u0026 chmod +x filebrowser.sh \u0026\u0026 bash filebrowser.sh\n```\n\n#### 一键删除平台监控\n\n- 一键移除大多数云服务器监控\n- 涵盖阿里云、腾讯云、华为云、UCLOUD、甲骨文云、京东云\n\n```bash\ncurl -L https://raw.githubusercontent.com/spiritLHLS/one-click-installation-script/main/install_scripts/dlm.sh -o dlm.sh \u0026\u0026 chmod +x dlm.sh \u0026\u0026 bash dlm.sh\n```\n\n## 部分手动命令\n\n### 一键开启root登陆并替换密码\n\n```\nbash \u003c(curl -sSL https://raw.githubusercontent.com/fscarmen/tools/main/root.sh) [PASSWORD]\n```\n\n### 一键屏蔽邮件端口避免被恶意程序使用\n\n```bash\niptables -A INPUT -p tcp --dport 25 -j DROP\niptables -A OUTPUT -p tcp --dport 25 -j DROP\n/sbin/iptables-save\n```\n\n### 设置语言包\n\n```bash\nsudo apt update\nsudo apt install -y locales\nsudo locale-gen en_US.UTF-8\necho 'LANG=en_US.UTF-8' | sudo tee /etc/default/locale\necho 'LC_ALL=en_US.UTF-8' | sudo tee -a /etc/default/locale\nsudo sed -i '/^#.* en_US.UTF-8 /s/^#//' /etc/locale.gen\nsudo locale-gen\nexport LANG=en_US.UTF-8\nexport LC_ALL=en_US.UTF-8\nlocale\n```\n\n重新连接SSH或重启服务器以使得设置生效\n\n### ubuntu更新源被锁\n\n```bash\nsudo rm -rf /var/cache/apt/archives/lock\nsudo pkill apt\nsudo rm /var/lib/dpkg/lock-frontend\nsudo rm /var/lib/apt/lists/lock\nsudo rm /var/cache/apt/archives/lock\nsudo rm /var/lib/dpkg/lock\nsudo dpkg --configure -a\n```\n\n然后重启系统\n\n### debian缺失公钥\n\n```bash\napt-get install debian-keyring debian-archive-keyring -y\n```\n\n### ubuntu或debian缺失公钥\n\n后续这块有计划整理为一个一键脚本\n\n```bash\nsudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 公钥\n```\n\n### centos换源\n\n```bash\nsudo cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup\nsudo sed -i 's/^mirrorlist=http/mirrorlist=https/' /etc/yum.repos.d/CentOS-Base.repo\n```\n\n### 安装gitea\n\n安装时使用这里的方法：\n\nhttps://gitlab.com/packaging/gitea\n\n但不要设置无人值守自动升级版本，容易升级到一个有BUG的新版本\n\n更改默认配置需要更改文件```/etc/gitea/app.ini```\n\n比如设置文件上传无限制\n\n```\n[repository.upload]\nENABLED = true\nALLOWED_TYPES =\nFILE_MAX_SIZE = 1024\nMAX_FILES = 100\n```\n\n写在```[security]```上面，每个模块```[]```的内容之间间隔一个空行\n\n### 卸载aapanel\n\n```bash\napt install sysv-rc-conf -y \u0026\u0026 service bt stop \u0026\u0026 sysv-rc-conf bt off \u0026\u0026 rm -f /etc/init.d/bt \u0026\u0026 rm -rf /www/server/panel\n```\n\n### 查询是什么东西占用硬盘大于100M\n\n```bash\nfind / -type f -size +100M -exec ls -lh {} \\;\n```\n\n### 卸载dns缓存机制避免配置覆写\n\n```bash\nsystemctl stop systemd-resolved\nsystemctl disable systemd-resolved\n```\n\n### 安装docker和docker-compose\n\n安装24版本的docker\n\n```bash\ncurl -sSL https://get.docker.com/ | sh\n```\n\n或安装最新版本的docker(都选官方源即可)\n\n```\nbash \u003c(curl -sSL https://linuxmirrors.cn/docker.sh)\n```\n\n安装docker-compose最新版本\n\n```\ncurl -L \"https://github.com/docker/compose/releases/latest/download/docker-compose-linux-$(uname -m)\" -o /usr/local/bin/docker-compose\nchmod +x /usr/local/bin/docker-compose\ndocker-compose --version\n```\n\n卸载所有docker镜像和容器\n\n```\ndocker rm -f $(docker ps -aq); docker rmi $(docker images -aq)\n```\n\n删除累积的docker日志\n\n```\ncd /var/lib/docker/containers/ \u0026\u0026 for container_id in */; do container_path=\"/var/lib/docker/containers/${container_id}\"; log_file=\"${container_id%/}-json.log\"; rm -rf \"${container_path}${log_file}\" \u0026\u0026 echo \"已删除 ${container_path}${log_file}\"; done\n```\n\n### 通过docker安装code-server\n\n安装\n\n```shell\nmkdir -p ~/.config\ndocker run --restart=always --name code-server -p 0.0.0.0:8886:8080 \\\n  -v \"$HOME/.config:/home/coder/.config\" \\\n  -v \"$PWD:/home/coder/project\" \\\n  -u \"$(id -u):$(id -g)\" \\\n  -e \"DOCKER_USER=$USER\" \\\n  codercom/code-server:latest\n```\n\n新窗口\n\n```shell\ndocker exec code-server cat /root/.config/code-server/config.yaml\n```\n\n或\n\n```\ncurl -fsSL https://code-server.dev/install.sh | sh -s -- --dry-run\nsudo systemctl enable --now code-server@root\nsed -i '1s/127.0.0.1:8080/0.0.0.0:8536/' ~/.config/code-server/config.yaml\nsudo systemctl restart code-server@root\ncat .config/code-server/config.yaml\n```\n\n卸载需要\n\n```\nsudo systemctl stop code-server@root\nsudo systemctl disable code-server@root\nrm -rf ~/.cache/coder\nsudo apt remove coder -y\n```\n\n## 友链\n\n#### 一键测试服务器的融合怪脚本\n\nhttps://github.com/spiritLHLS/ecs\n\n#### 一键批量开NAT服务器的LXD脚本\n\nhttps://github.com/spiritLHLS/lxd\n\n#### 一键安装PVE和使用PVE批量开设虚拟机的脚本\n\nhttps://github.com/spiritLHLS/pve\n\n#### 朋友fscarmen的常用一键工具仓库\n\nhttps://github.com/fscarmen/tools\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspiritlhls%2Fone-click-installation-script","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspiritlhls%2Fone-click-installation-script","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspiritlhls%2Fone-click-installation-script/lists"}