[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Installing package *NOT* in repository



On Tue 21 Aug 2018 at 11:23:59 (-0400), Greg Wooledge wrote:
> On Tue, Aug 21, 2018 at 10:04:58AM -0500, David Wright wrote:
> > Why would you expect it to look for a «file» at all? If you write
> >     # apt install gem.deb
> > then apt should try to install any «packages» it finds called
> > "gemadeb", "gembdeb", "gemcdeb", "gemddeb", etc, and will
> > consequently install the «package» gem2deb, which is likely
> > not what you expected unless you read the man page for apt-get
> > in combination with that for apt.
> 
> First of all, the . character is valid in a package name, and is supposed
> to be treated literally.  A package named python3.5 exists, for example.
> 
> The . character can be a single-character wildcard in some kinds of
> regular expression, but one would hope (I certainly hope) that when
> an exactly matching package name exists in the database, the exact
> match should win out over a regex(7) match.

Hey, I don't write this stuff. I only read the man pages.

> The . character is NOT a single-character wildcard to the shell, so it
> does not need escaping or quoting to survive the shell's argument
> parsing.  You might be thinking of the ? character.

No, I'm not. That's why you don't need to escape it.

> Second, this whole thread has been about the undocumented feature of
> apt (but not apt-get) that allows you to specify a pathname to a .deb
> file on an "apt install" command.  Nobody was quite sure how it worked,
> because it's undocumented.

Yes, that's why I tried it (in stretch. Simulated. Installing it
would be a bit of a stretch. Bothering to install buster first would
be going for bust.)

> However, Michael Stone was kind enough to point out the line of code
> which is partly responsible for this feature (thank you).  So, now we
> know that "apt install" can take a pathname argument, but only if the
> pathname begins with "/" or "./" or "../".  This seems like a strange
> choice to me (I would've gone with "contains a slash", because there's
> precedent for that, and because it allows pathnames like "foo/bar.deb"
> which the current code does not allow).  But at least now we know.

But there's a slash in the allowed syntax already, so that choice has gone.

Anyway, let's actually count the teeth in the horse's mouth:

The short test:

~/4greg $ ls -l
total 2552
-rw-r----- 1 david david 1305596 Jul  9 11:41 apt_1.6.3_amd64.deb
-rw-r----- 1 david david 1305596 Jul  9 11:41 gem.deb
~/4greg $ apt -s install gem.deb | grep gem

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

  dirmngr dpkg-dev dput equivs g++ g++-6 gem2deb gem2deb-test-runner gettext
Inst gem2deb-test-runner (0.33.1 Debian:9.5/stable [amd64])
Inst gem2deb (0.33.1 Debian:9.5/stable [amd64])
Conf gem2deb-test-runner (0.33.1 Debian:9.5/stable [amd64])
Conf gem2deb (0.33.1 Debian:9.5/stable [amd64])
~/4greg $ 

and the long test, as a warning:

~/4greg $ apt -s install gem.deb 
NOTE: This is only a simulation!
      apt needs root privileges for real execution.
      Keep also in mind that locking is deactivated,
      so don't depend on the relevance to the real current situation!
Reading package lists...
Building dependency tree...
Reading state information...
The following packages were automatically installed and are no longer required:
  linux-headers-4.9.0-6-amd64 linux-headers-4.9.0-6-common
  linux-image-4.9.0-6-amd64
Use 'apt autoremove' to remove them.
The following additional packages will be installed:
  autoconf automake autopoint autotools-dev build-essential debhelper
  debian-keyring devscripts dh-autoreconf dh-strip-nondeterminism diffstat
  dirmngr dpkg-dev dput equivs g++ g++-6 gettext intltool-debian
  libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl
  libarchive-zip-perl libclass-inspector-perl libclass-xsaccessor-perl
  libclone-perl libconvert-binhex-perl libdevel-globaldestruction-perl
  libdigest-hmac-perl libdistro-info-perl libemail-valid-perl
  libfile-chdir-perl libfile-stripnondeterminism-perl
  libgetopt-long-descriptive-perl libgit-wrapper-perl libgmp-dev libgmpxx4ldbl
  libimport-into-perl libio-pty-perl libio-sessiondata-perl
  libio-socket-inet6-perl libio-stringy-perl libipc-run-perl
  liblist-compare-perl libltdl-dev libmail-sendmail-perl libmime-tools-perl
  libmoo-perl libnet-dns-perl libnet-domain-tld-perl libnet-ip-perl
  libnumber-compare-perl libnumber-range-perl libossp-uuid-perl libossp-uuid16
  libparams-validate-perl libpath-iterator-rule-perl libpath-tiny-perl
  libperlio-gzip-perl libpod-constants-perl libsoap-lite-perl libsocket6-perl
  libsort-key-perl libsort-versions-perl libstdc++-6-dev libstrictures-perl
  libstring-copyright-perl libstring-escape-perl libsys-hostname-long-perl
  libtask-weaken-perl libtext-glob-perl libtext-levenshtein-perl libtool
  libunicode-utf8-perl libxmlrpc-lite-perl libyaml-libyaml-perl licensecheck
  lintian m4 patchutils po-debconf python-apt python-debian python-gpg
  python3-magic ruby-all-dev ruby-setup ruby2.3-dev wdiff
Suggested packages:
  autoconf-archive gnu-standards autoconf-doc dh-make adequate autopkgtest
  bls-standalone check-all-the-things cvs-buildpackage devscripts-el
  diffoscope disorderfs dose-extra duck faketime gnuplot how-can-i-help
  libnet-smtps-perl libterm-size-perl libyaml-syck-perl mozilla-devscripts
  piuparts ratt reprotest svn-buildpackage dbus-user-session pinentry-gnome3
  tor mini-dinstall g++-multilib g++-6-multilib gcc-6-doc libstdc++6-6-dbg
  gettext-doc libasprintf-dev libgettextpo-dev gmp-doc libgmp10-doc
  libmpfr-dev libtool-doc uuid libapache2-mod-perl2 libmime-lite-perl
  libnet-jabber-perl libstdc++-6-doc libbareword-filehandles-perl
  libindirect-perl libmultidimensional-perl gfortran | fortran95-compiler
  gcj-jdk binutils-multiarch libtext-template-perl m4-doc libmail-box-perl
  python-apt-dbg python-apt-doc wdiff-doc
The following NEW packages will be installed:
  autoconf automake autopoint autotools-dev build-essential debhelper
  debian-keyring devscripts dh-autoreconf dh-strip-nondeterminism diffstat
  dirmngr dpkg-dev dput equivs g++ g++-6 gem2deb gem2deb-test-runner gettext
  intltool-debian libalgorithm-diff-perl libalgorithm-diff-xs-perl
  libalgorithm-merge-perl libarchive-zip-perl libclass-inspector-perl
  libclass-xsaccessor-perl libclone-perl libconvert-binhex-perl
  libdevel-globaldestruction-perl libdigest-hmac-perl libdistro-info-perl
  libemail-valid-perl libfile-chdir-perl libfile-stripnondeterminism-perl
  libgetopt-long-descriptive-perl libgit-wrapper-perl libgmp-dev libgmpxx4ldbl
  libimport-into-perl libio-pty-perl libio-sessiondata-perl
  libio-socket-inet6-perl libio-stringy-perl libipc-run-perl
  liblist-compare-perl libltdl-dev libmail-sendmail-perl libmime-tools-perl
  libmoo-perl libnet-dns-perl libnet-domain-tld-perl libnet-ip-perl
  libnumber-compare-perl libnumber-range-perl libossp-uuid-perl libossp-uuid16
  libparams-validate-perl libpath-iterator-rule-perl libpath-tiny-perl
  libperlio-gzip-perl libpod-constants-perl libsoap-lite-perl libsocket6-perl
  libsort-key-perl libsort-versions-perl libstdc++-6-dev libstrictures-perl
  libstring-copyright-perl libstring-escape-perl libsys-hostname-long-perl
  libtask-weaken-perl libtext-glob-perl libtext-levenshtein-perl libtool
  libunicode-utf8-perl libxmlrpc-lite-perl libyaml-libyaml-perl licensecheck
  lintian m4 patchutils po-debconf python-apt python-debian python-gpg
  python3-magic ruby-all-dev ruby-setup ruby2.3-dev wdiff
0 upgraded, 91 newly installed, 0 to remove and 0 not upgraded.
Inst m4 (1.4.18-1 Debian:9.5/stable [amd64])
Inst autoconf (2.69-10 Debian:9.5/stable [all])
Inst autotools-dev (20161112.1 Debian:9.5/stable [all])
Inst automake (1:1.15-6 Debian:9.5/stable [all])
Inst autopoint (0.19.8.1-2 Debian:9.5/stable [all])
Inst libstdc++-6-dev (6.3.0-18+deb9u1 Debian:9.5/stable, Debian-Security:9/stable [amd64])
Inst g++-6 (6.3.0-18+deb9u1 Debian:9.5/stable, Debian-Security:9/stable [amd64])
Inst g++ (4:6.3.0-4 Debian:9.5/stable [amd64])
Inst dpkg-dev (1.18.25 Debian:9.5/stable [all])
Inst build-essential (12.3 Debian:9.5/stable [amd64])
Inst libtool (2.4.6-2 Debian:9.5/stable [all])
Inst dh-autoreconf (14 Debian:9.5/stable [all]) []
Inst libarchive-zip-perl (1.59-1 Debian:9.5/stable [all]) []
Inst libfile-stripnondeterminism-perl (0.034-1 Debian:9.5/stable [all]) []
Inst dh-strip-nondeterminism (0.034-1 Debian:9.5/stable [all]) []
Inst gettext (0.19.8.1-2 Debian:9.5/stable [amd64]) []
Inst intltool-debian (0.35.0+20060710.4 Debian:9.5/stable [all]) []
Inst po-debconf (1.0.20 Debian:9.5/stable [all]) []
Inst debhelper (10.2.5 Debian:9.5/stable [all])
Inst debian-keyring (2017.05.28 Debian:9.5/stable [all])
Inst devscripts (2.17.6+deb9u2 Debian:9.5/stable [amd64])
Inst diffstat (1.61-1+b1 Debian:9.5/stable [amd64])
Inst dirmngr (2.1.18-8~deb9u2 Debian:9.5/stable, Debian-Security:9/stable [amd64])
Inst python-debian (0.1.30 Debian:9.5/stable [all])
Inst python-gpg (1.8.0-3+b2 Debian:9.5/stable [amd64])
Inst dput (0.12.1 Debian:9.5/stable [all])
Inst gem2deb-test-runner (0.33.1 Debian:9.5/stable [amd64])
Inst libgmpxx4ldbl (2:6.1.2+dfsg-1 Debian:9.5/stable [amd64])
Inst libgmp-dev (2:6.1.2+dfsg-1 Debian:9.5/stable [amd64])
Inst ruby2.3-dev (2.3.3-1+deb9u3 Debian-Security:9/stable [amd64])
Inst ruby-all-dev (1:2.3.3 Debian:9.5/stable [amd64])
Inst ruby-setup (3.4.1-9 Debian:9.5/stable [all])
Inst gem2deb (0.33.1 Debian:9.5/stable [amd64])
Inst libalgorithm-diff-perl (1.19.03-1 Debian:9.5/stable [all])
Inst libalgorithm-diff-xs-perl (0.04-4+b2 Debian:9.5/stable [amd64])
Inst libalgorithm-merge-perl (0.08-3 Debian:9.5/stable [all])
Inst libclass-inspector-perl (1.31-1 Debian:9.5/stable [all])
Inst libclass-xsaccessor-perl (1.19-2+b7 Debian:9.5/stable [amd64])
Inst libclone-perl (0.38-2+b1 Debian:9.5/stable [amd64])
Inst libconvert-binhex-perl (1.125-1 Debian:9.5/stable [all])
Inst libdevel-globaldestruction-perl (0.14-1 Debian:9.5/stable [all])
Inst libdigest-hmac-perl (1.03+dfsg-1 Debian:9.5/stable [all])
Inst libdistro-info-perl (0.14 Debian:9.5/stable [all])
Inst libsocket6-perl (0.27-1+b1 Debian:9.5/stable [amd64])
Inst libio-socket-inet6-perl (2.72-2 Debian:9.5/stable [all])
Inst libnet-ip-perl (1.26-1 Debian:9.5/stable [all])
Inst libnet-dns-perl (1.07-1 Debian:9.5/stable [all])
Inst libnet-domain-tld-perl (1.75-1 Debian:9.5/stable [all])
Inst libemail-valid-perl (1.202-1 Debian:9.5/stable [all])
Inst libfile-chdir-perl (0.1008-1 Debian:9.5/stable [all])
Inst libio-stringy-perl (2.111-2 Debian:9.5/stable [all])
Inst libparams-validate-perl (1.26-1 Debian:9.5/stable [amd64])
Inst libgetopt-long-descriptive-perl (0.100-1 Debian:9.5/stable [all])
Inst libsort-versions-perl (1.62-1 Debian:9.5/stable [all])
Inst libgit-wrapper-perl (0.047-1 Debian:9.5/stable [all])
Inst libimport-into-perl (1.002005-1 Debian:9.5/stable [all])
Inst libio-pty-perl (1:1.08-1.1+b2 Debian:9.5/stable [amd64])
Inst libio-sessiondata-perl (1.03-1 Debian:9.5/stable [all])
Inst libipc-run-perl (0.94-1+deb9u1 Debian:9.5/stable [all])
Inst liblist-compare-perl (0.53-1 Debian:9.5/stable [all])
Inst libltdl-dev (2.4.6-2 Debian:9.5/stable [amd64])
Inst libsys-hostname-long-perl (1.5-1 Debian:9.5/stable [all])
Inst libmail-sendmail-perl (0.79.16-2 Debian:9.5/stable [all])
Inst libmime-tools-perl (5.508-1 Debian:9.5/stable [all])
Inst libstrictures-perl (2.000003-1 Debian:9.5/stable [all])
Inst libmoo-perl (2.002005-1 Debian:9.5/stable [all])
Inst libnumber-compare-perl (0.03-1 Debian:9.5/stable [all])
Inst libnumber-range-perl (0.12-1 Debian:9.5/stable [all])
Inst libossp-uuid16 (1.6.2-1.5+b4 Debian:9.5/stable [amd64])
Inst libossp-uuid-perl (1.6.2-1.5+b4 Debian:9.5/stable [amd64])
Inst libtext-glob-perl (0.10-1 Debian:9.5/stable [all])
Inst libpath-iterator-rule-perl (1.009-1 Debian:9.5/stable [all])
Inst libpath-tiny-perl (0.100-1 Debian:9.5/stable [all])
Inst libperlio-gzip-perl (0.19-1+b2 Debian:9.5/stable [amd64])
Inst libpod-constants-perl (0.19-1 Debian:9.5/stable [all])
Inst libtask-weaken-perl (1.04-1 Debian:9.5/stable [all])
Inst libsoap-lite-perl (1.20-1 Debian:9.5/stable [all])
Inst libsort-key-perl (1.33-1+b3 Debian:9.5/stable [amd64])
Inst libstring-copyright-perl (0.003005-1 Debian:9.5/stable [all])
Inst libstring-escape-perl (2010.002-1 Debian:9.5/stable [all])
Inst libtext-levenshtein-perl (0.13-1 Debian:9.5/stable [all])
Inst libunicode-utf8-perl (0.60-1+b3 Debian:9.5/stable [amd64])
Inst libxmlrpc-lite-perl (0.717-1 Debian:9.5/stable [all])
Inst libyaml-libyaml-perl (0.63-2 Debian:9.5/stable [amd64])
Inst licensecheck (3.0.29-1 Debian:9.5/stable [all])
Inst patchutils (0.3.4-2 Debian:9.5/stable [amd64])
Inst lintian (2.5.50.4 Debian:9.5/stable [all])
Inst python-apt (1.4.0~beta3 Debian:9.5/stable [amd64])
Inst python3-magic (1:5.30-1+deb9u2 Debian:9.5/stable [all])
Inst wdiff (1.2.2-2 Debian:9.5/stable [amd64])
Inst equivs (2.0.9+nmu1 Debian:9.5/stable [all])
Conf m4 (1.4.18-1 Debian:9.5/stable [amd64])
Conf autoconf (2.69-10 Debian:9.5/stable [all])
Conf autotools-dev (20161112.1 Debian:9.5/stable [all])
Conf automake (1:1.15-6 Debian:9.5/stable [all])
Conf autopoint (0.19.8.1-2 Debian:9.5/stable [all])
Conf libstdc++-6-dev (6.3.0-18+deb9u1 Debian:9.5/stable, Debian-Security:9/stable [amd64])
Conf g++-6 (6.3.0-18+deb9u1 Debian:9.5/stable, Debian-Security:9/stable [amd64])
Conf g++ (4:6.3.0-4 Debian:9.5/stable [amd64])
Conf dpkg-dev (1.18.25 Debian:9.5/stable [all])
Conf build-essential (12.3 Debian:9.5/stable [amd64])
Conf libtool (2.4.6-2 Debian:9.5/stable [all])
Conf dh-autoreconf (14 Debian:9.5/stable [all])
Conf libarchive-zip-perl (1.59-1 Debian:9.5/stable [all])
Conf libfile-stripnondeterminism-perl (0.034-1 Debian:9.5/stable [all])
Conf dh-strip-nondeterminism (0.034-1 Debian:9.5/stable [all])
Conf gettext (0.19.8.1-2 Debian:9.5/stable [amd64])
Conf intltool-debian (0.35.0+20060710.4 Debian:9.5/stable [all])
Conf po-debconf (1.0.20 Debian:9.5/stable [all])
Conf debhelper (10.2.5 Debian:9.5/stable [all])
Conf debian-keyring (2017.05.28 Debian:9.5/stable [all])
Conf devscripts (2.17.6+deb9u2 Debian:9.5/stable [amd64])
Conf diffstat (1.61-1+b1 Debian:9.5/stable [amd64])
Conf dirmngr (2.1.18-8~deb9u2 Debian:9.5/stable, Debian-Security:9/stable [amd64])
Conf python-debian (0.1.30 Debian:9.5/stable [all])
Conf python-gpg (1.8.0-3+b2 Debian:9.5/stable [amd64])
Conf dput (0.12.1 Debian:9.5/stable [all])
Conf gem2deb-test-runner (0.33.1 Debian:9.5/stable [amd64])
Conf libgmpxx4ldbl (2:6.1.2+dfsg-1 Debian:9.5/stable [amd64])
Conf libgmp-dev (2:6.1.2+dfsg-1 Debian:9.5/stable [amd64])
Conf ruby2.3-dev (2.3.3-1+deb9u3 Debian-Security:9/stable [amd64])
Conf ruby-all-dev (1:2.3.3 Debian:9.5/stable [amd64])
Conf ruby-setup (3.4.1-9 Debian:9.5/stable [all])
Conf gem2deb (0.33.1 Debian:9.5/stable [amd64])
Conf libalgorithm-diff-perl (1.19.03-1 Debian:9.5/stable [all])
Conf libalgorithm-diff-xs-perl (0.04-4+b2 Debian:9.5/stable [amd64])
Conf libalgorithm-merge-perl (0.08-3 Debian:9.5/stable [all])
Conf libclass-inspector-perl (1.31-1 Debian:9.5/stable [all])
Conf libclass-xsaccessor-perl (1.19-2+b7 Debian:9.5/stable [amd64])
Conf libclone-perl (0.38-2+b1 Debian:9.5/stable [amd64])
Conf libconvert-binhex-perl (1.125-1 Debian:9.5/stable [all])
Conf libdevel-globaldestruction-perl (0.14-1 Debian:9.5/stable [all])
Conf libdigest-hmac-perl (1.03+dfsg-1 Debian:9.5/stable [all])
Conf libdistro-info-perl (0.14 Debian:9.5/stable [all])
Conf libsocket6-perl (0.27-1+b1 Debian:9.5/stable [amd64])
Conf libio-socket-inet6-perl (2.72-2 Debian:9.5/stable [all])
Conf libnet-ip-perl (1.26-1 Debian:9.5/stable [all])
Conf libnet-dns-perl (1.07-1 Debian:9.5/stable [all])
Conf libnet-domain-tld-perl (1.75-1 Debian:9.5/stable [all])
Conf libemail-valid-perl (1.202-1 Debian:9.5/stable [all])
Conf libfile-chdir-perl (0.1008-1 Debian:9.5/stable [all])
Conf libio-stringy-perl (2.111-2 Debian:9.5/stable [all])
Conf libparams-validate-perl (1.26-1 Debian:9.5/stable [amd64])
Conf libgetopt-long-descriptive-perl (0.100-1 Debian:9.5/stable [all])
Conf libsort-versions-perl (1.62-1 Debian:9.5/stable [all])
Conf libgit-wrapper-perl (0.047-1 Debian:9.5/stable [all])
Conf libimport-into-perl (1.002005-1 Debian:9.5/stable [all])
Conf libio-pty-perl (1:1.08-1.1+b2 Debian:9.5/stable [amd64])
Conf libio-sessiondata-perl (1.03-1 Debian:9.5/stable [all])
Conf libipc-run-perl (0.94-1+deb9u1 Debian:9.5/stable [all])
Conf liblist-compare-perl (0.53-1 Debian:9.5/stable [all])
Conf libltdl-dev (2.4.6-2 Debian:9.5/stable [amd64])
Conf libsys-hostname-long-perl (1.5-1 Debian:9.5/stable [all])
Conf libmail-sendmail-perl (0.79.16-2 Debian:9.5/stable [all])
Conf libmime-tools-perl (5.508-1 Debian:9.5/stable [all])
Conf libstrictures-perl (2.000003-1 Debian:9.5/stable [all])
Conf libmoo-perl (2.002005-1 Debian:9.5/stable [all])
Conf libnumber-compare-perl (0.03-1 Debian:9.5/stable [all])
Conf libnumber-range-perl (0.12-1 Debian:9.5/stable [all])
Conf libossp-uuid16 (1.6.2-1.5+b4 Debian:9.5/stable [amd64])
Conf libossp-uuid-perl (1.6.2-1.5+b4 Debian:9.5/stable [amd64])
Conf libtext-glob-perl (0.10-1 Debian:9.5/stable [all])
Conf libpath-iterator-rule-perl (1.009-1 Debian:9.5/stable [all])
Conf libpath-tiny-perl (0.100-1 Debian:9.5/stable [all])
Conf libperlio-gzip-perl (0.19-1+b2 Debian:9.5/stable [amd64])
Conf libpod-constants-perl (0.19-1 Debian:9.5/stable [all])
Conf libtask-weaken-perl (1.04-1 Debian:9.5/stable [all])
Conf libsoap-lite-perl (1.20-1 Debian:9.5/stable [all])
Conf libsort-key-perl (1.33-1+b3 Debian:9.5/stable [amd64])
Conf libstring-copyright-perl (0.003005-1 Debian:9.5/stable [all])
Conf libstring-escape-perl (2010.002-1 Debian:9.5/stable [all])
Conf libtext-levenshtein-perl (0.13-1 Debian:9.5/stable [all])
Conf libunicode-utf8-perl (0.60-1+b3 Debian:9.5/stable [amd64])
Conf libxmlrpc-lite-perl (0.717-1 Debian:9.5/stable [all])
Conf libyaml-libyaml-perl (0.63-2 Debian:9.5/stable [amd64])
Conf licensecheck (3.0.29-1 Debian:9.5/stable [all])
Conf patchutils (0.3.4-2 Debian:9.5/stable [amd64])
Conf lintian (2.5.50.4 Debian:9.5/stable [all])
Conf python-apt (1.4.0~beta3 Debian:9.5/stable [amd64])
Conf python3-magic (1:5.30-1+deb9u2 Debian:9.5/stable [all])
Conf wdiff (1.2.2-2 Debian:9.5/stable [amd64])
Conf equivs (2.0.9+nmu1 Debian:9.5/stable [all])
~/4greg $ apt -s install ./gem.deb 
NOTE: This is only a simulation!
      apt needs root privileges for real execution.
      Keep also in mind that locking is deactivated,
      so don't depend on the relevance to the real current situation!
Reading package lists...
Building dependency tree...
Reading state information...
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 apt : Depends: libapt-pkg5.0 (>= 1.6.3) but 1.4.8 is to be installed
E: Unable to correct problems, you have held broken packages.
~/4greg $ 

And if you got to the end, the last command shows how it should be done.
(The test .deb *is* from buster.)

Cheers,
David.


Reply to: