Команда «apt-get update» запускается с ошибкой «Временный сбой при разрешении «ports.ubuntu.com»» в Ubuntu 18.04, при этом нормально работает в Ubuntu 14.04.
Недавно я попытался использовать команду chroot для развертывания Ubuntu на моем планшете Android с root-правами, и все прошло хорошо (сеть и исполняемые команды) с Ubuntu 14.04 с http://ports.ubuntu.com/ . Но когда я перешел на Ubuntu 18.04, всегда возникала ошибка при запуске команды или файла . Я настроил свой сервер имен в /etc/resolv.conf и источники в /etc/apt/sources.list, и команда работает хорошо. И я пробовал много способов, опубликованных другими, например, изменение источников, но эта ошибка все еще существует. Любой совет очень ценится.
root@localhost:/# apt-get update
Err:1 http://ports.ubuntu.com/ubuntu-ports bionic InRelease
Temporary failure resolving 'ports.ubuntu.com'
Err:2 http://ports.ubuntu.com/ubuntu-ports bionic-updates InRelease
Temporary failure resolving 'ports.ubuntu.com'
Err:3 http://ports.ubuntu.com/ubuntu-ports bionic-backports InRelease
Temporary failure resolving 'ports.ubuntu.com'
Err:4 http://ports.ubuntu.com/ubuntu-ports bionic-security InRelease
Temporary failure resolving 'ports.ubuntu.com'
Reading package lists... Done
W: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/bionic/InRelease Temporary failure resolving 'ports.ubuntu.com'
W: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/bionic-updates/InRelease Temporary failure resolving 'ports.ubuntu.com'
W: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/bionic-backports/InRelease Temporary failure resolving 'ports.ubuntu.com'
W: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/bionic-security/InRelease Temporary failure resolving 'ports.ubuntu.com'
W: Some index files failed to download. They have been ignored, or old ones used instead.
root@localhost:/# apt-get install vim -y
Reading package lists... Done
Building dependency tree... Done
The following additional packages will be installed:
libgpm2 libpython3.6 vim-runtime
Suggested packages:
gpm ctags vim-doc vim-scripts
The following NEW packages will be installed:
libgpm2 libpython3.6 vim vim-runtime
0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded.
Need to get 7700 kB of archives.
After this operation, 34.4 MB of additional disk space will be used.
Err:1 http://ports.ubuntu.com/ubuntu-ports bionic/main armhf libgpm2 armhf 1.20.7-5
Temporary failure resolving 'ports.ubuntu.com'
Err:2 http://ports.ubuntu.com/ubuntu-ports bionic/main armhf libpython3.6 armhf 3.6.5-3
Temporary failure resolving 'ports.ubuntu.com'
Err:3 http://ports.ubuntu.com/ubuntu-ports bionic/main armhf vim-runtime all 2:8.0.1453-1ubuntu1
Temporary failure resolving 'ports.ubuntu.com'
Err:4 http://ports.ubuntu.com/ubuntu-ports bionic/main armhf vim armhf 2:8.0.1453-1ubuntu1
Temporary failure resolving 'ports.ubuntu.com'
E: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/pool/main/g/gpm/libgpm2_1.20.7-5_armhf.deb Temporary failure resolving 'ports.ubuntu.com'
E: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/pool/main/p/python3.6/libpython3.6_3.6.5-3_armhf.deb Temporary failure resolving 'ports.ubuntu.com'
E: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/pool/main/v/vim/vim-runtime_8.0.1453-1ubuntu1_all.deb Temporary failure resolving 'ports.ubuntu.com'
E: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/pool/main/v/vim/vim_8.0.1453-1ubuntu1_armhf.deb Temporary failure resolving 'ports.ubuntu.com'
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
И мои источники в
/etc/apt/sources.list:
root@localhost:/# cat /etc/apt/sources.list
deb http://ports.ubuntu.com/ubuntu-ports bionic main universe multiverse restricted
deb http://ports.ubuntu.com/ubuntu-ports bionic-updates main universe multiverse restricted
deb http://ports.ubuntu.com/ubuntu-ports bionic-backports main universe multiverse restricted
deb http://ports.ubuntu.com/ubuntu-ports bionic-security main universe multiverse restricted
А также
pingкоманда работает хорошо
root@localhost:/# ping -c 3 ports.ubuntu.com
PING ports.ubuntu.com (91.189.88.142) 56(84) bytes of data.
64 bytes from aerodent.canonical.com (91.189.88.142): icmp_seq=1 ttl=53 time=212 ms
64 bytes from aerodent.canonical.com (91.189.88.142): icmp_seq=2 ttl=53 time=217 ms
64 bytes from aerodent.canonical.com (91.189.88.142): icmp_seq=3 ttl=53 time=212 ms
--- ports.ubuntu.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2001ms
rtt min/avg/max/mdev = 212.202/213.841/217.012/2.242 ms
PS: когда я пытаюсь выполнить chroot для этого же образа в среде Ubuntu, управляемой Docker, все идет гладко и без ошибок для команд.
apt-get updateа также
apt-get install xxx.