Published Book on Amazon
|All of IOT Starting with the Latest Raspberry Pi from Beginner to Advanced – Volume 1|
|All of IOT Starting with the Latest Raspberry Pi from Beginner to Advanced – Volume 2|
출판된 한글판 도서
|최신 라즈베리파이(Raspberry Pi)로 시작하는 사물인터넷(IOT)의 모든 것 – 초보에서 고급까지 (상)|
|최신 라즈베리파이(Raspberry Pi)로 시작하는 사물인터넷(IOT)의 모든 것 – 초보에서 고급까지 (하)|
Original Book Contents
17.5.3 Installing Programs Distributed in Package Format
Of course, if the program is configured in a package format but is not registered in the package repository and distributed in a separate way, you can not use the APT tool "apt-get" command, and you have to use the low-level "dpkg" command.
dpkg [option...] -i directory/package-file
dpkg [option...] --install directory/package-file
■ This installs a specified package in the system.
■ User privilege -- Super user.
■ The package-file specified here is a file name that contains package information, not a package name, and usually has a ".deb" extension.
■ If "--recursive" or "-R" option is specified, specify a directory, not a specific file to package-file.
■ This action processes both "--unpack" and "--configure" action.
■ The install operation processes the next step:
■ Extract the control files for the new package.
■ If another version of the same package has been installed before installing the new package, run "prerm" script of the previous package.
■ If the package provides a "preinst" script, run the script.
■ Unpacks the package of the new file and backs up the old file so that it can be restored if the installation processing is wrong during the installation process.
■ If another version of the same package has been installed before running a new installation, run "postrm" script of the previous package. This script will be executed after "preinst" script of the new package is executed, and note that this is because new files will be written as soon as the old ones are deleted.
■ Configure the configuration for the package. See the description of "--configure" action for details on how this works.
-i, --install package-file...
Install the package. If --recursive or -R option is specified, package-file must refer to a directory instead.
Unpack the package, but don't configure it. If --recursive or –R option is specified, package-file must refer to a directory instead.
Configure a package which has been unpacked but not yet configured.
If -a or --pending is given instead of package, all unpacked but unconfigured packages are configured.
Recursively handle all regular files matching pattern *.deb found at specified directories and all of its subdirectories. This can be used with -i, -A, --install, --unpack and --avail actions.
The following is an example of downloading the package file and installing it on the system to install <Mplayer> program.
pi@raspberrypi ~ $ dpkg -i /home/pi/Downloads/mplayer_0.xx_i386.deb
The following is an example of downloading and installing <cron> program package file.
pi@raspberrypi ~ $ dpkg -i /home/pi/Downloads/cron_3.0p11.deb