From 24c0b8e239bcf8fde5853cbd904150f9099507b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=8B=E5=88=80=E7=8B=90=E7=8B=B8?= Date: Sun, 7 Aug 2022 08:09:18 +0000 Subject: [PATCH] =?UTF-8?q?update=205.PVE=E9=85=8D=E7=BD=AE=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E8=99=9A=E6=8B=9F=E6=9C=BA.md.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 5.PVE配置模板虚拟机.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/5.PVE配置模板虚拟机.md b/5.PVE配置模板虚拟机.md index fa652a8..38e025d 100644 --- a/5.PVE配置模板虚拟机.md +++ b/5.PVE配置模板虚拟机.md @@ -397,4 +397,25 @@ Time to change your default shell to zsh: Do you want to change your default shell to zsh? [Y/n] y ``` +### 1.10.清理系统 +Debian 模板虚拟机已经配置完成,在将其转换为模板前需要对系统进行清理。 + +逐条执行以下命令,注意命令中的空格: + +```bash +## 清理系统软件包 +sudo apt clean && sudo apt autoclean && sudo apt autoremove --purge + +## 清理系统缓存 +sudo rm -rvf /var/cache/apt/* /var/lib/apt/lists/* /tmp/* + +## 清理系统日志 +sudo find /var/log/ -type f |xargs sudo rm -rvf + +## 清理命令历史记录文件 +rm -rvf ~/.bash_history ~/.zsh_history + +## 清理命令历史 +history -c +```