I would
```ruby
repos.inject([]) do |ids, repo|
  pkg_ids.push *repo.packages.collect(&:id)
end
```