Zusammenfassung der Ressource
102.4 Use
Debian package
management
- Introduction
- A long time ago, when
Linux was still in its
infancy
- (usually a .tar.gz
archive
- Compilated
- as the amount and
complexity of software
grew, the need for a
way to distribute
pre-compiled software
- Debian package
format (.deb
- dpkg
- -i:instalar (*.deb)
-r:emover,
-I:Informacin(
*deb) -L:lista
-S:Pacquete Dueño
- de un archivo
-c_lista el cntenido
(*.deb)
- -i(deb), -l(paq),
-I(deb), -s(paq),
-S(file), -L(paq),
-r(paq)
- dpkg-query -S archivo
- apt
- The Debian
Package Tool
(dpkg)
- configure, maintain and
remove software packages
on Debian-based systems
- dpkg -i packagename.deb
- Dealing
with
Dependencies
- a package may
depend on others
to work
- an image editor may
need libraries to open
JPEG files,
- to install the
OpenShot video
editor package,
- dpkg -i openshot-qt_2.4.3+dfsg1-1_all.deb
- openshot-qt depends on fonts-cantarell; however:
Package fonts-cantarell is not installed. openshot-qt
depends on python3-openshot; however: Package
python3-openshot is not installed.
- OpenShot depends on the fonts-cantarell, python3-openshot,
python3-pyqt5, python3-pyqt5.qtsvg, python3-pyqt5.qtwebkit
and python3-zmq packages. All of those need to be installed
before the installation of OpenShot can succeed.
- dpkg -i --force packaname.deb
- Removing Packages
- dpkg -r unrar
- The removal operation also runs a dependency
check, and a package cannot be removed unless
every other package that depends on it is also
removed
- Getting
Package
Information
- # dpkg -I google-chrome-stable_current_amd64.deb
- Package: google-chrome-stable
Version: 76.0.3809.100-1 Architecture:
amd64 Maintainer: Chrome Linux
Team <chromium-dev@chromium.org>
Installed-Size: 205436 Pre-Depends:
dpkg (>= 1.14.0)
- Listing Installed
Packages and
Package Contents
- # dpkg -L unrar
- /. /usr
/usr/bin
/usr/bin/unrar-nonfree
/usr/share
- Finding Out
Which Package
Owns a
Specific File
- # dpkg-query -S /usr/bin/unrar-nonfree
unrar: /usr/bin/unrar-nonfree
- dpkg --get-selections
- Lists out (enumera) every
package that dpkg has
installed on the system.
- Reconfiguring
Installed Packages
- post-install
- permisos
- file
configuration
- ask some
questions of
the user to set
preferences
- dpkg-reconfigure packagename,
- will back-up the old
configuration files,
- unpack the new
ones in the correct
directories
- and run the post-install
script provided by the
package
- dpkg-reconfigure tzdata
- example
- Advanced
Package Tool
(apt)
- is a package
management
system
- including a set
of tools
- that greatly simplifies package
installation, upgrade, removal and
management
- automatic
dependency
resolution.
- APT works in concert with
software repositories
which contain the
packages available to
install.
- apt-get used to download,
install, upgrade or remove
packages from the system.
- apt-cache used to perform
operations, like searches,
in the package index.
- apt-file used for
searching for files
inside packages
- Updating
the Package
Index
- apt-get update
- Installing and
Removing Packages
- # apt-get
install
xournal
- # apt-get
remove xournal
- apt-get purge p7zip
- apt-get remove --purge p7zip
- Fixing Broken
Dependencies
- apt-get install -f
- Upgrading Packages
- apt-get update
apt-get upgrade
- The Local
Cache
- /var/cache/apt/archives
- file is downloaded to a local
cache directory
- /var/cache/apt/archives/partial/
- Partially downloaded
- The Sources List
- /etc/apt/sources.list
- deb http://us.archive.ubuntu.com/ubuntu/ disco main restricted universe multiverse
- Archive type
- deb:binario
deb-source:fuente
- url repository
- main:soportado oficialmente
- restricted: soportado oficialmente y codigo cerrado
- universe:Software open source comunidad
- multiverse:contains unsupported,
closed-source or patent-encumbered
software.
- distribucion:dsco
- disco:disco dingo
- main:packages compilados
con Debian Free Software
Guidelines
- contrib:contains
DFSG-compliant
packages, depends of
other packages not main
- non-free
- not compliant
with the
DFSG.
- security
- contains
security
updates.
- backports
- contains more recent
versions of packages
that are in main
- Searching for Packages
- apt-cache search p7zip
- apt-cache show liblzma5
- /etc/apt/sources.list.d Directory
- add files with additional
repositories to be used by APT,
without the need to modify
the main /etc/apt/sources.list
file.
- These are simple text files,
with the same syntax
described above and the .list
file extension.
- Listing Package
Contents and
Finding Files
- # apt-get install apt-file
- apt-file update
- apt-file update
- apt-file search libSDL2.so
- Preguntas Y Repuestas
- What is the command to
install a package named
package.deb using dpkg
- dpkg -i package-name
- Using dpkg-query, find
which package contains a
file named 7zr.1.gz.
- dpkg-query -S 7zr.1.gz
- Can you remove a package
called unzip from the system
using dpkg -r unzip if the
package file-roller depends on
it? If not, what would be the
correct way to do it?
- No. dpkg will not
resolve dependencie
- How can you find out which
package contains the file
/usr/bin/unrar using the apt-file
utility?
- # apt-file search /usr/bin/unrar
- Using apt-cache, what is the
command to show
information for the package
gimp?
- # apt-cache show gimp
- Consider a repository with Debian source packages
for the xenial distribution, hosted at
http://us.archive.ubuntu.com/ubuntu/ and with
packages for the universe component. What would
be the corresponding line to be added to
/etc/apt/sources.list? Source packages are of the
deb-src type, so the line should be:
- deb-src http://us.archive.ubuntu.com/ubuntu/ xenial universe
- While compiling a program, you come across an error
message complaining that the header file zzip-io.h is not
present on your system. How can you find out with
package provides that file? Use apt-file search to find which
package contains a file not present in the system:
- # apt-file search zzip-io.h
- How can you ignore a dependency
warning and remove a package using
dpkg, even if there are packages that
depend on it in the system?
- The parameter --force can be used,
- How can you get more
information about a package
called midori using apt-cache?
- # apt-cache show midori
- Before installing or updating
packages with apt-get, which
command should be used to
ensure that the package
index is up-to-date?
- apt-get update