dpkg -i errors [SOLVED]

Kernels & Hardware, configuring network, installing services

dpkg -i errors [SOLVED]

Postby questlinq » 2019-11-05 16:51

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.
questlinq
 
Posts: 50
Joined: 2017-09-19 08:51

Re: dpkg -i errors

Postby roseway » 2019-11-05 17:31

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
roseway
 
Posts: 1511
Joined: 2007-12-31 22:50
Location: Kent, UK

Re: dpkg -i errors

Postby Soul Singin' » 2019-11-05 17:32

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
User avatar
Soul Singin'
 
Posts: 1578
Joined: 2008-12-21 07:02

Re: dpkg -i errors

Postby questlinq » 2019-11-05 17:55

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?
questlinq
 
Posts: 50
Joined: 2017-09-19 08:51

Re: dpkg -i errors

Postby sunrat » 2019-11-05 18:30

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 - 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!
User avatar
sunrat
 
Posts: 2882
Joined: 2006-08-29 09:12
Location: Melbourne, Australia

Re: dpkg -i errors

Postby questlinq » 2019-11-06 08:46

@sunrat

Thank you. Now, the problem is solved.
questlinq
 
Posts: 50
Joined: 2017-09-19 08:51

Re: dpkg -i errors

Postby Soul Singin' » 2019-11-06 18:03

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
Soul Singin'
 
Posts: 1578
Joined: 2008-12-21 07:02

Re: dpkg -i errors

Postby Head_on_a_Stick » 2019-11-06 18:36

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.
Don't break DebianHow to report bugs

SharpBang GNU/Linux — a pre-configured Openbox/Tint2 desktop running on Debian stable
User avatar
Head_on_a_Stick
 
Posts: 10613
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: dpkg -i errors [SOLVED]

Postby stevepusser » 2019-11-06 18:45

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.
The MX Linux repositories: Backports galore! If we don't have something, just ask and we'll try--we like challenges. New packages: Clipgrab 3.8.6, Hedgewars 1.0.0, PulseEffects 4.6.8, Telegram-desktop 1.8.15, Pale Moon 28.7.2, KeepassXC 2.5.1
User avatar
stevepusser
 
Posts: 11254
Joined: 2009-10-06 05:53

Re: dpkg -i errors [SOLVED]

Postby sunrat » 2019-11-06 19:54

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!
User avatar
sunrat
 
Posts: 2882
Joined: 2006-08-29 09:12
Location: Melbourne, Australia

Re: dpkg -i errors [SOLVED]

Postby Deb-fan » 2019-11-06 20:58

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. :)
Deb-fan
 
Posts: 445
Joined: 2012-08-14 12:27

Re: dpkg -i errors [SOLVED]

Postby Soul Singin' » 2019-11-06 22:39

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:
User avatar
Soul Singin'
 
Posts: 1578
Joined: 2008-12-21 07:02

Re: dpkg -i errors [SOLVED]

Postby Deb-fan » 2019-11-07 00:18

^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.
Deb-fan
 
Posts: 445
Joined: 2012-08-14 12:27


Return to System configuration

Who is online

Users browsing this forum: No registered users and 18 guests

fashionable