Ubuntu: How do I get the latest content of a .deb file without downloading redundant data?



Question:

I want to update a .deb file with the latest content from available update. I searched and found apt-sync program, however, this apt-sync project seems dead.

Is there any alternative of it? or Is this moved to somewhere else? or How can I achieve the same result?


Solution:1

Currently I am following this procedure.

  1. Log into my Koding cloud space.
  2. Fire-up a terminal there and download the package's deb file using apt-get download.
  3. Extract the downloaded .deb file using dpkg-deb -R <deb-file> . to get the content of the file.
  4. Move the contents to a suitable directory. For example, /home/anwarshah/contents
  5. In local pc, Extract the old deb's content in a directory, preferably in a directory with same remote name i.e contents.
  6. Use rsync to synchronize the contents

    rsync -a -i -h -v -c <myusername@myusername>.koding.io:/home/<myusername>/contents/ /home/anwar/contents/  
  7. Now build the newly synched package using dpkg-deb

    dpkg-deb --build /home/anwar/contents   
  8. A new .deb file will be created with name contents.deb. Rename this to standard package format using dpkg-name

    dpkg-name contents.deb   
  9. Now I have the .deb file with latest contents without having to download extra redundant data. It was very helpful for large packages with multimedia data such as kde-wallpapers etc.

Alternative way

  1. Find a cloud VM where you can download the .deb files.
  2. Use zsyncmake to create a .deb.zsync file
  3. Use zsync to download .deb file after making the file available to be downloaded. Make sure to read the zsync manual.

Zsync is a program similar to rsync, which aims to reduce the data needed for download for compressed files. It basically updates a large compressed file with the latest content of that compressed file from Internet. Ubuntu provides .iso.zsync for it's ISOs which is efficient to save some (around 35%) bandwidth, if you already have the ISO locally.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »