How do I install a .deb file via the command line?
|
|
Packages are manually installed via the Something along the lines of:
But of course the easiest ways to install a package would be, first, the GUI apps (Synaptic, Software Center, etc..), followed by the terminal commands Since dpkg is the base, you can use it to install packaged directly from the command line. Install a package
For example if the package file is called Remove a package
For example if the package is called Reconfigure an existing package
This is useful when you need to reconfigure something related to said package. Some useful examples it the
Another great one is when you need to set the Timezone for a server or your local testing computer, so you use use the
|
|||||||||||||||||||||
|
|
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
To remove a Debian (Ubuntu) package (.deb):
To Reconfigure/Repair an installed Debian (Ubuntu) package (.deb):
|
|||
|
|
|
My favourite is GDebi, available from both terminal/shell or graphical desktop.
I usually associate For command-line run |
|||||||||||||||||
|
DPKG commandsThere are two actions, they are Install a package
Remove a package
Remove a package and its configuration files
List all installed packages.You can pipe the command to
Check if the package is installed or not
Check if the package is installed or not, and if it is, launch it:
See whether a package is installed or notAnd this will show the location where the package will be installed.
Here
Install a *.deb package from a specified locationHere
Show package detailsHere
View the content of a packageUse
Extract the
|
|
"Check if the package is installed or not, and if it is, launch it:
# dpkg -l | vlc" - this would only pipe a list of packages to vlc, with unpredictable results if it were installed; and no better than just typing vlc
– Xen2050
Feb 7 '15 at 6:15
|
|
While
Note the |
|||||||||
|
|
A handy tip when installing a program like Libreoffice which has multiple .deb files in a folder is to use.
|
|||||
|
|
Create your own script installer
Make the script executable with
Then move it to some dirs in your PATH or add the current directory to your PATH. I'm going to move it to /usr/bin
Now you can install any
The added value of this method is the solving the dependencies problem, since mostly you'll face some problems when you install a |
||||
|
|
The
|
|
|
askubuntu.com/a/170557/158442 does say
gdebi can be used from the command line
– muru
Dec 27 '16 at 11:59
|
||
|
|
@muru Yeah, but it's easy to miss because of the screenshot. Also, it doesn't explain the problems with
dpkg -i skype.deb
– Flimm
Dec 27 '16 at 12:29
|
|
To Install:
To Remove:
To Reconfigure:
Another approach is to install gdebi |
||||
|
|
|
In 16.04 & higher: Apt now installs & resolves dependencies from .deb files so quite simple,
|
||||
|
|
|
To install a Debian package (ends with '.deb') using cmd 'dpkg', you would enter:
If you want to remove that same Debian package at some point, then:
To get a list of current Debian packages installed, use:
|
|||
|
|
|
(.deb) packages are manually installed using dpkg command or we can say "Debian Package Management System". dpkg is one of the backend commands like apt-get and aptitude. For an example:dpkg --> apt-get, aptitude --> Synaptic, Software Center But of course the easiest ways to install a package would be, first,since dpkg is the base, you can use it to install packaged directly from the command line. For Install a package:sudo dpkg -i "DEB_PACKAGE" For example if the package file is called askubuntu_2.0.deb then you should do sudo dpkg -i askubuntu_2.0.deb. If dpkg reports an error due to dependency problems, you can run sudo 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 example How do I resolve unmet dependencies after adding a PPA?. For Remove a package:sudo dpkg -r PACKAGE_NAME For example if the package is called askubuntu then you should do sudo dpkg -r askubuntu Reconfigure an existing package:sudo dpkg-reconfigure PACKAGE_NAME It will be useful if you need to reconfigure something related to said package. Some useful examples it the keyboard-configuration when you want to enable the Ctrl+Alt+Backspace in order to reset the X server. |
|||||
|
protected by Community♦ Feb 20 '14 at 20:57
Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?
