zl程序教程

您现在的位置是:首页 >  其他

当前栏目

【教程】Ubuntu清理系统垃圾

2023-03-07 09:06:52 时间

简单记录一下,方便以后要用了直接复制。

内置命令行方式

sudo apt upgrade -y

sudo du  –h  /var/cache/apt/archives

sudo apt-get clean -y
sudo apt-get clean -y
sudo apt-get autoremove -y
sudo apt-get autoremove --purge -y

 
#Removes old revisions of snaps  
#CLOSE ALL SNAPS BEFORE RUNNING THIS  
set -eu  
LANG=en_US.UTF-8 
snap list --all | awk '/disabled/{print $1, $3}' |
      while read snapname revision; do
          snap remove "$snapname" --revision="$revision"
      done

第三方软件方式

(为了清理空间,装了个100+MB的软件,哈哈哈。。。)

这个需要UI界面支持,如果是服务器没有屏幕的,可以考虑用VNC或者X Server;

sudo apt install sweeper

sweeper