How to find all possible dependencies of a program?

New to Debian (Or Linux in general)? Ask your questions here!

How to find all possible dependencies of a program?

Postby emil_21 » 2020-07-30 06:21

I want to be able to find all possible dependencies that a program requires, so i can download them for offline install, but i am not sure how to do that. If i take vlc as example, if i run 'apt-cache depends vlc' it shows these dependencies:

Code: Select all
  Depends: vlc-bin
  Depends: vlc-plugin-base
  Depends: vlc-plugin-qt
  Depends: vlc-plugin-video-output
  Recommends: vlc-l10n
  Recommends: vlc-plugin-notify
  Recommends: vlc-plugin-samba
  Recommends: vlc-plugin-skins2
  Recommends: vlc-plugin-video-splitter
  Recommends: vlc-plugin-visualization


But if i run 'sudo apt --donwload-only install vlc' it downloads a lot more dependencies .deb files. How can i be sure these are all dependencies that vlc requires? Because some of the dependencies could be already installed and in this case they will not be downloaded, correct?
emil_21
 
Posts: 87
Joined: 2017-04-14 06:13

Re: How to find all possible dependencies of a program?

Postby Dai_trying » 2020-07-30 06:29

Easiest way I can think of would be to do a "simulated" install like so
Code: Select all
sudo apt -s install vlc

This will show you exactly what would be installed if you ran the command without the -s switch.
Dai_trying
 
Posts: 936
Joined: 2016-01-07 12:25

Re: How to find all possible dependencies of a program?

Postby Deb-fan » 2020-07-30 07:05

^ That is FRIGGIN BRILLIANT, thanks for pointing out using it like that. :)

Yep .. dependencies can have unsatisfied dependencies, overall this is lovingly referred to as dependency hell. One sure-fire way to ascertain whether everything required is satisfied is installing them(crapton of deb's)locally with apt, have used dpkg for doing this type of thing ... For installing whatever pkgs to offline OS's. Though keep seeing people mention apt is better able to handle this, does a better job and should be used instead. Either one will make it obvious if something is missing, what the something(s) is/are etc.

Some good commands to know while playing around with this type of thing, if you get the opportunity to put an offline system on the internet briefly, "sudo apt install -f" and-or "sudo dpkg --configure -a". For helping to resolve package nightmares. More random thoughts a good precaution can be setting up and doing this type of thing on a VM if possible or a bare-metal clone to use for crash testing etc. Rather than the install you care about. Setting such up takes very little time, same for tearing them down or restoring them too.

For that matter depending on what you have in mind, if you've got access to an online system but want to maintain an install on another which doesn't have internet access. Could perhaps set up a clone of the offline OS on a pc with internet(upgrade it normally) and use rsync to transfer changes/upgrades to the system without. Even turn it(clone)into a portable Os, anywhere you can plug the thumb drive into and boot on a pc that has internet, you can upgrade, install whatever to it and rsync the changes onto an offline os.

Are also of course utils specifically for this type of thing, though when isn't there in gnu/Linux ? :D One which comes to mind is apt-offline (google it) are others but off the top don't remember them. Such searches are bound to bring up much offline upgrading information for you to consider. Been here done some of this, forgot most of it. :P

Ps, The big daddy of em all, mirroring entire Debian software repo's onto a portable usb drive. Dont remember how much drive space is involved but it's not as much diskspace as one might think. Then you have the ultimate offline, portable repository a person could ever want. :P Install anything desired locally, gnu/linux is fairly amazing. If x-user can imagine it, some geek(s) probably already came out with tools and doc's on how to do it.
Most powerful FREE tech-support tool on the planet * HERE. *
Deb-fan
 
Posts: 814
Joined: 2012-08-14 12:27

Re: How to find all possible dependencies of a program?

Postby cuckooflew » 2020-07-30 08:15

Dai_trying wrote:Easiest way I can think of would be to do a "simulated" install like so
Code: Select all
sudo apt -s install vlc

This will show you exactly what would be installed if you ran the command without the -s switch.

Yes, and the manual has more details, information:
Code: Select all
$man apt
and
Code: Select all
$man apt-get
or
https://linux.die.net/man/8/apt-get
-s, --simulate, --just-print, --dry-run, --recon, --no-act
No action. Perform a simulation of events that would occur but do not actually change the system.
Configuration Item: APT::Get::Simulate.
Simulate prints out a series of lines, each one representing an rpm
operation: Configure (Conf), Remove (Remv), Unpack (Inst). Square brackets indicate broken packages with an empty set of square brackets meaning breaks that are of no consequence (rare).
Please Read What we expect you have already Done
Google knows a lot, and
"If God had wanted computers to work all the time, He wouldn't have invented RESET buttons"
…one flew east, one flew west,
One flew over the cuckoo’s nest.
cuckooflew
 
Posts: 551
Joined: 2018-05-10 19:34
Location: Some where out west

Re: How to find all possible dependencies of a program?

Postby emil_21 » 2020-07-30 09:44

I run into a problem with dpkg. I downloaded vlc and dependencies files with 'sudo apt --donwload-only install vlc' and then installed vlc with 'sudo dpkg -i *.deb'. But if i remove vlc with 'sudo apt remove vlc' it doesn't remove the vlc dependecies. If i run 'sudo apt autoremove' it doesn't show any leftovers. Why is that?
emil_21
 
Posts: 87
Joined: 2017-04-14 06:13

Re: How to find all possible dependencies of a program?

Postby Deb-fan » 2020-07-30 09:47

Check out aptmark, those pkgs are probably marked as manually installed, thus even if nothing else on system depends on them apt leaves them alone. You can change that with aptmark, dpkg etc though.

Ps, Not sure what you have in mind but cant help thinking about things like snaps and flatpak's when discussing this type of thing, portable (self contained apps) have been around forever. Have their place, pro's n cons.
Most powerful FREE tech-support tool on the planet * HERE. *
Deb-fan
 
Posts: 814
Joined: 2012-08-14 12:27

Re: How to find all possible dependencies of a program?

Postby emil_21 » 2020-07-30 10:46

I am not sure apt-mark will be helpful. If i run 'apt-mark showmanual' it shows lots of manually installed packages, but how to find which are installed as dependencies to vlc?

I prefer to install from .deb packages, i don't like snap or flatpak. I like appimages though, but there are not many of them.
emil_21
 
Posts: 87
Joined: 2017-04-14 06:13

Re: How to find all possible dependencies of a program?

Postby Deb-fan » 2020-07-30 10:57

Hint: Check dpkg logs. :)

