Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

dpkg -i errors [SOLVED]

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
questlinq
Posts: 69
Joined: 2017-09-19 08:51

dpkg -i errors [SOLVED]

#1 Post by questlinq »

Hello,

When trying to install local .deb package, on Debian 10, I get the following errors.
dpkg: warning: 'ldconfig' not found in PATH or not executable
dpkg: warning: 'start-stop-daemon' not found in PATH or not executable
dpkg: error: 2 expected programs not found in PATH or not executable
The package can't be installed.
Last edited by questlinq on 2019-11-06 08:48, edited 2 times in total.

User avatar
roseway
Posts: 1528
Joined: 2007-12-31 22:50
Location: Kent, UK
Has thanked: 3 times
Been thanked: 4 times

Re: dpkg -i errors

#2 Post by roseway »

If you use su to become root, you have to enter

Code: Select all

su -
If you just use su on its own, you keep the user's path, which does not include ldconfig etc.
Eric

User avatar
Soul Singin'
Posts: 1605
Joined: 2008-12-21 07:02

Re: dpkg -i errors

#3 Post by Soul Singin' »

EDIT: . Roseway responded faster than I did. My observation is the same, but with a longer explanation.
questlinq wrote:

Code: Select all

dpkg: warning: 'ldconfig' not found in PATH or not executable
dpkg: warning: 'start-stop-daemon' not found in PATH or not executable
/sbin/ldconfig is provided by the libc-bin package and /sbin/start-stop-daemon is provided by the dpkg package. Both are "essential" packages. They must have been installed at installation.

So assuming that they're installed ... How did you become root? On Debian Buster, you now have to add a dash ("-") after the su command:

Code: Select all

$ su -
Password:
# dpkg -i <debfile>
When you add the dash, your $PATH will contain the /sbin/ directories:

Code: Select all

$ su -
Password: 
# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
If you forget to add the dash, your $PATH will not:

Code: Select all

$ su
Password: 
# echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games

questlinq
Posts: 69
Joined: 2017-09-19 08:51

Re: dpkg -i errors

#4 Post by questlinq »

Thank you to both of you - it worked!

Usually, I sign in as user and then I do "su" + "password" and then "apt install .. "

Do I always need to use "su -" in Buster?

User avatar
sunrat
Administrator
Administrator
Posts: 6412
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 116 times
Been thanked: 462 times

Re: dpkg -i errors

#5 Post by sunrat »

