termux / termux-packages

A package build system for Termux.
https://termux.dev
Other
13.01k stars 2.99k forks source link

Can not update using apt #99

Closed indam closed 8 years ago

indam commented 8 years ago

Hey, I reinstalled the app, and executed 'apt update', then failed. here is the screenshot.

screenshot

fornwall commented 8 years ago

Hm, same problem as in https://github.com/termux/termux-app/issues/30.

Could you try accessing http://apt.termux.com/dists/stable/InRelease in the browser on the device, and try running

wget http://apt.termux.com/dists/stable/InRelease

Could you also paste the output of uname -a and apt --version?

fornwall commented 8 years ago

Also, which Android device do you run? Which Android version? Running a custom ROM?

indam commented 8 years ago

@fornwall thanks, please find it here. I installed termux from Google Play. My phone is HTC M8, with the official ROM, android version 5.0.1, rooted.

screenshot_2015-12-19-19-30-24

indam commented 8 years ago

And I tried to download the InRelease file, it seems not working for me.

indam commented 8 years ago

oops, I am sorry, I closed this issue by mistake, could you please reopen it?

fornwall commented 8 years ago

And I tried to download the InRelease file, it seems not working for me.

Can you access it (http://apt.termux.com/dists/stable/InRelease) in your Android browser? If not, what happens (blank page or error message)?

indam commented 8 years ago

@fornwall I am sorry, I make you confused. I mean I can access it in browser, and also be able to download it with wget. But apt install still did not work for me.

fornwall commented 8 years ago

@indam Ok, thanks for the confirmation! I'm trying to reproduce the problem, but I'm still unable to do so. So if you have the possibility to try a few things it would be helpful:

(1) Update to the latest apt version by hand, and see if it works afterwards:

wget http://apt.termux.com/dists/stable/main/binary-arm/apt-1.1.5_arm.deb
dpkg -i apt-1.1.5_arm.deb

(2) If the problem still persists, could you run the following and append the output here?

apt-get update -o Debug::Acquire::Http=true

(3) Later, could you install strace by hand:

wget http://apt.termux.com/dists/stable/main/binary-arm/strace-4.10-1_arm.deb
dpkg -i strace-4.10-1_arm.deb

Then run the following

strace -f -o log.txt apt update

and upload the log.txt somewhere and link to it (or mail the file to me)?

indam commented 8 years ago

@fornwall Yes, I put the screenshot here, and you can also find the log file as attachment.

1 2

log.txt.zip

fornwall commented 8 years ago

@indam Thanks for all the help!

It seems that apt loads the url fine, but for some reason the lib/apt/methods/http binary seem to hit the line

Dprint(statp->options & RES_DEBUG,
           (stdout, ";; new DG socket\n"))

in the system DNS resolver, res_send.c. This output interferes with the text-based protocol through which apt communicates with lib/apt/methods/http. Root cause still unknown...

indam commented 8 years ago

@fornwall You are welcome. I hope this can be solved soon, and if you need more investigation, do not hesitate to contact me.

franciscod commented 8 years ago

have you guys tried on another network? if you're on 3G try wifi, if on wifi try 3G or another wifi, and so on

franciscod commented 8 years ago

Also, notice this message in the first line:

res_send: select: Connection refused

It might be an issue on the server where the packages are hosted. Maybe hosting them on a mirror could help to diagnose the issue?

fornwall commented 8 years ago

There was a DNS change done for apt.termux.com (updating the SOA record in the DNS zone to ensure it lines up with the nameservers in use by the domain) two days ago, could you try again if it works for you now @indam?

If it's still a problem, could you install curl and check if e.g. curl http://apt.termux.com/gives any error output (just ruling out some possible errors)?

jlefman commented 8 years ago

There are issues with wget and apt. Curl works okay it seems.

$ wget http://apt.termux.com/dists/stable/InRelease
--2015-12-22 22:33:21--  http://apt.termux.com/dists/stable/InRelease                     Resolving apt.termux.com... 216.119.132.66
Connecting to apt.termux.com|216.119.132.66|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1875 (1.8K) [text/plain]             Saving to: 'InRelease.2'

[1]+  Stopped                 wget http://apt.termux.com/dists/stable/InRelease
$ fg
-bash: fg: job has terminated
[1]+  Segmentation fault      wget http://apt.termux.com/dists/stable/InRelease
$ curl  http://apt.termux.com/dists/stable/InRelease > cfile
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0  0     0    0     0    0     0      0      0100  1875  100
$ apt --version                              apt 1.1.5 (arm)

Android info:

franciscod commented 8 years ago

maybe try verbosities of curl and wget to see effectively what IP address they're trying to download from?

indam commented 8 years ago

@fornwall I tried again, still the same problem. And I do not think this is due to the network, because I tried using different VPNs, it is still like this.

I test with curl, it seems fine. No errors found. @franciscod

screenshot_2015-12-23-15-20-40

jlefman commented 8 years ago

Update

Manually installed all available updates in arm binaries under release packages using dpkg. No changes to apt error.

$ apt update                                 0% [Working]res_send: select: Connection refused                                          Get:1 http://apt.termux.com stable InRelease [1875 B]                                     Get:2 http://apt.termux.com stable/main arm Packages [35.7 kB]                            Reading package lists... Done                E: Invalid message from method http: ;; new DG socket                                     102 Status                                   URI: http://apt.termux.com/dists/stable/InRelease                                         Message: Connecting to apt.termux.com

All packages installed:

$ dpkg -l
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version      Architecture Description
+++-==============-============-============-=================================
ii  aapt           5.1.1-1      arm          Android Asset Packaging Tool
ii  angband        4.0.4        arm          Dungeon exploration game where yo
ii  apr            1.5.2-1      arm          Apache Portable Runtime - library
ii  apr-dev        1.5.2-1      arm          Development files for apr
ii  apr-util       1.5.4        arm          Apache Portable Runtime - library
ii  apr-util-dev   1.5.4        arm          Development files and documentati
ii  apt            1.1.5        arm          Front-end for the dpkg package ma
ii  apt-transport- 1.1.5        arm          Https download support for APT
ii  aria2          1.19.3-1     arm          Multi-protocol & multi-source com
ii  asciinema      1.1.1-1      arm          Record and share your terminal se
ii  autoconf       2.69         arm          Creator of shell scripts to confi
ii  automake       1.15         arm          Tool for automatically generating
ii  bash           4.3.42-6     arm          A sh-compatible shell that incorp
ii  bash-completio 2.1          arm          Programmable completion for the b
ii  bc             1.06.95      arm          Arbitrary precision numeric proce
ii  binutils       2.25         arm          Collection of binary tools, the m
ii  binutils-dev   2.25         arm          Development files and documentati
ii  bison          3.0.4        arm          General-purpose parser generator
ii  brogue         1.7.4        arm          Roguelike dungeon crawling game
ii  bsdtar         3.1.2-3      arm          The tar(1) and cpio(1) programs f
ii  busybox        1.24.1       arm          Tiny versions of many common UNIX
ii  bzip2          1.0.6        arm          Tools for working with bzip2 comp
ii  c-ares         1.10.0-1     arm          C library for asynchronous DNS re
ii  c-ares-dev     1.10.0-1     arm          Development files for c-ares
ii  ca-certificate 20151028-2   all          Common CA certificates
ii  cboard         0.7.3        arm          PGN browser, editor and chess eng
ii  clang          3.7.0        arm          C and C++ frontend for the LLVM c
ii  clang-dev      3.7.0        arm          Development files for clang
ii  cmake          3.4.1        arm          Family of tools designed to build
ii  cmake-curses-g 3.4.1        arm          Curses based user interface for C
ii  cmatrix        1.2a         arm          Command producing a Matrix-style
ii  command-not-fo 1.1          arm          Suggest installation of packages
ii  coreutils      8.24-4       arm          Basic file, shell and text manipu
ii  cppi           1.18         arm          Indents C preprocessor directives
ii  curl           7.46.0       arm          Command line tool for transferrin
ii  curseofwar     1.2.0        arm          Fast-paced action strategy game f
ii  dash           0.5.8-3      arm          Small POSIX-compliant implementat
ii  datamash       1.0.7        arm          GNU datamash performs basic numer
ii  dcraw          9.26.0-1     arm          Raw digital camera images decodin
ii  debianutils    4.5.1        arm          Small utilities which are used pr
ii  dialog         1.2-20150920 arm          Application used in shell scripts
ii  diffutils      3.3          arm          Programs (cmd, diff, diff3 and sd
ii  direvent       5.0          arm          Monitor of events in file system
ii  dirmngr        2.1.10-1     arm          Server for managing certificate r
ii  dnsutils       9.10.3-6     arm          Clients provided with BIND
ii  dnsutils-dev   9.10.3-6     arm          Development files for dnsutils
ii  dpkg           1.18.3-1     arm          Debian package management system
ii  dpkg-dev       1.18.3-1     arm          Development files for dpkg
ii  dropbear       2015.71      arm          Small SSH server and client
ii  emacs          24.5-2       arm          Extensible, customizable text edi
ii  espeak         1.48.04      arm          Compact software speech synthesiz
ii  espeak-dev     1.48.04      arm          Development files for espeak
ii  ffmpeg         2.8.3        arm          Tools and libraries to manipulate
ii  ffmpeg-dev     2.8.3        arm          Development files for ffmpeg
ii  fftw           3.3.4        arm          Library for computing the Discret
ii  fftw-dev       3.3.4        arm          Development files and documentati
ii  figlet         2.2.5        arm          Program for making large letters
ii  file           5.25-1       arm          Command-line tool that tells you
ii  file-dev       5.25-1       arm          Development files for file
ii  finch          2.10.11-2    arm          Text-based multi-protocol instant
ii  finch-dev      2.10.11-2    arm          Development files for finch
ii  findutils      4.5.14       arm          Utilities to find files meeting s
ii  fish           2.2.20151217 arm          Shell geared towards interactive
ii  flex           2.5.39       arm          Fast lexical analyser generator
ii  flex-dev       2.5.39       arm          Development files and documentati
ii  fontconfig     2.11.1-2     arm          Library for configuring and custo
ii  fontconfig-dev 2.11.1-2     arm          Development files for fontconfig
ii  fontconfig-uti 2.11.1-2     arm          Fontconfig binaries
ii  freetype       2.6.2        arm          Software font engine capable of p
ii  freetype-dev   2.6.2        arm          Development files for freetype
ii  frobtads       1.2.3        arm          TADS is a free authoring system f
ii  frotz          2.44         arm          Interpreter for Infocom and other
ii  g++            4.9.3-5      arm          GNU C++ compiler
ii  gawk           4.1.3-1      arm          Interpreted programming language
ii  gawk-dev       4.1.3-1      arm          Development files for gawk
ii  gcc            4.9.3-5      arm          GNU C compiler
ii  gcov           4.9.3-5      arm          GNU coverage testing tool
ii  gdb            7.10.1       arm          The standard GNU Debugger that ru
ii  gdb-dev        7.10.1       arm          Development files for gdb
ii  gdbm           1.11         arm          Library of database functions tha
ii  gdbm-dev       1.11         arm          Development files and documentati
ii  gdk-pixbuf     2.32.1       arm          Library for image loading and man
ii  gdk-pixbuf-dev 2.32.1       arm          Development files for gdk-pixbuf
ii  gifsicle       1.88         arm          Tool for creating, editing, and g
ii  git            2.6.4        arm          Distributed version control syste
ii  glib           2.46.2-1     arm          Library providing core building b
ii  glib-bin       2.46.2-1     arm          Programs for the GLib library
ii  glib-dev       2.46.2-1     arm          Development files for glib
ii  global         6.5          arm          GNU global source code tag system
ii  glulxe         0.5.2        arm          Interpreter for the Glulx portabl
ii  gnuchess       6.2.2        arm          Chess-playing program
ii  gnugo          3.8          arm          Program that plays the game of Go
ii  gnupg          1.4.19-2     arm          OpenPGP implementation for encryp
ii  gnupg-curl     1.4.19-2     arm          GnuPG keyserver helper tools buil
ii  gnupg2         2.1.10-1     arm          Implementation of the OpenPGP sta
ii  gnuplot        4.6.6        arm          Command-line driven graphing util
ii  gnushogi       1.4.2        arm          Program that plays the game of Sh
ii  gnutls         3.4.7        arm          Commandline utilities for interfa
ii  golang         1:1.6beta1   arm          Go programming language compiler
ii  googletest     1.7.0        arm          Google C++ testing framework
ii  googletest-dev 1.7.0        arm          Development files and documentati
ii  gpgme          1.6.0-1      arm          Library designed to make access t
ii  gpgme-dev      1.6.0-1      arm          Development files for gpgme
ii  graphicsmagick 1.3.23-1     arm          Collection of image processing to
ii  graphicsmagick 1.3.23-1     arm          Development files for graphicsmag
ii  greed          4.1          arm          Game where you try to eat as much
ii  grep           2.22         arm          Command which searches one or mor
ii  gsl            2.1          arm          GNU Scientific Library (GSL) prov
ii  gsl-dev        2.1          arm          Development files for gsl
ii  gtypist        2.9.5        arm          Universal typing tutor
ii  gzip           1.6          arm          Standard GNU file compression uti
ii  harfbuzz       1.0.6        arm          OpenType text shaping engine
ii  harfbuzz-dev   1.0.6        arm          Development files for harfbuzz
ii  harfbuzz-utils 1.0.6        arm          Tools using the harfbuzz library
ii  hexcurse       1.58         arm          Console hexeditor
ii  ht             2.1.0        arm          File editor/viewer/analyzer for e
ii  htop           1.0.3        arm          Interactive process viewer for Li
ii  hunspell       1.3.3        arm          Spell checker
ii  hunspell-dev   1.3.3        arm          Development files and documentati
ii  hunspell-en-us 1.1          arm          American english dictionary for h
ii  iconv          1.14         arm          Utility converting between differ
ii  imagemagick    6.9.2-10-0   arm          Suite to create, edit, compose, o
ii  imagemagick-de 6.9.2-10-0   arm          Development files for imagemagick
ii  inetutils      1.9.4-1      arm          Collection of common network prog
ii  inotify-tools  3.14         arm          Programs providing a simple inter
ii  inotify-tools- 3.14         arm          Development files and documentati
ii  iperf3         3.1          arm          TCP, UDP, and SCTP network bandwi
ii  iperf3-dev     3.1          arm          Development files for iperf3
ii  irssi          0.8.17       arm          Terminal based IRC client for UNI
ii  irssi-dev      0.8.17       arm          Development files and documentati
ii  jhead          3.00         arm          Exif Jpeg header manipulation too
ii  jq             1.5          arm          Command-line JSON processor
ii  jq-dev         1.5          arm          Development files for jq
ii  jsoncpp        1.6.5        arm          C++ library for interacting with
ii  jsoncpp-dev    1.6.5        arm          Development files for jsoncpp
ii  kona           3.36         arm          Open-source implementation of the
ii  ldns           1.6.17       arm          Library for simplifying DNS progr
ii  ldns-dev       1.6.17       arm          Development files and documentati
ii  less           481          arm          Terminal pager program used to vi
ii  lftp           4.6.4-1      arm          FTP/HTTP client and file transfer
ii  libandroid-glo 0.2          arm          Shared library for the glob(3) sy
ii  libandroid-glo 0.2          arm          Development files for libandroid-
ii  libandroid-sup 10e.4        arm          Library extending the Android C l
ii  libandroid-sup 10e.4        arm          Development files for libandroid-
ii  libarchive     3.1.2-3      arm          Multi-format archive and compress
ii  libarchive-dev 3.1.2-3      arm          Development files for libarchive
ii  libassuan      2.4.2        arm          Library implementing the Assuan I
ii  libassuan-dev  2.4.2        arm          Development files for libassuan
ii  libbz2         1.0.6        arm          BZ2 format compression library
ii  libbz2-dev     1.0.6        arm          Development files and documentati
ii  libcaca        0.99.beta19  arm          Graphics library that outputs tex
ii  libcaca-dev    0.99.beta19  arm          Development files and documentati
ii  libcairo       1.14.4       arm          Cairo 2D vector graphics library
ii  libcairo-dev   1.14.4       arm          Development files for libcairo
ii  libcairo-gobje 1.14.4       arm          GObject bindings for cairo
ii  libcroco       0.6.11       arm          CSS parsing and manipulation libr
ii  libcroco-dev   0.6.11       arm          Development files for libcroco
ii  libcurl        7.46.0       arm          Easy-to-use client-side URL trans
ii  libcurl-dev    7.46.0       arm          Development files for libcurl
ii  libelf         0.161-1      arm          ELF object file access library
ii  libelf-dev     0.161-1      arm          Development files for libelf
ii  libevent       2.0.22       arm          Library that provides asynchronou
ii  libevent-dev   2.0.22       arm          Development files for libevent
ii  libexif        0.6.21       arm          Library for reading and writing E
ii  libexif-dev    0.6.21       arm          Development files and documentati
ii  libexpat       2.1.0        arm          XML parsing C library
ii  libexpat-dev   2.1.0        arm          Development files and documentati
ii  libfaac        1.28         arm          MPEG-4 and MPEG-2 AAC encoder
ii  libfaac-dev    1.28         arm          Development files and documentati
ii  libffi         3.2.1        arm          Library providing a portable, hig
ii  libffi-dev     3.2.1        arm          Development files and documentati
ii  libgc          7.4.2        arm          Library providing the Boehm-Demer
ii  libgc-dev      7.4.2        arm          Development files and documentati
ii  libgcrypt      1.6.4-1      arm          General purpose cryptographic lib
ii  libgcrypt-dev  1.6.4-1      arm          Development files for libgcrypt
ii  libgmp         6.1.0        arm          Library for arbitrary precision a
ii  libgmp-dev     6.1.0        arm          Development files for libgmp
ii  libgnustl      10e          arm          The GNU Standard C++ Library (a.k
ii  libgnutls      3.4.7        arm          Secure communications library imp
ii  libgnutls-dev  3.4.7        arm          Development files for libgnutls
ii  libgpg-error   1.21         arm          Small library that defines common
ii  libgpg-error-d 1.21         arm          Development files for libgpg-erro
ii  libidn         1.32-1       arm          GNU Libidn library, implementatio
ii  libidn-dev     1.32-1       arm          Development files for libidn
ii  libisl         0.15-1       arm          Library for manipulating sets and
ii  libisl-dev     0.15-1       arm          Development files for libisl
ii  libjasper      1.900.1-1    arm          Library for manipulating JPEG-200
ii  libjasper-dev  1.900.1-1    arm          Development files for libjasper
ii  libjasper-util 1.900.1-1    arm          JPEG-2000 utilities
ii  libjpeg-turbo  1.4.2-1      arm          Library for reading and writing J
ii  libjpeg-turbo- 1.4.2-1      arm          Development files for libjpeg-tur
ii  libjpeg-turbo- 1.4.2-1      arm          Programs for manipulating JPEG fi
ii  libksba        1.3.3-1      arm          Library for using X.509 certifica
ii  libksba-dev    1.3.3-1      arm          Development files for libksba
ii  libluajit      2.0.4-1      arm          Just-In-Time Compiler for Lua
ii  libluajit-dev  2.0.4-1      arm          Development files for libluajit
ii  liblzma        5.2.2        arm          XZ-format compression library
ii  liblzma-dev    5.2.2        arm          Development files for liblzma
ii  libmp3lame     3.99         arm          High quality MPEG Audio Layer III
ii  libmp3lame-dev 3.99         arm          Development files and documentati
ii  libmpc         1.0.3-1      arm          C library for the arithmetic of c
ii  libmpc-dev     1.0.3-1      arm          Development files for libmpc
ii  libmpfr        3.1.3-1      arm          C library for multiple-precision
ii  libmpfr-dev    3.1.3-1      arm          Development files for libmpfr
ii  libmsgpack     1.2.0        arm          MessagePack implementation for C
ii  libmsgpack-dev 1.2.0        arm          Development files for libmsgpack
ii  libnettle      3.1.1-2      arm          Cryptographic library that is des
ii  libnettle-dev  3.1.1-2      arm          Development files for libnettle
ii  libnpth        1.2-1        arm          New GNU Portable Threads Library
ii  libnpth-dev    1.2-1        arm          Development files for libnpth
ii  libogg         1.3.2        arm          Library for working with the Ogg
ii  libogg-dev     1.3.2        arm          Development files and documentati
ii  liboggz        1.1.1-1      arm          Command and library to inspect, t
ii  liboggz-dev    1.1.1-1      arm          Development files for liboggz
ii  libopus        1.1          arm          Reference implementation of the O
ii  libopus-dev    1.1          arm          Development files and documentati
ii  libpcap        1.7.4        arm          Library for network traffic captu
ii  libpcap-dev    1.7.4        arm          Development files for libpcap
ii  libpipeline    1.4.0        arm          C library for manipulating pipeli
ii  libpipeline-de 1.4.0        arm          Development files and documentati
ii  libpixman      0.32.8       arm          Low-level library for pixel manip
ii  libpixman-dev  0.32.8       arm          Development files for libpixman
ii  libpng         1.6.19       arm          Official PNG reference library
ii  libpng-dev     1.6.19       arm          Development files for libpng
ii  librsvg        2.40.12      arm          Library to render SVG files using
ii  librsvg-dev    2.40.12      arm          Development files for librsvg
ii  libsasl        2.1.26       arm          Cyrus SASL - authentication abstr
ii  libsasl-dev    2.1.26       arm          Development files for libsasl
ii  libsqlite      3.9.2        arm          Software library that implements
ii  libsqlite-dev  3.9.2        arm          Development files for libsqlite
ii  libtermkey     0.18         arm          Library for processing of keyboar
ii  libtermkey-dev 0.18         arm          Development files for libtermkey
ii  libtiff        4.0.6-1      arm          Support for the Tag Image File Fo
ii  libtiff-dev    4.0.6-1      arm          Development files for libtiff
ii  libtiff-utils  4.0.6-1      arm          Tools for working with tiff files
ii  libtool        2.4.6        arm          Generic library support script hi
ii  libtool-dev    2.4.6        arm          Development files and documentati
ii  libtsm         3-1          arm          Terminal-emulator State Machine
ii  libtsm-dev     3-1          arm          Development files for libtsm
ii  libunibilium   1.2.0        arm          Terminfo parsing library
ii  libunibilium-d 1.2.0        arm          Development files for libunibiliu
ii  libunistring   0.9.6        arm          Library providing functions for m
ii  libunistring-d 0.9.6        arm          Development files for libunistrin
ii  libutil        0.2          arm          Library with terminal functions
ii  libutil-dev    0.2          arm          Development files for libutil
ii  libuuid        1.0.3        arm          Portable uuid C library
ii  libuuid-dev    1.0.3        arm          Development files and documentati
ii  libuv          1.7.5        arm          Support library with a focus on a
ii  libuv-dev      1.7.5        arm          Development files for libuv
ii  libvorbis      1.3.5        arm          Library for using the Ogg Vorbis
ii  libvorbis-dev  1.3.5        arm          Development files and documentati
ii  libvpx         1.5.0        arm          VP9 Codec SDK
ii  libvpx-dev     1.5.0        arm          Development files for libvpx
ii  libvterm       0.0.20151217 arm          Terminal emulator library
ii  libvterm-dev   0.01         arm          Development files and documentati
ii  libx264        20141218-224 arm          Library for encoding video stream
ii  libx264-dev    20141218-224 arm          Development files and documentati
ii  libxml2        2.9.3        arm          Library for parsing XML documents
ii  libxml2-dev    2.9.3        arm          Development files for libxml2
ii  libxml2-utils  2.9.3        arm          XML utilities
ii  libxslt        1.1.28-3     arm          XSLT processing library
ii  libxslt-dev    1.1.28-3     arm          Development files for libxslt
ii  lighttpd       1.4.35       arm          Web server optimized for speed-cr
ii  littlecms      2.7-1        arm          Color management library
ii  littlecms-dev  2.7-1        arm          Development files for littlecms
ii  littlecms-util 2.7-1        arm          Color management utilities
ii  lua            5.3.1        arm          Powerful, fast, lightweight, embe
ii  lua-dev        5.3.1        arm          Development files for lua
ii  luajit         2.0.4-1      arm          Just-In-Time compiler for Lua - c
ii  luarocks       2.2.2        arm          Deployment and management system
ii  lynx           2.8.8rel.2   arm          The text web browser
ii  m4             1.4.17       arm          Traditional Unix macro processor
ii  make           4.1-1        arm          Tool which controls the generatio
ii  make-dev       4.1-1        arm          Development files for make
ii  man            1.13.3       arm          Man page viewer from the mandoc t
ii  man-dev        1.13.3       arm          Development files for man
ii  mathomatic     16.0.5-1     arm          Simple CAS and symbolic calculato
ii  mc             4.8.15-1     arm          Midnight Commander - a powerful f
ii  mlocate        0.26         arm          Tool to find files anywhere in th
ii  moon-buggy     1.0.51       arm          Simple character graphics game wh
ii  multitail      6.4.2        arm          Tool to monitor logfiles and comm
ii  mutt           1.5.24-2     arm          Mail client
ii  nano           2.5.0        arm          Small, free and friendly text edi
ii  ncdc           1.19.1       arm          Modern and lightweight direct con
ii  ncdu           1.11         arm          Disk usage analyzer
ii  ncurses        5.9.20141206 arm          Library for text-based user inter
ii  ncurses-dev    5.9.20141206 arm          Development files for ncurses
ii  ncurses-ui-lib 5.9.20141206 arm          Libraries for terminal user inter
ii  ncurses-utils  5.9.20141206 arm          Tools for working with terminals
ii  ndk-stl        10e          arm          Header files from the Android NDK
ii  ndk-sysroot    10e-1        arm          System header and library files f
ii  neovim         0.0.20151217 arm          Ambitious Vim-fork focused on ext
ii  netpbm         2665         arm          Toolkit for manipulation of graph
ii  netpbm-dev     2665         arm          Development files for netpbm
ii  nettle         3.1.1-2      arm          Low level cryptographic tools
ii  nmap           7.01         arm          Utility for network discovery and
ii  nodejs         4.2.3        arm          Platform built on Chrome's JavaSc
ii  nodejs-dev     4.2.3        arm          Development files for nodejs
ii  ocrad          0.25         arm          Optical Character Recognition pro
ii  ocrad-dev      0.25         arm          Development files and documentati
ii  openjpeg       2.1.0        arm          JPEG 2000 image compression libra
ii  openjpeg-dev   2.1.0        arm          Development files and documentati
ii  openjpeg-tools 2.1.0        arm          Command-line tools using the JPEG
ii  openssh        7.1-3        arm          Secure shell for logging into a r
ii  openssl        1.0.2e       arm          Library implementing the SSL and
ii  openssl-dev    1.0.2e       arm          Development files for openssl
ii  openssl-tool   1.0.2e       arm          The openssl command line cryptogr
ii  optipng        0.7.5        arm          PNG optimizer that recompresses i
ii  p7zip          15.09        arm          Command-line version of the 7zip
ii  pango          1.39.0       arm          Library for laying out and render
ii  pango-dev      1.39.0       arm          Development files for pango
ii  parallel       20151022     arm          GNU Parallel is a shell tool for
ii  patch          2.7.5        arm          GNU patch which applies diff file
ii  pathpicker     0.7.0        arm          Facebook PathPicker - a terminal-
ii  pcre           8.37         arm          Library implementing regular expr
ii  pcre-dev       8.37         arm          Development files for pcre
ii  perl           5.22.1       arm          Capable, feature-rich programming
ii  php            5.6.16       arm          Server-side, HTML-embedded script
ii  php-dev        5.6.16       arm          Development files for php
ii  pick           1.2.1        arm          Utility to choose one option from
ii  picolisp       15.11-1      arm          Lisp interpreter and application
ii  pkg-config     0.29         arm          Helper tool used when compiling a
ii  play-audio     0.3          arm          Simple commandline audio player f
ii  poppler        0.39.0       arm          PDF rendering library
ii  poppler-dev    0.39.0       arm          Development files for poppler
ii  procps         3.3.11       arm          Utilities that give information a
ii  procps-dev     3.3.11       arm          Development files for procps
ii  protobuf       2.6.1        arm          Library for encoding structured d
ii  protobuf-dev   2.6.1        arm          Development files for protobuf
ii  psmisc         22.21        arm          Some small useful utilities that
ii  pv             1.6.0        arm          Terminal-based tool for monitorin
ii  pwgen          2.07-1       arm          Password generator which by defau
ii  python         3.5.1-1      arm          Programming language intended to
ii  python-dev     3.5.1-1      arm          Development files for python
ii  python2        2.7.11       arm          Programming language intended to
ii  python2-dev    2.7.11       arm          Development files for python2
ii  ragel          6.9          arm          Compiles finite state machines fr
ii  readline       6.3.8        arm          Library providing a set of functi
ii  readline-dev   6.3.8        arm          Development files and documentati
ii  remind         3.1.15       arm          Sophisticated calendar and alarm
ii  resolv-conf    1.0          arm          Resolver configuration file
ii  rlwrap         0.42         arm          Wrapper using readline to enable
ii  rsync          3.1.1        arm          Utility that provides fast increm
ii  ruby           2.2.4        arm          Dynamic programming language with
ii  ruby-dev       2.2.4        arm          Development files for ruby
ii  sed            4.2.2        arm          GNU stream text editor
ii  sensible-utils 0.0.9        arm          Small utilities used by programs
ii  serf           1.3.8        arm          High performance C-based HTTP cli
ii  serf-dev       1.3.8        arm          Development files and documentati
ii  sharutils      4.15.2       arm          Utilities for packaging and unpac
ii  silversearcher 0.31.0       arm          Fast grep-like program, alternati
ii  sl             5.02         arm          Tool curing your bad habit of mis
ii  socat          1.7.3.0      arm          Relay for bidirectional data tran
ii  sox            14.4.2-1     arm          Command line utility for converti
ii  sox-dev        14.4.2-1     arm          Development files for sox
ii  speex          1.2rc2       arm          Patent-free audio compression for
ii  speex-dev      1.2rc2       arm          Development files for speex
ii  sqlite         3.9.2        arm          Command line shell for SQLite
ii  sshpass        1.05         arm          Noninteractive ssh password provi
ii  strace         4.10-1       arm          Debugging utility to monitor the
ii  stunnel        5.28         arm          Socket wrapper which can provide
ii  subversion     1.9.2        arm          Centralized version control syste
ii  subversion-dev 1.9.2        arm          Development files for subversion
ii  tack           1.07         arm          Program that can be used to verif
ii  tar            1.28         arm          GNU tar for manipulating tar arch
ii  taskwarrior    2.5.0        arm          Utility for managing your TODO li
ii  tcl            8.6.4-1      arm          Powerful but easy to learn dynami
ii  tcl-dev        8.6.4-1      arm          Development files for tcl
ii  tcpdump        4.7.4        arm          Powerful command-line packet anal
ii  termux-api     0.9          arm          Termux API commands
ii  termux-tools   0.12         arm          Some tools for Termux
ii  teseq          1.1.1        arm          Tool for analyzing control charac
ii  tig            2.1.1        arm          Ncurses-based text-mode interface
ii  tmux           2.1-1        arm          Terminal multiplexer implementing
ii  toilet         0.3          arm          FIGlet-compatible display of larg
ii  tracepath      20150815     arm          Tool to trace the network path to
ii  transmission   2.84         arm          Easy, lean and powerful BitTorren
ii  ttyrec         1.0.8-2      arm          Terminal recorder and player
ii  units          2.12         arm          Converts between different system
ii  unnethack      5.1.0        arm          Dungeon crawling game, fork of Ne
ii  unrar          5.3.2        arm          Tool for extracting files from .r
ii  unzip          6.0          arm          Tools for working with zip files
ii  utfdecode      0.3.4        arm          Tool for decoding, encoding and d
iU  vim            7.4.972      arm          Vi IMproved - enhanced vi editor
ii  vttest         20140305     arm          Program for testing the VT100 com
ii  vtutils        0.5          arm          Utilities for testing and working
ii  w3m            0.5.3        arm          Text based Web browser and pager
ii  wcalc          2.5-1        arm          Capable calculator
ii  weechat        1.3-4        arm          Fast, light and extensible IRC ch
ii  weechat-dev    1.3-4        arm          Development files for weechat
ii  weechat-ruby-p 1.3-4        arm          WeeChat Ruby Plugin
ii  wget           1.17.1-1     arm          Commandline tool for retrieving f
ii  x264           20141218-224 arm          Commandline video encoder for the
ii  xmlstarlet     1.6.1-1      arm          Command line XML toolkit
ii  xsltproc       1.1.28-3     arm          XSLT command line processor
ii  xvidcore       1.3.4        arm          High performance and high quality
ii  xvidcore-dev   1.3.4        arm          Development files for xvidcore
ii  xz-utils       5.2.2        arm          XZ-format compression tools
ii  yasm           1.3.0        arm          Assembler supporting the x86 and
ii  yasm-dev       1.3.0        arm          Development files and documentati
ii  zile           2.4.11-2     arm          Lightweight clone of the Emacs te
ii  zip            3.0          arm          Tools for working with zip files
ii  zsh            5.2.0        arm          Shell designed for interactive us
fornwall commented 8 years ago

I was able to reproduce the problem on a HTC One X with stock ROM, so I would guess that this is a HTC problem (the apt http code triggering debug logging on HTC system builds). Will look into it!

franciscod commented 8 years ago

right now:

$ apt install python2
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  python2
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 6863 kB of archives.
After this operation, 35.6 MB of additional disk space will be used.
Err:1 http://apt.termux.com stable/main arm python2 arm 2.7.11
  Could not connect to apt.termux.com:80 (216.119.132.66). - connect (111: Connection refused)
E: Failed to fetch http://apt.termux.com/dists/stable/main/binary-arm/python2-2.7.11_arm.deb  Could not connect to apt.termux.com:80 (216.119.132.66). - connect (111: Connection refused)

E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
$ 
franciscod commented 8 years ago

fixed

EDIT: no, server seems to be flaky...

fornwall commented 8 years ago

Hi, finally this issue with (certain?) HTC devices not working with apt can now be resolved! It's fixed in a new version of the apt package, version 1.1.6. This now comes as part of the bootstrap installation for new users.

For users stuck with the current non-working apt version, you can either re-install the application, or execute the following commands:

apt -o Acquire::EnableSrvRecords=false update
apt -o Acquire::EnableSrvRecords=false upgrade

This should work around the issue and update apt to the working version 1.1.6, after which you can update and install packages as normal.

Thanks a lot for all the information provided which helped pinpoint where the problem was!

indam commented 8 years ago

Thank you, it works for me now. :D

jlefman commented 8 years ago

:+1: Working for my system as well. Thank you, @fornwall. Would it be possible to receive an explanation of the underlying issue and what this workaround is doing? Thank you for your time on this issue.

fornwall commented 8 years ago

@jlefman The problem was that apt version 1.1 introduced support for SRV records, whose retrieval using system functions seems to cause debug logging on (certain?) HTC devices - perhaps due to HTC having left the debug flag on by mistake.

This debug output from a dedicated http fetching process in apt led to apt not being able to parse the http response, which caused to this problem.

The solution was to patch apt to disable SRV records by default for now, since it's not something used by the Termux apt.

dvlasenk commented 8 years ago

This (simple install using "apt install") does not work for me. Freshly installed termix. $ apt --version apt 1.2.1 (arm) $ strace -tt -s99 -f -oLOG.TXT apt install sox Reading package lists... Done Building dependency tree... Done E: Unable to locate package sox

Please find the LOG.TXT file attached. I don't see any attempt to resolve "termux.net" thru DNS there... is that normal?

stracing "ping -c1 termux.net" shows how DNS resolution looks like in a working case:

... 18877 socket(PF_LOCAL, SOCK_STREAM|SOCK_CLOEXEC, 0) = 4 18877 setsockopt(4, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0 18877 connect(4, {sa_family=AF_LOCAL, sun_path="/dev/socket/dnsproxyd"}, 110) = 0 18877 fcntl64(4, F_GETFL) = 0x2 (flags O_RDWR) 18877 fstat64(4, {st_mode=S_IFSOCK|0777, st_size=0, ...}) = 0 18877 mprotect(0xb6e65000, 4096, PROT_READ|PROT_WRITE) = 0 18877 mprotect(0xb6e65000, 4096, PROT_READ) = 0 18877 write(4, "gethostbyname 0 termux.net 2\0", 29) = 29 18877 read(4, "222\0\0\0\0\vtermux.net\0\0\0\0\0\0\0\0\2\0\0\0\4\0\0\0\20h\22%\352termh\22$\352et\0\0\0\0\0\20h\22$\352et\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 4096) = 75 18877 close(4) = 0 18877 socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 4 18877 socket(PF_LOCAL, SOCK_STREAM, 0) = 5 18877 connect(5, {sa_family=AF_LOCAL, sun_path="/dev/socket/fwmarkd"}, 110) = 0 18877 sendmsg(5, {msg_name(0)=NULL, msg_iov(1)=[{"\1\0\0\0\0\0\0\0\0\0\0\0", 12}], msg_controllen=16, [{cmsg_len=16, cmsg_level=SOL_SOCKET, cmsg_type=SCM_RIGHTS, [4]}], msg_flags=0}, 0) = 12 18877 recvfrom(5, "\0\0\0\0", 4, 0, NULL, NULL) = 4 18877 close(5) = 0 18877 connect(4, {sa_family=AF_INET, sin_port=htons(1025), sin_addr=inet_addr("104.18.37.234")}, 16) = 0 ...

LOG.TXT

fornwall commented 8 years ago

@dvlasenk Have you executed apt update before running apt install? This is needed to download the list of available packages.

Pathak706 commented 6 years ago

I have newly joined termux. and I oftenly face the issue of E:Unable to locate How to fix this issue