Subject: [alpine-user] apk(1) error does not go away

From: Steffen Nurpmeso <[email-masked]>
Date: Sat, 10 Feb 2018 17:16:22 +0100

Hello.

Well last week or so a i interrupted an "apk upgrade" and ever
since i get an error status even though the action is performed
just fine, for example:

  ?127[@essex ]# apk info bash-doc
  bash-doc-4.4.12-r5 description:
  ...
  ?0[@essex ]# apk add -u bash-doc
  (1/1) Upgrading bash-doc (4.4.12-r5 -> 4.4.19-r1)
  Executing mdocml-apropos-1.14.3-r0.trigger
  1 error; 1256 MiB in 369 packages
  ?1[@essex ]# apk info bash-doc
  bash-doc-4.4.19-r1 description:
  ...
  ?0[@essex ]#

Is there something that can be done about that?
Thanks,

--steffen
|
|Der Kragenbaer,                The moon bear,
|der holt sich munter           he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---

---

From: Cág <[email-masked]>
Date: Sat, 10 Feb 2018 19:26:34 +0000

> since i get an error status even though the action is performed

[...]
 
> Is there something that can be done about that?

apk fix ?

P.S. Don't use Bash.

--
caóc

---

---

From: Martin Galvan <[email-masked]>
Date: Sat, 10 Feb 2018 17:29:06 -0300

>> since i get an error status even though the action is performed

Sounds a bit similar to https://bugs.alpinelinux.org/issues/8067

> P.S. Don't use Bash.

Why not?

---

---

From: Steffen Nurpmeso <[email-masked]>
Date: Sat, 10 Feb 2018 22:02:57 +0100

Martin Galvan <[email-masked]> wrote:
 |2018-02-10 16:26 GMT-03:00 Cág <[email-masked]>:
 |> Steffen Nurpmeso wrote:
 |>
 |>> Well last week or so a i interrupted an "apk upgrade" and ever
 |>> since i get an error status even though the action is performed
 |>> just fine, for example:
 |
 |Sounds a bit similar to https://bugs.alpinelinux.org/issues/8067

Hmm, maybe, of course, but apk does not fail, it just reports
error ever since i interrupted in the middle of an upgrade.

--steffen
|

---

---

From: Cág <[email-masked]>
Date: Sat, 10 Feb 2018 21:36:18 +0000

> error ever since i interrupted in the middle of an upgrade.

Have you tried apk del; apk add though, as described? In case
it's the dma package.

--
caóc

---

---

From: [email-masked]
Date: Sat, 10 Feb 2018 22:51:24 +0100

Cág <[email-masked]> wrote:
 |Steffen Nurpmeso wrote:
 |> Hmm, maybe, of course, but apk does not fail, it just reports
 |> error ever since i interrupted in the middle of an upgrade.
 |
 |Have you tried apk del; apk add though, as described? In case
 |it's the dma package.

No, that is a local package.  I have no idea which package it was
back then, it was an "upgrade" that i have interrupted.  But ok,
if it is "fix" i will use that to do the entire next upgrade, it
seems to be able to do that.  Hopefully we overcome the problem
with that.

Thanks, Cág.

--Steffen Schönbein

---

---

From: Steffen Nurpmeso <[email-masked]>
Date: Sat, 10 Feb 2018 22:52:37 +0100

Thanks, Cág.

--steffen
|

---

---

From: Cág <[email-masked]>
Date: Sat, 10 Feb 2018 22:04:41 +0000

> Why not?

If keeping it short: it's slow, gargantuan (several gorillions lines of
buggy code), Shellshock™, bashisms.

But, more importantly: it's Gah-NOO.

Seeing people using #!/bin/bash for one-two-three-line scripts triggers
a gag reflex in me. If you absolutely must use scripting for a task,
use /bin/sh if it's simple, or maybe Perl/Lua for something more
complex (but rather use C).

--
caóc

---

---

From: Martin Galvan <[email-masked]>
Date: Sat, 10 Feb 2018 19:16:31 -0300

> complex (but rather use C).

Oh, I see. So it's just because you don't like it. I thought there was
some system-wide limitation or something on Alpine.

---

---

