2022-12-19 11:36:53 +08:00
|
|
|
|
# one-click-script
|
2022-12-19 11:35:37 +08:00
|
|
|
|
|
2022-12-19 12:10:06 +08:00
|
|
|
|
如果脚本有任何问题或者任何修复系统的需求,可在issues中提出,有空会解决或者回答
|
2022-12-19 11:35:37 +08:00
|
|
|
|
|
|
|
|
|
## 一键修复脚本
|
2022-12-11 14:47:57 +08:00
|
|
|
|
|
2022-12-18 18:57:06 +08:00
|
|
|
|
运行所有一键修复脚本前注意看说明,以及保证服务器无重要数据,运行后造成的一切后果作者不负任何责任,自行评判风险!
|
|
|
|
|
|
2022-12-18 13:31:24 +08:00
|
|
|
|
#### 一键尝试修复apt源
|
2022-12-17 20:36:44 +08:00
|
|
|
|
|
|
|
|
|
- 支持系统:Ubuntu 12+,Debian 6+
|
2022-12-17 21:23:39 +08:00
|
|
|
|
- 修复apt源broken损坏
|
2022-12-17 20:37:31 +08:00
|
|
|
|
- 修复apt源锁死
|
|
|
|
|
- 修复apt源公钥缺失
|
2022-12-17 21:23:47 +08:00
|
|
|
|
- 修复替换系统可用的apt源列表,国内用阿里源,国外用官方源
|
2022-12-18 12:48:23 +08:00
|
|
|
|
- 修复本机的Ubuntu系统是EOL非长期维护的版本(奇数或陈旧的偶数版本),将替换为Ubuntu官方的old-releases仓库以支持apt的使用
|
2022-12-16 10:47:04 +08:00
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
curl -L https://raw.githubusercontent.com/spiritLHLS/one-click-installation-script/main/package.sh -o package.sh && chmod +x package.sh && bash package.sh
|
|
|
|
|
```
|
|
|
|
|
|
2022-12-18 13:31:24 +08:00
|
|
|
|
#### 一键尝试修复系统时间
|
2022-12-17 20:36:44 +08:00
|
|
|
|
|
|
|
|
|
- 支持系统:Ubuntu 18+,Debian 8+,centos 7+,Fedora,Almalinux 8.5+
|
2022-12-18 12:55:05 +08:00
|
|
|
|
- 检测修复本机系统时间,对应时区时间,如果相差超过300秒的合理范围则校准时间
|
2022-12-17 19:09:49 +08:00
|
|
|
|
|
2022-12-17 23:07:43 +08:00
|
|
|
|
```bash
|
2022-12-17 19:09:49 +08:00
|
|
|
|
curl -L https://raw.githubusercontent.com/spiritLHLS/one-click-installation-script/main/modify_time.sh -o modify_time.sh && chmod +x modify_time.sh && bash modify_time.sh
|
|
|
|
|
```
|
|
|
|
|
|
2022-12-18 13:33:33 +08:00
|
|
|
|
#### 一键尝试修复```sudo: unable to resolve host xxx: Name or service not known```警告(爆错)
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
curl -L https://raw.githubusercontent.com/spiritLHLS/one-click-installation-script/main/check_sudo.sh -o check_sudo.sh && chmod +x check_sudo.sh && bash check_sudo.sh
|
|
|
|
|
```
|
|
|
|
|
|
2022-12-18 13:31:24 +08:00
|
|
|
|
#### 一键修改系统自带的journal日志记录大小释放系统盘空间
|
2022-12-17 23:07:43 +08:00
|
|
|
|
|
|
|
|
|
- 支持系统:Ubuntu 18+,Debian 8+,centos 7+,Fedora,Almalinux 8.5+
|
2022-12-18 11:38:40 +08:00
|
|
|
|
- 1.自定义修改大小,单位为MB,一般500或者1000即可,有的系统日志默认给了5000甚至更多,不是做站啥的没必要
|
2022-12-19 11:25:21 +08:00
|
|
|
|
- 请注意,修改journal目录大小会影响系统日志的记录,因此,在修改journal目录大小之前如果需要之前的日志,建议先备份系统日志到本地
|
2022-12-18 12:02:12 +08:00
|
|
|
|
- 2.自定义修改设置系统日志保留日期时长,超过日期时长的日志将被清除
|
|
|
|
|
- 3.默认修改日志只记录warning等级(无法自定义)
|
2022-12-18 11:38:40 +08:00
|
|
|
|
- 4.以后日志的产生将受到日志文件大小,日志保留时间,日志保留等级的限制
|
2022-12-17 23:07:43 +08:00
|
|
|
|
|
2022-12-18 13:30:32 +08:00
|
|
|
|
```bash
|
2022-12-17 23:07:43 +08:00
|
|
|
|
curl -L https://raw.githubusercontent.com/spiritLHLS/one-click-installation-script/main/resize_journal.sh -o resize_journal.sh && chmod +x resize_journal.sh && bash resize_journal.sh
|
|
|
|
|
```
|
|
|
|
|
|
2022-12-19 11:29:01 +08:00
|
|
|
|
#### 一键尝试修复网络
|
|
|
|
|
|
|
|
|
|
**该脚本轻易勿要使用,请确保运行时服务器无重要文件或程序,出现运行bug后续可能需要重装系统**
|
2022-12-19 11:29:22 +08:00
|
|
|
|
|
2022-12-19 11:29:01 +08:00
|
|
|
|
**一定要在screen中执行该脚本,否则可能导致修改过程中ssh断链接而修改失败卡住最终SSH无法连接!不在screen中执行后果自负!**
|
|
|
|
|
- 支持系统:Ubuntu 18+,Debian 8+,centos 7+,Fedora,Almalinux 8.5+
|
|
|
|
|
- 尝试修复nameserver为google源或cloudflare源
|
|
|
|
|
- 尝试修复为IP类型对应的网络优先级(默认IPV4类型,纯V6类型再替换为IPV6类型)
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
curl -L https://cdn.spiritlhl.workers.dev/https://raw.githubusercontent.com/spiritLHLS/one-click-installation-script/main/network.sh -o network.sh && chmod +x network.sh && bash network.sh
|
|
|
|
|
```
|
|
|
|
|
|
2022-12-19 11:35:37 +08:00
|
|
|
|
## 一键环境安装脚本
|
2022-12-17 21:23:39 +08:00
|
|
|
|
|
2022-12-19 12:25:22 +08:00
|
|
|
|
只推荐在新服务器上安装,环境不纯净不保证不出bug
|
|
|
|
|
|
2022-12-18 20:02:11 +08:00
|
|
|
|
#### 一键安装jupyter环境
|
|
|
|
|
|
2022-12-19 11:35:37 +08:00
|
|
|
|
- **本脚本尝试使用Miniconda3安装虚拟环境jupyter-env再进行jupyter和jupyterlab的安装,如若安装机器不纯净勿要轻易使用本脚本!**
|
2022-12-19 11:26:32 +08:00
|
|
|
|
- **本脚本为实验性脚本可能会有各种bug,勿要轻易尝试!**
|
|
|
|
|
- **安装前需要保证 sudo wget curl 已安装**
|
2022-12-19 11:25:21 +08:00
|
|
|
|
- 验证已支持的系统:
|
|
|
|
|
- Ubuntu 18/20/22 - 推荐,脚本自动挂起到后台
|
|
|
|
|
- Debian 9/10/11 - 还行,需要手动挂起到后台,详看脚本运行安装完毕的后续提示
|
2022-12-19 11:26:49 +08:00
|
|
|
|
- 可能支持的系统(未验证):centos 7+,Fedora,Almalinux 8.5+
|
2022-12-19 11:26:32 +08:00
|
|
|
|
- 执行脚本,之前有用本脚本安装过则直接打印设置的登陆信息,没安装过则进行安装再打印信息
|
|
|
|
|
- 如果是初次安装无脑输入y回车即可,按照提示进行操作即可,安装完毕将在后台常驻运行
|
2022-12-19 18:06:08 +08:00
|
|
|
|
- 安装完毕后,如果需要在lab中安装第三方库需要使用conda进行下载而不是pip下载,这是需要注意的
|
2022-12-19 10:29:28 +08:00
|
|
|
|
|
2022-12-18 20:02:11 +08:00
|
|
|
|
```bash
|
|
|
|
|
curl -L https://raw.githubusercontent.com/spiritLHLS/one-click-installation-script/main/jupyter.sh -o jupyter.sh && chmod +x jupyter.sh && bash jupyter.sh
|
|
|
|
|
```
|
|
|
|
|
|
2022-12-18 13:31:24 +08:00
|
|
|
|
#### 一键安装rust环境
|
2022-12-17 21:23:39 +08:00
|
|
|
|
|
|
|
|
|
- 支持系统:Ubuntu 18+,Debian 8+,centos 7+,Fedora,Almalinux 8.5+
|
2022-12-18 20:02:11 +08:00
|
|
|
|
- 加载官方脚本安装,前置条件适配系统以及后置条件判断安装的版本
|
2022-12-17 21:23:39 +08:00
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
curl -L https://raw.githubusercontent.com/spiritLHLS/one-click-installation-script/main/rust.sh -o rust.sh && chmod +x rust.sh && bash rust.sh
|
|
|
|
|
```
|
|
|
|
|
|
2022-12-19 11:40:05 +08:00
|
|
|
|
## 部分手动命令
|
2022-12-16 10:47:04 +08:00
|
|
|
|
|
2022-12-11 14:47:57 +08:00
|
|
|
|
ubuntu缺失公钥
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 公钥
|
|
|
|
|
```
|
2022-12-15 21:27:52 +08:00
|
|
|
|
|
2022-12-15 22:23:20 +08:00
|
|
|
|
ubuntu更新源被锁
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
sudo rm -rf /var/cache/apt/archives/lock
|
|
|
|
|
```
|
|
|
|
|
|
2022-12-19 11:40:05 +08:00
|
|
|
|
或查看下文
|
2022-12-15 22:23:20 +08:00
|
|
|
|
|
|
|
|
|
https://itsfoss.com/fix-ubuntu-install-error/
|
|
|
|
|
|
2022-12-15 21:27:52 +08:00
|
|
|
|
debian缺失公钥
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
apt-get install debian-keyring debian-archive-keyring
|
|
|
|
|
```
|
2022-12-16 10:52:23 +08:00
|
|
|
|
|
|
|
|
|
centos换源
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
sudo cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
|
|
|
|
|
sudo sed -i 's/^mirrorlist=http/mirrorlist=https/' /etc/yum.repos.d/CentOS-Base.repo
|
|
|
|
|
```
|
2022-12-19 17:54:04 +08:00
|
|
|
|
|
2022-12-19 17:58:16 +08:00
|
|
|
|
## 友链
|
|
|
|
|
|
|
|
|
|
#### 一键测试服务器的融合怪脚本
|
|
|
|
|
|
|
|
|
|
https://github.com/spiritLHLS/ecs
|
|
|
|
|
|
|
|
|
|
#### 一键批量开NAT服务器(LXC)
|
|
|
|
|
|
|
|
|
|
https://github.com/spiritLHLS/lxc
|
|
|
|
|
|
2022-12-19 17:59:11 +08:00
|
|
|
|
#### 朋友 fscarmen 的常用一键工具仓库
|
2022-12-19 17:54:04 +08:00
|
|
|
|
|
|
|
|
|
https://github.com/fscarmen/tools
|