can't use "dpkg" command to install Debian apps

Linyx10

New Member
Credits
31
If i use
Code:
dpkg -i <.deb file>
answer is:

Code:
dpkg: Warning: Cannot find ldconfig in the PATH environment variable or no executable permissions
dpkg: warning: Start-stop-daemon cannot be found in the PATH environment variable or no executable permissions
dpkg: Error: 2 The program cannot be found in the environment variable PATH, or is not executable
Tip: root's PATH environment variable should usually contain /usr/local/sbin, /usr/sbin and /sbin
 


Tolkem

Well-Known Member
Credits
1,920
If i use
Code:
dpkg -i <.deb file>
answer is:

Code:
dpkg: Warning: Cannot find ldconfig in the PATH environment variable or no executable permissions
dpkg: warning: Start-stop-daemon cannot be found in the PATH environment variable or no executable permissions
dpkg: Error: 2 The program cannot be found in the environment variable PATH, or is not executable
Tip: root's PATH environment variable should usually contain /usr/local/sbin, /usr/sbin and /sbin
Unless you're root, you need to use sudo with dpkg to install, remove and pretty much anything else actually;
Code:
sudo dpkg -i pkg_name.deb
type in your pasword when asked, hit enter, wait for the process to finish and that's it. Note that installing pkgs.deb this way doesn't take care of dependencies so you'll have to deal with those separately, to avoid that, you could use apt instead of dpkg so it solves dependencies for you
Code:
sudo apt install ./pkg_name.deb
this will install the pkg_name.deb as well as its dependencies. Another advantage of installing pkgs.deb with apt instead of dpkg is that if you want/need to remove it later you can do it with apt too
Code:
sudo apt remove pkg_name
or if you need/want to remove its dependencies as well
Code:
sudo apt autoremove pkg_name
Hope this helps! :)
 

raman kumar

Member
Credits
1,221
The simplest way to install a single package you've downloaded is the command dpkg -i (short for dpkg --install). Say you've downloaded the package icewm_0.8.12-1.deb and you'd like to install it. First log on as root, then type:

dpkg -i icewm_0.8.12-1.deb


and icewm version 0.8.12 will be installed. If you already had an older version, dpkg will upgrade it rather than installing both versions at once.


If you want to remove a package, you have two options. The first is most intuitive:

dpkg -r icewm


This will remove the icewm package (-r is short for --remove). Note that you give only the 'icewm' for --remove, while --install requires the entire .deb filename.


--remove will leave configuration files for the package on your system. A configuration file is defined as any file you might have edited in order to customize the program for your system or your preferences. This way, if you later reinstall the package, you won't have to set everything up a second time.


However, you might want to erase the configuration files too, so dpkg also provides a --purge option. dpkg --purge icewm will permanently delete every last file associated with the icewm package.
 

Tolkem

Well-Known Member
Credits
1,920
The simplest way to install a single package you've downloaded is the command dpkg -i (short for dpkg --install). Say you've downloaded the package icewm_0.8.12-1.deb and you'd like to install it. First log on as root, then type:

dpkg -i icewm_0.8.12-1.deb


and icewm version 0.8.12 will be installed. If you already had an older version, dpkg will upgrade it rather than installing both versions at once.
the icewm_0.8.12-1.deb has dependencies and dpkg won't install those, so after installing the icewm_0.8.12-1.deb you'll have to run apt right after so it does resolve those dependencies
Code:
sudo apt --fix-broken install
or else the pkg will be half installed and misconfigured thus it won't work correctly.
 
Last edited:

Linyx10

New Member
Credits
31
Unless you're root, you need to use sudo with dpkg to install, remove and pretty much anything else actually;
Code:
sudo dpkg -i pkg_name.deb
type in your pasword when asked, hit enter, wait for the process to finish and that's it. Note that installing pkgs.deb this way doesn't take care of dependencies so you'll have to deal with those separately, to avoid that, you could use apt instead of dpkg so it solves dependencies for you
Code:
sudo apt install ./pkg_name.deb
this will install the pkg_name.deb as well as its dependencies. Another advantage of installing pkgs.deb with apt instead of dpkg is that if you want/need to remove it later you can do it with apt too
Code:
sudo apt remove pkg_name
or if you need/want to remove its dependencies as well
Code:
sudo apt autoremove pkg_name
Hope this helps! :)
:DYes! The installation was successful!
 


Staff online


Latest posts

Top