이것을 작성한 이유는 지금까지 우분투에서 sudo dpkg -l|grep 패키지이름 명령으로 원하는 패키지를 검색했었는데 할 때마다 암호 입력해야하고 이래 저래 불편했었다. 그런데.. apt-cache search 밖에 기능을 몰라 그 기능 외엔 버렸던 apt-cache 에 로컬에 설치된 패키지 이름을 손쉽게 일반 사용자 권한으로 검색 가능한 기능이 이미 있었다..
apt-cache pkgnames 패키지이름 명령이면 관리자 권한도 필요없고 파이프 쓸 필요도 없다...
콘솔에서 아무 옵션 없이 apt-cache를 실행시킨 결과이다.
사용법: apt-cache [옵션] 명령
apt-cache [옵션] add 파일1 [파일2 ...]
apt-cache [옵션] showpkg 패키지1 [패키지2 ...]
apt-cache [옵션] showsrc 패키지1 [패키지2 ...]
apt-cache는 APT의 바이너리 캐시 파일을 처리하고, 캐시 파일에
정보를 질의하는 저수준 도구입니다.
명령:
add - 소스 캐시에 패키지 파일을 추가합니다
gencaches - 패키지 캐시 및 소스 캐시를 만듭니다
showpkg - 한 개의 패키지에 대한 일반적인 정보를 봅니다
showsrc - 소스 기록을 봅니다
stats - 기본적인 통계를 봅니다
dump - 전체 파일을 간략한 형태로 봅니다
dumpavail - 사용 가능한 파일을 표준출력에 표시합니다
unmet - 맞지 않는 의존성을 봅니다
search - 정규식 패턴에 맞는 패키지 목록을 찾습니다
show - 패키지에 대해 읽을 수 있는 기록을 봅니다
showauto - 자동으로 설치한 패키지 목록을 표시합니다
depends - 패키지에 대해 의존성 정보를 그대로 봅니다
rdepends - 패키지의 역 의존성 정보를 봅니다
pkgnames - 시스템에 들어 있는 패키지의 이름을 모두 봅니다
dotty - GraphViz용 패키지 그래프를 만듭니다
xvcg - xvcg용 패키지 그래프를 만듭니다
policy - 정책 설정을 봅니다
옵션:
-h 이 도움말.
-p=? 패키지 캐시.
-s=? 소스 캐시.
-q 상태 표시를 하지 않습니다.
-i unmet 명령에서 중요한 의존성만 봅니다.
-c=? 지정한 설정 파일을 읽습니다.
-o=? 임의의 옵션을 설정합니다. 예를 들어 -o dir::cache=/tmp
좀 더 자세한 정보는 apt-cache(8) 및 apt.conf(5) 매뉴얼 페이지를 보십시오.
다음은 man apt-cache 한 결과 중 옵션에 관한 설명
showsrc pkg(s)
showsrc displays all the source package records that match the
given package names. All versions are shown, as well as all records
that declare the name to be a Binary.
dump
dump shows a short listing of every package in the cache. It is
primarily for debugging.
dumpavail
dumpavail prints out an available list to stdout. This is suitable
for use with dpkg(1) and is used by the dselect(1) method.
unmet
unmet displays a summary of all unmet dependencies in the package
cache.
show pkg(s)
show performs a function similar to dpkg --print-avail; it displays
the package records for the named packages.
search regex [ regex ... ]
search performs a full text search on all available package lists
for the POSIX regex pattern given, see regex(7). It searches the
package names and the descriptions for an occurrence of the regular
e-pression and prints out the package name and the short
description, including virtual package names. If --full is given
then output identical to show is produced for each matched package,
and if --names-only is given then the long description is not
searched, only the package name is.
Separate arguments can be used to specify multiple search patterns
that are and'ed together.
depends pkg(s)
depends shows a listing of each dependency a package has and all
the possible other packages that can fulfill that dependency.
rdepends pkg(s)
rdepends shows a listing of each reverse dependency a package has.
pkgnames [ prefix ]
This command prints the name of each package APT knows. The
optional argument is a prefix match to filter the name list. The
output is suitable for use in a shell tab complete function and the
output is generated extremely quickly. This command is best used
with the --generate option.
Note that a package which APT knows of is not necessarily available
to download, installable or installed, e.g. virtual packages are
also listed in the generated list.
dotty pkg(s)
dotty takes a list of packages on the command line and generates
output suitable for use by dotty from the GraphViz[1] package. The
result will be a set of nodes and edges representing the
relationships between the packages. By default the given packages
will trace out all dependent packages; this can produce a very
large graph. To limit the output to only the packages listed on the
command line, set the APT::Cache::GivenOnly option.
The resulting nodes will have several shapes; normal packages are
boxes, pure provides are triangles, mixed provides are diamonds,
missing packages are hexagons. Orange boxes mean recursion was
stopped [leaf packages], blue lines are pre-depends, green lines
are conflicts.
Caution, dotty cannot graph larger sets of packages.
xvcg pkg(s)
The same as dotty, only for xvcg from the VCG tool[2].
policy [ pkg(s) ]
policy is meant to help debug issues relating to the preferences
file. With no arguments it will print out the priorities of each
source. Otherwise it prints out detailed information about the
priority selection of the named package.
madison /[ pkg(s) ]
apt-cache's madison command attempts to mimic the output format and
a subset of the functionality of the Debian archive management
tool, madison. It displays available versions of a package in a
tabular format. Unlike the original madison, it can only display
information for the architecture for which APT has retrieved
package lists (APT::Architecture).
최근 덧글