2 years ago

#70405

test-img

Tim

Why does apt don't accept my Packages.gz file?

I'm trying to upgrade Linux systems off network. I have a routine that create patches that I download on my units, and a script executes the upgrades. I'm working on Linux For Tegra arm64. It works most of the time, but sometimes apt update ends with the error :

File not found - /data/patch/test_patch/./Packages (2: No such file or directory)

Here is the content of the folder containing my packages:

26 # ls /data/patch/test_patch/ -l
total 3896
-rw-r--r-- 1 root root    2420 Jan 19 14:55 Packages.gz
-rw-r--r-- 1 root root     682 Jan 19 14:55 apt.conf
-rw-r--r-- 1 root root 1200720 Jan 19 14:55 php7.2-cli_7.2.24-0ubuntu0.18.04.10_arm64.deb
-rw-r--r-- 1 root root  477560 Jan 19 14:55 php7.2-common_7.2.24-0ubuntu0.18.04.10_arm64.deb
-rw-r--r-- 1 root root   16836 Jan 19 14:55 php7.2-json_7.2.24-0ubuntu0.18.04.10_arm64.deb
-rw-r--r-- 1 root root  142768 Jan 19 14:55 php7.2-opcache_7.2.24-0ubuntu0.18.04.10_arm64.deb
-rw-r--r-- 1 root root 1234148 Jan 19 14:55 php7.2-phpdbg_7.2.24-0ubuntu0.18.04.10_arm64.deb
-rw-r--r-- 1 root root   10988 Jan 19 14:55 php7.2-readline_7.2.24-0ubuntu0.18.04.10_arm64.deb
-rw-r--r-- 1 root root  877196 Jan 19 14:55 postgresql-client-10_10.19-0ubuntu0.18.04.1_arm64.deb
-rw-r--r-- 1 root root      70 Jan 19 14:55 test.list

test.list:

# Local repository
deb [trusted=yes] file:///data/patch/test_patch ./

apt.conf file:

Acquire
{
    Check-Valid-Until "false";
    CompressionTypes
    {
        Order "gz";
    };
};
APT
{
    Architecture "arm64";
    Get
    {
        Allow-Downgrades "true";
        AllowUnauthenticated "true";
        Assume-Yes "true";
        List-Cleanup "false";
    };
};
Dir
{
    Etc /data/patch/test_patch
    {
        PreferencesParts "/etc/apt/preferences.d";
        SourceList "test.list";
        SourceParts "";
    };
};
DPkg
{
    Options { "--force-confnew" ; }
};
Item
{
    quiet;
};

Example of output when it works:

25 # apt-get --config-file /data/patch/test_patch/apt.conf update
Get:1 file:/data/patch/test_patch ./ InRelease
Ign:1 file:/data/patch/test_patch ./ InRelease
Get:2 file:/data/patch/test_patch ./ Release
Ign:2 file:/data/patch/test_patch ./ Release
Get:3 file:/data/patch/test_patch ./ Packages [2420 B]
Get:4 file:/data/patch/test_patch ./ Translation-en
Ign:4 file:/data/patch/test_patch ./ Translation-en
Get:4 file:/data/patch/test_patch ./ Translation-en
Ign:4 file:/data/patch/test_patch ./ Translation-en
Get:4 file:/data/patch/test_patch ./ Translation-en
Ign:4 file:/data/patch/test_patch ./ Translation-en
Get:4 file:/data/patch/test_patch ./ Translation-en
Ign:4 file:/data/patch/test_patch ./ Translation-en
Get:4 file:/data/patch/test_patch ./ Translation-en
Ign:4 file:/data/patch/test_patch ./ Translation-en
Get:4 file:/data/patch/test_patch ./ Translation-en
Ign:4 file:/data/patch/test_patch ./ Translation-en
Get:4 file:/data/patch/test_patch ./ Translation-en
Ign:4 file:/data/patch/test_patch ./ Translation-en
Reading package lists... Done

And a system where it doesn't work:

40 # apt-get --config-file /data/patch/test_patch/apt.conf update
Get:1 file:/data/patch/test_patch ./ InRelease
Ign:1 file:/data/patch/test_patch ./ InRelease
Get:2 file:/data/patch/test_patch ./ Release
Ign:2 file:/data/patch/test_patch ./ Release
Get:3 file:/data/patch/test_patch ./ Packages [2420 B]
Get:4 file:/data/patch/test_patch ./ Translation-en
Ign:4 file:/data/patch/test_patch ./ Translation-en
Get:4 file:/data/patch/test_patch ./ Translation-en
Ign:4 file:/data/patch/test_patch ./ Translation-en
Get:4 file:/data/patch/test_patch ./ Translation-en
Ign:4 file:/data/patch/test_patch ./ Translation-en
Get:4 file:/data/patch/test_patch ./ Translation-en
Ign:4 file:/data/patch/test_patch ./ Translation-en
Get:4 file:/data/patch/test_patch ./ Translation-en
Ign:4 file:/data/patch/test_patch ./ Translation-en
Get:4 file:/data/patch/test_patch ./ Translation-en
Ign:4 file:/data/patch/test_patch ./ Translation-en
Get:4 file:/data/patch/test_patch ./ Translation-en
Ign:4 file:/data/patch/test_patch ./ Translation-en
Ign:3 file:/data/patch/test_patch ./ Packages
Get:3 file:/data/patch/test_patch ./ Packages
Ign:3 file:/data/patch/test_patch ./ Packages
Get:3 file:/data/patch/test_patch ./ Packages
Ign:3 file:/data/patch/test_patch ./ Packages
Get:3 file:/data/patch/test_patch ./ Packages
Ign:3 file:/data/patch/test_patch ./ Packages
Get:3 file:/data/patch/test_patch ./ Packages
Ign:3 file:/data/patch/test_patch ./ Packages
Get:3 file:/data/patch/test_patch ./ Packages
Ign:3 file:/data/patch/test_patch ./ Packages
Get:3 file:/data/patch/test_patch ./ Packages
Err:3 file:/data/patch/test_patch ./ Packages
  File not found - /data/patch/test_patch/./Packages (2: No such file or directory)
Reading package lists... Done
N: Download is performed unsandboxed as root as file '/data/patch/test_patch/./InRelease' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)
E: Failed to fetch file:/data/patch/test_patch/./Packages  File not found - /data/patch/test_patch/./Packages (2: No such file or directory)
E: Some index files failed to download. They have been ignored, or old ones used instead.

I tried to run apt clean before the update, delete the content of /var/lib/apt/lists/, set _apt owner of /data/patch/test_patch but it changed nothing.

It works if I gunzip my Packages.gz file (but I still have the "N: Download is performed unsandboxed as root as file" error), but how can I be sure that apt will not look for a Packages.gz next time ...?

linux

debian

upgrade

apt

apt-get

0 Answers

Your Answer

Accepted video resources