# 清理 Ubuntu 上的 cache 和 垃圾文件 ## 清除 apt 儲存下載的套件快取 1. 檢查快取大小 ```bash sudo du -sh /var/cache/apt/archives ``` 2. 清理以下載但不再需要的套件 ```bash sudo apt-get clean ``` 3. 清理部分快取 ```bash sudo apt-get autoclean ``` ## 清理 user 應用程式快取 1. 查看 快取 大小 ```bash du -sh ~/.cache ``` 2. 安全刪除快取 ```bash rm -rf ~/.cache/* ``` ## 清理 `/tmp` 1. 清理 `/tmp` ```bash ls /tmp ``` 2. 手動刪除 `/tmp` 內容 ```bash sudo rm -rf /tmp/* ``` ## 清理 `/var/tmp` 1. 查看 ```bash ls /var/tmp ``` 2. 清理 ```bash sudo rm -rf /var/tmp/* ``` ## Reference - [資訊詞彙翻譯](https://hackmd.io/@sysprog/it-vocabulary) - [如何在Ubuntu上清理缓存和垃圾文件](https://blog.csdn.net/m0_52537869/article/details/134705999)
×
Sign in
Email
Password
Forgot password
or
Sign in via Google
Sign in via Facebook
Sign in via X(Twitter)
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
Continue with a different method
New to HackMD?
Sign up
By signing in, you agree to our
terms of service
.