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

 

 

 

How to find all possible dependencies of a program?

New to Debian (Or Linux in general)? Ask your questions here!
Message
Author
emil_21
Posts: 98
Joined: 2017-04-14 06:13

How to find all possible dependencies of a program?

#1 Post by emil_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?

Dai_trying
Posts: 1100
Joined: 2016-01-07 12:25
Has thanked: 5 times
Been thanked: 16 times

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

#2 Post by Dai_trying »

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.

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

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

#3 Post by Deb-fan »

^ 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. *

cuckooflew
Posts: 677
Joined: 2018-05-10 19:34
Location: Some where out west
Been thanked: 1 time

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

#4 Post by cuckooflew »

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
Search Engines know a lot, and
"If God had wanted computers to work all the time, He wouldn't have invented RESET buttons"
and
Just say NO to help vampires!

emil_21
Posts: 98
Joined: 2017-04-14 06:13

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

#5 Post by emil_21 »

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?

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

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

#6 Post by Deb-fan »

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. *

emil_21
Posts: 98
Joined: 2017-04-14 06:13

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

#7 Post by emil_21 »

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.

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

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

#8 Post by Deb-fan »

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. *

User avatar
sickpig
Posts: 589
Joined: 2019-01-23 10:34

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

#9 Post by sickpig »

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.

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

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

#10 Post by Deb-fan »

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. *

emil_21
Posts: 98
Joined: 2017-04-14 06:13

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

#11 Post by emil_21 »

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

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

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

#12 Post by Deb-fan »

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. *

User avatar
sickpig
Posts: 589
Joined: 2019-01-23 10:34

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

#13 Post by sickpig »

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.

emil_21
Posts: 98
Joined: 2017-04-14 06:13

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

#14 Post by emil_21 »

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) ...

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

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

#15 Post by Deb-fan »

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. *

User avatar
sickpig
Posts: 589
Joined: 2019-01-23 10:34

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

#16 Post by sickpig »

emil_21 wrote:If i run 'sudo apt install ./vlc_3.0.11-0+deb10u1_amd64.deb'
That is right but you need to be in the directory from where you are invoking the command. Or just specify the full path to the deb file.

emil_21
Posts: 98
Joined: 2017-04-14 06:13

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

#17 Post by emil_21 »

sickpig wrote:
emil_21 wrote:If i run 'sudo apt install ./vlc_3.0.11-0+deb10u1_amd64.deb'
That is right but you need to be in the directory from where you are invoking the command. Or just specify the full path to the deb file.
What do you mean? I am in the directory where vlc_3.0.11-0+deb10u1_amd64.deb file is.

emil_21
Posts: 98
Joined: 2017-04-14 06:13

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

#18 Post by emil_21 »

Deb-fan wrote: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.
I tried to use chroot once for installing apps, but run into lot of problems running apps with gui. For programs that run only in the terminal it works though.

emil_21
Posts: 98
Joined: 2017-04-14 06:13

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

#19 Post by emil_21 »

I think i found a way that could work for removing vlc dependencies installed with dpkg, but i have problem implementing it. I run this command in the directory with all .deb files for vlc: 'find . > list.txt'. Now, i want to remove the packages from the list.txt, but i am not sure how. I tried these commands, but it didn't worked:

Code: Select all

sudo dpkg -r $(cat list.txt)
sudo apt remove $(cat list.txt)

cuckooflew
Posts: 677
Joined: 2018-05-10 19:34
Location: Some where out west
Been thanked: 1 time

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

#20 Post by cuckooflew »

try

Code: Select all

sudo apt-get remove `cat list.txt` 
(in the same directory where list.txt is,or with the correct path to that directory) be sure to pay attention to what it says will be removed.
Please Read What we expect you have already Done
Search Engines know a lot, and
"If God had wanted computers to work all the time, He wouldn't have invented RESET buttons"
and
Just say NO to help vampires!

Post Reply