Discussion:
pkg delete dilema
(too old to reply)
Mario Lobo
2016-05-10 17:44:51 UTC
Permalink
Hi;

I've been looking through pkg documentation but I can't find what I need.

I want to upgrade cups port but many of cups related ports went through a
lot of changes and after a svn up, many of them disappeared.

So when I try to install the new cups port, I get this:

Installing cups-2.1.3_2...
pkg-static: cups-2.1.3_2 conflicts with cups-client-2.0.3_2 (installs files
into the same place). Problematic file: /usr/local/bin/cups-config
*** Error code 70

The problem is that there is no cups-client port anymore, so I can't cd to
it and make deinstall.

Ok so I resort to pkg. But when I try it, I get this:

pkg delete cups-client
Checking integrity... done (0 conflicting)
Deinstallation has been requested for the following 114 packages (of 0
packages in the universe):

Installed packages to be REMOVED:
cups-client-2.0.3_2
freerdp-1.2.0_5
cups-filters-1.0.71
cups-image-2.0.3_2
gtk2-2.24.27
....
....

I simply do not want to remove all those installed ports for two reasons.
One it will a long time to recompile all of the 144 that will be removed.
And two, I know that cups-client was merged into cups, so whatever it
installed will get installed over by the cups port, and all ports dependent
on it will keep their functionality.

So, is there a way to tell pkg just to delete the package WITHOUT deleting
the dependent ports? If not, is there a way for me to remove just the
cups-client port? Or just force cups to get installed (make
FORCE_PKG_REGISTER=yes install issues the same problem as plain make above)?

Thanks,
--
Mario Lobo
http://www.mallavoodoo.com.br
FreeBSD since version 2.2.8 [not Pro-Audio.... YET!!] (99,7% winfoes FREE)
Matthew Seaman
2016-05-10 18:28:19 UTC
Permalink
Post by Mario Lobo
So, is there a way to tell pkg just to delete the package WITHOUT deleting
the dependent ports? If not, is there a way for me to remove just the
cups-client port? Or just force cups to get installed (make
FORCE_PKG_REGISTER=yes install issues the same problem as plain make above)?
pkg delete -f cups-client

Cheers,

Matthew
Mario Lobo
2016-05-10 19:06:10 UTC
Permalink
Post by Mario Lobo
Post by Mario Lobo
So, is there a way to tell pkg just to delete the package WITHOUT
deleting
Post by Mario Lobo
the dependent ports? If not, is there a way for me to remove just the
cups-client port? Or just force cups to get installed (make
FORCE_PKG_REGISTER=yes install issues the same problem as plain make
above)?
pkg delete -f cups-client
Cheers,
Matthew
Thanks Anton but I DID RTFM, but i expected to find the answer in the
obvious "man pkg", which by the way, is not there anywhere:

man pkg
...
delete Delete a package from the database and the system.

That's all there is.

The only reference in there to -f is:

bootstrap
This is for compatibility with the pkg(7) bootstrapper. If pkg
is already installed, nothing is done.

If invoked with the (-f) flag an attempt will be made to
reinstall
pkg from remote repository.

I honestly didn't know that there are separate options for "man
pkg-command" but now, thanks to you, I do.

Thanks Matthew ;)!
--
Mario Lobo
http://www.mallavoodoo.com.br
FreeBSD since version 2.2.8 [not Pro-Audio.... YET!!] (99,7% winfoes FREE)
Matthias Apitz
2016-05-10 17:52:04 UTC
Permalink
Post by Mario Lobo
Hi;
I've been looking through pkg documentation but I can't find what I need.
I want to upgrade cups port but many of cups related ports went through a
lot of changes and after a svn up, many of them disappeared.
Installing cups-2.1.3_2...
pkg-static: cups-2.1.3_2 conflicts with cups-client-2.0.3_2 (installs files
into the same place). Problematic file: /usr/local/bin/cups-config
*** Error code 70
The problem is that there is no cups-client port anymore, so I can't cd to
it and make deinstall.
...
See https://svnweb.freebsd.org/ports/head/UPDATING?revision=414898&view=markup
the entry for 20160311

Does this help?

