Although I recommend using the software repositories to install your programs on Debian, Ubuntu, Linux Mint or others, sometimes it is necessary to download a DEB file to install software not present on a repository. So here are several methods (among many others) for installing software from a DEB file already downloaded on your machine.
Prerequisites
the account used must be administrator
Install software from a DEB file with GDebi
Gdebi is software for installing software in Debian formats. It can be used from the command line or through a graphical interface. It has the advantage of having automatic dependency management:
if they are available on the repositories of your distribution, it will download and install them automatically.
otherwise it will tell you which ones are missing and then you will have to install them manually ...
It is available from the repositories of Debian and its derivatives. Linux Mint even integrates it from the base ...
However, in Ubuntu 20.04, it no longer seems to work correctly… It will then be necessary to favor another method.
Installation of GDebi
To install it, do:
sudo apt install gdebi-core
or, if you want to use it with the GUI (only on GNOME, XFCE, MATE, Cinnamon and any GTK environment but does not work with KDE or LXQt) do:
sudo apt install gdebi
gdebi-core will install automatically.
Using GDebi from the command line
Nothing could be simpler, in your terminal do:
sudo gdebi /path_to_file/my_fichier.deb
then, if there are any, you have an indication of which dependencies to install.
And if it's okay to continue, press y to continue the installation.
But, if a dependency cannot be satisfied (not present on the repositories), the installation stops.
Also, write down the name of the installed package. It is not necessarily the name of the installation DEB file. And knowing this name will allow you to easily uninstall it later ...
GDebi use through the graphical interface
Start Gdebi from the menu (Gdebi package installer) or with the command:
gdebi-gtk
Then open the DEB file to install using the File> Open menu
You will find in the interface several useful information such as the name of the package, if it has any dependencies to install, etc.
Finally, to install it, click on the Install package button.
Also, if the package is already there, you can reinstall or remove it.
Install software from a DEB file with dpkg
dpkg is the basic software for managing deb packages in Debian and its derivatives. It works from the command line. It allows, depending on the command arguments, to perform many operations such as installing / uninstalling packages, reconfiguring software etc.
But unlike Gdebi, it does not handle the automatic installation of dependencies. So, you will have to install them later for your software to work.
To install a deb file with dpkg, do:
sudo dpkg -i /path_to_file/my_file.deb
-i is the argument to install a package
In case dependencies are needed, you will get a message like this:
To install them from the repositories, do:
sudo apt install --fix-broken
or
sudo apt install -f
If they cannot be satisfied, the package will be deleted ...
Also, if the software to be installed contains several DEB files dependent on each other, you can install them all at once:
sudo dpkg -i /path_to_file/*.deb
* .deb allows you to select and install all the DEB files present in the folder
sudo dpkg -i path_to_the_folder / LibreOffice_X.X.X_Linux_x86-64_deb / DEBS / *. deb
X.X.X is to be replaced by the version of LibreOffice to install.
Install software from a DEB file downloaded with apt or apt-get
Although intended for use with repositories, it is however possible to use the apt or apt-get commands to install a downloaded DEB file:
sudo apt install full_path / file.deb
full_path / file.deb the path must start from the root for example:
sudo /home/user/Downloads/file.deb
Uninstall software installed from a downloaded DEB file
Software installed from a downloaded DEB file may not appear in your distribution's software manager. Indeed, the latter lists the packages present on the repositories to which it has access.
But to uninstall software, you need to know the name of the installed package (not the name of the file that was used for its installation).
If you don't know it, you can always try to find it with the command
dpkg -S search_expression
-S indicates a search for packages that contain search_expression in their name.
Uninstalling software with APT
This is the easiest method. In addition, it is the same as the one used to uninstall a package from a command line repository.
So to uninstall software, do:
sudo apt remove package_name
if you want to delete the configuration files at the same time, do:
sudo apt purge package_name
or, for a more complete cleaning (removal of unnecessary dependencies and configuration files)
sudo apt autoremove --purge package_name
Uninstalling software with dpkg
dpkg also allows you to uninstall packages. Do:
sudo dpkg -r package_name
or to also delete the associated configuration files:
sudo dpkg -P package_name

Commentaires
Enregistrer un commentaire