How to get a list of packages from one machine and install in another with Chocolatey?

前端 未结 6 2090
迷失自我
迷失自我 2021-01-31 08:23

Calling clist -l gives me a list of packages with versions:

7zip.install 16.04
ccleaner 5.28.6005
ConEmu 17.3.16.0
...

How do I ge

6条回答
  •  萌比男神i
    2021-01-31 09:11

    This was my poor-man's solution to the same problem, i.e. take all the Chocolatey packages on one machine and install them on another, without worrying about specific versions (i.e. I want the latest versions).

    1. Use the Export button on Chocolately-GUI to save a packages.config file (to a shared network drive).
    2. Edit that .config file and remove the version="X.Y.Z" fields from each line.
    3. On the new machine run choco install \\mypc\shared\packages.config -y.

    For example, my edited packages.config file looks like this:

    
    
      
      
      
      
      
      
      
    
    

    PS.: Don't make the same mistake I did: I used a simple regular expression in Notepad++ to delete all the version="1.1.1" entries and inadvertently removed the same field from the first line. This breaks the XML file. Be more careful/clever than me!

提交回复
热议问题