choco icon indicating copy to clipboard operation
choco copied to clipboard

Improving choco list with options to show dependencies and sort by date (and more)

Open arieljannai opened this issue 8 years ago • 14 comments

Feature request:

  • Add features to choco list:
    • Show the installed apps with their dependencies (maybe as a tree?)
    • Sort the output list by installed date, last updated
    • Check which arguments were used to install an app
    • Show exact installed apps - only apps I actively installed (without dependencies). Useful for saving the list of my installed apps.

I believe it would be very useful 😄

arieljannai avatar Apr 30 '17 10:04 arieljannai

+a more verbose one-line output, with Title and Publication date

abejenaru avatar Apr 30 '17 11:04 abejenaru

Comment moved to separate issue: #1281

boaz001 avatar May 02 '17 08:05 boaz001

@boaz001 please file a new issue for this. I'd love to track it, and we like to keep things to one request per issue please. Thanks!

ferventcoder avatar May 02 '17 18:05 ferventcoder

Well this is pretty old right now. I've ended up with a powershell helper for uninstalling my packages:


function shouldNotUnInstalled {
  param (
    [String]  $name
  )
  return  $name -like 'chocolatey*' -or
  $name -match 'KB\d+' -or
  $name -like 'vcredist*' -or
  $name -match '\d+'
}

$packages = choco list -lo
foreach ($package in $packages) {
  $packageInfos = $package -split " "
  $packageName = $packageInfos[0]
  if (shouldNotUnInstalled -name $packageName  ) {
    Write-Host "Ignore $packageName"
  }
  else {
    Write-Host "Uninstall $packageName"
    choco uninstall $packageName -y
  }
}

Bjego avatar Aug 25 '20 08:08 Bjego

Try choco info

ferventcoder avatar Sep 01 '20 22:09 ferventcoder

Try choco info

@ferventcoder when I run

choco info -lo kubernetes-cli

I only get the description of that package and no information about the installation on my machine. Or did I miss a parameter?

Bjego avatar Sep 02 '20 07:09 Bjego

I think, if an uninstallation via packages.config would be possible. I won't need this feature. See https://github.com/chocolatey/choco/issues/533

Bjego avatar Sep 02 '20 07:09 Bjego

Sorry @Bjego I didn't mean that comment for you. Just for the top thread as I came back in here to note that there is choco info for some of these other things.

ferventcoder avatar Sep 02 '20 19:09 ferventcoder

Currently I fix this for installed packages like this:

$packages = Get-ChildItem C:\ProgramData\chocolatey\lib\ -Recurse  *.nuspec | select fullname,name 
foreach($p in $packages){
        [XML]$xml=get-content $p.fullname
        $dependencies = $xml.package.metadata.dependencies.dependency
        foreach($d in $dependencies){
	        $obj = New-Object -TypeName psobject
	        $obj | Add-Member -MemberType NoteProperty -name package  -Value $xml.package.metadata.id
	        $obj | Add-Member -MemberType NoteProperty -name packageversion  -Value $xml.package.metadata.version
	        $obj | Add-Member -MemberType NoteProperty -name dependency  -Value  $d.id
	        $obj | Add-Member -MemberType NoteProperty -name dependencyversion  -Value  $d.version
	        $obj
        }
}

For online search (package not installed locally) I use a combination of choco info and regex to find the source. Then I use invoke-webrequest to retrieve the .nuspec file

package                    packageversion      dependency                         dependencyversion
-------                    --------------      ----------                         -----------------
git                        2.29.2.3            git.install                        [2.29.2.3]
git.install                2.29.2.3            chocolatey-core.extension          1.3.3
git.install                2.29.2.3            chocolatey                         0.10.7

Kipjr avatar Jan 05 '21 13:01 Kipjr

still no way to get the dependencies of a choco package? cant see dependencies in chocoalteygui either?

nascentt avatar Oct 28 '21 09:10 nascentt

This will show all packages dependencies. Execute in PowerShell:

Get-ChildItem C:\ProgramData\chocolatey\lib -Recurse -Name "*.nuspec" | % { Select-String "<dependency" $_ }

https://superuser.com/a/1582307/146085

akirayamamoto avatar Nov 26 '21 14:11 akirayamamoto

This bug is for packages that are already installed, but what if I want to know the dependencies of some package and version which is not installed?

Example, list dependencies for Chocolatey GUI 2.1.0, having some older version of it installed, or none at all. This is what's really useful, if you have it installed you may have your install broken already.

superbonaci avatar Jul 06 '23 18:07 superbonaci

This would be convenient indeed!

pfremy avatar Apr 17 '24 14:04 pfremy