http://people.debian.org/~mrd/deb-ref/apt-dpkg-ref.html

APT and Dpkg Quick Reference Sheet

Matthew Danish 역) 박똥

Common APT usage 자주 쓰는 사용법

apt-get install <package> Downloads <package> and all of its dependencies, and installs or upgrades them. This will also take a package off of hold if it was put on. See below for more info on hold.

apt-get install <패키지> <패키지>를 다운로드 하는데 의존성관련 패키지 처리해주고난다음 설치하거나 업그레이드 해준다.전에 홀딩한 패키지는 그대로 있으며 아래에 굶은글씨로 표시된다.

apt-get remove [–purge] <package> Removes <package> and any packages that depend on it. –purge specifies that packages should be purged, see dpkg -P for more information.

apt-get remove [–purge] <package> <패키지>와 의존성이 걸리는것들을 지워준다.–purge 는 패키지를 아예 플러그 해버린다. dpkg -P를 보면 좀더 많은 정보가 있으니깐 참고

apt-get update Updates packages listings from Debian mirrors, should be run at least once a day if you install anything that day, and every time after /etc/apt/sources.list is changed.

apt-get update 흐흐 /etc/apt/sources.list에 지정한 데비안 미러로부터 나의 데비안박스의 패키지리스트를 업데이트 한다. 패키지를 인스톨하기 전에 한번 해주면 좋구. 알아서 해라..취향이니깐.

apt-get upgrade [-u] Upgrades all packages installed to newest versions available. Will not install new or remove old packages. If a package changes dependencies and requires installation of a new package, it will not be upgraded, it will be put on hold instead. apt-get upgrade will not upgrade packages put on hold (that is the meaning of hold). See below for how to manually put packages on hold. I suggest the -u' option as well, because then you can see what packages are going to be upgraded. apt-get upgrade [-u] 업그레이드 가능한 모든 패키지를 업그레이드 한다. 새로운것을 인스톨하거나 지우지는 못한다. -_-이놈의 것은 새로운 패키지를 깔을때 다른것에 의존성이 걸리면 업그레이드 하지 않는다. 홀드한것도 업그레이드 하지 않구..-u옵션 주게 되면 업그레이드 패키지가 무엇인지 볼수 잇씀~ apt-get dist-upgrade [-u] Similar to apt-get upgrade, except that dist-upgrade will install or remove packages to satisfy dependencies. apt-get dist-upgrade [-u] apt-get upgrade와 비슷허긴 한데. -_-이건 패키지 충돌나면 처리를 못한다. 안정적인 의존성 관계만 인스톨하거나 지우버린다. apt-cache search <pattern> Searches packages and descriptions for <pattern>. apt-cache search <문자열> <문자열>로 패키지 이름이나 설명을 찾는다. apt-cache show <package> Shows the full description of <package>. apt-cache show <package> <패키지>의 모든 설명을 뿌려준다. apt-cache showpkg <package> Shows a lot more detail about <package>, and its relationships to other packages. apt-cache showpkg <패키지> <패키지>의 더 자세한정보(다른 패키지와 관계)를 보여준다. dselect apt와 dpkg의 프론트 엔드 프로그램! 푠하다..흐흐 console-apt aptitude gnome-apt Graphical front ends to APT (some of these may be in their own package, that must be installed before use). While dselect is arguably the most powerful, it's also the oldest and hardest to use. Common Dpkg usage dpkg -i <package.deb> Installs a Debian package file; one that you downloaded manually, for example. dpkg -i <패키지.deb> 데비안 패키지파일(deb)을 인스톨 해준다. dpkg -c <package.deb> Lists the contents of <package.deb>, a .deb file. dpkg -c <패키지.deb> <패키지.deb>의 내용을 보여준다. dpkg -I <package.deb> Extracts package information from <package.deb>, a .deb file. dpkg -I <패키지.deb> <패키지.deb>를 패키지정보를 풀어 보여준다. dpkg -r <package> Removes an installed package named <package> dpkg -r <패키지> 설치되있던 <패키지>를 지우버린다. dpkg -P <package> Purges an installed package named <package>. The difference between remove and purge is that while remove only deletes data and executables, purge also deletes all configuration files in addition. dpkg -P <패키지> <패키지>를 Purges 한다. 지우는것은 실행가능한 데이터나 파일을 지우는데 반해 purge는 설정파일까지 싸그리 지워버린다. dpkg -L <package> Gives a listing of all the files installed by <package>. See also dpkg -c for checking the contents of a .deb file. dpkg -L <패키지> <패키지>의 설치된 파일을 보여준다. deb 파일의 내용(설치할 화일)을 볼려면 dpkg -c 해보~ dpkg -s <package> Shows information on the installed package <package>. See also apt-cache show for viewing package information in the Debian archive and dpkg -I for viewing package information extracted from a .deb file. 설치된 <패키지>의 정보를 보여준다. apt-cache show 또한 같은 기능이구 dpkg -l 은 <패키지.deb>화일로부터 정보를 보여준다. dpkg-reconfigure <package> Reconfigures an installed package, if it uses debconf (debconf provides that consistent configuration interface for package installation). You can reconfigure debconf itself if you want to change the front-end or priority of questions asked. For example, to reconfigure debconf with the dialog front-end, you simply run: dpkg-reconfigure –frontend=dialog debconf echo <package> hold | dpkg –set-selections Put <package> on hold (command line method)

dpkg –get-selections <package> Get the current status of <package> (command line method) dpkg -S <file> Searches for <file> in package database, telling you which packages have that file in them. Building Debian packages from Source 데비안 패키지 소스로부터 데비안 패키지 만들기 apt-get source [-b] <package> Download the source Debian package for <package> and extract it. You must have deb-src lines in your /etc/apt/sources.list for this to work. If you supply the -b' option and you are currently root, then the package will be automatically built if possible.

apt-get build-dep <package> Download and install the packages necessary to build the source Debian package <package>. This feature is only present in apt version 0.5 and up. Currently this means that woody and above contain this functionality. If you have an older version of apt then the easiest way to find out the build dependencies is to look in the debian/control file in the source package directory. A common usage of this command is in conjunction with apt-get source -b. For example (as root):

apt-get build-dep <package> apt-get source -b <package>

Will download the source package, all of its build dependencies, and attempt to compile the source package.

dpkg-source -x <package.dsc> If you have downloaded the source package for a program manually, which includes several files such as a .orig.tar.gz (or .tar.gz if it is Debian native), a .dsc, and a .diff.gz (if it is not Debian native), then you can unpack the source package using this command on the .dsc file.

dpkg-buildpackage Builds a Debian package from a Debian source tree. You must be in the main directory of the source tree for this to work. Sample usage:

dpkg-buildpackage -rfakeroot -uc -b

Where -rfakeroot' instructs it to use the fakeroot program to simulate root privileges (for ownership purposes), -uc' stands for Don't cryptographically sign the changelog, and -b' stands for Build the binary package only''

debuild A handy wrapper script around dpkg-buildpackage that will automatically take care of using fakeroot or not, as well as running lintian and gpg for you.

Fixing dependencies dpkg –configure –pending If dpkg quits with an error while apt-get install, upgrade, or dist-upgradeing try running this to configure the packages that were already unpacked. Then try apt-get install, upgrade, or dist-upgrade -f, and then try apt-get install, upgrade, or dist-upgrade again. Repeat as needed. This usually resolves most dependency problems (also, if it mentions a specific package for some reason, you might want to try installing or removing that package)

apt-get install -f apt-get upgrade -f apt-get dist-upgrade -f Attempt to fix dependencies while doing one of the above. Note that apt-get install -f does not require a <package> argument.