Packages aremanuallyinstalled via thedpkg
command (Debian Package Management System).dpkg
is the backend to commands likeapt-get
andaptitude
,which in turn are the backend for GUI install apps like the Software Center and Synaptic.
Something along the lines of:
dpkg
-->apt-get
,aptitude
--> Synaptic,Software Center
But of course the easiest ways to install a package would be,first,the GUI apps (Synaptic,Software Center,etc..),followed by the terminal commandsaptitude
that add a very nice user friendly approach to the backend dpkg,including but not limited to packaged dependencies,control over what is installed,needs update,not installed,broken packages,etc.. Lastly thedpkg
command which is the base for all of them.
Since dpkg is the base,you can use it to install packaged directly from the command line.
Install a package
sudo dpkg -i DEB_PACKAGE
For example if the package file is calledaskubuntu_2.0.deb
then you should dosudo dpkg -i askubuntu_2.0.deb
. Ifdpkg
reports an error due to dependency problems,you can runsudo apt-get install -f
to download the missing dependencies and configure everything. If that reports an error,you'll have to sort out the dependencies yourself by following for exampleHow do I resolve unmet dependencies after adding a PPA?.
Remove a package
sudo dpkg -r PACKAGE_NAME
For example if the package is calledaskubuntu
then you should dosudo dpkg -r askubuntu
.
Reconfigure an existing package
sudo dpkg-reconfigure PACKAGE_NAME
This is useful when you need to reconfigure something related to said package. Some useful examples it thekeyboard-configuration
when you want to enable theCtrl+Alt+Backspacein order to reset the X server,so you would the following:
sudo dpkg-reconfigure keyboard-configuration
Another great one is when you need to set the Timezone for a server or your local testing computer,so you use use thetzdata
package:
sudo dpkg-reconfigure tzdata
@H_502_8@ | |
2 |
sudo apt-get install texlive-latex-base
,it has Failed for months with "Hash Sum mismatch". I can download the .deb file fromhttp://gb.archive.ubuntu.com/ubuntu/pool/main/t/texlive-base/texlive-latex-base-doc_2015.20150625-1ubuntu1_all.deb
. If I install it using dpkg,would it subsequently be recognised (and updated) by apt-get.–
user643722
Jan 19 '16 at 17:05
Debian (.deb) packages are the packages that are used in Ubuntu. You can install any .deb package in your system. .deb files can generally be installed from your file manager (Nautilus) merely by clicking on them,since file associations with the default installer is already set in Ubuntu. These instructions are for those who wish to install packages from the command-line terminal (Terminal).
To install a downloaded Debian (Ubuntu) package (.deb): Open Terminal and type
sudo dpkg -i packagename.deb
To remove a Debian (Ubuntu) package (.deb):
sudo dpkg -r packagename
To Reconfigure/Repair an installed Debian (Ubuntu) package (.deb):
sudo dpkg-reconfigure packagename