matthias
--
Matthias Apitz, ✉ ***@unixarea.de, ⌂ http://www.unixarea.de/ ☎ +49-176-38902045
8 мая 1945: Спасибо, Советского Союза! -- May 8, 1945: Thank you, Soviet Union!
Anton Sayetsky
2016-05-10 19:11:13 UTC
Permalink
Post by Mario Lobo
Post by Mario Lobo
Post by Mario Lobo
So, is there a way to tell pkg just to delete the package WITHOUT
deleting
Post by Mario Lobo
the dependent ports? If not, is there a way for me to remove just the
cups-client port? Or just force cups to get installed (make
FORCE_PKG_REGISTER=yes install issues the same problem as plain make
above)?
pkg delete -f cups-client
Cheers,
Matthew
Thanks Anton but I DID RTFM, but i expected to find the answer in the
Please, read messages carefully. You did NOT read required manpage.
"man pkg" is WRONG, and I said about "man pkg-***delete***".
Evidence follows:
***@cs0:~$ man pkg-delete | col -bx | egrep -A3 '\-f,'
-f, --force
Forces packages to be removed despite leaving unresolved
dependencies. In combination with the -a or --all flag,
causes pkg(8) to be removed as well as all other packages.
***@cs0:~$
Brandon J. Wandersee
2016-05-10 20:27:11 UTC
Permalink
Post by Matthew Seaman
Post by Mario Lobo
So, is there a way to tell pkg just to delete the package WITHOUT deleting
the dependent ports? If not, is there a way for me to remove just the
cups-client port? Or just force cups to get installed (make
FORCE_PKG_REGISTER=yes install issues the same problem as plain make above)?
pkg delete -f cups-client
Cheers,
Matthew
From the pkg-delete(8) man page:

| -f, --force
| Forces packages to be removed despite leaving unresolved
| dependencies. In combination with the -a or --all flag,
| causes pkg(8) to be removed as well as all other packages.

Correct me if I'm wrong, but that bit about "despite leaving unresolved
dependencies" is not inconsequential. Yes, it will allow Mario to
upgrade one port, but will also essentially leave all those ports with
recorded dependencies on outdated cups-* packages unresolvable, won't
it? That is, when it comes time to upgrade other ports pkg(8) will
then complain that dependencies of those ports can't be resolved, won't
it?

If not, then what of all the ports that depended on the previous version
of cups *and* the manner in which it and its components were previously
packaged? Isn't it best to state that rebuilding the whole "package
chain" will ensure it's intact, while forcibly removing one link in that
chain will possibly break the whole thing?

I could be wrong. I have to admit that I don't know all the ins-and-outs
of pkg(8), but (if I may be blunt) the conventional wisdom I learned
from my Arch Linux days was "Don't ever use 'pacman --force' unless you
know what you're doing---and if you think using 'pacman --force' is a
good idea, you don't know what you're doing."
--
:: Brandon J. Wandersee
:: ***@gmail.com
:: --------------------------------------------------
:: 'The best design is as little design as possible.'
:: --- Dieter Rams ----------------------------------
Mario Lobo
2016-05-11 11:47:54 UTC
Permalink
On Tue, 10 May 2016 15:27:11 -0500
Post by Brandon J. Wandersee
Post by Matthew Seaman
Post by Mario Lobo
So, is there a way to tell pkg just to delete the package WITHOUT
deleting the dependent ports? If not, is there a way for me to
remove just the cups-client port? Or just force cups to get
installed (make FORCE_PKG_REGISTER=yes install issues the same
problem as plain make above)?
pkg delete -f cups-client
Cheers,
Matthew
| -f, --force
| Forces packages to be removed despite leaving unresolved
| dependencies. In combination with the -a or --all flag,
| causes pkg(8) to be removed as well as all other
packages.
Correct me if I'm wrong, but that bit about "despite leaving
unresolved dependencies" is not inconsequential. Yes, it will allow
Mario to upgrade one port, but will also essentially leave all those
ports with recorded dependencies on outdated cups-* packages
unresolvable, won't it? That is, when it comes time to upgrade other
ports pkg(8) will then complain that dependencies of those ports
can't be resolved, won't it?
Yes! It will! But I desperately needed to print something so I had to
make it work. I will deal with the dependencies later.
Post by Brandon J. Wandersee
I could be wrong. I have to admit that I don't know all the
ins-and-outs of pkg(8), but (if I may be blunt) the conventional
wisdom I learned from my Arch Linux days was "Don't ever use 'pacman
--force' unless you know what you're doing---and if you think using
'pacman --force' is a good idea, you don't know what you're doing."
Right! It is not a good idea but I had to.
--
Mario Lobo
http://www.mallavoodoo.com.br
FreeBSD since 2.2.8 [not Pro-Audio.... YET!!]

"UNIX was not designed to stop you from doing stupid things,
because that would also stop you from doing clever things."
Matthias Apitz
2016-05-11 11:56:37 UTC
Permalink
Post by Mario Lobo
Post by Brandon J. Wandersee
I could be wrong. I have to admit that I don't know all the
ins-and-outs of pkg(8), but (if I may be blunt) the conventional
wisdom I learned from my Arch Linux days was "Don't ever use 'pacman
--force' unless you know what you're doing---and if you think using
'pacman --force' is a good idea, you don't know what you're doing."
Right! It is not a good idea but I had to.
I compile all my ~1800 packages on some other host with poudriere and
install them from time to time from my own repository with:

# pkg delete -a
# pkg delete -f pkg
# pkg-static install ...

This works nice, fast and clean.

matthias
--
Matthias Apitz, ✉ ***@unixarea.de, ⌂ http://www.unixarea.de/ ☎ +49-176-38902045
8 мая 1945: Спасибо, Советского Союза! -- May 8, 1945: Thank you, Soviet Union!
Mario Lobo
2016-05-11 12:26:01 UTC
Permalink
On Wed, 11 May 2016 13:56:37 +0200
El día Wednesday, May 11, 2016 a las 08:47:54AM -0300, Mario Lobo
Post by Mario Lobo
Post by Brandon J. Wandersee
I could be wrong. I have to admit that I don't know all the
ins-and-outs of pkg(8), but (if I may be blunt) the conventional
wisdom I learned from my Arch Linux days was "Don't ever use
'pacman --force' unless you know what you're doing---and if you
think using 'pacman --force' is a good idea, you don't know what
you're doing."
Right! It is not a good idea but I had to.
I compile all my ~1800 packages on some other host with poudriere and
# pkg delete -a
# pkg delete -f pkg
# pkg-static install ...
This works nice, fast and clean.
matthias
Thanks Matthias!

This is something I'll definitely be doing.
--
Mario Lobo
http://www.mallavoodoo.com.br
FreeBSD since 2.2.8 [not Pro-Audio.... YET!!]

"UNIX was not designed to stop you from doing stupid things,
because that would also stop you from doing clever things."
Matthias Apitz
2016-05-11 13:22:40 UTC
Permalink
Post by Mario Lobo
Mario Lobo
http://www.mallavoodoo.com.br
FreeBSD since 2.2.8 [not Pro-Audio.... YET!!]
^^^^^^^^^^^^^^^^^^^

I won :-)
--
Matthias Apitz, ✉ ***@unixarea.de, ⌂ http://www.unixarea.de/ ☎ +49-176-38902045
UNIX since V7 on PDP-11 | UNIX on mainframe since ESER 1055 (IBM /370)
UNIX on x86 since SVR4.2 UnixWare 2.1.2 | FreeBSD since 2.2.5
Mario Lobo
2016-05-11 13:33:03 UTC
Permalink
On Wed, 11 May 2016 15:22:40 +0200
El día Wednesday, May 11, 2016 a las 09:26:01AM -0300, Mario Lobo
Post by Mario Lobo
Mario Lobo
http://www.mallavoodoo.com.br
FreeBSD since 2.2.8 [not Pro-Audio.... YET!!]
^^^^^^^^^^^^^^^^^^^
I won :-)
You do indeed :D !
--
Mario Lobo
http://www.mallavoodoo.com.br
FreeBSD since 2.2.8 [not Pro-Audio.... YET!!]

"UNIX was not designed to stop you from doing stupid things,
because that would also stop you from doing clever things."
Steve O'Hara-Smith
2016-05-11 13:26:20 UTC
Permalink
On Wed, 11 May 2016 15:22:40 +0200
El día Wednesday, May 11, 2016 a las 09:26:01AM -0300, Mario Lobo
Post by Mario Lobo
Mario Lobo
http://www.mallavoodoo.com.br
FreeBSD since 2.2.8 [not Pro-Audio.... YET!!]
Newcomers :) FreeBSD since 1.1.5 (Jordan gave me a 1.1 disc but I
never used it, I'd already got 1.1.5 installed).
--
Steve O'Hara-Smith <***@sohara.org>
Matthias Apitz
2016-06-06 08:32:58 UTC
Permalink
Post by Matthias Apitz
I compile all my ~1800 packages on some other host with poudriere and
# pkg delete -a
# pkg delete -f pkg
# pkg-static install ...
This works nice, fast and clean.
matthias
In addition to the procedure above, I did this time before the deletion
of all packages:

# pkg query '%a %n' | fgrep '0 ' | sed 's/0 //' > what-I-have-installed.txt

this gives you in the file what-I-have-installed.txt a list of what you
have installed, i.e. without dependency packages;

later you just run this list from a script

# sh
# while read name; do
pkg install -y $name
done < what-I-have-installed.txt

and you have all back again as before;

matthias
--
Matthias Apitz, ✉ ***@unixarea.de, ⌂ http://www.unixarea.de/ ☎ +49-176-38902045
"Die Verkaufsschlager des Buchmarkts geben Auskunft über den Zustand einer Gesellschaft bzw.
sind, was diese Zeiten angeht, Gradmesser fortschreitenden Schwachsinns. ..." (jW 19.05.2016)
Matthew Seaman
2016-06-07 13:38:37 UTC
Permalink
Post by Matthias Apitz
# pkg query '%a %n' | fgrep '0 ' | sed 's/0 //' > what-I-have-installed.txt
This is more usually spelled as:

# pkg query -e '%a == 0' %n > what-I-have-installed.txt

Cheers,

Matthew

Loading...