dpkg is a tool to install, build, remove and manage Debian packages. The primary and more user-friendly front-endfor dpkg is aptitude(1). dpkg itself is controlled entirely via command line parameters, which consist of exactly one action and zero or more options.The action- parameter tells dpkg what to doand options control the behavior of the action in some way.
dpkg can also be used as a front-end to dpkg-deb(1)and dpkg-query(1). The list of supported actions can be found later on in the ACTIONS sec? tion.If any such action is encountered dpkg just runs dpkg-deb or dpkg-query with the parameters given to it, but no specific options are currently passed to them, to use any such option the back-ends need to be called directly.
dpkg -i [package-name]
dpkg -i google-chrome-stable_current_amd64.deb
1.Extract the control files of the newpackage.
2.If another version of the same package was installed before the new installation, execute prerm script of the old package.
3.Run preinst script,if provided by the package.
4.Unpack the new files,and at the same time back up the old files, so that if something goes wrong, they can be restored.
5.If another version of the same package was installed before the new installation, execute the postrm script of the old pack? age.Note that this script is executed after the preinst script of the newpackage, because new files are written at the same time old files are removed.
6.Configure the package.See--configure for detailed informa? tion about how thisisdone.
dpkg -r [package-name]
dpkg -r googler_3.3.0-1_all.deb
Removing of a package consists of the following steps:
1.Run prerm script
2.Remove the installed files
3.Run postrm script
dpkg –contents [package name]
dpkg –unpack [package-name]
dpkg –configure [package-name]
Configuring consists of the following steps:
1.Unpack the conffiles,and at the same time back up the old conffiles, so that they can be restored if something goes wrong.
Some configuration files might be unknown to dpkg because they are created and handled separately through the configura? tion scripts.In that case, dpkg won't remove them by itself, but the package's postrm script (which is called by dpkg), has to take care of their removal during purge.Of course,this only applies to files in system directories,not configuration files written to individual users' home directories.
Purging of a package consists of the following steps:
1. Remove the package, if not already removed. See --remove for detailed information about how this is done.