[Environment configuration] WSL under Windows will move ubuntu - system disk cleaning

Problem – Too much junk, too much space on the system disk

Recently, the space on the C drive has skyrocketed. Using tools WinDirStat- highly recommended tools, I found that WSLthe subsystem occupies more than 6 G of space, so I tried to move it;
[Keywords] WindowsMove the subsystem in to a non-system disk D;

insert image description here

solve

  1. Open the WSL console
wsl -l -v # 查看当前子系统
PS D:\> wsl -l  -v
  NAME            STATE           VERSION
* Ubuntu-22.04    Stopped         2
  1. export
wsl --export Ubuntu-22.04 d:\ubuntu2204.tar
正在导出,这可能需要几分钟时间。
操作成功完成。
  1. log out
PS D:\> wsl --unregister Ubuntu-22.04
正在注销。
操作成功完成。
  1. reimport
PS D:\> wsl --import Ubuntu-22.04 d:\Ubuntu-22.04 d:\ubuntu2204.tar --version 2
正在导入,这可能需要几分钟时间。
操作成功完成。

Supplementary cleaning of other garbage

Clean up WPS junk

The path is:C:\Users\xxx\AppData\Roaming\kingsoft\wps\addons\pool\win-i386

Open the folder layer by layer according to the above path, win-i386the content in the folder is useless garbage, you can clear them all, alt+aselect all, right click [Delete]

temp trash

win+R key, enter in the command box %temp%, the opened folder contains system cache files, alt+aselect all, and right click to delete.

Change the path of Android AVD

AVDThe default path for is still on Cdisk and GBis growing in increments.

insert image description here

  • Create a new environment variable

insert image description here

Open it Android Studio, D:\Android\Android_AVDthere will be an extra .androidfolder under the path, copy and overwrite the .android folder corresponding to the path under the C drive;

  • Change setting

In the corresponding AVDas follows:D:\Android\Android_AVD\.android\avd\Pixel_4_API_30.avd

Find the configuration file hardware-qemu.ini, ctrl + Hfind the corresponding old path and change it to the new path.

insert image description here

Tool recommendation

Dism++, perhaps the most powerful utility tool , can usually kill several gigabytes of garbage at once.

Quickly locate files and folders based on name under Everything Windows

【reference】

The computer C disk is full, quickly clear the C disk garbage in 10 seconds
and change the default path of AVD in Android Studio

Guess you like

Origin blog.csdn.net/zhoujinwang/article/details/132000840