메뉴 건너뛰기

XEDITION

Linux

[LINUX/Ubuntu] dpkg 명령어

김병수 2019.10.03 18:27 조회 수 : 9

dpkg 명령어 사용

 

dpkg is a tool to install, build, remove and manage Debian packages.

 

[방법]

# dpkg -L mariadb-server-10.1

 

 

[결과]

mariadb-server-10.1 패키지가 설치된 위치 및 파일들을 보여준다.

 

 

[예제]

root@openbase:~# dpkg -L mariadb-server-10.1
/.
/usr
/usr/lib
/usr/lib/mysql
/usr/lib/mysql/plugin
/usr/lib/mysql/plugin/auth_pam.so
/usr/lib/mysql/plugin/query_response_time.so
/usr/lib/mysql/plugin/semisync_slave.so
/usr/lib/mysql/plugin/ha_tokudb.so
/usr/lib/mysql/plugin/ha_cassandra.so
/usr/lib/mysql/plugin/auth_socket.so
/usr/lib/mysql/plugin/simple_password_check.so
/usr/lib/mysql/plugin/query_cache_info.so
/usr/lib/mysql/plugin/wsrep_info.so
/usr/lib/mysql/plugin/semisync_master.so
/usr/lib/mysql/plugin/ha_federatedx.so
/usr/lib/mysql/plugin/metadata_lock_info.so
/usr/lib/mysql/plugin/ha_archive.so
/usr/lib/mysql/plugin/ha_sphinx.so
/usr/lib/mysql/plugin/handlersocket.so
/usr/lib/mysql/plugin/ha_mroonga.so
/usr/lib/mysql/plugin/file_key_management.so
/usr/lib/mysql/plugin/ha_innodb.so
/usr/lib/mysql/plugin/server_audit.so
/usr/lib/mysql/plugin/locales.so
/usr/lib/mysql/plugin/ha_federated.so
/usr/lib/mysql/plugin/ha_spider.so
/usr/lib/mysql/plugin/sql_errlog.so
/usr/lib/mysql/plugin/ha_blackhole.so
/usr/sbin
/usr/share
/usr/share/apport
/usr/share/apport/package-hooks
/usr/share/apport/package-hooks/source_mariadb-10.1.py
/usr/share/doc
/usr/share/doc/mariadb-server-10.1
/usr/share/doc/mariadb-server-10.1/README.Debian.gz
/usr/share/doc/mariadb-server-10.1/INFO_BIN
/usr/share/doc/mariadb-server-10.1/copyright
/usr/share/doc/mariadb-server-10.1/changelog.Debian.gz
/usr/share/doc/mariadb-server-10.1/INFO_SRC
/usr/share/doc/mariadb-server-10.1/mysqld.sym.gz
/usr/share/mysql
/usr/share/mysql/install_spider.sql
/usr/share/mysql/echo_stderr
/usr/share/mysql/mroonga
/usr/share/mysql/mroonga/uninstall.sql
/usr/share/mysql/mroonga/install.sql
/usr/share/mysql/debian-start.inc.sh
/usr/share/mysql/mysql_system_tables.sql
/usr/share/mysql/fill_help_tables.sql
/usr/share/mysql/errmsg-utf8.txt
/usr/share/mysql/maria_add_gis_sp_bootstrap.sql
/usr/share/mysql/mysql_test_data_timezone.sql
/usr/share/mysql/mysql_system_tables_data.sql
/usr/share/mysql/wsrep_notify
/usr/share/mysql/mysql_performance_tables.sql
/usr/share/man
/usr/share/man/man8
/usr/share/man/man1
/usr/share/man/man1/mysqlhotcopy.1.gz
/usr/share/man/man1/mysqld_safe.1.gz
/usr/share/man/man1/mysql_convert_table_format.1.gz
/usr/share/man/man1/perror.1.gz
/usr/share/man/man1/mysql_setpermission.1.gz
/usr/share/man/man1/myisamlog.1.gz
/usr/share/man/man1/msql2mysql.1.gz
/usr/share/man/man1/mysql_zap.1.gz
/usr/share/man/man1/mysql_upgrade.1.gz
/usr/share/man/man1/mysql_install_db.1.gz
/usr/share/man/man1/my_print_defaults.1.gz
/usr/share/man/man1/myisampack.1.gz
/usr/share/man/man1/innochecksum.1.gz
/usr/share/man/man1/replace.1.gz
/usr/share/man/man1/resolve_stack_dump.1.gz
/usr/share/man/man1/resolveip.1.gz
/usr/share/man/man1/mysql_secure_installation.1.gz
/usr/share/man/man1/mysqld_multi.1.gz
/usr/share/man/man1/mysqlbinlog.1.gz
/usr/share/man/man1/myisam_ftdump.1.gz
/usr/share/man/man1/myisamchk.1.gz
/usr/share/man/man1/mysql_tzinfo_to_sql.1.gz
/usr/bin
/usr/bin/wsrep_sst_mysqldump
/usr/bin/mysql_setpermission
/usr/bin/mysql_tzinfo_to_sql
/usr/bin/aria_pack
/usr/bin/wsrep_sst_common
/usr/bin/myisam_ftdump
/usr/bin/mysql_upgrade
/usr/bin/tokuftdump
/usr/bin/myisamlog
/usr/bin/replace
/usr/bin/mysqld_safe
/usr/bin/msql2mysql
/usr/bin/myisampack
/usr/bin/mysql_secure_installation
/usr/bin/mysql_zap
/usr/bin/wsrep_sst_xtrabackup-v2
/usr/bin/aria_chk
/usr/bin/mysql_install_db
/usr/bin/mysqld_multi
/usr/bin/aria_ftdump
/usr/bin/aria_read_log
/usr/bin/wsrep_sst_xtrabackup
/usr/bin/mysqlbinlog
/usr/bin/aria_dump_log
/usr/bin/my_print_defaults
/usr/bin/resolve_stack_dump
/usr/bin/myisamchk
/usr/bin/wsrep_sst_rsync
/usr/bin/perror
/usr/bin/mysql_plugin
/usr/bin/mysql_convert_table_format
/usr/bin/mysqlhotcopy
/usr/bin/resolveip
/var
/var/lib
/var/lib/mysql-upgrade
/var/run
/var/run/mysqld
/etc
/etc/apparmor.d
/etc/apparmor.d/usr.sbin.mysqld
/etc/init.d
/etc/init.d/mysql
/etc/logrotate.d
/etc/logrotate.d/mysql-server
/etc/logcheck
/etc/logcheck/ignore.d.paranoid
/etc/logcheck/ignore.d.paranoid/mariadb-server-10_1
/etc/logcheck/ignore.d.workstation
/etc/logcheck/ignore.d.workstation/mariadb-server-10_1
/etc/logcheck/ignore.d.server
/etc/logcheck/ignore.d.server/mariadb-server-10_1
/etc/mysql
/etc/mysql/debian-start
/etc/mysql/conf.d
/etc/mysql/conf.d/tokudb.cnf
/etc/mysql/conf.d/mysqld_safe_syslog.cnf

 

[EXAMPLES]

       To list installed packages related to the editor vi(1) (note that dpkg-query does not load the available  file  anymore  by  default,  and  the  dpkg-query
       --load-avail option should be used instead for that):
            dpkg -l '*vi*'

       To see the entries in /var/lib/dpkg/available of two packages:
            dpkg --print-avail elvis vim | less

       To search the listing of packages yourself:
            less /var/lib/dpkg/available

       To remove an installed elvis package:
            dpkg -r elvis

       To install a package, you first need to find it in an archive or CDROM. The available file shows that the vim package is in section "editors":
            cd /media/cdrom/pool/main/v/vim
            dpkg -i vim_4.5-3.deb

       To make a local copy of the package selection states:
            dpkg --get-selections >myselections

       You  might  transfer  this  file  to  another computer, and after having updated the available file there with your package manager frontend of choice (see
       https://wiki.debian.org/Teams/Dpkg/FAQ for more details), for example:
            avail=`mktemp`
            apt-cache dumpavail >"$avail"
            dpkg --merge-avail "$avail"
            rm "$avail"
       you can install it with:
            dpkg --clear-selections
            dpkg --set-selections <myselections

       Note that this will not actually install or remove anything, but just set the selection state on the requested packages. You will need some other  applica[m
       tion to actually download and install the requested packages. For example, run apt-get dselect-upgrade.

       Ordinarily, you will find that dselect(1) provides a more convenient way to modify the package selection states.

위로