2

Using dpkg, I see that Chef version 11.2.0 is currently installed:

$ dpkg -l | grep -i 'chef'
ii  chef                                 11.2.0-1.ubuntu.11.04             The full stack of chef

I'm building another server and want to use that exact package. I'm assuming that either apt or dpkg put it somewhere, how do I determine where the original installer resides?

I see a bunch of .deb files in /var/cache/apt/archives/, however none appear to be for Chef.

EDIT:

I found the debian installer on the Opscode web site:

https://opscode-omnibus-packages.s3.amazonaws.com/ubuntu/11.04/x86_64/chef_11.2.0-1.ubuntu.11.04_amd64.deb

After I installed it using sudo dpkg -i chef_11.2.0-1.ubuntu.11.04_amd64.deb, I tried the locate command as recommended by waltinator, and it didn't return any results.

Am I to assume, then, that packages installed manually like this are NOT added to the local apt archive?

muru
  • 207,228
Alan
  • 187

2 Answers2

2

You could look for it:

locate --regexp 'chef.*deb'

Or, you could get a new copy, if /var/cache/apt/archives has been cleaned out.

See man apt-get, which says, in part:

NAME
       apt-get - APT package handling utility -- command-line interface

SYNOPSIS
       apt-get [-asqdyfmubV] [-o=config_string] [-c=config_file] [-t=target_release] [-a=architecture] {update | upgrade | dselect-upgrade | dist-upgrade |
               install pkg [{=pkg_version_number | /target_release}]...  | remove pkg...  | purge pkg...  |
               source pkg [{=pkg_version_number | /target_release}]...  | build-dep pkg [{=pkg_version_number | /target_release}]...  |
               download pkg [{=pkg_version_number | /target_release}]...  | check | clean | autoclean | autoremove | {-v | --version} | {-h | --help}}

Especially the download pkg [{=pkg_version_number | /target_release}] part, later on:

   download
       download will download the given binary package into the current directory.

So, apt-get download chef=11.2.0-1.ubuntu.11.04 is where I would start. I HAVE NOT TESTED THIS COMMAND

waltinator
  • 37,856
1

So after some searching in addition to what I've posted in the comments, I found a command that produces the exact repository - apt-cache policy packagename.

Example:

$ apt-cache policy chef
chef:
  Installed: (none)
  Candidate: 11.8.2-2
  Version table:
     11.8.2-2 0
        500 http://us.archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages
Fabby
  • 35,017