• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here:Home » How To Repack Installed Software on Debian/Ubuntu

By Abhishek Ghosh January 16, 2021 6:06 am Updated on January 16, 2021

How To Repack Installed Software on Debian/Ubuntu

Advertisement

It can happen that a particular version of a specific tweaked package no longer available elsewhere or you want the exact “clone” of the running software. If you have installed some Debian package on your server and want to install the same package on another server either to avoid downloading them again or “clone” with the settings then there are some tools which can help you. If the second machine lacks an internet connection then you’ll need to install the dependencies as well.

The dpkg-repack utility can be helpful in many situations where you want to move the original .deb file :

Vim
1
2
# man
https://manpages.ubuntu.com/manpages/disco/en/man1/dpkg-repack.1.html

You can easily install it :

Advertisement

---

Vim
1
sudo apt install dpkg-repack

You can repackage any software such as apache2 first by stopping any running instance and then running this kind of command :

Vim
1
dpkg-repack apache2

If you can’t rebuild the deb file due to any permission issues, then run the command from fakeroot environment:

Vim
1
fakeroot -u dpkg-repack apache2

You can install the resulting deb file with the below command :

Vim
1
2
3
sudo dpkg -i <package-name>
# install the dependencies
sudo apt-get -f install

We can print the dependencies on the main server running the original software :

Vim
1
apt-cache depends Package_name |awk '{print $2}'

You can create a script to automate the dependency installation :

Vim
1
2
package=package
dpkg-repack $(apt-cache depends --false-suggests $package |awk '{print $2}') $package

How To Repack Installed Software on Debian Ubuntu

However, dpkg-repack utility will not copy your custom settings. dpkg-repack is helpful to get the original deb file we used on our main server. That is helpful in a certain scenario where an exact copy of the settings is not desired.

apt-clone is another utility which copies all the settings and create a debian installation file :

Vim
1
2
http://manpages.ubuntu.com/manpages/bionic/man8/apt-clone.8.html
https://packages.debian.org/stretch/apt-clone

You can install apt-clone utility by running :

Vim
1
sudo apt-get install apt-clone

If we want to clone a running instance of apache2 then we need to run :

Vim
1
apt-clone clone apache2

This creates a file apache2.apt-clone.tar.gz. Copy it to the destination machine, and run

Vim
1
2
apt-get install apt-clone
apt-clone restore apache2.apt-clone.tar.gz

You can manually install the same packages from one server to another with the below commands :

Vim
1
2
3
dpkg -l | grep ^ii | awk '{print $2}' > installed
# another server
sudo apt-get install $(cat installed)

Usually, the settings are saved in the /etc/ directory. There are tools such as etckeeper which can be used with git to restore the settings :

Vim
1
http://etckeeper.branchable.com/

Tagged With dpkg-repack all options , How to repack installed software , install cat on ubuntu , repack installed debian apps dpkg
Facebook Twitter Pinterest

Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to How To Repack Installed Software on Debian/Ubuntu

  • Nginx WordPress Installation Guide (All Steps)

    This is a Full Nginx WordPress Installation Guide With All the Steps, Including Some Optimization and Setup Which is Compatible With WordPress DOT ORG Example Settings For Nginx.

  • Changing Data With cURL for OpenStack Swift (HP Cloud CDN)

    Changing Data With cURL For Object is Quite Easy in OpenStack Swift. Here Are Examples With HP Cloud CDN To Make it Clear. Official Examples Are Bad.

  • Steps To Install Nginx Plus on Ubuntu Server (HP Cloud)

    Here Are the Steps To Install Nginx Plus on Ubuntu Server Running on HP Cloud. Nginx Plus is the Paid Version of Nginx with Extra Features.

  • OpenShift OctoPress Auto install Script

    OpenShift OctoPress Auto install Script is an Advanced Script to Run OctoPress on Free OpenShift PaaS Practically Without Any Knowing Ruby or Git.

performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

Get new posts by email:

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (24.3K Followers)
  • Twitter (5.8k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • Hybrid Multi-Cloud Environments Are Becoming UbiquitousJuly 12, 2023
  • Data Protection on the InternetJuly 12, 2023
  • Basics of BJT TransistorJuly 11, 2023
  • What is Confidential Computing?July 11, 2023
  • How a MOSFET WorksJuly 10, 2023
PC users can consult Corrine Chorney for Security.

Want to know more about us?

Read Notability and Mentions & Our Setup.

Copyright © 2023 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy