Table des matières
Dernière mise-à-jour : 2023/06/08 11:54
LDF202 - Gestion des Paquets
Contenu du Module
- LRF202 - Gestion des Paquets
- Contenu du Module
- LAB #1 - Compiler à partir des sources
- ./configure
- make
- make check
- make install
- La Commande dpkg
- Configuration
- Utilisation
- La Commande dselect
- La Commande apt-get
- Configuration
- Dépôts
- Utilisation
- LAB #1 - Utiliser la commande apt-get
- LAB #2 - Utiliser la commande apt-cache
- Les Bibliothèques Partagées
- Présentation
- Introduction
- Stockage
- ld-linux.so.2
- La Commande ldd
- Le fichier /etc/ld.so.conf
- La Commande ldconfig
Compiler à partir des sources
Historiquement il était nécessaire d'installer un logiciel à partir de ses fichiers sources.
Pour commencer, installez les outils dont vous aurez besoin :
root@debian9:~# apt-get install gcc Lecture des listes de paquets... Fait Construction de l'arbre des dépendances Lecture des informations d'état... Fait The following additional packages will be installed: binutils gcc-6 libasan3 libatomic1 libc-dev-bin libc6-dev libcc1-0 libcilkrts5 libgcc-6-dev libitm1 liblsan0 libmpx2 libtsan0 libubsan0 linux-libc-dev manpages-dev Paquets suggérés : binutils-doc gcc-multilib make autoconf automake libtool flex bison gdb gcc-doc gcc-6-multilib gcc-6-doc gcc-6-locales libgcc1-dbg libgomp1-dbg libitm1-dbg libatomic1-dbg libasan3-dbg liblsan0-dbg libtsan0-dbg libubsan0-dbg libcilkrts5-dbg libmpx2-dbg libquadmath0-dbg glibc-doc Les NOUVEAUX paquets suivants seront installés : binutils gcc gcc-6 libasan3 libatomic1 libc-dev-bin libc6-dev libcc1-0 libcilkrts5 libgcc-6-dev libitm1 liblsan0 libmpx2 libtsan0 libubsan0 linux-libc-dev manpages-dev 0 mis à jour, 17 nouvellement installés, 0 à enlever et 0 non mis à jour. Il est nécessaire de prendre 20,0 Mo dans les archives. Après cette opération, 90,9 Mo d'espace disque supplémentaires seront utilisés. Souhaitez-vous continuer ? [O/n]
Pour comprendre ce qui est la compilation d'un logiciel, commencez par télécharger le logiciel hello :
root@debian9:~# wget --no-check-certificate https://ftp.gnu.org/gnu/hello/hello-2.1.1.tar.gz --2019-03-25 17:07:33-- https://ftp.gnu.org/gnu/hello/hello-2.1.1.tar.gz Résolution de ftp.gnu.org (ftp.gnu.org)… 209.51.188.20, 2001:470:142:3::b Connexion à ftp.gnu.org (ftp.gnu.org)|209.51.188.20|:443… connecté. Avertissement : le certificat de « ftp.gnu.org » n'est pas de confiance. Avertissement : le certificat de « ftp.gnu.org » n'est pas encore activé. Le certificat n'est pas encore activé requête HTTP transmise, en attente de la réponse… 200 OK Taille : 389363 (380K) [application/x-gzip] Sauvegarde en : « hello-2.1.1.tar.gz » hello-2.1.1.tar.gz 100%[=====================================================================================>] 380,24K 825KB/s in 0,5s 2019-03-25 17:07:35 (825 KB/s) — « hello-2.1.1.tar.gz » sauvegardé [389363/389363]
Ensuite désarchivez le logiciel :
root@debian9:~# tar xvf hello-2.1.1.tar.gz hello-2.1.1/ hello-2.1.1/intl/ hello-2.1.1/intl/ChangeLog hello-2.1.1/intl/Makefile.in hello-2.1.1/intl/config.charset hello-2.1.1/intl/locale.alias hello-2.1.1/intl/ref-add.sin hello-2.1.1/intl/ref-del.sin hello-2.1.1/intl/gmo.h hello-2.1.1/intl/gettextP.h hello-2.1.1/intl/hash-string.h hello-2.1.1/intl/plural-exp.h hello-2.1.1/intl/eval-plural.h hello-2.1.1/intl/os2compat.h hello-2.1.1/intl/libgnuintl.h hello-2.1.1/intl/loadinfo.h hello-2.1.1/intl/bindtextdom.c hello-2.1.1/intl/dcgettext.c hello-2.1.1/intl/dgettext.c hello-2.1.1/intl/gettext.c hello-2.1.1/intl/finddomain.c hello-2.1.1/intl/loadmsgcat.c hello-2.1.1/intl/localealias.c hello-2.1.1/intl/textdomain.c hello-2.1.1/intl/l10nflist.c hello-2.1.1/intl/explodename.c hello-2.1.1/intl/dcigettext.c hello-2.1.1/intl/dcngettext.c hello-2.1.1/intl/dngettext.c hello-2.1.1/intl/ngettext.c hello-2.1.1/intl/plural.y hello-2.1.1/intl/plural-exp.c hello-2.1.1/intl/localcharset.c hello-2.1.1/intl/localename.c hello-2.1.1/intl/osdep.c hello-2.1.1/intl/os2compat.c hello-2.1.1/intl/intl-compat.c hello-2.1.1/intl/plural.c hello-2.1.1/intl/VERSION hello-2.1.1/po/ hello-2.1.1/po/Makefile.in.in hello-2.1.1/po/Makevars hello-2.1.1/po/remove-potcdate.sin hello-2.1.1/po/quot.sed hello-2.1.1/po/boldquot.sed hello-2.1.1/po/en@quot.header hello-2.1.1/po/en@boldquot.header hello-2.1.1/po/insert-header.sin hello-2.1.1/po/Rules-quot hello-2.1.1/po/POTFILES.in hello-2.1.1/po/hello.pot hello-2.1.1/po/ca.po hello-2.1.1/po/da.po hello-2.1.1/po/de.po hello-2.1.1/po/de_DE.po hello-2.1.1/po/el.po hello-2.1.1/po/eo.po hello-2.1.1/po/es.po hello-2.1.1/po/et.po hello-2.1.1/po/fi.po hello-2.1.1/po/fr.po hello-2.1.1/po/gl.po hello-2.1.1/po/he.po hello-2.1.1/po/hr.po hello-2.1.1/po/hu.po hello-2.1.1/po/id.po hello-2.1.1/po/it.po hello-2.1.1/po/ja.po hello-2.1.1/po/ko.po hello-2.1.1/po/lv.po hello-2.1.1/po/nb.po hello-2.1.1/po/nl.po hello-2.1.1/po/nn.po hello-2.1.1/po/pl.po hello-2.1.1/po/pt.po hello-2.1.1/po/pt_BR.po hello-2.1.1/po/ru.po hello-2.1.1/po/sk.po hello-2.1.1/po/sl.po hello-2.1.1/po/sv.po hello-2.1.1/po/tr.po hello-2.1.1/po/uk.po hello-2.1.1/po/ca.gmo hello-2.1.1/po/da.gmo hello-2.1.1/po/de.gmo hello-2.1.1/po/de_DE.gmo hello-2.1.1/po/el.gmo hello-2.1.1/po/eo.gmo hello-2.1.1/po/es.gmo hello-2.1.1/po/et.gmo hello-2.1.1/po/fi.gmo hello-2.1.1/po/fr.gmo hello-2.1.1/po/gl.gmo hello-2.1.1/po/he.gmo hello-2.1.1/po/hr.gmo hello-2.1.1/po/hu.gmo hello-2.1.1/po/id.gmo hello-2.1.1/po/it.gmo hello-2.1.1/po/ja.gmo hello-2.1.1/po/ko.gmo hello-2.1.1/po/lv.gmo hello-2.1.1/po/nb.gmo hello-2.1.1/po/nl.gmo hello-2.1.1/po/nn.gmo hello-2.1.1/po/pl.gmo hello-2.1.1/po/pt.gmo hello-2.1.1/po/pt_BR.gmo hello-2.1.1/po/ru.gmo hello-2.1.1/po/sk.gmo hello-2.1.1/po/sl.gmo hello-2.1.1/po/sv.gmo hello-2.1.1/po/tr.gmo hello-2.1.1/po/uk.gmo hello-2.1.1/po/ChangeLog hello-2.1.1/po/LINGUAS hello-2.1.1/README hello-2.1.1/ABOUT-NLS hello-2.1.1/AUTHORS hello-2.1.1/COPYING hello-2.1.1/ChangeLog hello-2.1.1/INSTALL hello-2.1.1/Makefile.am hello-2.1.1/Makefile.in hello-2.1.1/NEWS hello-2.1.1/THANKS hello-2.1.1/TODO hello-2.1.1/aclocal.m4 hello-2.1.1/config.guess hello-2.1.1/config.h.in hello-2.1.1/config.rpath hello-2.1.1/config.sub hello-2.1.1/configure hello-2.1.1/configure.ac hello-2.1.1/depcomp hello-2.1.1/install-sh hello-2.1.1/missing hello-2.1.1/mkinstalldirs hello-2.1.1/BUGS hello-2.1.1/ChangeLog.O hello-2.1.1/contrib/ hello-2.1.1/contrib/ChangeLog hello-2.1.1/contrib/Makefile.am hello-2.1.1/contrib/Makefile.in hello-2.1.1/contrib/de_franconian_po.txt hello-2.1.1/contrib/evolution.txt hello-2.1.1/contrib/hello.1 hello-2.1.1/doc/ hello-2.1.1/doc/gpl.texi hello-2.1.1/doc/ChangeLog hello-2.1.1/doc/Makefile.am hello-2.1.1/doc/Makefile.in hello-2.1.1/doc/mdate-sh hello-2.1.1/doc/stamp-vti hello-2.1.1/doc/texinfo.tex hello-2.1.1/doc/version.texi hello-2.1.1/doc/hello.texi hello-2.1.1/doc/hello.info hello-2.1.1/src/ hello-2.1.1/src/ChangeLog hello-2.1.1/src/Makefile.am hello-2.1.1/src/Makefile.in hello-2.1.1/src/alloca.c hello-2.1.1/src/hello.c hello-2.1.1/src/version.c hello-2.1.1/src/getopt.c hello-2.1.1/src/getopt1.c hello-2.1.1/src/getopt.h hello-2.1.1/src/system.h hello-2.1.1/man/ hello-2.1.1/man/ChangeLog hello-2.1.1/man/Makefile.am hello-2.1.1/man/Makefile.in hello-2.1.1/man/hello.1 hello-2.1.1/man/help2man hello-2.1.1/m4/ hello-2.1.1/m4/README hello-2.1.1/m4/ChangeLog hello-2.1.1/m4/Makefile.am hello-2.1.1/m4/Makefile.in hello-2.1.1/m4/codeset.m4 hello-2.1.1/m4/gettext.m4 hello-2.1.1/m4/glibc21.m4 hello-2.1.1/m4/iconv.m4 hello-2.1.1/m4/isc-posix.m4 hello-2.1.1/m4/lcmessage.m4 hello-2.1.1/m4/lib-ld.m4 hello-2.1.1/m4/lib-link.m4 hello-2.1.1/m4/lib-prefix.m4 hello-2.1.1/m4/progtest.m4 hello-2.1.1/tests/ hello-2.1.1/tests/ChangeLog hello-2.1.1/tests/Makefile.am hello-2.1.1/tests/Makefile.in hello-2.1.1/tests/hello-1 hello-2.1.1/tests/world-1 hello-2.1.1/tests/nothing-1
Changez de répertoire :
root@debian9:~# cd hello-2.1.1/ root@debian9:~/hello-2.1.1#
A l'étude du fichier README, celui-ci nous renvoie vers le fichier INSTALL. Visualisez donc ce dernier :
root@debian9:~/hello-2.1.1# more INSTALL Copyright 1994, 1995, 1996, 1999, 2000, 2001 Free Software Foundation, Inc. This file is free documentation; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. Basic Installation ================== These are generic installation instructions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). It can also use an optional file (typically called `config.cache' and enabled with `--cache-file=config.cache' or simply `-C') that saves the results of its tests to speed up reconfiguring. (Caching is disabled by default to prevent problems with accidental use of stale cache files.) If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If you are using the cache, and at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.ac' (or `configure.in') is used to create `configure' by a program called `autoconf'. You only need `configure.ac' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: --More--(18%)
La procédure expliquée est celle utilisée pour la plupart des installations manuelles, à savoir la saisie des quatre commandes suivantes.
./configure
Important : configure est un script chargé de créer les makefiles pour une architecture donnée. Les makefiles sont lus par la commande make.
root@debian9:~/hello-2.1.1# ./configure checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for gawk... no checking for mawk... mawk checking whether make sets ${MAKE}... yes checking for gcc... gcc checking for C compiler default output... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for style of include used by make... GNU checking dependency style of gcc... gcc3 checking for strerror in -lcposix... no checking how to run the C preprocessor... gcc -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking for string.h... (cached) yes checking fcntl.h usability... yes checking fcntl.h presence... yes checking for fcntl.h... yes checking sys/file.h usability... yes checking sys/file.h presence... yes checking for sys/file.h... yes checking sys/param.h usability... yes checking sys/param.h presence... yes checking for sys/param.h... yes checking for working alloca.h... yes checking for alloca... yes checking for struct stat.st_blksize... yes checking for msgfmt... no checking for gmsgfmt... : checking for xgettext... no checking for msgmerge... no checking build system type... x86_64-unknown-linux checking host system type... x86_64-unknown-linux checking for ranlib... ranlib checking for gcc option to accept ANSI C... none needed checking for an ANSI C-conforming const... yes checking for inline... inline checking for off_t... yes checking for size_t... yes checking for stdlib.h... (cached) yes checking for unistd.h... (cached) yes checking for getpagesize... yes checking for working mmap... yes checking whether we are using the GNU C Library 2.1 or newer... yes checking for ld used by GCC... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for shared library run path origin... done checking for iconv... yes checking argz.h usability... yes checking argz.h presence... yes checking for argz.h... yes checking limits.h usability... yes checking limits.h presence... yes checking for limits.h... yes checking locale.h usability... yes checking locale.h presence... yes checking for locale.h... yes checking nl_types.h usability... yes checking nl_types.h presence... yes checking for nl_types.h... yes checking malloc.h usability... yes checking malloc.h presence... yes checking for malloc.h... yes checking stddef.h usability... yes checking stddef.h presence... yes checking for stddef.h... yes checking for stdlib.h... (cached) yes checking for string.h... (cached) yes checking for unistd.h... (cached) yes checking for sys/param.h... (cached) yes checking for feof_unlocked... yes checking for fgets_unlocked... yes checking for getc_unlocked... yes checking for getcwd... yes checking for getegid... yes checking for geteuid... yes checking for getgid... yes checking for getuid... yes checking for mempcpy... yes checking for munmap... yes checking for putenv... yes checking for setenv... yes checking for setlocale... yes checking for stpcpy... yes checking for strcasecmp... yes checking for strdup... yes checking for strtoul... yes checking for tsearch... yes checking for __argz_count... yes checking for __argz_stringify... yes checking for __argz_next... yes checking for iconv declaration... extern size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); checking for nl_langinfo and CODESET... yes checking for LC_MESSAGES... yes checking for bison... no checking whether NLS is requested... yes checking whether included gettext is requested... no checking for GNU gettext in libc... yes checking for perl... perl configure: creating ./config.status config.status: creating Makefile config.status: creating contrib/Makefile config.status: creating doc/Makefile config.status: creating intl/Makefile config.status: creating man/Makefile config.status: creating po/Makefile.in config.status: creating m4/Makefile config.status: creating src/Makefile config.status: creating tests/Makefile config.status: creating config.h config.status: executing depfiles commands config.status: executing default-1 commands config.status: creating po/POTFILES config.status: creating po/Makefile config.status: executing default command
make
Important : make sert à appeler des commandes créant des fichiers nécessaires à l'installation du logiciel.
root@debian9:~/hello-2.1.1# make make all-recursive make[1]: Entering directory '/root/hello-2.1.1' Making all in contrib make[2]: Entering directory '/root/hello-2.1.1/contrib' make[2]: Nothing to be done for 'all'. make[2]: Leaving directory '/root/hello-2.1.1/contrib' Making all in doc make[2]: Entering directory '/root/hello-2.1.1/doc' make[2]: Nothing to be done for 'all'. make[2]: Leaving directory '/root/hello-2.1.1/doc' Making all in intl make[2]: Entering directory '/root/hello-2.1.1/intl' make[2]: Nothing to be done for 'all'. make[2]: Leaving directory '/root/hello-2.1.1/intl' Making all in po make[2]: Entering directory '/root/hello-2.1.1/po' make[2]: Nothing to be done for 'all'. make[2]: Leaving directory '/root/hello-2.1.1/po' Making all in src make[2]: Entering directory '/root/hello-2.1.1/src' source='hello.c' object='hello.o' libtool=no \ depfile='.deps/hello.Po' tmpdepfile='.deps/hello.TPo' \ depmode=gcc3 /bin/bash ../depcomp \ gcc -DLOCALEDIR=\"/usr/local/share/locale\" -DHAVE_CONFIG_H -I. -I. -I.. -I. -I. -I.. -I../intl -I../intl -g -O2 -c `test -f 'hello.c' || echo './'`hello.c source='version.c' object='version.o' libtool=no \ depfile='.deps/version.Po' tmpdepfile='.deps/version.TPo' \ depmode=gcc3 /bin/bash ../depcomp \ gcc -DLOCALEDIR=\"/usr/local/share/locale\" -DHAVE_CONFIG_H -I. -I. -I.. -I. -I. -I.. -I../intl -I../intl -g -O2 -c `test -f 'version.c' || echo './'`version.c source='getopt.c' object='getopt.o' libtool=no \ depfile='.deps/getopt.Po' tmpdepfile='.deps/getopt.TPo' \ depmode=gcc3 /bin/bash ../depcomp \ gcc -DLOCALEDIR=\"/usr/local/share/locale\" -DHAVE_CONFIG_H -I. -I. -I.. -I. -I. -I.. -I../intl -I../intl -g -O2 -c `test -f 'getopt.c' || echo './'`getopt.c source='getopt1.c' object='getopt1.o' libtool=no \ depfile='.deps/getopt1.Po' tmpdepfile='.deps/getopt1.TPo' \ depmode=gcc3 /bin/bash ../depcomp \ gcc -DLOCALEDIR=\"/usr/local/share/locale\" -DHAVE_CONFIG_H -I. -I. -I.. -I. -I. -I.. -I../intl -I../intl -g -O2 -c `test -f 'getopt1.c' || echo './'`getopt1.c gcc -g -O2 -o hello hello.o version.o getopt.o getopt1.o make[2]: Leaving directory '/root/hello-2.1.1/src' Making all in man make[2]: Entering directory '/root/hello-2.1.1/man' perl help2man --name="Friendly Greeting Program" ../src/hello >hello.1 make[2]: Leaving directory '/root/hello-2.1.1/man' Making all in m4 make[2]: Entering directory '/root/hello-2.1.1/m4' make[2]: Nothing to be done for 'all'. make[2]: Leaving directory '/root/hello-2.1.1/m4' Making all in tests make[2]: Entering directory '/root/hello-2.1.1/tests' make[2]: Nothing to be done for 'all'. make[2]: Leaving directory '/root/hello-2.1.1/tests' make[2]: Entering directory '/root/hello-2.1.1' make[2]: Leaving directory '/root/hello-2.1.1' make[1]: Leaving directory '/root/hello-2.1.1'
make check
Important : make check permet de vérifier si la commande make a bien fonctionné.
root@debian9:~/hello-2.1.1# make check Making check in contrib make[1]: Entering directory '/root/hello-2.1.1/contrib' make[1]: Nothing to be done for 'check'. make[1]: Leaving directory '/root/hello-2.1.1/contrib' Making check in doc make[1]: Entering directory '/root/hello-2.1.1/doc' make[1]: Nothing to be done for 'check'. make[1]: Leaving directory '/root/hello-2.1.1/doc' Making check in intl make[1]: Entering directory '/root/hello-2.1.1/intl' make[1]: Nothing to be done for 'check'. make[1]: Leaving directory '/root/hello-2.1.1/intl' Making check in po make[1]: Entering directory '/root/hello-2.1.1/po' make[1]: Nothing to be done for 'check'. make[1]: Leaving directory '/root/hello-2.1.1/po' Making check in src make[1]: Entering directory '/root/hello-2.1.1/src' make[1]: Nothing to be done for 'check'. make[1]: Leaving directory '/root/hello-2.1.1/src' Making check in man make[1]: Entering directory '/root/hello-2.1.1/man' make[1]: Nothing to be done for 'check'. make[1]: Leaving directory '/root/hello-2.1.1/man' Making check in m4 make[1]: Entering directory '/root/hello-2.1.1/m4' make[1]: Nothing to be done for 'check'. make[1]: Leaving directory '/root/hello-2.1.1/m4' Making check in tests make[1]: Entering directory '/root/hello-2.1.1/tests' make check-TESTS make[2]: Entering directory '/root/hello-2.1.1/tests' PASS: hello-1 PASS: world-1 PASS: nothing-1 ================== All 3 tests passed ================== make[2]: Leaving directory '/root/hello-2.1.1/tests' make[1]: Leaving directory '/root/hello-2.1.1/tests' make[1]: Entering directory '/root/hello-2.1.1' make[1]: Leaving directory '/root/hello-2.1.1'
make install
Important : make install sert à installer le logiciel.
root@debian9:~/hello-2.1.1# make install Making install in contrib make[1]: Entering directory '/root/hello-2.1.1/contrib' make[2]: Entering directory '/root/hello-2.1.1/contrib' make[2]: Nothing to be done for 'install-exec-am'. make[2]: Nothing to be done for 'install-data-am'. make[2]: Leaving directory '/root/hello-2.1.1/contrib' make[1]: Leaving directory '/root/hello-2.1.1/contrib' Making install in doc make[1]: Entering directory '/root/hello-2.1.1/doc' make[2]: Entering directory '/root/hello-2.1.1/doc' make[2]: Nothing to be done for 'install-exec-am'. /bin/bash ../mkinstalldirs /usr/local/info mkdir -p -- /usr/local/info /usr/bin/install -c -m 644 ./hello.info /usr/local/info/hello.info install-info --info-dir=/usr/local/info /usr/local/info/hello.info make[2]: Leaving directory '/root/hello-2.1.1/doc' make[1]: Leaving directory '/root/hello-2.1.1/doc' Making install in intl make[1]: Entering directory '/root/hello-2.1.1/intl' if test "hello" = "gettext" \ && test '' = 'intl-compat.o'; then \ /bin/sh `case "./mkinstalldirs" in /*) echo "./mkinstalldirs" ;; *) echo ".././mkinstalldirs" ;; esac` /usr/local/lib /usr/local/include; \ /usr/bin/install -c -m 644 libintl.h /usr/local/include/libintl.h; \ @LIBTOOL@ --mode=install \ /usr/bin/install -c -m 644 libintl.a /usr/local/lib/libintl.a; \ else \ : ; \ fi if test 'no' = yes; then \ test yes != no || /bin/sh `case "./mkinstalldirs" in /*) echo "./mkinstalldirs" ;; *) echo ".././mkinstalldirs" ;; esac` /usr/local/lib; \ temp=/usr/local/lib/t-charset.alias; \ dest=/usr/local/lib/charset.alias; \ if test -f /usr/local/lib/charset.alias; then \ orig=/usr/local/lib/charset.alias; \ sed -f ref-add.sed $orig > $temp; \ /usr/bin/install -c -m 644 $temp $dest; \ rm -f $temp; \ else \ if test yes = no; then \ orig=charset.alias; \ sed -f ref-add.sed $orig > $temp; \ /usr/bin/install -c -m 644 $temp $dest; \ rm -f $temp; \ fi; \ fi; \ /bin/sh `case "./mkinstalldirs" in /*) echo "./mkinstalldirs" ;; *) echo ".././mkinstalldirs" ;; esac` /usr/local/share/locale; \ test -f /usr/local/share/locale/locale.alias \ && orig=/usr/local/share/locale/locale.alias \ || orig=./locale.alias; \ temp=/usr/local/share/locale/t-locale.alias; \ dest=/usr/local/share/locale/locale.alias; \ sed -f ref-add.sed $orig > $temp; \ /usr/bin/install -c -m 644 $temp $dest; \ rm -f $temp; \ else \ : ; \ fi if test "hello" = "gettext"; then \ /bin/sh `case "./mkinstalldirs" in /*) echo "./mkinstalldirs" ;; *) echo ".././mkinstalldirs" ;; esac` /usr/local/share/gettext/intl; \ /usr/bin/install -c -m 644 VERSION /usr/local/share/gettext/intl/VERSION; \ /usr/bin/install -c -m 644 ChangeLog.inst /usr/local/share/gettext/intl/ChangeLog; \ dists="COPYING.LIB-2.0 COPYING.LIB-2.1 Makefile.in config.charset locale.alias ref-add.sin ref-del.sin gmo.h gettextP.h hash-string.h plural-exp.h eval-plural.h os2compat.h libgnuintl.h loadinfo.h bindtextdom.c dcgettext.c dgettext.c gettext.c finddomain.c loadmsgcat.c localealias.c textdomain.c l10nflist.c explodename.c dcigettext.c dcngettext.c dngettext.c ngettext.c plural.y plural-exp.c localcharset.c localename.c osdep.c os2compat.c intl-compat.c"; \ for file in $dists; do \ /usr/bin/install -c -m 644 ./$file \ /usr/local/share/gettext/intl/$file; \ done; \ chmod a+x /usr/local/share/gettext/intl/config.charset; \ dists="plural.c"; \ for file in $dists; do \ if test -f $file; then dir=.; else dir=.; fi; \ /usr/bin/install -c -m 644 $dir/$file \ /usr/local/share/gettext/intl/$file; \ done; \ dists="xopen-msg.sed linux-msg.sed po2tbl.sed.in cat-compat.c COPYING.LIB-2 gettext.h libgettext.h plural-eval.c"; \ for file in $dists; do \ rm -f /usr/local/share/gettext/intl/$file; \ done; \ else \ : ; \ fi make[1]: Leaving directory '/root/hello-2.1.1/intl' Making install in po make[1]: Entering directory '/root/hello-2.1.1/po' /bin/sh `case "./mkinstalldirs" in /*) echo "./mkinstalldirs" ;; *) echo ".././mkinstalldirs" ;; esac` /usr/local/share mkdir -p -- /usr/local/share/locale/ca/LC_MESSAGES installing ca.gmo as /usr/local/share/locale/ca/LC_MESSAGES/hello.mo mkdir -p -- /usr/local/share/locale/da/LC_MESSAGES installing da.gmo as /usr/local/share/locale/da/LC_MESSAGES/hello.mo mkdir -p -- /usr/local/share/locale/de/LC_MESSAGES installing de.gmo as /usr/local/share/locale/de/LC_MESSAGES/hello.mo mkdir -p -- /usr/local/share/locale/de_DE/LC_MESSAGES installing de_DE.gmo as /usr/local/share/locale/de_DE/LC_MESSAGES/hello.mo mkdir -p -- /usr/local/share/locale/el/LC_MESSAGES installing el.gmo as /usr/local/share/locale/el/LC_MESSAGES/hello.mo mkdir -p -- /usr/local/share/locale/eo/LC_MESSAGES installing eo.gmo as /usr/local/share/locale/eo/LC_MESSAGES/hello.mo mkdir -p -- /usr/local/share/locale/es/LC_MESSAGES installing es.gmo as /usr/local/share/locale/es/LC_MESSAGES/hello.mo mkdir -p -- /usr/local/share/locale/et/LC_MESSAGES installing et.gmo as /usr/local/share/locale/et/LC_MESSAGES/hello.mo mkdir -p -- /usr/local/share/locale/fi/LC_MESSAGES installing fi.gmo as /usr/local/share/locale/fi/LC_MESSAGES/hello.mo mkdir -p -- /usr/local/share/locale/fr/LC_MESSAGES installing fr.gmo as /usr/local/share/locale/fr/LC_MESSAGES/hello.mo mkdir -p -- /usr/local/share/locale/gl/LC_MESSAGES installing gl.gmo as /usr/local/share/locale/gl/LC_MESSAGES/hello.mo mkdir -p -- /usr/local/share/locale/he/LC_MESSAGES installing he.gmo as /usr/local/share/locale/he/LC_MESSAGES/hello.mo mkdir -p -- /usr/local/share/locale/hr/LC_MESSAGES installing hr.gmo as /usr/local/share/locale/hr/LC_MESSAGES/hello.mo mkdir -p -- /usr/local/share/locale/hu/LC_MESSAGES installing hu.gmo as /usr/local/share/locale/hu/LC_MESSAGES/hello.mo mkdir -p -- /usr/local/share/locale/id/LC_MESSAGES installing id.gmo as /usr/local/share/locale/id/LC_MESSAGES/hello.mo mkdir -p -- /usr/local/share/locale/it/LC_MESSAGES installing it.gmo as /usr/local/share/locale/it/LC_MESSAGES/hello.mo mkdir -p -- /usr/local/share/locale/ja/LC_MESSAGES installing ja.gmo as /usr/local/share/locale/ja/LC_MESSAGES/hello.mo mkdir -p -- /usr/local/share/locale/ko/LC_MESSAGES installing ko.gmo as /usr/local/share/locale/ko/LC_MESSAGES/hello.mo mkdir -p -- /usr/local/share/locale/lv/LC_MESSAGES installing lv.gmo as /usr/local/share/locale/lv/LC_MESSAGES/hello.mo mkdir -p -- /usr/local/share/locale/nb/LC_MESSAGES installing nb.gmo as /usr/local/share/locale/nb/LC_MESSAGES/hello.mo mkdir -p -- /usr/local/share/locale/nl/LC_MESSAGES installing nl.gmo as /usr/local/share/locale/nl/LC_MESSAGES/hello.mo mkdir -p -- /usr/local/share/locale/nn/LC_MESSAGES installing nn.gmo as /usr/local/share/locale/nn/LC_MESSAGES/hello.mo mkdir -p -- /usr/local/share/locale/pl/LC_MESSAGES installing pl.gmo as /usr/local/share/locale/pl/LC_MESSAGES/hello.mo mkdir -p -- /usr/local/share/locale/pt/LC_MESSAGES installing pt.gmo as /usr/local/share/locale/pt/LC_MESSAGES/hello.mo mkdir -p -- /usr/local/share/locale/pt_BR/LC_MESSAGES installing pt_BR.gmo as /usr/local/share/locale/pt_BR/LC_MESSAGES/hello.mo mkdir -p -- /usr/local/share/locale/ru/LC_MESSAGES installing ru.gmo as /usr/local/share/locale/ru/LC_MESSAGES/hello.mo mkdir -p -- /usr/local/share/locale/sk/LC_MESSAGES installing sk.gmo as /usr/local/share/locale/sk/LC_MESSAGES/hello.mo mkdir -p -- /usr/local/share/locale/sl/LC_MESSAGES installing sl.gmo as /usr/local/share/locale/sl/LC_MESSAGES/hello.mo mkdir -p -- /usr/local/share/locale/sv/LC_MESSAGES installing sv.gmo as /usr/local/share/locale/sv/LC_MESSAGES/hello.mo mkdir -p -- /usr/local/share/locale/tr/LC_MESSAGES installing tr.gmo as /usr/local/share/locale/tr/LC_MESSAGES/hello.mo mkdir -p -- /usr/local/share/locale/uk/LC_MESSAGES installing uk.gmo as /usr/local/share/locale/uk/LC_MESSAGES/hello.mo if test "hello" = "gettext"; then \ /bin/sh `case "./mkinstalldirs" in /*) echo "./mkinstalldirs" ;; *) echo ".././mkinstalldirs" ;; esac` /usr/local/share/gettext/po; \ for file in Makefile.in.in Makevars remove-potcdate.sin quot.sed boldquot.sed en@quot.header en@boldquot.header insert-header.sin Rules-quot ; do \ /usr/bin/install -c -m 644 ./$file \ /usr/local/share/gettext/po/$file; \ done; \ else \ : ; \ fi make[1]: Leaving directory '/root/hello-2.1.1/po' Making install in src make[1]: Entering directory '/root/hello-2.1.1/src' make[2]: Entering directory '/root/hello-2.1.1/src' /bin/bash ../mkinstalldirs /usr/local/bin /usr/bin/install -c hello /usr/local/bin/hello make[2]: Nothing to be done for 'install-data-am'. make[2]: Leaving directory '/root/hello-2.1.1/src' make[1]: Leaving directory '/root/hello-2.1.1/src' Making install in man make[1]: Entering directory '/root/hello-2.1.1/man' make[2]: Entering directory '/root/hello-2.1.1/man' make[2]: Nothing to be done for 'install-exec-am'. /bin/bash ../mkinstalldirs /usr/local/man/man1 mkdir -p -- /usr/local/man/man1 /usr/bin/install -c -m 644 ./hello.1 /usr/local/man/man1/hello.1 make[2]: Leaving directory '/root/hello-2.1.1/man' make[1]: Leaving directory '/root/hello-2.1.1/man' Making install in m4 make[1]: Entering directory '/root/hello-2.1.1/m4' make[2]: Entering directory '/root/hello-2.1.1/m4' make[2]: Nothing to be done for 'install-exec-am'. make[2]: Nothing to be done for 'install-data-am'. make[2]: Leaving directory '/root/hello-2.1.1/m4' make[1]: Leaving directory '/root/hello-2.1.1/m4' Making install in tests make[1]: Entering directory '/root/hello-2.1.1/tests' make[2]: Entering directory '/root/hello-2.1.1/tests' make[2]: Nothing to be done for 'install-exec-am'. make[2]: Nothing to be done for 'install-data-am'. make[2]: Leaving directory '/root/hello-2.1.1/tests' make[1]: Leaving directory '/root/hello-2.1.1/tests' make[1]: Entering directory '/root/hello-2.1.1' make[2]: Entering directory '/root/hello-2.1.1' make[2]: Nothing to be done for 'install-exec-am'. make[2]: Nothing to be done for 'install-data-am'. make[2]: Leaving directory '/root/hello-2.1.1' make[1]: Leaving directory '/root/hello-2.1.1'
Il convient maintenant de tester le nouveau logiciel :
root@debian9:~/hello-2.1.1# hello Hello, world!
Le logiciel hello a été correctement installé.
La Commande dpkg
A faire - Placez-vous dans le répertoire personnel de root grâce à la commande cd ~.
Afin de faciliter l'installation, la désinstallation et la gestion des logiciels (appelés paquets) sous Linux, Debian et ses dérivés utilisent un format de fichier de logiciels installables spécifique. Celui-ci s'appelle DEB. La commande utilisée pour manipuler ses paquetages s'appelle dpkg.
Les options de la commande dpkg sont :
root@debian9:~# dpkg --help Syntaxe : dpkg [<option> ...] <commande> Commands: -i|--install <.deb file name> ... | -R|--recursive <directory> ... --unpack <.deb file name> ... | -R|--recursive <directory> ... -A|--record-avail <.deb file name> ... | -R|--recursive <directory> ... --configure <package> ... | -a|--pending --triggers-only <package> ... | -a|--pending -r|--remove <package> ... | -a|--pending -P|--purge <package> ... | -a|--pending -V|--verify <package> ... Verify the integrity of package(s). --get-selections [<pattern> ...] Get list of selections to stdout. --set-selections Set package selections from stdin. --clear-selections Deselect every non-essential package. --update-avail [<Packages-file>] Replace available packages info. --merge-avail [<Packages-file>] Merge with info from file. --clear-avail Erase existing available info. --forget-old-unavail Forget uninstalled unavailable pkgs. -s|--status <package> ... Display package status details. -p|--print-avail <package> ... Display available version details. -L|--listfiles <package> ... List files 'owned' by package(s). -l|--list [<pattern> ...] List packages concisely. -S|--search <pattern> ... Find package(s) owning file(s). -C|--audit [<package> ...] Check for broken package(s). --yet-to-unpack Print packages selected for installation. --predep-package Print pre-dependencies to unpack. --add-architecture <arch> Add <arch> to the list of architectures. --remove-architecture <arch> Remove <arch> from the list of architectures. --print-architecture Print dpkg architecture. --print-foreign-architectures Print allowed foreign architectures. --assert-<feature> Assert support for the specified feature. --validate-<thing> <string> Validate a <thing>'s <string>. --compare-versions <a> <op> <b> Compare version numbers - see below. --force-help Show help on forcing. -Dh|--debug=help Show help on debugging. -?, --help Afficher ce message. --version Afficher la version. Fonctionnalités pouvant être déclarées : support-predepends, working-epoch, long-filenames, multi-conrep, multi-arch, versioned-provides. Validatable things: pkgname, archname, trigname, version. Utiliser dpkg avec -b, --build, -c, --contents, -e, --control, -I, --info, -f, --field, -x, --extract, -X, --vextract, --ctrl-tarfile, --fsys-tarfile sur les archives (taper dpkg-deb --help.) Options : --admindir=<rép.> Utilise le répertoire <rép.> au lieu de /var/lib/dpkg. --root=<rép.> Installe sur un système alternatif dont la racine est située à un autre endroit. --instdir=<rép.> Change la racine d'installation sans changer le répertoire d'administration. --path-exclude=<motif> Ne pas installer les chemins correspondant à un motif du shell. --path-include=<pattern> Réinclut un motif après une exclusion antérieure. -O|--selected-only Ignore les paquets non sélectionnées pour être installés ou mis à niveau. -E|--skip-same-version Ignore les paquets dont la version est la même que celle installée. -G|--refuse-downgrade Ignore les paquets dont la version est moins récente que celle installée. -B|--auto-deconfigure Installe même si cela entraîne la rupture d'autres paquets. --[no-]triggers Passe ou force les actions différées invoquées par le traitement. --verify-format=<format> Vérifie le format de sortie (pris en charge : « rpm »). --no-debsig N'essaie pas d'authentifier les signatures des paquets. --no-act|--dry-run|--simulate Se contente d'afficher les actions à effectuer sans les réaliser effectivement. -D|--debug=<octal> Active le débogage (voir -Dhelp ou --debug=help). --status-fd <n> Envoie les mises à jour d'état au descripteur de fichier <n>. --status-logger=<commande> Envoie les mises à jour d'état sur l'entrée standard de la commande <commande>. --log=<fichier> Enregistre dans <fichier> les changements d'état et les actions effectuées. --ignore-depends=<paquet>,... Ignore les dépendances impliquant <paquet>. --force-... Passe outre les problèmes (voir --force-help). --no-force-...|--refuse-... Arrête en cas de problème(s). --abort-after <n> Arrête après avoir rencontré <n> erreurs. Les opérateurs de comparaison pour --compare-versions sont les suivants : lt le eq ne ge gt (ne considérer aucune version comme plus tardive que n'importe quelle version) lt-nl le-nl ge-nl gt-nl (ne considérer aucune version comme plus récente que n'importe quelle version) < << <= = >= >> > (uniquement pour des raison de compatibilité avec la syntaxe du fichier control) Utilisez « apt » ou « aptitude » pour gérer les paquets de manière plus conviviale.
Configuration
Le fichier de configuration proncipal de la commande dpkg est /etc/dpkg/dpkg.cfg :
root@debian9:~# cat /etc/dpkg/dpkg.cfg # dpkg configuration file # # This file can contain default options for dpkg. All command-line # options are allowed. Values can be specified by putting them after # the option, separated by whitespace and/or an `=' sign. # # Do not enable debsig-verify by default; since the distribution is not using # embedded signatures, debsig-verify would reject all packages. no-debsig # Log status changes and actions to a file. log /var/log/dpkg.log
Les directives dans ce fichier sont les option de la commande dpkg sans les charactères –.
Il est important à noter que la base de données de la commande dpkg se trouve dans le répertoire /var/lib/dpkg :
root@debian9:~# ls -l /var/lib/dpkg total 2792 drwxr-xr-x 2 root root 4096 janv. 22 13:37 alternatives -rw-r--r-- 1 root root 124816 janv. 22 13:18 available -rw-r--r-- 1 root root 8 janv. 22 13:18 cmethopt -rw-r--r-- 1 root root 559 janv. 22 13:39 diversions -rw-r--r-- 1 root root 614 janv. 22 13:39 diversions-old drwxr-xr-x 2 root root 258048 mars 25 17:04 info -rw-r----- 1 root root 0 mars 25 17:04 lock drwxr-xr-x 2 root root 4096 juin 26 2018 parts -rw-r--r-- 1 root root 100 janv. 22 13:37 statoverride -rw-r--r-- 1 root root 35 janv. 22 13:18 statoverride-old -rw-r--r-- 1 root root 1215468 mars 25 17:04 status -rw-r--r-- 1 root root 1215540 mars 25 17:04 status-old drwxr-xr-x 2 root root 4096 janv. 22 13:37 triggers drwxr-xr-x 2 root root 4096 mars 25 17:04 updates
Important - Il est recommendé d'inclure ce répertoire et son contenu dans les sauvegardes régulières.
Utilisation
Afin de connaître la liste des paquets disponibles sur la machine, il convient de saisir la commande suivante dans une fenêtre de console en tant que root :
root@debian9:~# dpkg -l | more Souhait=inconnU/Installé/suppRimé/Purgé/H=à garder | État=Non/Installé/fichier-Config/dépaqUeté/échec-conFig/H=semi-installé/W=attend-traitement-déclenchements |/ Err?=(aucune)/besoin Réinstallation (État,Err: majuscule=mauvais) ||/ Nom Version Architecture Description +++-=====================================-=================================-============-=============================================================================== ii acl 2.2.52-3+b1 amd64 Access control list utilities ii adduser 3.115 all add and remove users and groups ii adwaita-icon-theme 3.22.0-1+deb9u1 all default icon theme of GNOME ii alsa-utils 1.1.3-1 amd64 Utilities for configuring and using ALSA ii anacron 2.3-24 amd64 cron-like program that doesn't go by time ii ant 1.9.9-1+deb9u1 all Java based build tool like make ii ant-optional 1.9.9-1+deb9u1 all Java based build tool like make - optional libraries ii apt 1.4.9 amd64 commandline package manager ii apt-listchanges 3.10 all package change history notification tool ii apt-utils 1.4.9 amd64 package management related utility programs ii aspell 0.60.7~20110707-3+b2 amd64 GNU Aspell spell-checker ii aspell-en 2016.11.20-0-0.1 all English dictionary for GNU Aspell ii aspell-fr 0.50-3-8 all French dictionary for aspell ii at-spi2-core 2.22.0-6+deb9u1 amd64 Assistive Technology Service Provider Interface (dbus core) ii avahi-autoipd 0.6.32-2 amd64 Avahi IPv4LL network address configuration daemon ii avahi-daemon 0.6.32-2 amd64 Avahi mDNS/DNS-SD daemon ii base-files 9.9+deb9u6 amd64 Debian base system miscellaneous files ii base-passwd 3.5.43 amd64 Debian base system master password and group files ii bash 4.4-5 amd64 GNU Bourne Again SHell ii bash-completion 1:2.1-4.3 all programmable completion for the bash shell ii bind9-host 1:9.10.3.dfsg.P4-12.3+deb9u4 amd64 Version of 'host' bundled with BIND 9.X ii bluetooth 5.43-2+deb9u1 all Bluetooth support ii bluez 5.43-2+deb9u1 amd64 Bluetooth tools and daemons ii bsdmainutils 9.0.12+nmu1 amd64 collection of more utilities from FreeBSD ii bsdutils 1:2.29.2-1+deb9u1 amd64 basic utilities from 4.4BSD-Lite ii busybox 1:1.22.0-19+b3 amd64 Tiny utilities for small and embedded systems ii bzip2 1.0.6-8.1 amd64 high-quality block-sorting file compressor - utilities ii ca-certificates 20161130+nmu1+deb9u1 all Common CA certificates ii ca-certificates-java 20170531+nmu1 all Common CA certificates (JKS keystore) ii coinor-libcbc3 2.8.12-1+b2 amd64 Coin-or branch-and-cut mixed integer programming solver (shared libraries) ii coinor-libcgl1 0.58.9-1+b1 amd64 COIN-OR Cut Generation Library ii coinor-libclp1 1.15.10-3+b1 amd64 Coin-or linear programming solver (shared libraries) ii coinor-libcoinmp1v5:amd64 1.7.6+dfsg1-2 amd64 Simple C API for COIN-OR Solvers Clp and Cbc -- library ii coinor-libcoinutils3v5 2.9.15-4 amd64 Coin-or collection of utility classes (binaries and libraries) --Plus--
Important - L'option -l liste les paquets disponibles spécifiés par le fichier /var/lib/dpkg/available.
root@debian9:~# more /var/lib/dpkg/available Package: gcc-6-base Source: gcc-6 Version: 6.3.0-18+deb9u1 Installed-Size: 209 Maintainer: Debian GCC Maintainers <debian-gcc@lists.debian.org> Architecture: amd64 Breaks: gcc-4.4-base (<< 4.4.7), gcc-4.7-base (<< 4.7.3), gcj-4.4-base (<< 4.4.6-9~), gcj-4.6-base (<< 4.6.1-4~), gnat-4.4-base (<< 4.4.6-3~), gnat-4.6 (<< 4.6.1-5~) Description: GCC, the GNU Compiler Collection (base package) Description-md5: b6e93638a6d08ea7a18929d7cf078e5d Multi-Arch: same Homepage: http://gcc.gnu.org/ Tag: role::shared-lib Section: libs Priority: required Filename: pool/main/g/gcc-6/gcc-6-base_6.3.0-18+deb9u1_amd64.deb Size: 179954 MD5sum: fae6ab4e4c63ceb1b18df23f13dc7776 SHA256: 56a205b9032e54edffeab48b0e76ffc829e20e6c7c3c5976cf5e278f0471705f Package: libgcc1 Source: gcc-6 (6.3.0-18+deb9u1) Version: 1:6.3.0-18+deb9u1 Installed-Size: 108 Maintainer: Debian GCC Maintainers <debian-gcc@lists.debian.org> Architecture: amd64 Depends: gcc-6-base (= 6.3.0-18+deb9u1), libc6 (>= 2.14) Breaks: gcc-4.3 (<< 4.3.6-1), gcc-4.4 (<< 4.4.6-4), gcc-4.5 (<< 4.5.3-2) Description: GCC support library Description-md5: bbd60d723e97d8e06c04228ee4c76f10 Multi-Arch: same Homepage: http://gcc.gnu.org/ Tag: role::shared-lib Section: libs Priority: required Filename: pool/main/g/gcc-6/libgcc1_6.3.0-18+deb9u1_amd64.deb Size: 38018 MD5sum: 486770bbab9926da4c945733d372966a SHA256: 423a6541ee7ade69967c99492e267e724fd4675de53310861af5d1a1d249c4bf --Plus--(1%)
Le statut de chaque paquet est inclus dans le fichier /var/lib/dpkg/status :
root@debian9:~# more /var/lib/dpkg/status Package: libatk-adaptor Status: install ok installed Priority: optional Section: misc Installed-Size: 46 Maintainer: Debian Accessibility Team <debian-accessibility@lists.debian.org> Architecture: amd64 Multi-Arch: same Source: at-spi2-atk Version: 2.22.0-2 Replaces: at-spi Provides: at-spi Depends: libatk-bridge2.0-0 (>= 2.5.3), libatk1.0-0 (>= 2.15.4), libatspi2.0-0 (>= 2.9.90), libc6 (>= 2.2.5), libdbus-1-3 (>= 1.9.14), libglib2.0-0 (>= 2.12.0) Conflicts: at-spi Conffiles: /etc/X11/Xsession.d/90atk-adaptor 4078a3f4ac00fc84e750302cad860730 Description: AT-SPI 2 toolkit bridge This package includes a gtk-module that bridges ATK to the new D-Bus based AT-SPI. Homepage: https://wiki.gnome.org/Accessibility Package: libquadmath0 Status: install ok installed Priority: optional Section: libs Installed-Size: 265 Maintainer: Debian GCC Maintainers <debian-gcc@lists.debian.org> Architecture: amd64 Multi-Arch: same Source: gcc-6 Version: 6.3.0-18+deb9u1 Depends: gcc-6-base (= 6.3.0-18+deb9u1), libc6 (>= 2.23) Description: GCC Quad-Precision Math Library A library, which provides quad-precision mathematical functions on targets supporting the __float128 datatype. The library is used to provide on such targets the REAL(16) type in the GNU Fortran compiler. Homepage: http://gcc.gnu.org/ Package: libvorbisfile3 --Plus--(0%)
Afin de connaître le nombre total de paquets installés, utilisez la commande suivante :
root@debian9:~# dpkg --get-selections | wc -l 1293
Imaginons maintenant que vous souhaitez vérifier si un paquet contenant la chaîne de caractères zip soit déjà installé sur la machine. Dans ce cas, il convient d'abord d'utiliser la commande suivante :
root@debian9:~# dpkg --get-selections | grep zip bzip2 install gzip install p7zip install p7zip-full install unzip install
Afin de connaître le statut de du paquet gzip, il convient de saisir la commande suivante :
root@debian9:~# dpkg -s gzip Package: gzip Essential: yes Status: install ok installed Priority: required Section: utils Installed-Size: 231 Maintainer: Bdale Garbee <bdale@gag.com> Architecture: amd64 Source: gzip (1.6-5) Version: 1.6-5+b1 Depends: dpkg (>= 1.15.4) | install-info Pre-Depends: libc6 (>= 2.17) Suggests: less Description: GNU compression utilities This package provides the standard GNU file compression utilities, which are also the default compression tools for Debian. They typically operate on files with names ending in '.gz', but can also decompress files ending in '.Z' created with 'compress'.
Afin de lister tous les fichiers installés par le paquet gzip, utilisez la commande suivante :
root@debian9:~# dpkg -L gzip /. /bin /bin/gunzip /bin/gzexe /bin/gzip /bin/uncompress /bin/zcat /bin/zcmp /bin/zdiff /bin/zegrep /bin/zfgrep /bin/zforce /bin/zgrep /bin/zless /bin/zmore /bin/znew /usr /usr/share /usr/share/doc /usr/share/doc/gzip /usr/share/doc/gzip/README-release /usr/share/doc/gzip/README.gz /usr/share/doc/gzip/TODO /usr/share/doc/gzip/changelog.Debian.amd64.gz /usr/share/doc/gzip/changelog.Debian.gz /usr/share/doc/gzip/changelog.gz /usr/share/doc/gzip/copyright /usr/share/info /usr/share/info/gzip.info.gz /usr/share/lintian /usr/share/lintian/overrides /usr/share/man /usr/share/man/man1 /usr/share/man/man1/gzexe.1.gz /usr/share/man/man1/gzip.1.gz /usr/share/man/man1/zdiff.1.gz /usr/share/man/man1/zforce.1.gz /usr/share/man/man1/zgrep.1.gz /usr/share/man/man1/zless.1.gz /usr/share/man/man1/zmore.1.gz /usr/share/man/man1/znew.1.gz /usr/share/man/man1/gunzip.1.gz /usr/share/man/man1/uncompress.1.gz /usr/share/man/man1/zcat.1.gz /usr/share/man/man1/zcmp.1.gz /usr/share/man/man1/zegrep.1.gz /usr/share/man/man1/zfgrep.1.gz
A l'inverse, si vous connaissez le nom d'un fichier et vous souhaitez savoir quel paquet l'a installé, utilisez la commande suivante :
root@debian9:~# dpkg -S /bin/zfgrep gzip: /bin/zfgrep
La Commande dselect
La commande dselect est un outil interactif utilisé pour gérer, installer et désinstaller des paquets. C'est un Front End à la commande dpkg et est lancé sans options.
La commande dselect n'est pas installé par défaut. Il convient donc d'utiliser la commande apt-get pour l'installer :
root@debian9:~# apt-get install dselect Lecture des listes de paquets... Fait Construction de l'arbre des dépendances Lecture des informations d'état... Fait Les NOUVEAUX paquets suivants seront installés : dselect 0 mis à jour, 1 nouvellement installés, 0 à enlever et 96 non mis à jour. Il est nécessaire de prendre 1 285 ko dans les archives. Après cette opération, 2 561 ko d'espace disque supplémentaires seront utilisés. Réception de:1 http://ftp.fr.debian.org/debian stretch/main amd64 dselect amd64 1.18.25 [1 285 kB] 1 285 ko réceptionnés en 0s (1 837 ko/s) Sélection du paquet dselect précédemment désélectionné. (Lecture de la base de données... 91043 fichiers et répertoires déjà installés.) Préparation du dépaquetage de .../dselect_1.18.25_amd64.deb ... Dépaquetage de dselect (1.18.25) ... Paramétrage de dselect (1.18.25) ... Traitement des actions différées (« triggers ») pour man-db (2.7.6.1-2) ...
Lancez maintenant dselect :
Interface de gestion de paquets Debian « dselect » version 1.18.25 (amd64). * 0. [A]ccéder Choisir la méthode d'accès à utiliser 1. [M]ise à j Mise à jour de l'information sur les paquets disponibles, si 2. [S]électio Sélection des paquets que vous désirez avoir sur votre syst 3. [I]nstaller Installation et mise à niveau des paquets désirés. 4. [C]onfigure Configuration de tout paquet non configuré. 5. [R]etirer Suppression des applications non désirées. 6. [Q]uitter Quitter dselect. Utilisez ^P et ^N, les touches fléchées, les lettres initiales ou les chiffres p our vous déplacer ; Appuyez sur <Entrée> pour confirmer la sélection. ^L pour redessiner l'écran. Copyright (C) 1994-1996 Ian Jackson. Copyright (C) 2000,2001 Wichert Akkerman. Ce programme est un logiciel libre ; prière de consulter la « GNU General Public License » version 2 ou supérieure pour prendre connaissance des conditions de reproduction. AUCUNE garantie n'est offerte.
A faire - Notez les instructions en bas de l'écran et expérimentez avec l'interface.
La Commande apt-get
APT ou en anglais Advanced Package Tool est un gestionnaire de paquets de haut niveau capable de résoudre automatiquement les problèmes de dépendances entre les paquets.
La commande apt-get prend la forme suivante :
# apt-get <options> <commande> <paquet(s)> [Entrée]
Les options et commandes de la commande apt-get sont :
root@debian9:~# apt-get --help apt 1.4.9 (amd64) Usage: apt-get [options] command apt-get [options] install|remove pkg1 [pkg2 ...] apt-get [options] source pkg1 [pkg2 ...] apt-get is a command line interface for retrieval of packages and information about them from authenticated sources and for installation, upgrade and removal of packages together with their dependencies. Most used commands: update - Récupère les nouvelles listes de paquets upgrade - Réalise une mise à jour install - Installe de nouveaux paquets (pkg1 est libc6 et non libc6.deb) remove - Supprime des paquets purge - Supprime des paquets et leurs fichiers de configuration autoremove - Supprime automatiquement les dépendances inutilisés dist-upgrade - Met à jour la distribution, reportez-vous à apt-get(8) dselect-upgrade - Suit les sélections de dselect build-dep - Configure build-dependencies pour les paquets sources clean - Supprime dans le cache local tous les fichiers téléchargés autoclean - Supprime dans le cache local les fichiers inutiles check - Vérifie qu'il n'y a pas de rupture de dépendances source - Télécharge les archives de sources download - Télécharge le paquet binaire dans le répertoire courant changelog - Télécharge et affiche le journal des modifications (« changelog ») du paquet indiqué See apt-get(8) for more information about the available commands. Configuration options and syntax is detailed in apt.conf(5). Information about how to configure sources can be found in sources.list(5). Package and version choices can be expressed via apt_preferences(5). Security details are available in apt-secure(8). Cet APT a les « Super Cow Powers »
Configuration
APT peut être configuré par un fichier centralisé /etc/apt/apt.conf. Un exemple est fourni :
root@debian9:~# cat /usr/share/doc/apt/examples/apt.conf // $Id: apt.conf,v 1.43 1999/12/06 02:19:38 jgg Exp $ /* This file is a sample configuration file with a few harmless sample options. */ APT { // Options for apt-get Get { Download-Only "false"; }; }; // Options for the downloading routines Acquire { Retries "0"; }; // Things that effect the APT dselect method DSelect { Clean "auto"; // always|auto|prompt|never }; DPkg { // Probably don't want to use force-downgrade.. Options {"--force-overwrite";} }
D'autres fichiers de configuration se trouvent dans le répertoire /etc/apt/apt.conf.d/ :
root@debian9:~# ls /etc/apt/apt.conf.d/ 00CDMountPoint 01autoremove 20listchanges 70debconf 00trustcdrom 01autoremove-kernels 20packagekit
Le contenu de ces fichiers sont :
root@debian9:~# cat /etc/apt/apt.conf.d/00CDMountPoint Acquire::cdrom { mount "/media/cdrom"; }; Dir::Media::MountPath "/media/cdrom"; root@debian9:~# root@debian9:~# cat /etc/apt/apt.conf.d/01autoremove APT { NeverAutoRemove { "^firmware-linux.*"; "^linux-firmware$"; }; VersionedKernelPackages { # linux kernels "linux-image"; "linux-headers"; "linux-image-extra"; "linux-signed-image"; # kfreebsd kernels "kfreebsd-image"; "kfreebsd-headers"; # hurd kernels "gnumach-image"; # (out-of-tree) modules ".*-modules"; ".*-kernel"; "linux-backports-modules-.*"; # tools "linux-tools"; }; Never-MarkAuto-Sections { "metapackages"; "contrib/metapackages"; "non-free/metapackages"; "restricted/metapackages"; "universe/metapackages"; "multiverse/metapackages"; }; Move-Autobit-Sections { "oldlibs"; "contrib/oldlibs"; "non-free/oldlibs"; "restricted/oldlibs"; "universe/oldlibs"; "multiverse/oldlibs"; }; }; root@debian9:~# root@debian9:~# cat /etc/apt/apt.conf.d/01autoremove-kernels // DO NOT EDIT! File autogenerated by /etc/kernel/postinst.d/apt-auto-removal APT::NeverAutoRemove { "^linux-image-4\.9\.0-8-amd64$"; "^linux-headers-4\.9\.0-8-amd64$"; "^linux-image-extra-4\.9\.0-8-amd64$"; "^linux-signed-image-4\.9\.0-8-amd64$"; "^kfreebsd-image-4\.9\.0-8-amd64$"; "^kfreebsd-headers-4\.9\.0-8-amd64$"; "^gnumach-image-4\.9\.0-8-amd64$"; "^.*-modules-4\.9\.0-8-amd64$"; "^.*-kernel-4\.9\.0-8-amd64$"; "^linux-backports-modules-.*-4\.9\.0-8-amd64$"; "^linux-tools-4\.9\.0-8-amd64$"; }; /* Debug information: # dpkg list: iF linux-image-4.9.0-8-amd64 4.9.130-2 amd64 Linux 4.9 for 64-bit PCs iU linux-image-amd64 4.9+80+deb9u6 amd64 Linux for 64-bit PCs (meta-package) # list of installed kernel packages: 4.9.0-8-amd64 4.9.130-2 # list of different kernel versions: 4.9.130-2 # Installing kernel: 4.9.130-2 (4.9.0-8-amd64) # Running kernel: 4.9.130-2 (4.9.0-8-amd64) # Last kernel: 4.9.130-2 # Previous kernel: # Kernel versions list to keep: 4.9.130-2 # Kernel packages (version part) to protect: 4\.9\.0-8-amd64 */ root@debian9:~# root@debian9:~# cat /etc/apt/apt.conf.d/70debconf // Pre-configure all packages with debconf before they are installed. // If you don't like it, comment it out. DPkg::Pre-Install-Pkgs {"/usr/sbin/dpkg-preconfigure --apt || true";};
Dépôts
Important - Un dépôt est un lieu de stockage de paquets binaires prêts à installer. Un dépôt peut être le DVD d'installation de la distribution, un dossier sur disque dur ou bien des serveurs distants accessibles par Internet.
Les dépôts de paquets sont spécifiés soit dans le fichier /etc/apt/sources.list, soit dans un fichier par dépôt stocké dans le répertoire /etc/apt/sources.list.d :
root@debian9:~# cat /etc/apt/sources.list # # deb cdrom:[Debian GNU/Linux 9.6.0 _Stretch_ - Official amd64 NETINST 20181110-11:34]/ stretch main #deb cdrom:[Debian GNU/Linux 9.6.0 _Stretch_ - Official amd64 NETINST 20181110-11:34]/ stretch main deb http://ftp.fr.debian.org/debian/ stretch main deb-src http://ftp.fr.debian.org/debian/ stretch main deb http://security.debian.org/debian-security stretch/updates main deb-src http://security.debian.org/debian-security stretch/updates main # stretch-updates, previously known as 'volatile' deb http://ftp.fr.debian.org/debian/ stretch-updates main deb-src http://ftp.fr.debian.org/debian/ stretch-updates main
Chaque ligne de ce fichier comporte quatre champs :
- Le premier champ deb ou deb-src
- indique si la source concerne des paquets binaires à installer ou les sources des paquets
- Le deuxième champ indique l'URL de la source
- indique file:// ou copy:// pour un répertoire local
- indique cdrom:// pour un CD ou DVD
- indique http:// pour un serveur web
- indique ftp:// pour un serveur ftp
- Le troisième champ indique la branche Debian
- indique stable, testing ou unstable ou leur nom de correspondant tel squeeze
- Le quatrième champs indique une section de paquets
- main
- contrib
- non-free
- non-US
Important - Il est possible d'ajouter une source directement en éditant le fichier /etc/apt/sources.list, en créant un fichier spécifique dans le répertoire /etc/apt/sources.list.d ou en utilisant la commande apt-setup.
La mise à jour de la base de références de la description des paquets est effectuée un utilisant la commande suivante :
root@debian9:~# apt-get update Atteint:1 http://security.debian.org/debian-security stretch/updates InRelease Ign:2 http://ftp.fr.debian.org/debian stretch InRelease Réception de:3 http://ftp.fr.debian.org/debian stretch-updates InRelease [91,0 kB] Atteint:4 http://ftp.fr.debian.org/debian stretch Release 91,0 ko réceptionnés en 0s (145 ko/s) Lecture des listes de paquets... Fait
Utilisation
Les commandes les plus utilisées d'apt-get sont :
Commande | Description |
---|---|
install | Installer un ou plusieurs paquets. |
upgrade | Mettre à jour les paquets installés. |
remove | Supprimer un paquet. |
purge | Supprimer un paquet et ses fichiers de configuration. |
LAB #1 - Utiliser la commande apt-get
Commencez par installer le paquet mc :
root@debian9:~# apt-get install mc Lecture des listes de paquets... Fait Construction de l'arbre des dépendances Lecture des informations d'état... Fait The following additional packages will be installed: mc-data Paquets suggérés : arj catdvi | texlive-binaries dbview djvulibre-bin genisoimage gv imagemagick libaspell-dev links | w3m | lynx odt2txt poppler-utils python-boto python-tz zip Les NOUVEAUX paquets suivants seront installés : mc mc-data 0 mis à jour, 2 nouvellement installés, 0 à enlever et 96 non mis à jour. Il est nécessaire de prendre 1 780 ko dans les archives. Après cette opération, 7 175 ko d'espace disque supplémentaires seront utilisés. Souhaitez-vous continuer ? [O/n] y Réception de:1 http://ftp.fr.debian.org/debian stretch/main amd64 mc-data all 3:4.8.18-1 [1 267 kB] Réception de:2 http://ftp.fr.debian.org/debian stretch/main amd64 mc amd64 3:4.8.18-1 [513 kB] 1 780 ko réceptionnés en 0s (2 484 ko/s) Sélection du paquet mc-data précédemment désélectionné. (Lecture de la base de données... 91128 fichiers et répertoires déjà installés.) Préparation du dépaquetage de .../mc-data_3%3a4.8.18-1_all.deb ... Dépaquetage de mc-data (3:4.8.18-1) ... Sélection du paquet mc précédemment désélectionné. Préparation du dépaquetage de .../mc_3%3a4.8.18-1_amd64.deb ... Dépaquetage de mc (3:4.8.18-1) ... Traitement des actions différées (« triggers ») pour mime-support (3.60) ... Traitement des actions différées (« triggers ») pour desktop-file-utils (0.23-1) ... Paramétrage de mc-data (3:4.8.18-1) ... Traitement des actions différées (« triggers ») pour man-db (2.7.6.1-2) ... Traitement des actions différées (« triggers ») pour hicolor-icon-theme (0.15-1) ... Paramétrage de mc (3:4.8.18-1) ... update-alternatives: utilisation de « /usr/bin/mcview » pour fournir « /usr/bin/view » (view) en mode automatique
La ré-installation d'un paquet est effectuée un utilisant la commande suivante :
root@debian9:~# apt-get --reinstall install mc Lecture des listes de paquets... Fait Construction de l'arbre des dépendances Lecture des informations d'état... Fait 0 mis à jour, 0 nouvellement installés, 1 réinstallés, 0 à enlever et 96 non mis à jour. Il est nécessaire de prendre 0 o/513 ko dans les archives. Après cette opération, 0 o d'espace disque supplémentaires seront utilisés. (Lecture de la base de données... 91494 fichiers et répertoires déjà installés.) Préparation du dépaquetage de .../mc_3%3a4.8.18-1_amd64.deb ... Dépaquetage de mc (3:4.8.18-1) sur (3:4.8.18-1) ... Traitement des actions différées (« triggers ») pour mime-support (3.60) ... Traitement des actions différées (« triggers ») pour desktop-file-utils (0.23-1) ... Paramétrage de mc (3:4.8.18-1) ...
La suppression complète d'un paquet, y compris les fichiers de configuration éventuellement modifiés est effectuée un utilisant la commande suivante :
root@debian9:~# apt-get --purge remove mc Lecture des listes de paquets... Fait Construction de l'arbre des dépendances Lecture des informations d'état... Fait Le paquet suivant a été installé automatiquement et n'est plus nécessaire : mc-data Veuillez utiliser « apt autoremove » pour le supprimer. Les paquets suivants seront ENLEVÉS : mc* 0 mis à jour, 0 nouvellement installés, 1 à enlever et 96 non mis à jour. Après cette opération, 1 465 ko d'espace disque seront libérés. Souhaitez-vous continuer ? [O/n] y (Lecture de la base de données... 91494 fichiers et répertoires déjà installés.) Suppression de mc (3:4.8.18-1) ... update-alternatives: utilisation de « /usr/bin/vim.tiny » pour fournir « /usr/bin/view » (view) en mode automatique Traitement des actions différées (« triggers ») pour mime-support (3.60) ... Traitement des actions différées (« triggers ») pour desktop-file-utils (0.23-1) ... (Lecture de la base de données... 91404 fichiers et répertoires déjà installés.) Purge des fichiers de configuration de mc (3:4.8.18-1) ...
Les paquets téléchargés d'une source distante ou via une source copy:// sont stockés dans le répertoire /var/cache/apt/archives. Les paquets partiellement téléchargés ou copiés sont stockés dans le répertoire /var/cache/apt/archives/partial.
root@debian9:~# ls /var/cache/apt/archives/ binutils_2.28-5_amd64.deb libasan3_6.3.0-18+deb9u1_amd64.deb libgcc-6-dev_6.3.0-18+deb9u1_amd64.deb libubsan0_6.3.0-18+deb9u1_amd64.deb partial curl_7.52.1-5+deb9u9_amd64.deb libatomic1_6.3.0-18+deb9u1_amd64.deb libitm1_6.3.0-18+deb9u1_amd64.deb lock dselect_1.18.25_amd64.deb libcc1-0_6.3.0-18+deb9u1_amd64.deb liblsan0_6.3.0-18+deb9u1_amd64.deb manpages-dev_4.10-2_all.deb gcc_4%3a6.3.0-4_amd64.deb libcilkrts5_6.3.0-18+deb9u1_amd64.deb libmpx2_6.3.0-18+deb9u1_amd64.deb mc_3%3a4.8.18-1_amd64.deb gcc-6_6.3.0-18+deb9u1_amd64.deb libcurl3_7.52.1-5+deb9u9_amd64.deb libtsan0_6.3.0-18+deb9u1_amd64.deb mc-data_3%3a4.8.18-1_all.deb
Pour nettoyer le cache il convient d'utiliser la commande suivante :
root@debian9:~# apt-get clean root@debian9:~# ls /var/cache/apt/archives/ lock partial
Pour mettre à jour les paquets déjà installés, il convient d'utiliser une de deux commandes apt-get :
- upgrade,
- dist-upgrade.
La deuxième commande met à jour une distribution complète, c'est-à-dire d'installer les mises à jour des paquets déjà installés et installer des nouveaux paquets ainsi que leur dépendances.
A faire - Consultez l'APT HOWTO pour vous renseigner sur les autres commandes et options.
LAB #2 - Utiliser la commande apt-cache
La commande apt-cache permet de se renseigner sur les paquetages connus à APT.
La commande apt-cache prend la forme suivante :
# apt-cache <options> <commande> <paquet(s)> [Entrée]
Les options et les commandes de la commande apt-cache sont :
root@debian9:~# apt-cache --help apt 1.4.9 (amd64) Usage: apt-cache [options] command apt-cache [options] show pkg1 [pkg2 ...] apt-cache queries and displays available information about installed and installable packages. It works exclusively on the data acquired into the local cache via the 'update' command of e.g. apt-get. The displayed information may therefore be outdated if the last update was too long ago, but in exchange apt-cache works independently of the availability of the configured sources (e.g. offline). Most used commands: showsrc - Affiche les enregistrements des sources search - Cherche une expression rationnelle dans la liste des paquets depends - Affiche toutes les dépendances d'un paquet rdepends - Affiche les dépendances inverses d'un paquet show - Affiche la description du paquet pkgnames - Liste le nom de tous les paquets du système policy - Affiche l'épinglage (Pin) en vigueur See apt-cache(8) for more information about the available commands. Configuration options and syntax is detailed in apt.conf(5). Information about how to configure sources can be found in sources.list(5). Package and version choices can be expressed via apt_preferences(5). Security details are available in apt-secure(8).
Les commandes les plus utilisées d'apt-cache sont :
Commande | Description |
---|---|
stats | Affiche quelques statistiques de base. |
search | Cherche une expression rationnelle dans la liste des paquets. |
show | Affiche la description du paquet. |
depends | Affiche toutes les dépendances d'un paquet. |
Utilisez la commande stats de la commande apt-cache pour obtenir des statistiques sur les paquets :
root@debian9:~# apt-cache stats Nombre total de paquets : 65317 (1 306 k) Nombre total de structures de paquets : 65322 (2 874 k) Paquets ordinaires : 50238 Paquets entièrement virtuels : 424 Paquets virtuels simples : 5490 Paquets virtuels mixtes : 636 Manquants : 8534 Nombre de versions distinctes : 52411 (4 193 k) Nombre de descriptions distinctes : 118225 (2 837 k) Nombre de dépendances : 328341/88670 (7 986 k) Nombre de relations version/fichier : 55240 (1 326 k) Nombre de relations description/fichier : 52689 (1 265 k) Nombre de relations « Provides » : 8946 (215 k) Nombre de motifs rationnels : 147962 (3 179 k) Espace disque gaspillé : 26,2 k Total de l'espace attribué : 25,6 M Total buckets in PkgHashTable: 50503 Unused: 13869 Used: 36634 Utilization: 72.5383% Average entries: 1.7831 Longest: 8 Shortest: 1 Total buckets in GrpHashTable: 50503 Unused: 13869 Used: 36634 Utilization: 72.5383% Average entries: 1.78296 Longest: 8 Shortest: 1
A faire - Utilisez le manuel d'apt-cache pour trouver les définitions des termes Normal packages, Pure virtual packages, Single virtual packages et Mixed virtual packages.
Recherchez maintenant la chaîne mc dans la liste des paquets :
root@debian9:~# apt-cache search mc | more alsa-oss - encapsuleur ALSA pour applications OSS amule-emc - liste les liens ed2k dans les fichiers emulecollection apel - bibliothèque portable pour emacsen apmd - utilitaires de gestion avancée de l'énergie (APM) appstream - gestion de métadonnées de composants logiciels ap-utils - utilitaires SNMP de point d'accès pour Linux archipel-agent-vmcasting - orchestration de machine virtuelle - agent Vmcasting ardour - station de travail audionumérique asterisk - Autocommutateur téléphonique (PBX) Open Source auto-07p - logiciel pour les problèmes de continuation et de bifurcation en équations différentielles ordinaires auto-multiple-choice - gestion de QCM auto-multiple-choice-common - Auto Multiple Choice - fichiers indépendants de l'architecture auto-multiple-choice-doc - Auto Multiple Choice - documentation HTML auto-multiple-choice-doc-pdf - Auto Multiple Choice - documentation PDF beast2-mcmc - inférence phylogénétique bayésienne MCMC beast2-mcmc-doc - inférence phylogénétique bayésienne MCMC – documentation beast2-mcmc-examples - inférence phylogénétique bayésienne MCMC – données d'exemple beast-mcmc - inférence phylogénétique bayésienne MCMC beast-mcmc-doc - inférence phylogénétique bayésienne MCMC – documentation beast-mcmc-examples - inférence phylogénétique bayésienne MCMC – données d'exemple cbmc - vérificateur de modèle borné pour les programmes C et C++ cccc - compteur de code C et C++, outil de métrique claws-mail-spam-report - greffon de rapport de pourriels pour Claws Mail cl-closer-mop - bibliothèque AMOP d'implémentation croisée cl-mcclim - boîte à outils d'interface utilisateur graphique Common Lisp cl-mcclim-doc - paquet d'interface utilisateur graphique pour les programmes Common Lisp cl-mcclim-examples - boîte à outils d'interface utilisateur graphique Common Lisp cl-swank - mode supérieur d'interaction LISP pour Emacs — serveur Lisp cl-trivial-backtrace - génération d'une trace Common Lisp portable cl-uffi - bibliothèque de fonction externe universelle pour Common Lisp cmucl-source - sources LISP de CMUCL collectd-core - démon de statistiques et surveillance – système central colortest - outils pour tester la capacité en couleur d'un terminal comgt - outil de contrôle de carte de donnée Vodafone et Option GlobeTrotter complexity - outil d'analyse de complexité pour les fonctions de programme C complexity-doc - outil d'analyse de complexité pour les fonctions de programme C – documentation cpuid - outil pour lister les informations CPUID x86 sur le(s) processeur(s) discover-data - listes de données pour Discover, le système d'identification de matériel dreamchess - jeu d’échecs 3D --Plus--
Pour être plus précis dans la recherche, il est nécessaire de rechercher une phrase clef :
root@debian9:~# apt-cache search "midnight commander" avfs - système de fichiers virtuel pour accéder aux archives, images disque, endroits distants gnome-commander - gestionnaires de fichiers pour GNOME junior-system - outils système Debian Jr. krusader - Gestionnaire de fichiers à deux volets (dans le style de Commander) lfm - gestionnaire de fichiers simple et puissant pour la console UNIX mc - Midnight Commander - gestionnaire de fichiers évolué mc-data - Midnight Commander - gestionnaire de fichiers évolué –⋅fichiers de données pilot - Navigateur simple de fichiers pour Alpine, client de courriel en mode texte tuxcmd - gestionnaire de fichiers à double panneau utilisant GTK+ 2 gnome-commander-data - Data files for GNOME Commander gnome-commander-dbg - Debugging symbols for gnome-commander moc - ncurses based console audio player ranger - File manager with an ncurses frontend written in Python
Afficher maintenant les informations concernant le paquet mc :
root@debian9:~# apt-cache show mc Package: mc Version: 3:4.8.18-1 Installed-Size: 1431 Maintainer: Debian MC Packaging Group <pkg-mc-devel@lists.alioth.debian.org> Architecture: amd64 Provides: mcedit Depends: e2fslibs (>= 1.37), libc6 (>= 2.15), libglib2.0-0 (>= 2.35.9), libgpm2 (>= 1.20.4), libslang2 (>= 2.2.4), libssh2-1 (>= 1.2.8), mc-data (= 3:4.8.18-1) Recommends: mime-support, perl, unzip Suggests: arj, bzip2, catdvi | texlive-binaries, dbview, djvulibre-bin, file, genisoimage, gv, imagemagick, libaspell-dev, links | w3m | lynx, odt2txt, poppler-utils, python, python-boto, python-tz, xpdf | pdf-viewer, zip Description-fr: Midnight Commander - gestionnaire de fichiers évolué GNU Midnight Commander est un gestionnaire de fichiers en mode texte plein écran. Il utilise une interface à deux volets et un sous-shell pour l'exécution de commandes. Il comporte un éditeur de fichiers avec colorisation syntaxique ainsi qu'un afficheur de fichiers gérant les fichiers binaires. Il fournit également VFS (« Virtual Filesystem », système de fichiers virtuel) qui permet de manipuler les fichiers situés sur des systèmes distants (p. ex. de serveurs FTP ou SSH) ainsi que les fichiers inclus dans des archives. Description-md5: 252a5c5aeeb7425db45357d4ab8aa55f Homepage: http://www.midnight-commander.org Tag: admin::filesystem, implemented-in::c, implemented-in::perl, interface::commandline, interface::text-mode, role::program, scope::application, suite::gnu, uitoolkit::ncurses, use::browsing, use::editing, use::organizing, works-with::archive, works-with::file Section: utils Priority: optional Filename: pool/main/m/mc/mc_4.8.18-1_amd64.deb Size: 512534 MD5sum: 0d114b3f03ec94fa58f4f0cb38a6edfd SHA256: 3e360d9848a0d44519f3e041b97cde6e88cd704d7b2f5efb3ffeede517b062ae
Dernièrement, visualisez les dépendances du paquet mc :
root@debian9:~# apt-cache depends mc mc Dépend: e2fslibs Dépend: libc6 Dépend: libglib2.0-0 Dépend: libgpm2 Dépend: libslang2 Dépend: libssh2-1 Dépend: mc-data Recommande: mime-support Recommande: perl Recommande: unzip Suggère: arj Suggère: bzip2 |Suggère: catdvi Suggère: texlive-binaries Suggère: dbview Suggère: djvulibre-bin Suggère: file Suggère: genisoimage Suggère: gv Suggère: imagemagick graphicsmagick-imagemagick-compat imagemagick-6.q16 Suggère: libaspell-dev |Suggère: links |Suggère: w3m Suggère: lynx Suggère: odt2txt Suggère: poppler-utils Suggère: python Suggère: python-boto Suggère: python-tz |Suggère: xpdf Suggère: <pdf-viewer> atril evince gv mupdf okular viewpdf.app xpdf zathura-pdf-poppler Suggère: zip
Les deux lignes suivantes :
|Suggère: xpdf Suggère: <pdf-viewer>
indiquent soit xpdf soit <pdf-viewer>
Les Bibliothèques Partagées
Présentation
Introduction
Les bibliothèques partagées sont des fonctions communes à plusieurs programmes différents d'un même domaine (son, base de données, vidéo etc.). Les fonctions proposées par une ou plusieurs bibliothèques forment un API (Application Programming Interface). Sous Linux les bibliothèques se nomment Shared Objects et portent le suffixe .so.
Stockage
Les bibliothèques partagées sont stockées par convention dans des répertoires lib, par exemple :
Répertoire | Contenu |
---|---|
/lib | Bibliothèques du système de base |
/usr/lib | Bibliothèques utilisateurs |
/usr/local/lib | Bibliothèques locales |
/usr/X11R6/lib | Bibliothèques de l'environnement X |
/opt/kde4/lib | Bibliothèques de KDE |
Important : La bibliothèque la plus importante est libc. Sans elle, le système Linux ne peut pas fonctionner.
ld-linux.so.2
La bibliothèque ld-linux.so.2 est utilisée par le système pour créer un lien avec une bibliothèque partagée au moment de l'exécution d'un programme et s'appelle le chargeur de liens. Ce dernier recherche des bibliothèques partagées dans un ordre précis :
- dans les chemins précisés par la variable système LD_LIBRARY_PATH,
- dans les chemins précisés dans le contenu compilé du fichier /etc/ld.so.cache,
- dans /lib et /usr/lib.
Il est à noter que le contenu du cache ld.so.cache est construit à partir des informations contenus dans le fichier de configuration /etc/ld.so.conf.
Afin d'étudier les bibliothèques liées à une application, nous allons d'abord installer l'application mc, un explorateur de fichiers en mode console :
root@debian9:~# apt-get install mc Lecture des listes de paquets... Fait Construction de l'arbre des dépendances Lecture des informations d'état... Fait Paquets suggérés : arj catdvi | texlive-binaries dbview djvulibre-bin genisoimage gv imagemagick libaspell-dev links | w3m | lynx odt2txt poppler-utils python-boto python-tz zip Les NOUVEAUX paquets suivants seront installés : mc 0 mis à jour, 1 nouvellement installés, 0 à enlever et 96 non mis à jour. Il est nécessaire de prendre 513 ko dans les archives. Après cette opération, 1 465 ko d'espace disque supplémentaires seront utilisés. Réception de:1 http://ftp.fr.debian.org/debian stretch/main amd64 mc amd64 3:4.8.18-1 [513 kB] 513 ko réceptionnés en 0s (878 ko/s) Sélection du paquet mc précédemment désélectionné. (Lecture de la base de données... 91395 fichiers et répertoires déjà installés.) Préparation du dépaquetage de .../mc_3%3a4.8.18-1_amd64.deb ... Dépaquetage de mc (3:4.8.18-1) ... Traitement des actions différées (« triggers ») pour mime-support (3.60) ... Traitement des actions différées (« triggers ») pour desktop-file-utils (0.23-1) ... Paramétrage de mc (3:4.8.18-1) ... update-alternatives: utilisation de « /usr/bin/mcview » pour fournir « /usr/bin/view » (view) en mode automatique
La Commande ldd
Pour déterminer quelles sont les bibliothèques liées à une application, il convient d'utiliser la commande ldd :
root@debian9:~# ldd /usr/bin/mc linux-vdso.so.1 (0x00007ffd98535000) libslang.so.2 => /lib/x86_64-linux-gnu/libslang.so.2 (0x00007fb441ace000) libgpm.so.2 => /usr/lib/x86_64-linux-gnu/libgpm.so.2 (0x00007fb4418c8000) libssh2.so.1 => /usr/lib/x86_64-linux-gnu/libssh2.so.1 (0x00007fb44169c000) libext2fs.so.2 => /lib/x86_64-linux-gnu/libext2fs.so.2 (0x00007fb44144b000) libgmodule-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgmodule-2.0.so.0 (0x00007fb441247000) libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007fb440f33000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fb440d16000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fb440977000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fb440773000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fb44046f000) libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fb440255000) libgcrypt.so.20 => /lib/x86_64-linux-gnu/libgcrypt.so.20 (0x00007fb43ff45000) libcom_err.so.2 => /lib/x86_64-linux-gnu/libcom_err.so.2 (0x00007fb43fd41000) libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007fb43face000) /lib64/ld-linux-x86-64.so.2 (0x00007fb4422e3000) libgpg-error.so.0 => /lib/x86_64-linux-gnu/libgpg-error.so.0 (0x00007fb43f8ba000)
Afin de comprendre ce qui se passe dans le cas où une bibliothèque est manquante, renommez la bibliothèque /usr/lib/libgpm.so.2 en /usr/lib/libgpm.so.2.old :
root@debian9:~# mv /usr/lib/x86_64-linux-gnu/libgpm.so.2 /usr/lib/x86_64-linux-gnu/libgpm.so.2.old
Exécutez de nouveau la commande ldd. Vous obtiendrez un résultat similaire à celui-ci :
root@debian9:~# ldd /usr/bin/mc linux-vdso.so.1 (0x00007ffd7bbf2000) libslang.so.2 => /lib/x86_64-linux-gnu/libslang.so.2 (0x00007f2f6e9da000) libgpm.so.2 => not found libssh2.so.1 => /usr/lib/x86_64-linux-gnu/libssh2.so.1 (0x00007f2f6e7ae000) libext2fs.so.2 => /lib/x86_64-linux-gnu/libext2fs.so.2 (0x00007f2f6e55d000) libgmodule-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgmodule-2.0.so.0 (0x00007f2f6e359000) libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007f2f6e045000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f2f6de28000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f2f6da89000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f2f6d885000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f2f6d581000) libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f2f6d367000) libgcrypt.so.20 => /lib/x86_64-linux-gnu/libgcrypt.so.20 (0x00007f2f6d057000) libcom_err.so.2 => /lib/x86_64-linux-gnu/libcom_err.so.2 (0x00007f2f6ce53000) libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f2f6cbe0000) /lib64/ld-linux-x86-64.so.2 (0x00007f2f6f1ef000) libgpg-error.so.0 => /lib/x86_64-linux-gnu/libgpg-error.so.0 (0x00007f2f6c9cc000)
Notez la présence de la ligne libgpm.so.2 ⇒ not found. Compte tenu de la bibliothèque partagée manquante, le programme mc ne peut plus être lancé :
root@debian9:~# mc mc: error while loading shared libraries: libgpm.so.2: cannot open shared object file: No such file or directory
Renommez la bibliothèque correctement et vérifiez la résolution de l'erreur précédente avec la commande ldd :
root@debian9:~# mv /usr/lib/x86_64-linux-gnu/libgpm.so.2.old /usr/lib/x86_64-linux-gnu/libgpm.so.2 root@debian9:~# ldd /usr/bin/mc linux-vdso.so.1 (0x00007ffeacd8e000) libslang.so.2 => /lib/x86_64-linux-gnu/libslang.so.2 (0x00007f1abfe58000) libgpm.so.2 => /usr/lib/x86_64-linux-gnu/libgpm.so.2 (0x00007f1abfc52000) libssh2.so.1 => /usr/lib/x86_64-linux-gnu/libssh2.so.1 (0x00007f1abfa26000) libext2fs.so.2 => /lib/x86_64-linux-gnu/libext2fs.so.2 (0x00007f1abf7d5000) libgmodule-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgmodule-2.0.so.0 (0x00007f1abf5d1000) libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007f1abf2bd000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f1abf0a0000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f1abed01000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f1abeafd000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f1abe7f9000) libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f1abe5df000) libgcrypt.so.20 => /lib/x86_64-linux-gnu/libgcrypt.so.20 (0x00007f1abe2cf000) libcom_err.so.2 => /lib/x86_64-linux-gnu/libcom_err.so.2 (0x00007f1abe0cb000) libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f1abde58000) /lib64/ld-linux-x86-64.so.2 (0x00007f1ac066d000) libgpg-error.so.0 => /lib/x86_64-linux-gnu/libgpg-error.so.0 (0x00007f1abdc44000)
Le fichier /etc/ld.so.conf
Le fichier /etc/ld.so.conf est utilisé pour configurer le cache /etc/ld.so.cache :
root@debian9:~# cat /etc/ld.so.conf include /etc/ld.so.conf.d/*.conf
Dans ce cas, le fichier ne contient qu'une directive include qui renvoie vers le contenu du répertoire /etc/ld.so.conf.d/ :
root@debian9:~# ls -l /etc/ld.so.conf.d/ total 8 -rw-r--r-- 1 root root 44 mars 21 2016 libc.conf -rw-r--r-- 1 root root 68 janv. 14 2018 x86_64-linux-gnu.conf
Le contenu de ces deux fichiers est le suivant :
root@debian9:~# cat /etc/ld.so.conf.d/x86_64-linux-gnu.conf # Multiarch support /lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu
root@debian9:~# cat /etc/ld.so.conf.d/libc.conf # libc default configuration /usr/local/lib
La Commande ldconfig
La commande ldconfig est utilisée pour :
- mettre à jour le cache pour les chemins inclus dans le fichier /etc/ld.so.conf ainsi que pour les répertoires /lib et /usr/lib. L'option -N de la commande ldconfig empêche la mise à jour des chemins dans le fichier,
- mettre à jour les liens symboliques sur les bibliothèques. L'option -X de la commande ldconfig empêche la mise à jour des liens symboliques.
Les liens symboliques sont utilisés pour gérer les versions de bibliothèques.
La commande ldconfig peut être utilisée avec l'option -p pour visualiser le contenu du cache :
root@debian9:~# ldconfig -p | more 753 libs trouvé dans le cache « /etc/ld.so.cache » libzvbi.so.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libzvbi.so.0 libzvbi-chains.so.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libzvbi-chains.so.0 libz.so.1 (libc6,x86-64) => /lib/x86_64-linux-gnu/libz.so.1 libyaml-0.so.2 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libyaml-0.so.2 libyajl.so.2 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libyajl.so.2 libx265.so.95 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libx265.so.95 libx264.so.148 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libx264.so.148 libxvidcore.so.4 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libxvidcore.so.4 libxtables.so.12 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libxtables.so.12 libxslt.so.1 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libxslt.so.1 libxshmfence.so.1 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libxshmfence.so.1 libxml2.so.2 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libxml2.so.2 libxklavier.so.16 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libxklavier.so.16 libxkbfile.so.1 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libxkbfile.so.1 libxkbcommon.so.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libxkbcommon.so.0 libxkbcommon-x11.so.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libxkbcommon-x11.so.0 libxfsm-4.6.so.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libxfsm-4.6.so.0 libxfsm-4.6.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libxfsm-4.6.so libxfconf-0.so.2 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libxfconf-0.so.2 libxfce4util.so.7 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libxfce4util.so.7 libxfce4ui-2.so.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libxfce4ui-2.so.0 libxfce4ui-1.so.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libxfce4ui-1.so.0 libxfce4panel-2.0.so.4 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libxfce4panel-2.0.so.4 libxfce4panel-1.0.so.4 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libxfce4panel-1.0.so.4 libxfce4kbd-private-3.so.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libxfce4kbd-private-3.so.0 libxfce4kbd-private-2.so.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libxfce4kbd-private-2.so.0 libxcb.so.1 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libxcb.so.1 libxcb-xv.so.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libxcb-xv.so.0 libxcb-xkb.so.1 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libxcb-xkb.so.1 libxcb-xinerama.so.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libxcb-xinerama.so.0 libxcb-xfixes.so.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libxcb-xfixes.so.0 libxcb-util.so.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libxcb-util.so.0 libxcb-sync.so.1 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libxcb-sync.so.1 libxcb-shm.so.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libxcb-shm.so.0 libxcb-shape.so.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libxcb-shape.so.0 libxcb-render.so.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libxcb-render.so.0 libxcb-render-util.so.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libxcb-render-util.so.0 libxcb-randr.so.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libxcb-randr.so.0 --Plus--
Pour ajouter des bibliothèques partagées, il convient de :
- créer un fichier dans le répertoire /etc/ld.so.conf.d/ et d'y inscrire le ou les chemins vers le lieu de stockage des bibliothèques partagées à ajouter,
- exécuter la commande ldconfig -v, où v implique verbose, afin de reconstruire le cache.
Copyright © 2023 Hugh Norris.