Eclean/ko
eclean 은 포티지 소스 파일과 바이너리 꾸러미를 제거하는 도구입니다. app-portage/gentoolkit 꾸러미의 일부이며, Portage-Tools 프로젝트 에서 관리합니다.
Also available on Gentoo is the eclean-kernel tool, available separately from the eclean tools installed with gentoolkit, in the app-admin/eclean-kernel package. eclean-kernel is used to automate the clean up of old Linux kernels.
설치
Emerge
eclean 을 설치하십시오:
root
#
emerge --ask app-portage/gentoolkit
사용법
기본적으로 소스 파일은
/usr/portage/distfiles
디렉터리에 있으며, 바이너리 꾸러미는
/usr/portage/packages
디렉터리에 있습니다. 각 용도의 위치는
/etc/portage/make.conf
에 있는
DISTDIR
과
PKGDIR
변수 값으로 각각 바꿀 수 있습니다. 두 위치는 주기적으로 비우지 않으면 좀 커질 수 있습니다. 이러한 점이
eclean
을 만든 이유입니다.
전체 옵션 목록
전체 동작 요약, 옵션 목록, 사용 방법 일체를 보려면 eclean --help 명령을 활용하십시오.
user
$
eclean --help
Usage: eclean [global-option] ... <action> [action-option] ... eclean-dist [global-option, distfiles-option] ... eclean-pkg [global-option, packages-option] ... eclean(-dist,-pkg) [--help, --version] Available global options: -C, --nocolor - turn off colors on output -d, --deep - only keep the minimum for a reinstallation -e, --exclude-file=<path> - path to the exclusion file -i, --interactive - ask confirmation before deletions -n, --package-names - protect all versions (when --deep -p, --pretend - only display what would be cleaned -q, --quiet - be as quiet as possible -t, --time-limit=<time> - don't delete files modified since <time> <time> is a duration: "1y" is "one year", "2w" is "two weeks", etc. Units are: y (years), m (months), w (weeks), d (days) and h (hours). -h, --help - display the help screen -V, --version - display version info Available actions: packages - clean outdated binary packages from PKGDIR distfiles - clean outdated packages sources files from DISTDIR Available options for the packages action: NONE :) Available options for the distfiles action: -f, --fetch-restricted - protect fetch-restricted files (when --deep) -s, --size-limit=<size> - don't delete distfiles bigger than <size> <size> is a size specification: "10M" is "ten megabytes", "200K" is "two hundreds kilobytes", etc. Units are: G, M, K and B. More detailed instruction can be found in `man eclean`
= distfiles 소거
distfiles
인자를 전달하여 소스 파일 디렉터리를 지우십시오:
root
#
eclean distfiles
또는 단축 옵션을 실행하시면 됩니다:
root
#
eclean-dist
If
distfiles
takes up too much space, perform a deep clean:
root
#
eclean -d distfiles
꾸러미 지우기
바이너리 꾸러미가 있는 디렉터리라면 대신 다음 명령을 사용하십시오:
root
#
eclean packages
또는 단축 옵션을 실행하시면 됩니다:
root
#
eclean-pkg
Options
기본적으로, 소스 파일과 바이너리 꾸러미는 삭제하지 않을 현재 포티지 트리의 ebuild에 해당합니다. 이 대로라면 시스템 관리자는 쉽게 꾸러미를 다운그레이드하거나 이전에 제거한 꾸러미를 설치하고, 제공한 꾸러미는 현재 포티지 트리에 남습니다.
예제에서와 같이, foo-1.0 와 foo-1.1 꾸러미가 포티지 트리에 있다고 가정합니다. foo-1.0 에서 foo-1.1로 업데이트하고 나면 eclean distfiles 을 실행하십시오. 두 버전의 소스 파일을 유지하므로 foo-1.1에 문제가 있다면, 사용자가 어떤 파일이든 다운로드하지 않아도 foo-1.0를 쉽게 다시 설치할 수 있습니다.
다른 가능한 경우는 앞서 제거한 꾸러미를 설치하는 경우입니다. foo(임의 버전) 꾸러미를 시스템에 설치했다고 치겠습니다. (우연히) 이 꾸러미를 삭제하고 eclean distfiles 를 실행한 후라면, foo 소스 파일을 유지하므로 어떤 파일도 다운로드하지 않고 다시 설치할 수 있습니다.
동일한 예제 또한 바이너리 꾸러미에 적용해보십시오.
디스크 공간을 더 아끼려면,
--destructive
옵션을 추가하십시오:
현재 설치한
꾸러미의 버전과 관련 없는 모든 소스 파일 또는 바이너리 꾸러미를 삭제합니다. 이 경우, 꾸러미를 다운그레이드해야 하거나 이전에 제거한 꾸러미를 다시 설치하는 경우는 사용자가 막지 못함을 참고하십시오.
대안책으로
--destructive
와
--package-names
옵션을 사용하십시오: 현재 설치한 꾸러미와 관련 없는 모든 소스 파일 또는 바이너리 꾸러미(버전은 상관 없음)를 삭제합니다. 이전에 제거한 필요한 꾸러미를 다시 설치하는 경우는 막지 못하지만 나중에 꾸러미를 다운그레이드할 필요가 있을 때 소스를 보호합니다.
자세한 내용은 eclean(1) 맨 페이지를 살펴보십시오:
user
$
man 1 eclean
Troubleshooting
Cleaning leaves some distfiles
Problem: when trying to clean distfiles, some distfiles are not removed and the message " The following unavailable installed packages were found " is displayed. For example:
root
#
eclean --deep distfiles
* Building file list for distfiles cleaning...
* Your distfiles directory was already clean.
The following unavailable installed packages were found
sys-kernel/gentoo-sources-4.19.44
sys-kernel/gentoo-sources-4.19.45
sys-kernel/gentoo-sources-4.19.46
This situation occurs when a package's ebuild has been removed from the Gentoo ebuild repository and the package is currently installed on the system. Generally if the listed packages/distfiles are no longer needed; the reason they are not being removed is because they are listed in Portage's world file .
The solution is to to remove the packages from the world file, or remove the specific package atom(s) via:
root
#
emerge --ask --depclean =sys-kernel/gentoo-sources-4.19.44
Then re-run eclean again in order to remove the distfiles.