Giter Club home page Giter Club logo

apt-clone's Introduction

Build Status

apt-clone

apt-clone lets you create "state" files of all installed packages for your Debian/Ubuntu systems that can be restored on freshly installed systems (or containers) or into a directory.

Use cases:

  • clone server package selection and restore on fallback system
  • backup system state to be able to restore in case of emergency

Usage

Create a clone (apt state backup)

$ sudo apt-clone clone ~/myhost

will create an ~/myhost.apt-clone.tar.gz.

Get info about the clone

$ apt-clone info ~/myhost.apt-clone.tar.gz
Hostname: top
Arch: amd64
Distro: wily
Meta: ubuntu-desktop
Installed: 3308 pkgs (1469 automatic)
Date: Fri Nov  6 23:06:35 2015

Restore the clone

The restore will override your existing /etc/apt/sources.list and will install/remove packages. So be careful!

$ sudo apt-clone restore ~/myhost.apt-clone.tar.gz Note that you can give the option --destination /some/dir and it will debootstrap the clone into this directory.

apt-clone's People

Contributors

alessio avatar benwiederhake avatar cjwatson avatar jelmer avatar lucaskanashiro avatar murraybd avatar mvo5 avatar shirocco88 avatar stgraber avatar vorlonofportland avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

apt-clone's Issues

sources.list link not handled

Does not work if /etc/apt/sources.list is a link.
It copies the link into the tar file, bot not the file, where the link points to.

This is mainly an issue if you change sources.list via a config package (built with the help of dh_configpackage).

While running the "clone" it prints this:

# apt-clone clone test
not installable: 
version mismatch: 
Note that you can use --with-dpkg-repack to include those packges in the clone file.

The info command on the generated tar file:

# apt-clone info test.apt-clone.tar.gz 
Traceback (most recent call last):
  File "/usr/local/bin/apt-clone", line 104, in <module>
    info = clone.info(args.source)
  File "/usr/local/lib/python2.7/dist-packages/apt_clone.py", line 375, in info
    "Date: %(date)s\n" % self._get_clone_info_dict(statefile)
  File "/usr/local/lib/python2.7/dist-packages/apt_clone.py", line 330, in _get_clone_info_dict
    distro = self._get_info_distro(statefile) or "unknown"
  File "/usr/local/lib/python2.7/dist-packages/apt_clone.py", line 319, in _get_info_distro
    f = tar.extractfile(self.TARPREFIX+"etc/apt/sources.list")
  File "/usr/lib/python2.7/tarfile.py", line 2154, in extractfile
    return self.extractfile(self._find_link_target(tarinfo))
  File "/usr/lib/python2.7/tarfile.py", line 2433, in _find_link_target
    raise KeyError("linkname %r not found" % linkname)
KeyError: "linkname './etc/apt/sources.list.test not found"

There are several solutions for this.

  1. add the link and the file the link points to.
    This could break the config package, which is installed by apt-clone on the new host.

  2. don't add the link at all
    The file would be handled by the config package which is installed on the new host by apt-clone, but requires that the config package is available without the sources.list from the clone host.

  3. add the linked file instead of the link
    The file will be overwritten by the config package on the new host, but it would break the purge of the config package, because config packages save the original file and restore it on purge.

  4. Handle the file according to the rules of "dh_configpackage"
    Use dpkg-divert --list /etc/apt/sources.list to check if the file is handled as diversion.
    Download the package and add it to the clone-tar-file and ignore /etc/apt/sources.list.
    On restore install the config package from the clone-tar first.

Example for diversion:

# dpkg-divert --list /etc/apt/sources.list
diversion of /etc/apt/sources.list to /etc/apt/sources.list.test-orig by test-repo
# dpkg-divert --listpackage /etc/apt/sources.list
test-repo

Why "version mismatch: " and how to fix ?

Why am I getting this report and how do I repair those conditions? installed versions are those reported in Synaptic. I don't know if I can trust that apt-clone has truly replicated the clone-master.

This is a desktop, personal, one-user computer.

  • UbuntuMATE 20.04 LTS amd64
  • Linux 5.4.0-90-lowlatency #101-Ubuntu SMP PREEMPT

version mismatch: samba-common-bin, libpq5, python3-ldb, thunderbird-locale-en-us, samba-dsdb-modules, samba-common, thunderbird-locale-en, libwbclient0, python3-software-properties, python3-samba, software-properties-gtk, software-properties-common, smbclient, libasound2, libatopology2, libasound2-data, thunderbird, thunderbird-locale-en-gb, thunderbird-locale-fr, libsmbclient, libldb2, samba-libs

terminalSessionLog.txt

OS_Admin__ClonePackageInstallation.sh.txt

restore does not write all gpg keys

When restoring, apt update reports a failure about an unknown key.
I had to extract .tar.gz into / to get all gpg keys and so update apt sources without key warning.

giving version mismatch error

when i try to clone on ubuntu 20.04 , it is giving error as below :

not installable:
version mismatch:

Note that you can use --with-dpkg-repack to include those packages in the clone file.

restore-new-distro: lsb_release.get_lsb_information doesn't work

I get the following error message when trying to use restore-new-distro:

host ~ # DEBIAN_FRONTEND=noninteractive apt-clone restore-new-distro --simulate /old/apt.apt-clone.tar.gz stretch
Traceback (most recent call last):
  File "/usr/bin/apt-clone", line 136, in <module>
    codename = lsb_release.get_lsb_information()["CODENAME"]
KeyError: 'CODENAME'

Apparently get_lsb_information() will only attempt to read $LSB_ETC_LSB_RELEASE or /etc/lsb-release; if that file doesn't exist, it won't return anything at all (see /usr/lib/python3/dist-packages/lsb_release.py). You probably want get_distro_information() instead:

host ~ # diff -u =apt-clone apt-clone2 
--- /usr/bin/apt-clone  2015-11-13 21:11:38.000000000 +0100
+++ apt-clone2  2018-04-04 15:32:47.412898874 +0200
@@ -133,7 +133,7 @@
         # we are not yet on the new release its fine to remove installed
         # pkgs as part of the upgrade
         import lsb_release
-        codename = lsb_release.get_lsb_information()["CODENAME"]
+        codename = lsb_release.get_distro_information()["CODENAME"]
         if (args.new_distro_codename and args.new_distro_codename == codename):
             protect_installed = True
         else:

`apt-clone restore` shows strange messages "(E:Unable to correct problems, you have held broken packages.)"

When running apt-clone restore, I got a lot of failed error messages like this:

                                                                                                                                                                                 
WARNING:root:can't add steam:i386 (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add strace (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add sudo (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add switcheroo-control (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add synaptic (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add system-config-printer (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add system-config-printer-common (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add system-config-printer-udev (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add system76-acpi-dkms (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add system76-cuda (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add system76-cuda-11.1 (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add system76-cudnn-11.1 (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add system76-dkms (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add system76-io-dkms (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add system76-power (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add system76-scheduler (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add systemd (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add systemd-sysv (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add systemd-timesyncd (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add sysvinit-utils (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add t1utils (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add tar (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add tcl (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add tcl8.6 (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add tcpdump (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add teckit (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add telnet (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add testng (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add tex-common (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add tex-gyre (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add texinfo (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add texlive-base (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add texlive-bibtex-extra (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add texlive-binaries (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add texlive-extra-utils (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add texlive-font-utils (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add texlive-fonts-extra (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add texlive-fonts-extra-doc (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add texlive-fonts-extra-links (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add texlive-fonts-recommended (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add texlive-fonts-recommended-doc (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add texlive-formats-extra (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add texlive-full (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add texlive-games (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add texlive-humanities (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add texlive-humanities-doc (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add texlive-lang-arabic (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add texlive-lang-chinese (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add texlive-lang-cjk (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add texlive-lang-cyrillic (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add texlive-lang-czechslovak (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add texlive-lang-english (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add texlive-lang-european (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add texlive-lang-french (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add texlive-lang-german (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add texlive-lang-greek (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add texlive-lang-italian (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add texlive-lang-japanese (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add texlive-lang-korean (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add texlive-lang-other (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add texlive-lang-polish (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add texlive-lang-portuguese (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add texlive-lang-spanish (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add texlive-latex-base (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add texlive-latex-base-doc (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add texlive-latex-extra (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add texlive-latex-extra-doc (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add texlive-latex-recommended (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add texlive-latex-recommended-doc (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add texlive-luatex (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add texlive-metapost (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add texlive-metapost-doc (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add texlive-music (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add texlive-pictures (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add texlive-pictures-doc (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add texlive-plain-generic (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add texlive-pstricks (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add texlive-pstricks-doc (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add texlive-publishers (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add texlive-publishers-doc (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add texlive-science (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add texlive-science-doc (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add texlive-xetex (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add texworks (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add texworks-help-en (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add thermald (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add thin-provisioning-tools (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add time (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add timgm6mb-soundfont (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add tipa (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add tk (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add tk8.6 (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add tlp (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add tlp-rdw (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add tmux (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add tnftp (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add toilet (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add toilet-fonts (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add tor (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add tor-geoipdb (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add torbrowser-launcher (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add torsocks (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add totem (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add totem-common (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add totem-plugins (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add touchegg (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add tpm-udev (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add tracker (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add tracker-extract (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add tracker-miner-fs (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add transmission (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add transmission-cli (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add transmission-common (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add transmission-gtk (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add tree (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add ttf-bitstream-vera (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add ttf-mscorefonts-installer (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add tumbler (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add tumbler-common (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add tumbler-plugins-extra (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add tzdata (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add ubuntu-advantage-desktop-daemon (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add ubuntu-advantage-tools (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add ubuntu-docs (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add ubuntu-drivers-common (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add ubuntu-keyring (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add ubuntu-minimal (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add ubuntu-mono (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add ubuntu-release-upgrader-core (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add ubuntu-standard (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add ubuntu-touch-settings (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add ucf (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add udev (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add udisks2 (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add ufw (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add uidmap (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add uno-libs-private (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add unrar (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add unzip (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add update-inetd (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add update-manager-core (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add upower (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add ure (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add usb-modeswitch (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add usb-modeswitch-data (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add usb.ids (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add usbmuxd (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add usbutils (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add usrmerge (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add util-linux (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add uuid-dev (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add uuid-runtime (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add va-driver-all:i386 (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add vbetool (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add vdpau-driver-all (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add vim-common (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add vim-tiny (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add visualvm (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add vivaldi-stable (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add vlc (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add vlc-bin (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add vlc-data (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add vlc-l10n (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add vlc-plugin-access-extra (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add vlc-plugin-base (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add vlc-plugin-notify (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add vlc-plugin-qt (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add vlc-plugin-samba (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add vlc-plugin-skins2 (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add vlc-plugin-video-output (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add vlc-plugin-video-splitter (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add vlc-plugin-visualization (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add vpnc-scripts (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add vprerex (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add w3m (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add w3m-img (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add wamerican (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add wbrazilian (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add wbritish (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add wfrench (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add wget (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add whiptail (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add whoopsie (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add whoopsie-preferences (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add winbind (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add wine (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add wine32:i386 (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add wine64 (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add winetricks (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add wireless-regdb (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add wireless-tools (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add wireplumber (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add wireshark (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add wireshark-common (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add wireshark-qt (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add witalian (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add wmdocker (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add wngerman (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add wogerman (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add wpasupplicant (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add wportuguese (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add wspanish (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add wswiss (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add x11-apps (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add x11-common (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add x11-session-utils (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add x11-utils (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add x11-xkb-utils (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add x11-xserver-utils (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add x11proto-core-dev (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add x11proto-dev (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add xapp (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add xapps-common (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add xauth (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add xbitmaps (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add xbrlapi (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add xclip (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add xcvt (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add xdg-dbus-proxy (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add xdg-desktop-portal (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add xdg-desktop-portal-gnome (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add xdg-desktop-portal-gtk (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add xdg-user-dirs (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add xdg-user-dirs-gtk (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add xdg-utils (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add xdotool (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add xfce4-taskmanager (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add xfconf (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add xfonts-base (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add xfonts-encodings (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add xfonts-scalable (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add xfonts-utils (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add xinit (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add xinput (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add xkb-data (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add xml-core (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add xorg (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add xorg-docs-core (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add xorg-sgml-doctools (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add xserver-common (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add xserver-xephyr (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add xserver-xorg (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add xserver-xorg-core (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add xserver-xorg-input-all (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add xserver-xorg-input-libinput (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add xserver-xorg-input-wacom (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add xserver-xorg-legacy (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add xserver-xorg-video-all (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add xserver-xorg-video-amdgpu (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add xserver-xorg-video-ati (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add xserver-xorg-video-fbdev (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add xserver-xorg-video-intel (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add xserver-xorg-video-nouveau (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add xserver-xorg-video-qxl (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add xserver-xorg-video-radeon (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add xserver-xorg-video-vesa (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add xserver-xorg-video-vmware (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add xterm (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add xtrans-dev (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add xwayland (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add xxd (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add xz-utils (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add yelp (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add yelp-xsl (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add zenity (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add zenity-common (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add zip (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add zipalign (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add zlib1g (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add zlib1g-dev (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add zlib1g:i386 (E:Unable to correct problems, you have held broken packages.)
WARNING:root:can't add zstd (E:Unable to correct problems, you have held broken packages.)
Traceback (most recent call last):
  File "/usr/bin/apt-clone", line 123, in <module>
    clone.restore_state(args.source, args.destination,
  File "/usr/lib/python3/dist-packages/apt_clone.py", line 500, in restore_state
    self._restore_package_selection(statefile, targetdir, protect_installed, exclude_pkgs)
  File "/usr/lib/python3/dist-packages/apt_clone.py", line 655, in _restore_package_selection
    self._restore_package_selection_in_cache(statefile, cache, protect_installed, exclude_pkgs)
  File "/usr/lib/python3/dist-packages/apt_clone.py", line 632, in _restore_package_selection_in_cache
    resolver.resolve()
apt_pkg.Error: E:Unable to correct problems, you have held broken packages.

It is unknown which apt command triggers them, is it possible to print the commands out to show how to reproduce these problems?

What is not installable: & version mismatch: ?

What is not installable: & version mismatch: ?
Can you please provide more details?
Is the clone file valid to restore my system EXACTLY as it was?

Great software by the way if I can figure it out and depend on it!

restore-new-distro seems to be broken since --exclude was added

I'm trying to get restore-new-distro to work, but apt-clone wrote this into the /etc/apt/sources.list file:

deb http://ftp.de.debian.org/debian/ True main non-free contrib
deb http://ftp.de.debian.org/debian/ True-updates main non-free contrib
deb http://security.debian.org/ True main non-free contrib
deb https://update.iserv.eu/debian/ True main non-free contrib
deb https://update.iserv.eu/debian/ True main non-free
deb http://deb.avast.com/lin/repo True release

I believe that this bug was introduced by 567b2f1; the arguments of AptClone.restore_state were changed, but the elif args.command == "restore-new-distro" block wasn't updated to reflect this.

The following patch should fix it:

host ~ # diff -u =apt-clone apt-clone
--- /usr/bin/apt-clone  2015-11-13 21:11:38.000000000 +0100
+++ apt-clone   2018-04-04 15:36:45.810880259 +0200
@@ -79,6 +79,11 @@
     command.add_argument("new_distro_codename")
     command.add_argument("--destination", default="/")
     command.add_argument("--simulate", action="store_true", default=False)
+    command.add_argument(
+        "--rewrite-server",
+        help="rewrite all URIs in sources.list to the specified url")
+    command.add_argument("--exclude", nargs='*',
+                         help="exclude the listed package names from the restore")
     command.set_defaults(command="restore-new-distro")
     # show-diff
     command = subparser.add_parser(
@@ -141,8 +146,10 @@

         if args.simulate:
             miss = clone.simulate_restore_state(
-                args.source, args.new_distro_codename)
+                args.source, args.exclude, args.new_distro_codename)
             print("missing: %s" % ",".join(sorted(list(miss))))
         else:
             clone.restore_state(
-                args.source, args.destination, args.new_distro_codename, protect_installed)
+                args.source, args.destination, args.exclude,
+                args.new_distro_codename, protect_installed,
+                mirror=args.rewrite_server)

sudo apt-clone clone /backup not installable:

version mismatch: libnvidia-compute-535-server, nvidia-driver-535-server-open, linux-modules-nvidia-535-server-open-generic, libnvidia-extra-535-server, nvidia-kernel-source-535-server-open, xserver-xorg-video-nvidia-535-server, libnvidia-decode-535-server, nvidia-utils-535-server, libnvidia-gl-535-server, libnvidia-fbc1-535-server, libnvidia-encode-535-server, nvidia-kernel-common-535-server, nvidia-compute-utils-535-server, libnvidia-cfg1-535-server, linux-modules-nvidia-535-server-open-5.4.0-166-generic

Note that you can use --with-dpkg-repack to include those packges in the clone file.

What does this mean and how should it be handled

Silently fails when dpkg-repack fails

(downstream bug: #909443)

What led up to the situation?

I invoked apt-clone --with-dpkg-repack my-repacked.apt-clone.tar.gz.

I have teamviewer installed, so one of the many packages is teamviewer.
Apparently, I deleted /etc/apt/sources.list.d/teamviewer.list at some point in time.
This may have confused dpkg-repack.

What was the outcome of this action?

The teamviewer package did not get repacked, and was missing from the generated tarball.
No exit code indicated that there was an error. (So automation would run into trouble).

There was only one warning from apt-clone, buried among many other similar
lines:

dpkg-deb: error: conffile '/etc/apt/sources.list.d/teamviewer.list' does not appear in package
dpkg -repack: Error running: dpkg-deb --build dpkg-repack.teamviewer.tTztGb.
dpkg -repack: Problems were encountered in processing.
dpkg -repack: The package may be broken.

If this had been an important package (i.e., the printer drivers that brought me here), and if I hadn't caught this, then I would have been in trouble.

What outcome did I expect instead?

I expected one of the following:

  • Ideal: Set a non-zero exit code, include the "maybe broken" package anyway.
  • Acceptable: Set a non-zero exit code.
  • Acceptable: Set a non-zero exit code, refuse to generate apt-clone tarball.

Cheers,
Ben

running apt-clone backup on a restored system results in many file not found errors

apt-clone is part of my normal daily backup routine. Recently my system broke and I restored it using apt-clone. Worked great.

The problem is, now the backup routine (on the restored system) does not work well anymore. During repack it packs dozens of packages and fails during that process, which it did not do before.

The system is Debian 10.6 stable and I restored from-to identical distro versions.

Running backup now, I get lots of errors like this:

dpkg-deb: building package 'firefox-esr' in './firefox-esr_68.2.0esr-1~deb10u1_amd64.deb'.
dpkg-repack: Problems were encountered in processing.
dpkg-repack: The package may be broken.
dpkg-repack: File not found: /usr/lib/x86_64-linux-gnu/libavcodec.so.57.64.101
dpkg-repack: File not found: /usr/share/doc/libavcodec57
dpkg-repack: File not found: /usr/share/doc/libavcodec57/changelog.Debian.gz

and this is the end of the log:

not installable: gcc-6, libva-x11-1, php7.0-json, openjdk-8-jre, php7.0-zip, libisl15, gcc-6-base, libprocps6, libsndio6.1, libwebpmux2, php7.0-common, libgnome-keyring-common, libvpx4, libunistring0, cpp-6, libswresample2, openjdk-8-jre-headless, php7.0-mbstring, php7.0-readline, libx265-95, libdns-export162, libasan3, libgnome-keyring0, libicu57, libmpfr4, libva-drm1, libx264-148, php7.0-intl, perl-modules-5.24, libgcc-6-dev, php7.0-xml, php7.0-cli, php7.0-bz2, libavutil55, libcryptsetup4, liblogging-stdlog0, php7.0, libisc-export160, libapache2-mod-php7.0, gir1.2-gnomekeyring-1.0, libssl1.0.2, php7.0-gd, php7.0-opcache, libva1, libgdbm3, firefox-esr, libavcodec57
version mismatch: phpmyadmin

At least some of these packages are old. gcc-6 was in Debian oldstable, but not in stable anymore. Therefore, I believe that I had it on my old system and it was part of the package list, but during restore it could not be installed (because it is not in the Debian stable repo). Still, apt-clone is looking for it now, and it is not there.

apt install gcc-6 does not work, the package does not exist, but I can remove it.

Any idea how I can solve this? Maybe I should just remove all of these packages? (which do not seem to be installed anyway)


This is the command I use to backup:

sudo apt-clone clone --with-dpkg-repack /somewhere

This is the command I used to restore:

apt-clone restore apt-clone-state-[HOSTNAME].tar.gz

show-diff should hide transitive dependencies

Right now, show-diff shows all dependencies, if they are all manually installed the system will lose ability to upgrade later due to transitive dependency lock, making it dangerous to use.

it should be configured to hide transitive dependencies, this should be an easy fix.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.