Public bug reported:
I am getting the following errors when running sudo -u apt-mirror apt-mirror Processing indexes: [ Psh: 1: cannot create archive.ubuntu.com/ubuntu//dists/trusty/main/binary-amd64/Packages: Permission denied sh: 1: cannot create archive.ubuntu.com/ubuntu//dists/trusty/restricted/binary-amd64/Packages: Permission denied Psh: 1: cannot create archive.ubuntu.com/ubuntu//dists/trusty-security/main/binary-amd64/Packages: Permission denied sh: 1: cannot create archive.ubuntu.com/ubuntu//dists/trusty-security/restricted/binary-amd64/Packages: Permission denied Psh: 1: cannot create archive.ubuntu.com/ubuntu//dists/trusty-updates/main/binary-amd64/Packages: Permission denied sh: 1: cannot create archive.ubuntu.com/ubuntu//dists/trusty-updates/restricted/binary-amd64/Packages: Permission denied Psh: 1: cannot create archive.ubuntu.com/ubuntu//dists/trusty-backports/main/binary-amd64/Packages: Permission denied sh: 1: cannot create archive.ubuntu.com/ubuntu//dists/trusty-backports/restricted/binary-amd64/Packages: Permission denied ] After looking at the source code, I believe the following code fragment inside "process_index_gz" should be the following: if ( $index =~ s/\.gz$// ) { system("gunzip < $mirror$index.gz > $mirror$index"); print "done!\n"; } instead of the original: if ( $index =~ s/\.gz$// ) { system("gunzip < $path/$index.gz > $path/$index"); print "done!\n"; } Since $path despite its name came from: $path = sanitise_uri($uri); and $mirror came from: $mirror = get_variable("mirror_path") . "/" . $path; ProblemType: Bug DistroRelease: Ubuntu 16.04 Package: apt-mirror 0.5.1-1ubuntu1 [modified: usr/bin/apt-mirror] ProcVersionSignature: Ubuntu 4.4.0-98.121-generic 4.4.90 Uname: Linux 4.4.0-98-generic x86_64 ApportVersion: 2.20.1-0ubuntu2.10 Architecture: amd64 Date: Sun Nov 5 22:11:54 2017 InstallationDate: Installed on 2017-11-04 (1 days ago) InstallationMedia: Ubuntu-Server 16.04.3 LTS "Xenial Xerus" - Release amd64 (20170801) PackageArchitecture: all ProcEnviron: TERM=xterm PATH=(custom, no user) XDG_RUNTIME_DIR=<set> LANG=en_US.UTF-8 SHELL=/bin/bash SourcePackage: apt-mirror UpgradeStatus: No upgrade log present (probably fresh install) modified.conffile..etc.cron.d.apt-mirror: # # Regular cron jobs for the apt-mirror package # 0 4 * * * apt-mirror /usr/bin/apt-mirror > /var/spool/apt-mirror/var/cron.log mtime.conffile..etc.apt.mirror.list: 2017-11-04T21:42:43.202920 mtime.conffile..etc.cron.d.apt-mirror: 2017-11-05T21:32:52.960585 ** Affects: apt-mirror (Ubuntu) Importance: Undecided Status: New ** Tags: amd64 apport-bug xenial -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1730285 Title: use $mirror instead of $path in calling system(gunzip) To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/apt-mirror/+bug/1730285/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs