Verification on Cosmic. Following the test case in the description : $ sudo guestfish -a xenial-server-cloudimg-amd64-disk1.img --network -v << EOF run mount /dev/sda1 / command 'apt update' EOF libguestfs: launch: program=guestfish libguestfs: launch: version=1.38.4 libguestfs: launch: backend registered: unix ... Get:1 http://security.ubuntu.com/ubuntu xenial-security InRelease [109 kB] Hit:2 http://archive.ubuntu.com/ubuntu xenial InRelease Get:3 http://archive.ubuntu.com/ubuntu xenial-updates InRelease [109 kB] Get:4 http://archive.ubuntu.com/ubuntu xenial-backports InRelease [107 kB] Get:5 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages [667 kB] Get:6 http://security.ubuntu.com/ubuntu xenial-security/main Translation-en [269 kB] Get:7 http://security.ubuntu.com/ubuntu xenial-security/universe amd64 Packages [438 kB] Get:8 http://security.ubuntu.com/ubuntu xenial-security/universe Translation-en [178 kB] Get:9 http://security.ubuntu.com/ubuntu xenial-security/multiverse amd64 Packages [5600 B] Get:10 http://archive.ubuntu.com/ubuntu xenial/universe amd64 Packages [7532 kB] Get:11 http://security.ubuntu.com/ubuntu xenial-security/multiverse Translation-en [2676 B] Get:12 http://archive.ubuntu.com/ubuntu xenial/universe Translation-en [4354 kB] Get:13 http://archive.ubuntu.com/ubuntu xenial/multiverse amd64 Packages [144 kB] Get:14 http://archive.ubuntu.com/ubuntu xenial/multiverse Translation-en [106 kB] Get:15 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages [966 kB] Get:16 http://archive.ubuntu.com/ubuntu xenial-updates/main Translation-en [384 kB] Get:17 http://archive.ubuntu.com/ubuntu xenial-updates/restricted amd64 Packages [7616 B] Get:18 http://archive.ubuntu.com/ubuntu xenial-updates/restricted Translation-en [2272 B] Get:19 http://archive.ubuntu.com/ubuntu xenial-updates/universe amd64 Packages [750 kB] Get:20 http://archive.ubuntu.com/ubuntu xenial-updates/universe Translation-en [312 kB] Get:21 http://archive.ubuntu.com/ubuntu xenial-updates/multiverse amd64 Packages [16.7 kB] Get:22 http://archive.ubuntu.com/ubuntu xenial-updates/multiverse Translation-en [8440 B] Get:23 http://archive.ubuntu.com/ubuntu xenial-backports/main amd64 Packages [7280 B] Get:24 http://archive.ubuntu.com/ubuntu xenial-backports/main Translation-en [4456 B] Get:25 http://archive.ubuntu.com/ubuntu xenial-backports/universe amd64 Packages [7804 B] Get:26 http://archive.ubuntu.com/ubuntu xenial-backports/universe Translation-en [4184 B] Fetched 16.5 MB in 28s (573 kB/s) Reading package lists... Building dependency tree... Reading state information... 109 packages can be upgraded. Run 'apt list --upgradable' to see them. ... Now 'apt update' works. $ dpkg -l | grep libguestfs ii libguestfs-hfsplus:amd64 1:1.38.4-1ubuntu2.1 amd64 guest disk image management system - HFS+ support ii libguestfs-perl 1:1.38.4-1ubuntu2.1 amd64 guest disk image management system - Perl bindings ii libguestfs-reiserfs:amd64 1:1.38.4-1ubuntu2.1 amd64 guest disk image management system - ReiserFS support ii libguestfs-tools 1:1.38.4-1ubuntu2.1 amd64 guest disk image management system - tools ii libguestfs-xfs:amd64 1:1.38.4-1ubuntu2.1 amd64 guest disk image management system - XFS support ii libguestfs0:amd64 1:1.38.4-1ubuntu2.1 amd64 guest disk image management system - shared library