How to remove a package with zypper without losing other packages?
I want to remove jdk-16 and install jdk-17. | ~ |● zypper se -i jdk-16 |Loading repository data... |Reading installed packages... | |S | Name | Summary | Type |---+------------+------------------------------------------------+-------- |i+ | jdk-16.0.1 | Java Platform Standard Edition Development Kit | package |@18:00:29,root@pinto rc=0 |~ |● zypper rm jdk-16.0.1 |Reading installed packages... |Resolving package dependencies... | |The following 4 packages are going to be REMOVED: | jdk-16.0.1 liblayout libreoffice-base pentaho-reporting-flow-engine |4 packages to remove. |After the operation, 306.1 MiB will be freed. |Continue? [y/n/v/...? shows all options] (y): n |@18:00:35,root@pinto rc=4 Notice that (particularly) libreoffice-base will be removed. I want to keep that. zypper help rm says, |~ |● zypper help rm |remove (rm) [OPTIONS] <CAPABILITY> ... | |Remove packages with specified capabilities. A capability is NAME[.ARCH][OP<VERSION>], where OP is |one of <, <=, =, >=, >. | | Command options: | |-t, --type <TYPE> Type of package (package, patch, pattern, product). |-n, --name Select packages by plain name, not by capability. Default: false |-C, --capability Select packages solely by capability. Default: false | --details Show the detailed installation summary. Default: false |-r, --repo <ALIAS|#|URI> Work only with the specified repository. |-y, --no-confirm Don't require user interaction. Alias for the --non-interactive global |option. Default: false |-D, --dry-run Don't change anything, just report what would be done. A meaningful file | conflict check can only be performed if used together with | '--download-only'. Default: false |-u, --clean-deps Automatically remove unneeded dependencies. |-U, --no-clean-deps No automatic removal of unneeded dependencies. | | Solver options | | --debug-solver Create a solver test case for debugging. | --force-resolution Force the solver to find a solution (even an aggressive one) rather than | asking. |-R, --no-force-resolution Do not force the solver to find a solution, let it ask. | --solver-focus <MODE> Set the solvers general attitude when resolving a job. | |@18:05:03,root@pinto rc=0 Are the additional packages to be removed "unneeded dependencies"? If not, how do I tell zypper to keep them? Leslie -- Distribution: openSUSE Leap 15.3 x86_64
On Fri, Sep 24, 2021 at 6:11 PM J Leslie Turriff <jlturriff@mail.com> wrote:
I want to remove jdk-16 and install jdk-17.
| ~ |● zypper se -i jdk-16
I believe that "rpm -e -f jdk-16" would do the trick. Libreoffice really
does need a java, though, from what I understand, so tread carefully. -Nick
On 25/09/2021 01.10, J Leslie Turriff wrote:
I want to remove jdk-16 and install jdk-17.
| ~ |● zypper se -i jdk-16 |Loading repository data... |Reading installed packages... | |S | Name | Summary | Type |---+------------+------------------------------------------------+-------- |i+ | jdk-16.0.1 | Java Platform Standard Edition Development Kit | package |@18:00:29,root@pinto rc=0 |~ |● zypper rm jdk-16.0.1 |Reading installed packages... |Resolving package dependencies... | |The following 4 packages are going to be REMOVED: | jdk-16.0.1 liblayout libreoffice-base pentaho-reporting-flow-engine
|4 packages to remove. |After the operation, 306.1 MiB will be freed. |Continue? [y/n/v/...? shows all options] (y): n |@18:00:35,root@pinto rc=4
Notice that (particularly) libreoffice-base will be removed. I want to keep that. zypper help rm says,
Don't remove jdk, libreoffice needs it. You can not remove jdk-16 and then install jdk-17, instead you have to upgrade jdk-16 to jdk-17 in one operation. -- Cheers / Saludos, Carlos E. R. (from oS Leap 15.2 x86_64 (Minas Tirith))
On 2021-09-24 18:32:55 Carlos E. R. wrote:
|On 25/09/2021 01.10, J Leslie Turriff wrote: |> I want to remove jdk-16 and install jdk-17. |> |> | ~ |> |● zypper se -i jdk-16 |> |Loading repository data... |> |Reading installed packages... |> | |> |S | Name | Summary | Type |> |---+------------+------------------------------------------------+----- |> |--- i+ | jdk-16.0.1 | Java Platform Standard Edition Development Kit | |> | package @18:00:29,root@pinto rc=0 |> |~ |> |● zypper rm jdk-16.0.1 |> |Reading installed packages... |> |Resolving package dependencies... |> | |> |The following 4 packages are going to be REMOVED: |> | jdk-16.0.1 liblayout libreoffice-base pentaho-reporting-flow-engine |> | |> |4 packages to remove. |> |After the operation, 306.1 MiB will be freed. |> |Continue? [y/n/v/...? shows all options] (y): n |> |@18:00:35,root@pinto rc=4 |> |> Notice that (particularly) libreoffice-base will be removed. I want to |> keep that. zypper help rm says, | |Don't remove jdk, libreoffice needs it. | |You can not remove jdk-16 and then install jdk-17, instead you have to |upgrade jdk-16 to jdk-17 in one operation.
So, | ~ | ● zypper se -is jdk | Loading repository data... | Reading installed packages... | | S | Name | Type | Version | Arch | Repository | ---+--------------------------+---------+------------------+--------+------------------------------------------------------------- | i | java-11-openjdk | package | 11.0.12.0-3.59.1 | x86_64 | Update repository with updates from SUSE Linux Enterprise 15 | i | java-11-openjdk-headless | package | 11.0.12.0-3.59.1 | x86_64 | Update repository with updates from SUSE Linux Enterprise 15 | i+ | jdk-16.0.1 | package | 2000:16.0.1-ga | x86_64 | Local | @19:24:36,root@pinto rc=0 | ~ | ● zypper up -D -r Local jdk | Loading repository data... | Reading installed packages... | 'jdk' not found in package names. Trying capabilities. | Resolving package dependencies... | Nothing to do. | @19:24:43,root@pinto rc=0 | ~ | ● zypper up -D -r Local jdk-16 | Loading repository data... | Reading installed packages... | 'jdk-16' not found in package names. Trying capabilities. | No provider of 'jdk-16' found. | Resolving package dependencies... | Nothing to do. | @19:24:46,root@pinto rc=104 | ~ | ● zypper up -D -r Local jdk-16.0.1 | Loading repository data... | Reading installed packages... | No update candidate for 'jdk-16.0.1-2000:16.0.1-ga.x86_64'. The highest available version is already installed. | Resolving package dependencies... | Nothing to do. | @19:24:50,root@pinto rc=0 but, | ~ | ● ls -l /usr/local/RPMrepository/jdk* | -rw-r--r--+ 1 leslie users 166M 2021-06-25 04:57 /usr/local/RPMrepository/jdk-14.0.2_linux-x64_bin.rpm | -rw-r--r--+ 1 leslie users 153M 2021-06-24 18:25 /usr/local/RPMrepository/jdk-16.0.1_linux-x64_bin.rpm | -rw-r--r--+ 1 leslie users 155M 2021-09-24 17:52 /usr/local/RPMrepository/jdk-17_linux-x64_bin.rpm | @19:26:51,root@pinto rc=0 Leslie -- Distribution: openSUSE Leap 15.3 x86_64
On 25/09/2021 02.29, J Leslie Turriff wrote:
On 2021-09-24 18:32:55 Carlos E. R. wrote:
|On 25/09/2021 01.10, J Leslie Turriff wrote: |> I want to remove jdk-16 and install jdk-17. |> |> | ~ |> |● zypper se -i jdk-16 |> |Loading repository data... |> |Reading installed packages... |> | |> |S | Name | Summary | Type |> |---+------------+------------------------------------------------+----- |> |--- i+ | jdk-16.0.1 | Java Platform Standard Edition Development Kit | |> | package @18:00:29,root@pinto rc=0 |> |~ |> |● zypper rm jdk-16.0.1 |> |Reading installed packages... |> |Resolving package dependencies... |> | |> |The following 4 packages are going to be REMOVED: |> | jdk-16.0.1 liblayout libreoffice-base pentaho-reporting-flow-engine |> | |> |4 packages to remove. |> |After the operation, 306.1 MiB will be freed. |> |Continue? [y/n/v/...? shows all options] (y): n |> |@18:00:35,root@pinto rc=4 |> |> Notice that (particularly) libreoffice-base will be removed. I want to |> keep that. zypper help rm says, | |Don't remove jdk, libreoffice needs it. | |You can not remove jdk-16 and then install jdk-17, instead you have to |upgrade jdk-16 to jdk-17 in one operation. So, | ~ | ● zypper se -is jdk | Loading repository data... | Reading installed packages... | | S | Name | Type | Version | Arch | Repository | ---+--------------------------+---------+------------------+--------+------------------------------------------------------------- | i | java-11-openjdk | package | 11.0.12.0-3.59.1 | x86_64 | Update repository with updates from SUSE Linux Enterprise 15 | i | java-11-openjdk-headless | package | 11.0.12.0-3.59.1 | x86_64 | Update repository with updates from SUSE Linux Enterprise 15 | i+ | jdk-16.0.1 | package | 2000:16.0.1-ga | x86_64 | Local | @19:24:36,root@pinto rc=0 | ~ | ● zypper up -D -r Local jdk | Loading repository data... | Reading installed packages... | 'jdk' not found in package names. Trying capabilities. | Resolving package dependencies... | Nothing to do. | @19:24:43,root@pinto rc=0
Probably the name is "jdk-16.0.1", so jdk finds nothing. Then you have to find another incantation, like install jdk-17 first. Or use rpm command instead, with --no-deps. -- Saludos/Cheers Carlos E. R.
J Leslie Turriff composed on 2021-09-24 18:10 (UTC-0500):
I want to remove jdk-16 and install jdk-17.
| ~ |● zypper se -i jdk-16 What distro is this about? What repo(s) are these jdks from?
# inxi -Sy System: Host: 00srv Kernel: 5.3.18-lp152.87-default x86_64 bits: 64 Console: tty pts/0 Distro: openSUSE Leap 15.2 # zypper se -s jdk | egrep '16|17' # # inxi -Sy System: Host: fi965 Kernel: 5.3.18-59.5-default x86_64 bits: 64 Console: tty pts/0 Distro: openSUSE Leap 15.3 # zypper se -s jdk | egrep '16|17' # -- Evolution as taught in public schools is, like religion, based on faith, not based on science. Team OS/2 ** Reg. Linux User #211409 ** a11y rocks! Felix Miata
On 2021-09-24 20:31:53 Felix Miata wrote:
|J Leslie Turriff composed on 2021-09-24 18:10 (UTC-0500): |> I want to remove jdk-16 and install jdk-17. |> |> | ~ |> |● zypper se -i jdk-16 | |What distro is this about? What repo(s) are these jdks from? | |# inxi -Sy |System: | Host: 00srv Kernel: 5.3.18-lp152.87-default x86_64 bits: 64 | Console: tty pts/0 Distro: openSUSE Leap 15.2 |# zypper se -s jdk | egrep '16|17' |# |# inxi -Sy |System: | Host: fi965 Kernel: 5.3.18-59.5-default x86_64 bits: 64 | Console: tty pts/0 Distro: openSUSE Leap 15.3 |# zypper se -s jdk | egrep '16|17' |#
Leap 15.3 and Oracle JDK 16 & 17. Leslie -- Distribution: openSUSE Leap 15.3 x86_64
J Leslie Turriff composed on 2021-09-24 18:10 (UTC-0500):
Are the additional packages to be removed "unneeded dependencies"? If not, how do I tell zypper to keep them.
zypper al liblayout libreoffice-base pentaho-reporting-flow-engine rpm -e --nodeps jdk-16.0.1 zypper in jdk-17.0.1 -- Evolution as taught in public schools is, like religion, based on faith, not based on science. Team OS/2 ** Reg. Linux User #211409 ** a11y rocks! Felix Miata
On 25/09/2021 08.15, Felix Miata wrote:
J Leslie Turriff composed on 2021-09-24 18:10 (UTC-0500):
Are the additional packages to be removed "unneeded dependencies"? If not, how do I tell zypper to keep them.
zypper al liblayout libreoffice-base pentaho-reporting-flow-engine rpm -e --nodeps jdk-16.0.1 zypper in jdk-17.0.1
Or, using "yast2 sw_single", repo tab, select the local repo that contains the packages, mark to remove 16, mark to install 17. Or use rpm nodeps to remove 16, and rpm to instal 17. Not zypper. -- Cheers / Saludos, Carlos E. R. (from oS Leap 15.2 x86_64 (Minas Tirith))
On 2021-09-25 05:06:51 Carlos E. R. wrote:
|On 25/09/2021 08.15, Felix Miata wrote: |> J Leslie Turriff composed on 2021-09-24 18:10 (UTC-0500): |>> Are the additional packages to be removed "unneeded dependencies"? If |>> not, how do I tell zypper to keep them. |> |> zypper al liblayout libreoffice-base pentaho-reporting-flow-engine |> rpm -e --nodeps jdk-16.0.1 |> zypper in jdk-17.0.1 | |Or, using "yast2 sw_single", repo tab, select the local repo that |contains the packages, mark to remove 16, mark to install 17. | |Or use rpm nodeps to remove 16, and rpm to instal 17. Not zypper.
Yes, I found that YaST doesn't seem to consider those packages as dependent, so that's what I did. For good measure, afterwards I also did an unconditional update to LibreOffice just to make sure it had no hooks into the old Java. Leslie -- Distribution: openSUSE Leap 15.3 x86_64
participants (5)
-
Carlos E. R.
-
Carlos E.R.
-
Felix Miata
-
J Leslie Turriff
-
Nick LeRoy