Backup Installed Packages And Restore Them On Freshly Installed Ubuntu System

5 Responses

  1. Habadeer says:

    Does this include packages installed from ppa’s? If so, does it add the ppa to software sources?

    • Ievgen Sobko says:

      From what I see at `https://github.com/mvo5/apt-clone/blob/master/apt_clone.py` it tries to restore `sources.list.d` directory that usually represents ppa repositories
      “` python
      tar.extract(self.TARPREFIX+”etc/apt/sources.list.d”, targetdir)
      “`

  2. IronManMH12 says:

    Can this utility be used to clone (backup) on Ubuntu 16.04 and then restore on Ubuntu 18.04 ?

  3. sk says:

    No, both source and destination should have the same OS and architecture.

  4. Guido van Harten says:

    On a clean system (Ubuntu 18.04 Server) I installed apt-clean using the above mentioned tutorial.
    When I ran
    [code]# apt-clone info mypackages/apt-clone-state-ubuntuserver.tar.gz[/code]
    my system replies:
    [code]Traceback (most recent call last):
    File “/usr/bin/apt-clone”, line 104, in
    info = clone.info(args.source)
    File “/usr/lib/python3/dist-packages/apt_clone.py”, line 375, in info
    “Date: %(date)s\n” % self._get_clone_info_dict(statefile)
    File “/usr/lib/python3/dist-packages/apt_clone.py”, line 330, in _get_clone_info_dict
    distro = self._get_info_distro(statefile) or “unknown”
    File “/usr/lib/python3/dist-packages/apt_clone.py”, line 316, in _get_info_distro
    with tarfile.open(statefile) as tar:
    File “/usr/lib/python3.6/tarfile.py”, line 1571, in open
    return func(name, “r”, fileobj, **kwargs)
    File “/usr/lib/python3.6/tarfile.py”, line 1636, in gzopen
    fileobj = gzip.GzipFile(name, mode + “b”, compresslevel, fileobj)
    File “/usr/lib/python3.6/gzip.py”, line 163, in __init__
    fileobj = self.myfileobj = builtins.open(filename, mode or ‘rb’)
    FileNotFoundError: [Errno 2] No such file or directory: ‘mypackages/apt-clone-state-ubuntuserver.tar.gz’
    [email protected]:/home/guido#[/code]

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.