LPI Linux Certification in a Nutshell
edited.
    Frequently used options
    -E
Do not overwrite a previously installed package of the
     same version.
-G
Do not overwrite a previously installed package with an
     older version of that same package.
-R (also
--
recursive )
Recursively process package files in specified
     subdirectories. Works with -i , --install , --unpack ,
     and so on.
    Frequently used options
    --configure
package
Configure an unpacked package. This involves setup of
     configuration files.
-i
package_file
(also --install
package_file
)
Install the package contained in
package_file
. This involves backing
     up old files, unpacking and installation of new files, and
     configuration.
-l
[
pattern
]
(also --list
[
pattern
]
)
Display information for installed package names that
     match
pattern
.
-L
package
(also --listfiles
package
)
List files installed from
package
.
--print-avail
package
Display details found in /var/lib/dpkg/available about
package
.
--purge
package
Remove everything for
package
.
-r
package
(also --remove
package
)
Remove everything except configuration files for
package
.
-s
package
(also --status
package
)
Report the status of
package
.
-S
search_pattern
(also --search
search_pattern
)
Search for a filename matching
search_pattern
from installed
     packages.
--unpack
package_file
Unpack
package_file
, but
     don’t install the package it contains.
    Example 1
    Install a package using dpkg -i with the
     name of an available package file:
# dpkg -i ./hdparm_3.3-3.deb (Reading database ... 54816 files and directories
currently installed.)
Preparing to replace hdparm 3.3-3 (using hdparm_3.3-3.deb)
Unpacking replacement hdparm ...
Setting up hdparm (3.3-3) ...
    Alternatively, use apt-get install with
     the name of the package. In this case, the package comes from the
     location or locations configured in /etc/apt/sources.list . For this example, the
     location is http://http.us.debian.org :
# apt-get install elvis Reading Package Lists... Done
Building Dependency Tree... Done
The following extra packages will be installed:
libncurses4 xlib6g
The following NEW packages will be installed:
elvis
2 packages upgraded, 1 newly installed, 0 to remove
and 376 not upgraded.
Need to get 1678kB of archives. After unpacking 2544kB
will be used.
Do you want to continue? [Y/n] y Get:1 http://http.us.debian.org stable/main
libncurses4 4.2-9 [180kB]
Get:2 http://http.us.debian.org stable/main
xlib6g 3.3.6-11 [993kB]
Get:3 http://http.us.debian.org stable/main
elvis 2.1.4-1 [505kB]
Fetched 1678kB in 4m11s (6663B/s)
(Reading database ... 54730 files and directories
currently installed.)
Preparing to replace libncurses4 4.2-3 (using
.../libncurses4_4.2-9_i386.deb) ...
Unpacking replacement libncurses4 ...
(installation continues...)
    Example 2
    Upgrading a package is no different from installing one.
     However, you should use the -G option when
     upgrading with dpkg to ensure that the
     installation won’t proceed if a newer version of the same package is
     already installed.
    Example 3
    Use dpkg -r or dpkg
     --purge to remove a package:
# dpkg --purge elvis (Reading database ... 54816 files and directories
currently installed.)
Removing elvis ...
(purge continues...)
    Example 4
    Use the dpkg -S command to find a package
     containing specific files. In this example, apt-get is contained in the apt package:
# dpkg -S apt-get apt: /usr/share/man/man8/apt-get.8.gz
apt: /usr/bin/apt-get
    Example 5
    Obtain package status information, such as version, content,
     dependencies, integrity, and installation status, using dpkg -s :
# dpkg -s apt Package: apt
Status: install ok installed
Priority: optional
Section: admin
Installed-Size: 1388
(listing continues...)
    Example 6
    List the files in a package using dpkg -L and process the output using grep or less :
# dpkg -L apt | grep '^/usr/bin' /usr/bin
/usr/bin/apt-cache
/usr/bin/apt-cdrom
/usr/bin/apt-config
/usr/bin/apt-get
    Example 7
    List the installed packages using dpkg
     -l ; if you

Similar Books

Thoreau in Love

John Schuyler Bishop

3 Loosey Goosey

Rae Davies

The Testimonium

Lewis Ben Smith

Consumed

Matt Shaw

Devour

Andrea Heltsley

Organo-Topia

Scott Michael Decker

The Strangler

William Landay

Shroud of Shadow

Gael Baudino