пятница, 24 апреля 2015 г.

Download all packages from Ubuntu repository

To download all packages from particular repository we can use "Packages" file. It contains meta information about every packages in repository.

1) Get particualr "Packages" file.

ls /var/lib/apt/lists/*_Packages

2) Use "apt-get download" to get all packages

for i in `grep "Package:" Packages | awk '{print $2}'`; do ${i}_* || apt-get download $i; done

It will download all deb files to current directory.