#1104628 apt-clone: "PermissionError" with new deb822 format for sources list

#1104628#5
Date:
2025-05-03 10:39:30 UTC
From:
To:
Dear Maintainer,

I have updated my sources list with "apt modernize-sources";
now I have the file "/etc/apt/sources.list.d/debian.sources" and the old
"/etc/apt/sources.list" does not exists anymore.

If I run the command "apt-clone clone test" it crashes with this error:

Traceback (most recent call last):
  File "/usr/bin/apt-clone", line 108, in <module>
    clone.save_state(args.source, args.destination,
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                     args.with_dpkg_repack, args.with_dpkg_status,
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                     extra_files=args.extra_files)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/apt_clone.py", line 154, in save_state
    self._write_state_installed_pkgs(sourcedir, tar)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/apt_clone.py", line 192, in _write_state_installed_pkgs
    cache = self._cache_cls(rootdir=sourcedir)
  File "/usr/lib/python3/dist-packages/apt/cache.py", line 149, in __init__
    self._check_and_create_required_dirs(rootdir)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
  File "/usr/lib/python3/dist-packages/apt/cache.py", line 191, in _check_and_create_required_dirs
    open(rootdir + f, "w").close()
    ~~~~^^^^^^^^^^^^^^^^^^
PermissionError: [Errno 13] Permission denied: '//etc/apt/sources.list'


I think apt-clone should be aware of the new format and not crash if a
file is missing; ideally it should backup both files if present.

Thanks

#1104628#10
Date:
2025-08-13 09:13:51 UTC
From:
To:
Dear submitter,

as the package apt-clone has just been removed from the Debian archive
unstable we hereby close the associated bug reports.  We are sorry
that we couldn't deal with your issue properly.

For details on the removal, please see https://bugs.debian.org/1108671

The version of this package that was in Debian prior to this removal
can still be found using https://snapshot.debian.org/.

Please note that the changes have been done on the master archive and
will not propagate to any mirrors until the next dinstall run at the
earliest.

This message was generated automatically; if you believe that there is
a problem with it please contact the archive administrators by mailing
ftpmaster@ftp-master.debian.org.

Debian distribution maintenance software
pp.
Thorsten Alteholz (the ftpmaster behind the curtain)