apt-cacher-ng fails to import from new distribution, ie bionic 18.04
i'm running apt-cacher-ng (acng) on an ubuntu 16.04 server (desktop) with a slow network connection. i have an 18.04 laptop and have used a fast connection to download all installed packages, and rsync'd them to _import for acng. i then point the laptop apt to use the server port 3142 as a proxy (and verified that it is actually used). this should populate the acng index files. however, when i trigger the import from the server (http://localhost:3142/acng-report.html), none of the bionic files are imported. further, it appears that the index files (Package.xz) are never stored in the acng dir (they appear for older distributions, but not for bionic)
what needs to be done to import 18.04 packages on a 16.04 acng ? how are the index files being recreated on the laptop without showing up in the acng cache ?
# on laptop
echo 'Acquire::http { Proxy "http://desktop:3142"; };' | sudo tee /etc/apt/apt.conf.d/01proxy
sudo rm /var/cache/apt/*.bin
sudo rm /var/lib/apt/lists/*
sudo apt-get update
no hits are found during the import and at the bottom it says:
4908 files (2.1 GiB) left behind
apt proxy apt-cacher-ng
add a comment |
i'm running apt-cacher-ng (acng) on an ubuntu 16.04 server (desktop) with a slow network connection. i have an 18.04 laptop and have used a fast connection to download all installed packages, and rsync'd them to _import for acng. i then point the laptop apt to use the server port 3142 as a proxy (and verified that it is actually used). this should populate the acng index files. however, when i trigger the import from the server (http://localhost:3142/acng-report.html), none of the bionic files are imported. further, it appears that the index files (Package.xz) are never stored in the acng dir (they appear for older distributions, but not for bionic)
what needs to be done to import 18.04 packages on a 16.04 acng ? how are the index files being recreated on the laptop without showing up in the acng cache ?
# on laptop
echo 'Acquire::http { Proxy "http://desktop:3142"; };' | sudo tee /etc/apt/apt.conf.d/01proxy
sudo rm /var/cache/apt/*.bin
sudo rm /var/lib/apt/lists/*
sudo apt-get update
no hits are found during the import and at the bottom it says:
4908 files (2.1 GiB) left behind
apt proxy apt-cacher-ng
add a comment |
i'm running apt-cacher-ng (acng) on an ubuntu 16.04 server (desktop) with a slow network connection. i have an 18.04 laptop and have used a fast connection to download all installed packages, and rsync'd them to _import for acng. i then point the laptop apt to use the server port 3142 as a proxy (and verified that it is actually used). this should populate the acng index files. however, when i trigger the import from the server (http://localhost:3142/acng-report.html), none of the bionic files are imported. further, it appears that the index files (Package.xz) are never stored in the acng dir (they appear for older distributions, but not for bionic)
what needs to be done to import 18.04 packages on a 16.04 acng ? how are the index files being recreated on the laptop without showing up in the acng cache ?
# on laptop
echo 'Acquire::http { Proxy "http://desktop:3142"; };' | sudo tee /etc/apt/apt.conf.d/01proxy
sudo rm /var/cache/apt/*.bin
sudo rm /var/lib/apt/lists/*
sudo apt-get update
no hits are found during the import and at the bottom it says:
4908 files (2.1 GiB) left behind
apt proxy apt-cacher-ng
i'm running apt-cacher-ng (acng) on an ubuntu 16.04 server (desktop) with a slow network connection. i have an 18.04 laptop and have used a fast connection to download all installed packages, and rsync'd them to _import for acng. i then point the laptop apt to use the server port 3142 as a proxy (and verified that it is actually used). this should populate the acng index files. however, when i trigger the import from the server (http://localhost:3142/acng-report.html), none of the bionic files are imported. further, it appears that the index files (Package.xz) are never stored in the acng dir (they appear for older distributions, but not for bionic)
what needs to be done to import 18.04 packages on a 16.04 acng ? how are the index files being recreated on the laptop without showing up in the acng cache ?
# on laptop
echo 'Acquire::http { Proxy "http://desktop:3142"; };' | sudo tee /etc/apt/apt.conf.d/01proxy
sudo rm /var/cache/apt/*.bin
sudo rm /var/lib/apt/lists/*
sudo apt-get update
no hits are found during the import and at the bottom it says:
4908 files (2.1 GiB) left behind
apt proxy apt-cacher-ng
apt proxy apt-cacher-ng
asked Jan 22 at 23:28
nqzeronqzero
12
12
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
i ended up figuring out how to do this. apt-cacher-ng can in theory import packages placed in _import, but modern apt doesn't appear to download the index files in a way that acng (at least the 0.9.1 version in ubuntu 16.04) recognizes so acng can't identify the imports and does nothing
the workaround is to explicitly request the index files, and then trigger the import using the webapp
# for bionic, with myhost as the acng host:
base="http://us.archive.ubuntu.com/ubuntu/dists"
for kk in bionic{,-updates,-backports}; do
for jj in amd64 i386; do
for ii in main multiverse restricted universe; do
url="$base/$kk/$ii/binary-$jj/Packages.xz";
echo $url;
curl -x myhost:3142 $url > /dev/null;
done;
done;
done
# then trigger the import
at this point, everything imported successfully. i tracked this down using a variety of tools, which might be useful if you're trying to import from a different repository:
sudo strace -s 222 -v -y -yy -o ~/apt.log apt-get update
sudo ngrep -d any -vv -w byline outbound and not dst myhost or dst port 3142 > ~/apt2.log 2>&1
# strace output at the point of printing the package file
read(7<pipe:[341008]>, "200 URI Start...nURI: http://us.archive.ubuntu.com/ubuntu/dists/bionic/universe/binary-amd64/by-hash/SHA256/39ec12bac1f788ae649d32c138898d49fdec15eee020a9c72ae92a622fb662a0nSize:"..., 64000) = 232
write(1</dev/pts/4>, "Get:8 http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 Packages [8,570 kB]n", 84) = 84
stat("/var/lib/apt/lists/partial/us.archive.ubuntu.com_ubuntu_dists_bionic_universe_binary-amd64_Packages.xz", ...) = 0
# the ngrep output showed the same hash
so instead of downloading the Package.xz file directly, apt is using the hash (and apparently acng doesn't now about it). grepping for this hash:
sudo grep -r 39ec12ba... /var/cache/apt* /var/lib/apt*
/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_bionic_InRelease
39ec12ba... 8569560 universe/binary-amd64/Packages.xz
which is how apt knows to use the hash instead of the Packages.xz url
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1112092%2fapt-cacher-ng-fails-to-import-from-new-distribution-ie-bionic-18-04%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
i ended up figuring out how to do this. apt-cacher-ng can in theory import packages placed in _import, but modern apt doesn't appear to download the index files in a way that acng (at least the 0.9.1 version in ubuntu 16.04) recognizes so acng can't identify the imports and does nothing
the workaround is to explicitly request the index files, and then trigger the import using the webapp
# for bionic, with myhost as the acng host:
base="http://us.archive.ubuntu.com/ubuntu/dists"
for kk in bionic{,-updates,-backports}; do
for jj in amd64 i386; do
for ii in main multiverse restricted universe; do
url="$base/$kk/$ii/binary-$jj/Packages.xz";
echo $url;
curl -x myhost:3142 $url > /dev/null;
done;
done;
done
# then trigger the import
at this point, everything imported successfully. i tracked this down using a variety of tools, which might be useful if you're trying to import from a different repository:
sudo strace -s 222 -v -y -yy -o ~/apt.log apt-get update
sudo ngrep -d any -vv -w byline outbound and not dst myhost or dst port 3142 > ~/apt2.log 2>&1
# strace output at the point of printing the package file
read(7<pipe:[341008]>, "200 URI Start...nURI: http://us.archive.ubuntu.com/ubuntu/dists/bionic/universe/binary-amd64/by-hash/SHA256/39ec12bac1f788ae649d32c138898d49fdec15eee020a9c72ae92a622fb662a0nSize:"..., 64000) = 232
write(1</dev/pts/4>, "Get:8 http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 Packages [8,570 kB]n", 84) = 84
stat("/var/lib/apt/lists/partial/us.archive.ubuntu.com_ubuntu_dists_bionic_universe_binary-amd64_Packages.xz", ...) = 0
# the ngrep output showed the same hash
so instead of downloading the Package.xz file directly, apt is using the hash (and apparently acng doesn't now about it). grepping for this hash:
sudo grep -r 39ec12ba... /var/cache/apt* /var/lib/apt*
/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_bionic_InRelease
39ec12ba... 8569560 universe/binary-amd64/Packages.xz
which is how apt knows to use the hash instead of the Packages.xz url
add a comment |
i ended up figuring out how to do this. apt-cacher-ng can in theory import packages placed in _import, but modern apt doesn't appear to download the index files in a way that acng (at least the 0.9.1 version in ubuntu 16.04) recognizes so acng can't identify the imports and does nothing
the workaround is to explicitly request the index files, and then trigger the import using the webapp
# for bionic, with myhost as the acng host:
base="http://us.archive.ubuntu.com/ubuntu/dists"
for kk in bionic{,-updates,-backports}; do
for jj in amd64 i386; do
for ii in main multiverse restricted universe; do
url="$base/$kk/$ii/binary-$jj/Packages.xz";
echo $url;
curl -x myhost:3142 $url > /dev/null;
done;
done;
done
# then trigger the import
at this point, everything imported successfully. i tracked this down using a variety of tools, which might be useful if you're trying to import from a different repository:
sudo strace -s 222 -v -y -yy -o ~/apt.log apt-get update
sudo ngrep -d any -vv -w byline outbound and not dst myhost or dst port 3142 > ~/apt2.log 2>&1
# strace output at the point of printing the package file
read(7<pipe:[341008]>, "200 URI Start...nURI: http://us.archive.ubuntu.com/ubuntu/dists/bionic/universe/binary-amd64/by-hash/SHA256/39ec12bac1f788ae649d32c138898d49fdec15eee020a9c72ae92a622fb662a0nSize:"..., 64000) = 232
write(1</dev/pts/4>, "Get:8 http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 Packages [8,570 kB]n", 84) = 84
stat("/var/lib/apt/lists/partial/us.archive.ubuntu.com_ubuntu_dists_bionic_universe_binary-amd64_Packages.xz", ...) = 0
# the ngrep output showed the same hash
so instead of downloading the Package.xz file directly, apt is using the hash (and apparently acng doesn't now about it). grepping for this hash:
sudo grep -r 39ec12ba... /var/cache/apt* /var/lib/apt*
/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_bionic_InRelease
39ec12ba... 8569560 universe/binary-amd64/Packages.xz
which is how apt knows to use the hash instead of the Packages.xz url
add a comment |
i ended up figuring out how to do this. apt-cacher-ng can in theory import packages placed in _import, but modern apt doesn't appear to download the index files in a way that acng (at least the 0.9.1 version in ubuntu 16.04) recognizes so acng can't identify the imports and does nothing
the workaround is to explicitly request the index files, and then trigger the import using the webapp
# for bionic, with myhost as the acng host:
base="http://us.archive.ubuntu.com/ubuntu/dists"
for kk in bionic{,-updates,-backports}; do
for jj in amd64 i386; do
for ii in main multiverse restricted universe; do
url="$base/$kk/$ii/binary-$jj/Packages.xz";
echo $url;
curl -x myhost:3142 $url > /dev/null;
done;
done;
done
# then trigger the import
at this point, everything imported successfully. i tracked this down using a variety of tools, which might be useful if you're trying to import from a different repository:
sudo strace -s 222 -v -y -yy -o ~/apt.log apt-get update
sudo ngrep -d any -vv -w byline outbound and not dst myhost or dst port 3142 > ~/apt2.log 2>&1
# strace output at the point of printing the package file
read(7<pipe:[341008]>, "200 URI Start...nURI: http://us.archive.ubuntu.com/ubuntu/dists/bionic/universe/binary-amd64/by-hash/SHA256/39ec12bac1f788ae649d32c138898d49fdec15eee020a9c72ae92a622fb662a0nSize:"..., 64000) = 232
write(1</dev/pts/4>, "Get:8 http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 Packages [8,570 kB]n", 84) = 84
stat("/var/lib/apt/lists/partial/us.archive.ubuntu.com_ubuntu_dists_bionic_universe_binary-amd64_Packages.xz", ...) = 0
# the ngrep output showed the same hash
so instead of downloading the Package.xz file directly, apt is using the hash (and apparently acng doesn't now about it). grepping for this hash:
sudo grep -r 39ec12ba... /var/cache/apt* /var/lib/apt*
/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_bionic_InRelease
39ec12ba... 8569560 universe/binary-amd64/Packages.xz
which is how apt knows to use the hash instead of the Packages.xz url
i ended up figuring out how to do this. apt-cacher-ng can in theory import packages placed in _import, but modern apt doesn't appear to download the index files in a way that acng (at least the 0.9.1 version in ubuntu 16.04) recognizes so acng can't identify the imports and does nothing
the workaround is to explicitly request the index files, and then trigger the import using the webapp
# for bionic, with myhost as the acng host:
base="http://us.archive.ubuntu.com/ubuntu/dists"
for kk in bionic{,-updates,-backports}; do
for jj in amd64 i386; do
for ii in main multiverse restricted universe; do
url="$base/$kk/$ii/binary-$jj/Packages.xz";
echo $url;
curl -x myhost:3142 $url > /dev/null;
done;
done;
done
# then trigger the import
at this point, everything imported successfully. i tracked this down using a variety of tools, which might be useful if you're trying to import from a different repository:
sudo strace -s 222 -v -y -yy -o ~/apt.log apt-get update
sudo ngrep -d any -vv -w byline outbound and not dst myhost or dst port 3142 > ~/apt2.log 2>&1
# strace output at the point of printing the package file
read(7<pipe:[341008]>, "200 URI Start...nURI: http://us.archive.ubuntu.com/ubuntu/dists/bionic/universe/binary-amd64/by-hash/SHA256/39ec12bac1f788ae649d32c138898d49fdec15eee020a9c72ae92a622fb662a0nSize:"..., 64000) = 232
write(1</dev/pts/4>, "Get:8 http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 Packages [8,570 kB]n", 84) = 84
stat("/var/lib/apt/lists/partial/us.archive.ubuntu.com_ubuntu_dists_bionic_universe_binary-amd64_Packages.xz", ...) = 0
# the ngrep output showed the same hash
so instead of downloading the Package.xz file directly, apt is using the hash (and apparently acng doesn't now about it). grepping for this hash:
sudo grep -r 39ec12ba... /var/cache/apt* /var/lib/apt*
/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_bionic_InRelease
39ec12ba... 8569560 universe/binary-amd64/Packages.xz
which is how apt knows to use the hash instead of the Packages.xz url
edited Feb 8 at 13:31
answered Feb 8 at 4:44
nqzeronqzero
12
12
add a comment |
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1112092%2fapt-cacher-ng-fails-to-import-from-new-distribution-ie-bionic-18-04%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown