I am using Ubuntu 18.04LTS, behind a proxy. This question was sparked by (but it is completely independent of) apt-get install behind proxy - Failed to fetch
When I check the location of package yudit-common
with apt install --print-uris
(e.g.; actually, as a prerequisite for feh
), I get http://us.archive.ubuntu.com/ubuntu/pool/universe/y/yudit/yudit-common_2.9.6-7_all.deb
as the location in the web of the deb
file.
See Note 1 below.
Then when I install yudit-common
, everything works fine, which means my PC knows where is the deb
file http://us.archive.ubuntu.com/ubuntu/pool/universe/y/yudit/yudit-common_2.9.6-7_all.deb
in the web, and it can download it prior to installing.
See Note 2 below.
But if I try to wget
the file, my PC doesn't even know where is the deb
file (in this case, of course it would not be able to get it).
See Note 3 below.
Where are apt
and wget
looking for the information?
Can I force wget
to use the same domain lookup as apt
?
In the case it is a firewall who is letting apt
succeed in knowing ip addresses and pulling files from the web, and precluding wget
from doing that, can I somehow "channel" wget
requests via apt
?
Notes
- Location of the
.deb
package file
$ apt install --print-uris feh 2> /dev/null
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
yudit-common
Suggested packages:
yudit-doc yudit
The following NEW packages will be installed:
feh yudit-common
0 upgraded, 2 newly installed, 0 to remove and 51 not upgraded.
Need to get 1.760 kB of archives.
After this operation, 9.775 kB of additional disk space will be used.
'http://us.archive.ubuntu.com/ubuntu/pool/universe/y/yudit/yudit-common_2.9.6-7_all.deb' yudit-common_2.9.6-7_all.deb 1637644 MD5Sum:987ef69fa59b1c3034bfa28955e612d9
'http://us.archive.ubuntu.com/ubuntu/pool/universe/f/feh/feh_2.23.2-1build1_amd64.deb' feh_2.23.2-1build1_amd64.deb 122020 MD5Sum:b5f42ee280ee4aada1cbd93ec0007e68
- Installing
yudit-common
$ sudo apt-get install yudit-common
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
yudit-doc yudit
The following NEW packages will be installed:
yudit-common
0 upgraded, 1 newly installed, 0 to remove and 51 not upgraded.
Need to get 1.638 kB of archives.
After this operation, 9.411 kB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 yudit-common all 2.9.6-7 [1.638 kB]
Fetched 1.638 kB in 9s (174 kB/s)
Selecting previously unselected package yudit-common.
(Reading database ... 488875 files and directories currently installed.)
Preparing to unpack .../yudit-common_2.9.6-7_all.deb ...
Unpacking yudit-common (2.9.6-7) ...
Setting up yudit-common (2.9.6-7) ...
wget
tingyudit-common
.deb
file
$ wget http://us.archive.ubuntu.com/ubuntu/pool/universe/y/yudit/yudit-common_2.9.6-7_all.deb
--2020-09-20 06:32:21-- http://us.archive.ubuntu.com/ubuntu/pool/universe/y/yudit/yudit-common_2.9.6-7_all.deb
Resolving us.archive.ubuntu.com (us.archive.ubuntu.com)... failed: Name or service not known.
wget: unable to resolve host address ´us.archive.ubuntu.com´
- Interesting:
wget
and not forapt
? Note that I am behind a proxy.apt
vs.wget
, it's DNS lookups at Time 1 vs. DNS lookups at Time 2.us.archive.ubuntu.com
) is translated to an IP address. "Time 1" and "Time 2" are different times. I'm suggesting that your environment changed in between./etc/resolv.conf
,dnsmasq
, connectivity,...