From: "Laurent Bercot" <[email-masked]>
Date: Sun, 11 Feb 2018 00:09:06 +0000

>some system-wide limitation or something on Alpine.

  It's not because someone doesn't like it. It's because it's an
inferior technical choice, teaching you to use non-standard constructs
in your scripts (reducing portability), consuming way more resources
than is necessary, and proven insecure in the past. We care about
quality of implementation, that's why we discourage you from using
bash. There's nothing more to it.

  Using bash makes sense in a few cases, namely when you need the extra
functionality that bash offers over a POSIX shell: for instance, arrays.
But those cases are pretty rare (and those bash scripts can generally
be advantageously replaced with small programs in a real programming
language - lua for instance). Most admin tasks can be achieved with
a POSIX shell, so it's good practice to code for sh, not for bash or
any other specific shell.

  There's no system-wide limitation on Alpine, but bash is not in base;
the default shell is ash, Busybox's /bin/sh, which is compatible with
bash in many ways, but not 100%. If you want to run bash scripts, you
need to apk add bash, which increases the size of your image.

  Of course, you're free not to care about any of this. But attention
to those details is generally why people choose Alpine over other
distributions, so you should expect those arguments to be given on
Alpine mailing-lists.

--
  Laurent

---

---

From: William Pitcock <[email-masked]>
Date: Sat, 10 Feb 2018 18:22:21 -0600

Hello,

> distributions, so you should expect those arguments to be given on

He shouldn't expect to be given unsolicited advice for using bash.  It
is off-topic (he wanted to know why his package manager broke) and
rude (because it is unsolicited).

William

---

---

From: Steffen Nurpmeso <[email-masked]>
Date: Sat, 10 Feb 2018 21:59:57 +0100

Hello caóc!

Cág <[email-masked]> wrote:
 |Steffen Nurpmeso wrote:
 |> Well last week or so a i interrupted an "apk upgrade" and ever
 |> since i get an error status even though the action is performed
 |> just fine, for example:
 |
 |[...]
 | 
 |> Is there something that can be done about that?
 |
 |apk fix ?

Does not really help it seems:

  ?0[@essex ]# apk fix                     
  (1/1) [APK unavailable, skipped] Reinstalling dma (20180131-r0)
  1 error; 1256 MiB in 369 packages                 
  ?1[@essex ]#

 |P.S. Don't use Bash.

Well i do not more or less, my login shell is mksh.  I need it for
testing and documentation, and then @essex is a superset of my
server -- and that needs bash for dehydrated, which manages the
letsencrypt certificates, you know.

--steffen
|

---

---

From: William Pitcock <[email-masked]>
Date: Sat, 10 Feb 2018 17:54:40 -0600

Hi Steffen,

>   1 error; 1256 MiB in 369 packages

The issue is that something (probably a maintainer script) in your dma
package failed to run successfully and, now, the original package is
missing.  If you do not have the package anymore because you don't
need it, you might do `apk del dma` to remove it.  Otherwise, you will
need to supply a working dma package and then do `apk fix` for the
error to go away.

William

---

---

From: Steffen Nurpmeso <[email-masked]>
Date: Sun, 11 Feb 2018 01:33:38 +0100

William Pitcock <[email-masked]> wrote:
 |On Sat, Feb 10, 2018 at 2:59 PM, Steffen Nurpmeso <[email-masked]> \
 |wrote:
 |> Cág <[email-masked]> wrote:
 |>|Steffen Nurpmeso wrote:
 |>|> Well last week or so a i interrupted an "apk upgrade" and ever
 |>|> since i get an error status even though the action is performed
 |>|> just fine, for example:
 ...
 |>|apk fix ?
 |>
 |> Does not really help it seems:
 |>
 |>   ?0[@essex ]# apk fix
 |>   (1/1) [APK unavailable, skipped] Reinstalling dma (20180131-r0)
 |>   1 error; 1256 MiB in 369 packages
 |>   ?1[@essex ]#
 |>
 |
 |The issue is that something (probably a maintainer script) in your dma
 |package failed to run successfully and, now, the original package is
 |missing.  If you do not have the package anymore because you don't
 |need it, you might do `apk del dma` to remove it.  Otherwise, you will
 |need to supply a working dma package and then do `apk fix` for the
 |error to go away.

Yes.  Thank you again.  The issue was indeed postfix being also
installed and dma wanting to

  (1/1) Installing dma (0.11-r6)
  ERROR: dma-0.11-r6: trying to overwrite usr/sbin/sendmail owned by postfix-3.2.4-r1.
  ERROR: dma-0.11-r6: trying to overwrite usr/bin/mailq owned by postfix-3.2.4-r1. 

Uninstalling dma and error was gone:

  ?0[@essex steffen]# apk add -u json-c
  (1/1) Upgrading json-c (0.12.1-r1 -> 0.12.1-r3)
  OK: 1443 MiB in 368 packages
  ?0[@essex ]#

Reinstalling dma and the error shows up again:

  ?0[@essex ]# apk add -u lzip
  (1/1) Upgrading lzip (1.19-r1 -> 1.19-r2)
  Executing busybox-1.27.2-r8.trigger
  1 error; 1443 MiB in 369 packages

The actual files complained about have not changed during that.
(One of the side effects of @essex being a superset of my server,
which drives postfix, i need to forcefully replace the above two
with symlinks.  Maybe it would be easier to have two distinct
Postfix configurations, but, well.)

P.S.: i could fix the cirrus fb issue mentioned on -devel by
changing the grub (i need that on the server because i had been
unable to install syslinux in the existing GPT disk layout
together with FreeBSD that lived there) config line "set
gfxpayload=text" (from =keep i think it was).

Thanks again, and a nice Sunday i wish.

--steffen
|

---

---

From: William Pitcock <[email-masked]>
Date: Sat, 10 Feb 2018 19:06:54 -0600

Hello,

>   ERROR: dma-0.11-r6: trying to overwrite usr/bin/mailq owned by postfix-3.2.4-r1.

If you want to have both postfix and dma installed at the same time,
you could put replaces="postfix" on the DMA package to get rid of this
error.

William

---

---

From: Steffen Nurpmeso <[email-masked]>
Date: Mon, 12 Feb 2018 17:32:09 +0100

Juhu on a Monday!

William Pitcock <[email-masked]> wrote:
 |On Sat, Feb 10, 2018 at 6:33 PM, Steffen Nurpmeso <[email-masked]> \
 |wrote:
 |> William Pitcock <[email-masked]> wrote:
 |>|On Sat, Feb 10, 2018 at 2:59 PM, Steffen Nurpmeso <[email-masked]> \
 |>|wrote:
 |>|> Cág <[email-masked]> wrote:
 |>|>|Steffen Nurpmeso wrote:
 ...
 |>|The issue is that something (probably a maintainer script) in your dma
 |>|package failed to run successfully and, now, the original package is
 ...
 |> Yes.  Thank you again.  The issue was indeed postfix being also
 |> installed and dma wanting to
 |>
 |>   (1/1) Installing dma (0.11-r6)
 |>   ERROR: dma-0.11-r6: trying to overwrite usr/sbin/sendmail owned \
 |>   by postfix-3.2.4-r1.
 |>   ERROR: dma-0.11-r6: trying to overwrite usr/bin/mailq owned by \
 |>   postfix-3.2.4-r1.
 |
 |If you want to have both postfix and dma installed at the same time,
 |you could put replaces="postfix" on the DMA package to get rid of this
 |error.

Oh, i thought this would be quite the opposite, i.e., forcefully
rejecting or replacing those mentioned?!  I have looked at exim,
who does not do anything regarding replaces= etc., so i kept that
part of the DMA APKBUILD the way it was.  I mean, if the DMA
package as posted on -ports is not updated the desired way then
i have to stick with a manual compilation of DMA for now anyway..
But thanks a lot for the feedback!

--steffen
|

---

---

From: William Pitcock <[email-masked]>
Date: Mon, 12 Feb 2018 15:02:04 -0600

Hello,

> But thanks a lot for the feedback!

replaces=postfix here means DMA is allowed to replace specific Postfix files.

We don't normally do this sort of thing because it's not really a
configuration people normally would be using, which is why I offered
it in the context of "if you really want both installed at once."

William

---