questlinq wrote:Do I always need to use "su -" in Buster?
As explained by Soul Singin' and roseway, if you need to run anything which is not in your user PATH, yes.
I sometimes run apt install (which is in /usr/bin/ therefore in user's PATH) without the dash after su, , to install a locally downloaded package. apt install is better than dpkg -i as it will also resolve and download dependencies if there are any. eg. -

Code: Select all

apt install ./<downloaded-package>
Don't forget the ./ (or give the full path) so apt knows it's installing locally and not from repository.
Of course you'd still need su - if the installer calls ldconfig or anything else in /usr/sbin/ .

See also - http://forums.debian.net/viewtopic.php?f=16&t=142973
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!

questlinq
Posts: 69
Joined: 2017-09-19 08:51

Re: dpkg -i errors

#6 Post by questlinq »

@sunrat

Thank you. Now, the problem is solved.

User avatar
Soul Singin'
Posts: 1605
Joined: 2008-12-21 07:02

Re: dpkg -i errors

#7 Post by Soul Singin' »

sunrat wrote:to install a locally downloaded package. apt install is better than dpkg -i as it will also resolve and download dependencies if there are any. eg. -

Code: Select all

apt install ./<downloaded-package>
Don't forget the ./ (or give the full path) so apt knows it's installing locally and not from repository.
Thank you for sharing this tip. I was unaware of it.

But my experiments with that command downloaded the package from the repository. They did not install from the local file. (See below).

So suppose that I built a backport. Under what conditions would the "dot-slash" installation method install my backport? and under what conditions would it install from the repository?

--------- --------- --------- ---------

Below are the results of my experiment with the (trivial) hello package:

Code: Select all

# apt install ./hello_2.10-2_amd64.deb 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'hello' instead of './hello_2.10-2_amd64.deb'
The following NEW packages will be installed:
  hello
0 upgraded, 1 newly installed, 0 to remove and 30 not upgraded.
Need to get 56.1 kB of archives.
After this operation, 287 kB of additional disk space will be used.
Get:1 http://deb.debian.org/debian buster/main amd64 hello amd64 2.10-2 [56.1 kB]
Fetched 56.1 kB in 0s (444 kB/s)
Selecting previously unselected package hello.
(Reading database ... 311442 files and directories currently installed.)
Preparing to unpack .../hello_2.10-2_amd64.deb ...
Unpacking hello (2.10-2) ...
Setting up hello (2.10-2) ...
Processing triggers for man-db (2.8.5-2) ...
Processing triggers for install-info (6.5.0.dfsg.1-4+b1) ...
I also tried with apt-get and obtained the same result:

Code: Select all

# apt-get install ./hello_2.10-2_amd64.deb 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'hello' instead of './hello_2.10-2_amd64.deb'
The following NEW packages will be installed:
  hello
0 upgraded, 1 newly installed, 0 to remove and 30 not upgraded.
Need to get 56.1 kB of archives.
After this operation, 287 kB of additional disk space will be used.
Get:1 http://deb.debian.org/debian buster/main amd64 hello amd64 2.10-2 [56.1 kB]
Fetched 56.1 kB in 0s (276 kB/s)
Selecting previously unselected package hello.
(Reading database ... 311442 files and directories currently installed.)
Preparing to unpack .../hello_2.10-2_amd64.deb ...
Unpacking hello (2.10-2) ...
Setting up hello (2.10-2) ...
Processing triggers for man-db (2.8.5-2) ...
Processing triggers for install-info (6.5.0.dfsg.1-4+b1) ...

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: dpkg -i errors

#8 Post by Head_on_a_Stick »

Soul Singin' wrote:Under what conditions would the "dot-slash" installation method install my backport?
If your backport was versioned correctly to indicate that it was newer than the package in the repositories.
deadbang

User avatar
stevepusser
Posts: 12930
Joined: 2009-10-06 05:53
Has thanked: 41 times
Been thanked: 71 times

Re: dpkg -i errors [SOLVED]

#9 Post by stevepusser »

After becoming root with "su -", you moved to your /root directory, and apt could not find the local deb in that directory. If you have enabled sudo, you can use that instead with apt to avoid that problem.
MX Linux packager and developer

User avatar
sunrat
Administrator
Administrator
Posts: 6412
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 116 times
Been thanked: 462 times

Re: dpkg -i errors [SOLVED]

#10 Post by sunrat »

stevepusser wrote:After becoming root with "su -", you moved to your /root directory, and apt could not find the local deb in that directory. If you have enabled sudo, you can use that instead with apt to avoid that problem.
Exactly. The command needs to be run with the terminal opened in the same directory as the file. su - switches you to root user's environment, which means it also switches the terminal to root user's home directory. That's why I said "Don't forget the ./ (or give the full path)". If you use su - , you could cd back to where the file resides. the "./" applies to when your terminal is open at the directory containing the file, "(or give the full path)" for when it is anywhere else.
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!

Deb-fan
Posts: 1047
Joined: 2012-08-14 12:27
Been thanked: 4 times

Re: dpkg -i errors [SOLVED]

#11 Post by Deb-fan »

Lol ... or in the grandest of gnu/Nix noobishness style. While in da directory (folder thingy) containing said .deb(s), right click xyz-filemanager, select "Open terminal here" ? :D Then go from there ! Sorry, sleep deprived and irritable I still do that often enough myself anyway, when not in the cli nav(cd) kind of mood. :)
Most powerful FREE tech-support tool on the planet * HERE. *

User avatar
Soul Singin'
Posts: 1605
Joined: 2008-12-21 07:02

Re: dpkg -i errors [SOLVED]

#12 Post by Soul Singin' »

Head_on_a_Stick wrote:
Soul Singin' wrote:Under what conditions would the "dot-slash" installation method install my backport?
If your backport was versioned correctly to indicate that it was newer than the package in the repositories.
Thanks! . :D

stevepusser wrote:After becoming root with "su -", you moved to your /root directory, and apt could not find the local deb in that directory. If you have enabled sudo, you can use that instead with apt to avoid that problem.
Not in this case. Being in the wrong directory generates a different error message. See below -- where I am intentionally in the wrong directory.

Code: Select all

# apt install ./hello_2.10-2_amd64.deb 
Reading package lists... Done
E: Unsupported file ./hello_2.10-2_amd64.deb given on commandline

Code: Select all

# apt-get install ./hello_2.10-2_amd64.deb 
Reading package lists... Done
E: Unsupported file ./hello_2.10-2_amd64.deb given on commandline
Deb-fan wrote:Lol ... or in the grandest of gnu/Nix noobishness style. While in da directory (folder thingy) containing said .deb(s), right click xyz-filemanager, select "Open terminal here" ? :D Then go from there ! Sorry, sleep deprived and irritable I still do that often enough myself anyway, when not in the cli nav(cd) kind of mood. :)
Look at the date that I joined this forum. Read some of the HowTo guides in my signature. Do you really think I'm a noob?

Answer: Yes! That's the way I do it every time. It's so much more convenient that way. . :lol:

Deb-fan
Posts: 1047
Joined: 2012-08-14 12:27
Been thanked: 4 times

Re: dpkg -i errors [SOLVED]

#13 Post by Deb-fan »

^LMAO ! :D

Hey ... true, whatever works. Was on the verge of having a meltdown, so was joshing the OP but do that approach often enough too. Got a few hrs sleep and another cup of coffee am ready to go for awhile longer again.
Most powerful FREE tech-support tool on the planet * HERE. *

Post Reply