Use -s flag like Dai_trying showed to simulate reinstall of vlc-etc again.?
Most powerful FREE tech-support tool on the planet * HERE. *
Deb-fan
 
Posts: 814
Joined: 2012-08-14 12:27

Re: How to find all possible dependencies of a program?

Postby sickpig » 2020-07-30 11:02

emil_21 wrote: installed vlc with 'sudo dpkg -i *.deb'. But if i remove vlc with 'sudo apt remove vlc' it doesn't remove the vlc dependecies.

Why use dpkg to install and apt to remove? Why not dpkg for both or apt for both? Or potentially you are just referring to internet and firing away commands.
User avatar
sickpig
 
Posts: 412
Joined: 2019-01-23 10:34

Re: How to find all possible dependencies of a program?

Postby Deb-fan » 2020-07-30 11:25

Mentioned seen people advise using apt for installing local deb(s), believe Hoas and Stevep(usser), both guys who tend to know their stuff so would lean towards listening to them on the topic.
Most powerful FREE tech-support tool on the planet * HERE. *
Deb-fan
 
Posts: 814
Joined: 2012-08-14 12:27

Re: How to find all possible dependencies of a program?

Postby emil_21 » 2020-07-30 11:46

sickpig wrote:Why use dpkg to install and apt to remove? Why not dpkg for both or apt for both? Or potentially you are just referring to internet and firing away commands.


I installed vlc with 'sudo dpkg -i *.deb', but if i try to remove it with 'sudo dpkg -r vlc' it removes only the vlc package without any dependencies.

The apt command doesn't work. If i run this 'sudo apt install *.deb' i get errors like these:

Code: Select all
E: Unable to locate package libaribb24-0_1.0.3-2_amd64.deb
E: Couldn't find any package by glob 'libaribb24-0_1.0.3-2_amd64.deb'
E: Couldn't find any package by regex 'libaribb24-0_1.0.3-2_amd64.deb'
E: Unable to locate package libbasicusageenvironment1_2018.11.26-1.1_amd64.deb
E: Couldn't find any package by glob 'libbasicusageenvironment1_2018.11.26-1.1_amd64.deb'
E: Couldn't find any package by regex 'libbasicusageenvironment1_2018.11.26-1.1_amd64.deb'
E: Unable to locate package libdvbpsi10_1.3.2-1_amd64.deb
E: Couldn't find any package by glob 'libdvbpsi10_1.3.2-1_amd64.deb'
E: Couldn't find any package by regex 'libdvbpsi10_1.3.2-1_amd64.deb'
E: Unable to locate package libebml4v5_1.3.6-2_amd64.deb
E: Couldn't find any package by glob 'libebml4v5_1.3.6-2_amd64.deb'
E: Couldn't find any package by regex 'libebml4v5_1.3.6-2_amd64.deb'
E: Unable to locate package libgroupsock8_2018.11.26-1.1_amd64.deb
E: Couldn't find any package by glob 'libgroupsock8_2018.11.26-1.1_amd64.deb'
E: Couldn't find any package by regex 'libgroupsock8_2018.11.26-1.1_amd64.deb'
E: Unable to locate package libixml10_1%3a1.8.4-2_amd64.deb
E: Couldn't find any package by glob 'libixml10_1%3a1.8.4-2_amd64.deb'
E: Couldn't find any package by regex 'libixml10_1%3a1.8.4-2_amd64.deb'
E: Unable to locate package liblirc-client0_0.10.1-5.2_amd64.deb
E: Couldn't find any package by glob 'liblirc-client0_0.10.1-5.2_amd64.deb'
E: Couldn't find any package by regex 'liblirc-client0_0.10.1-5.2_amd64.deb'
E: Unable to locate package liblivemedia64_2018.11.26-1.1_amd64.deb
emil_21
 
Posts: 87
Joined: 2017-04-14 06:13

Re: How to find all possible dependencies of a program?

Postby Deb-fan » 2020-07-30 12:02

Havent looked into the proper way to use apt to install local pkgs in depth. Its on the list of stuff to look into further though. Oops no have already done so in the context of setting up a local apt repository but forgot pretty much all of it.

Like appimages but not enough available? Make some, https://www.booleanworld.com/creating-l ... -appimage/ :P Of course haven't tried that so dont really know how well it'd work, shrugs. Also prefer the way software and pkgs are handled in gnu/nix already. Still can see some uses for snaps-etc too.
Most powerful FREE tech-support tool on the planet * HERE. *
Deb-fan
 
Posts: 814
Joined: 2012-08-14 12:27

Re: How to find all possible dependencies of a program?

Postby sickpig » 2020-07-30 12:11

emil_21 wrote:I installed vlc with 'sudo dpkg -i *.deb', but if i try to remove it with 'sudo dpkg -r vlc' it removes only the vlc package without any dependencies.

dpkg installs just the deb minus dependencies unlike apt. It would be helpful to read and understand the differences before using them.
User avatar
sickpig
 
Posts: 412
Joined: 2019-01-23 10:34

Re: How to find all possible dependencies of a program?

Postby emil_21 » 2020-07-30 12:46

sickpig wrote:dpkg installs just the deb minus dependencies unlike apt.


Then 'dpkg' will not be helpful in my case, because i want to remove vlc with all dependencies. The only way i see is to change manually all vlc dependencies from 'manual' to automatic' so i can remove them with 'apt autoremove', though i am not sure exactly how to do that. Or just remove them using Synaptic, all 35 of them.

I tried another way to install .deb file using apt, but it doesn't use the local deb, it still downloads the file from the repository. If i run 'sudo apt install ./vlc_3.0.11-0+deb10u1_amd64.deb' i get this:

Code: Select all
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'vlc' instead of './vlc_3.0.11-0+deb10u1_amd64.deb'
The following NEW packages will be installed:
  vlc
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 141 kB of archives.
After this operation, 229 kB of additional disk space will be used.
Get:1 http://deb.debian.org/debian-security stable/updates/main amd64 vlc amd64 3.0.11-0+deb10u1 [141 kB]
Fetched 141 kB in 0s (554 kB/s)
Selecting previously unselected package vlc.
(Reading database ... 230832 files and directories currently installed.)
Preparing to unpack .../vlc_3.0.11-0+deb10u1_amd64.deb ...
Unpacking vlc (3.0.11-0+deb10u1) ...
Setting up vlc (3.0.11-0+deb10u1) ...
Processing triggers for mime-support (3.62) ...
Processing triggers for desktop-file-utils (0.23-4) ...
emil_21
 
Posts: 87
Joined: 2017-04-14 06:13

Re: How to find all possible dependencies of a program?

Postby Deb-fan » 2020-07-30 12:51

Lol another funny/cool thing about this, installing apps in chroot.

https://linuxhint.com/use_chroot_debian/

Using chroot jails is a long standing way of isolating applications on a nix os for things like security. Have everything they need to run and enough permissions but not to effect or access to the overall Os. :)

Ps, now that you guys are going back and forth about apt, could've over-misinterpreted what Stevep/Hoas were saying about apt vs dpkg for this too. I still use dpkg for it anyway, if only cause im used to using it now.
Last edited by Deb-fan on 2020-07-30 12:59, edited 1 time in total.
Most powerful FREE tech-support tool on the planet * HERE. *
Deb-fan
 
Posts: 814
Joined: 2012-08-14 12:27

Next

Return to Beginners Questions

Who is online

Users browsing this forum: No registered users and 7 guests

fashionable