Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't update because of issue with vim-enhanced #115

Closed
Zlopez opened this issue Dec 13, 2020 · 24 comments
Closed

Can't update because of issue with vim-enhanced #115

Zlopez opened this issue Dec 13, 2020 · 24 comments

Comments

@Zlopez
Copy link

Zlopez commented Dec 13, 2020

Hi,

I tried to update my machine today with rpm-ostree update and I`m getting this output:

Already up to date.
1 metadata, 0 content objects fetched; 592 B transferred in 2 seconds; 0 bytes content written
Checking out tree fd39645... done
Enabled rpm-md repositories: fedora-cisco-openh264 updates fedora updates-archive
rpm-md repo 'fedora-cisco-openh264' (cached); generated: 2020-08-25T19:10:34Z
rpm-md repo 'updates' (cached); generated: 2020-12-13T02:00:07Z
rpm-md repo 'fedora' (cached); generated: 2020-10-19T23:27:19Z
rpm-md repo 'updates-archive' (cached); generated: 2020-12-13T02:59:13Z
Importing rpm-md... done
Resolving dependencies... done
Applying 1 override and 240 overlays
Processing packages... done
error: Checkout vim-enhanced-2:8.2.2115-1.fc33.x86_64: Hardlinking ab/4a0895ca254af3b2723cd907c171e9eb41aad71ba821f90b68e4afe9cb9918.file to vim.sh: File exists

This is the output of rpm-ostree status:

State: idle
Deployments:
● ostree://fedora:fedora/33/x86_64/silverblue
                   Version: 33.20201210.0 (2020-12-10T00:51:13Z)
                BaseCommit: fd39645fcf9da4279bd89bb9c8c5b020d31bc94bcbcb76bd33efa2795e1defe3
              GPGSignature: Valid signature by 963A2BEB02009608FE67EA4249FD77499570FF31
       RemovedBasePackages: firefox 83.0-13.fc33
           LayeredPackages: ansible emacs fish gnome-shell-extension-appindicator powerline powerline-fonts smartmontools tmux tmux-powerline traceroute vagrant vagrant-sshfs vim vim-powerline

  ostree://fedora:fedora/33/x86_64/silverblue
                   Version: 33.20201209.0 (2020-12-09T01:04:50Z)
                BaseCommit: 8b7c2dab53ce0a7033811f58bbe6fd12f8dce498bd8ee9eb2906eaed1910d4e1
              GPGSignature: Valid signature by 963A2BEB02009608FE67EA4249FD77499570FF31
       RemovedBasePackages: firefox 83.0-13.fc33
           LayeredPackages: ansible emacs fish gnome-shell-extension-appindicator powerline powerline-fonts smartmontools tmux tmux-powerline traceroute vagrant vagrant-sshfs vim vim-powerline

I noticed, that I have the vim layered, but when trying to uninstall it with rpm-ostree uninstall vim I'm getting similar output as on rpm-ostree update:

Checking out tree fd39645... done
Resolving dependencies... done
Applying 1 override and 240 overlays
Processing packages... done
error: Checkout vim-enhanced-2:8.2.2115-1.fc33.x86_64: Hardlinking ab/4a0895ca254af3b2723cd907c171e9eb41aad71ba821f90b68e4afe9cb9918.file to vim.sh: File exists
@tpopela
Copy link
Contributor

tpopela commented Dec 14, 2020

This reminds me coreos/rpm-ostree#2231 that was supposed to be addressed in https://github.com/ostreedev/ostree/releases/tag/v2020.7 (that's already part of Silverblue 33). Any idea @cgwalters ?

@tpopela
Copy link
Contributor

tpopela commented Dec 14, 2020

I actually tried to run the upgrade on my machine and I can reproduce it as well.

@Zlopez
Copy link
Author

Zlopez commented Dec 14, 2020

I can confirm that this is also happening on my second machine running Silverblue. Layered packages are identical.

@Verhoeckx
Copy link

I have the exact same issue.
Let me know if there is something I could do.

@TheOneandOnlyJakfrost
Copy link

TheOneandOnlyJakfrost commented Dec 14, 2020

I am victim to this as well. I had to uninstall vim-enhanced to allow the update to complete without erroring. Which it did complete, but now I get the same error when I try to re-install vim-enhanced, so no joy here.
[edit] Error from rpm-ostree
error: Checkout vim-enhanced-2:8.2.2115-1.fc33.x86_64: Hardlinking ab/4a0895ca254af3b2723cd907c171e9eb41aad71ba821f90b68e4afe9cb9918.file to vim.sh: File exists
Output from whereis vim.sh
vim: /usr/share/vim

@Verhoeckx
Copy link

What I do not understand: why is vim not part of the base image? Is it not one of the two main text editors on Linux (Vim and Emacs)? I know it's not part of the normal Fedora workstation either but again, in my opinion it should be.

@travier
Copy link
Member

travier commented Dec 14, 2020

@TheOneandOnlyJakfrost
Copy link

Vi still works, so the vim-core which is part of the base installation of SB is still working.

@travier
Copy link
Member

travier commented Dec 14, 2020

As both packages now both ship the same files, rpm-ostree will not allow them to be installed at the same time (nor DNF would). In this case, you need to replace vim-minimal by vim-enhanced in a single call. I'm looking for the exact command.

@travier
Copy link
Member

travier commented Dec 14, 2020

Can you try:

$ sudo rpm-ostree override remove vim-minimal --install vim-enhanced

@TheOneandOnlyJakfrost
Copy link

TheOneandOnlyJakfrost commented Dec 14, 2020

trying it now, it seems to be working, I'll let you know how the reboot works.

@travier
Copy link
Member

travier commented Dec 14, 2020

If you are upgrading: remove vim-enhanced, upgrade, re-add vim-enhanced as described above.

@TheOneandOnlyJakfrost
Copy link

It works as described by @travier,
I now have my vim back!

@Zlopez
Copy link
Author

Zlopez commented Dec 14, 2020

@travier Your solution is working. Just one question, do you need sudo for this?

@travier
Copy link
Member

travier commented Dec 14, 2020

Just one question, do you need sudo for this?

You probably don't need it in the common case (admin user logged on an active seat / graphical session).

@djasa
Copy link

djasa commented Dec 14, 2020

The solution by @travier:

$ sudo rpm-ostree override remove vim-minimal --install vim-enhanced

is a good workaround as long as you don't need something that depends on /usr/bin/vi which is provided by vim-minimal. :(

$ rpm-ostree install libguestfs-tools
Checking out tree fd39645... done
Enabled rpm-md repositories: fedora-cisco-openh264 updates fedora updates-archive
rpm-md repo 'fedora-cisco-openh264' (cached); generated: 2020-08-25T19:10:34Z
rpm-md repo 'updates' (cached); generated: 2020-12-14T00:43:12Z
rpm-md repo 'fedora' (cached); generated: 2020-10-19T23:27:19Z
rpm-md repo 'updates-archive' (cached); generated: 2020-12-14T01:37:17Z
Importing rpm-md... done
Resolving dependencies... done
error: Could not depsolve transaction; 1 problem detected:
 Problem: package libguestfs-tools-1:1.43.2-2.fc33.noarch requires libguestfs-tools-c = 1:1.43.2-2.fc33, but none of the providers can be installed
  - package libguestfs-tools-c-1:1.43.2-2.fc33.x86_64 requires /usr/bin/vi, but none of the providers can be installed
  - conflicting requests

Either vim subpackages should stop conflicting each other or vim-enhanced should provide /usr/bin/vi so it's drop-in replacement.

@travier:

(nor DNF would).

Well, why vim-minimal & vim-enhanced did not conflict up to 8.2.2115-2 then?

@travier
Copy link
Member

travier commented Dec 14, 2020

This is indeed strange as I have both vim-enhanced and vim-minimal installed in a toolbox so I have probably misunderstood the issue here.

@jlebon
Copy link
Member

jlebon commented Dec 14, 2020

This is probably another instance of https://src.fedoraproject.org/rpms/nfs-utils/pull-request/9#comment-59201. (I.e. no relationship between vim-enhanced and vim-minimal means you can install mismatched versions of both. And since they would both try to install a separate version of vim.sh, rpm-ostree/dnf complains.)

@jlebon
Copy link
Member

jlebon commented Dec 14, 2020

Reproduced this in my pet container:

$ sudo dnf install vim-minimal-8.2.2143-1.fc33.x86_64.rpm
...
Dependencies resolved.
==================================================================================================================================================================================================================================================================================
 Package                                                           Architecture                                                 Version                                                                  Repository                                                          Size
==================================================================================================================================================================================================================================================================================
Upgrading:
 vim-minimal                                                       x86_64                                                       2:8.2.2143-1.fc33                                                        @commandline                                                       682 k

Transaction Summary
==================================================================================================================================================================================================================================================================================
Upgrade  1 Package

Total size: 682 k
Is this ok [y/N]: y
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Error: Transaction test error:
  file /etc/profile.d/vim.sh from install of vim-minimal-2:8.2.2143-1.fc33.x86_64 conflicts with file from package vim-enhanced-2:8.2.2072-1.fc33.x86_64

@travier
Copy link
Member

travier commented Dec 14, 2020

@djasa
Copy link

djasa commented Dec 14, 2020

Ah! The versions of vim-minimal from base image and vim-enhanced from repos do not match. So installing specific version of vim-enhanced helps for now:

$ rpm-ostree install vim-enhanced-8.2.2072-1.fc33.x86_64
Checking out tree fd39645... done
Enabled rpm-md repositories: fedora-cisco-openh264 updates fedora updates-archive
rpm-md repo 'fedora-cisco-openh264' (cached); generated: 2020-08-25T19:10:34Z
rpm-md repo 'updates' (cached); generated: 2020-12-14T00:43:12Z
rpm-md repo 'fedora' (cached); generated: 2020-10-19T23:27:19Z
rpm-md repo 'updates-archive' (cached); generated: 2020-12-14T01:37:17Z
Importing rpm-md... done
Resolving dependencies... done
Will download: 2 packages (8.8 MB)
Downloading from 'updates-archive'... done
Importing packages... done
Checking out packages... done
Running pre scripts... done
Running post scripts... done
Running posttrans scripts... done
Writing rpmdb... done
Writing OSTree commit... done
Staging deployment... done
Freed: 56.4 MB (pkgcache branches: 0)
Downgraded:
  vim-common 2:8.2.2115-1.fc33 -> 2:8.2.2072-1.fc33
  vim-enhanced 2:8.2.2115-1.fc33 -> 2:8.2.2072-1.fc33
Added:
  vim-minimal-2:8.2.2072-1.fc33.x86_64
Run "systemctl reboot" to start a reboot

but it will blow up once vim-minimal in the base image gets updated:

$ rpm-ostree status
State: idle
AutomaticUpdates: stage; rpm-ostreed-automatic.timer: no runs since boot
Deployments:
  ostree://fedora:fedora/33/x86_64/silverblue
                   Version: 33.20201210.0 (2020-12-10T00:51:13Z)
                BaseCommit: fd39645fcf9da4279bd89bb9c8c5b020d31bc94bcbcb76bd33efa2795e1defe3
              GPGSignature: Valid signature by 963A2BEB02009608FE67EA4249FD77499570FF31
                      Diff: 2 downgraded, 1 added
           LayeredPackages: ansible fprintd fprintd-pam gnome-boxes gnome-tweak-tool gstreamer1-plugins-ugly-free
                            ipa-client krb5-workstation libfprint libguestfs libvirt-client
                            vim-enhanced-8.2.2072-1.fc33.x86_64 virt-viewer

Isn't it a dependency resolution issue by rpm-ostree after all?

@Verhoeckx
Copy link

I run the command 'rpm-ostree override remove vim-minimal --install vim-enhanced' and can confirm that it works!
Thanks!!

@jlebon
Copy link
Member

jlebon commented Dec 14, 2020

Isn't it a dependency resolution issue by rpm-ostree after all?

FWIW, dnf and rpm-ostree use the same dependency solver (libsolv) :).

I think the easiest fix for this is to make vim-common pull in vim-minimal? Then vim-enhanced and vim-minimal will naturally be EVRA-bound (and otherwise fail dep solving).

Another way is to do something like this in vim-minimal (short of a != operator):

Conflicts: %{name}-enhanced < %{version}-%{release}
Conflicts: %{name}-enhanced > %{version}-%{release}

For now, as noted above, as long as you make sure that you're pulling in the same version of both, it should be fine (which should be the case if you're upgrading to the latest versions available and not pinning to a specific NEVRA of either).

@tpopela
Copy link
Contributor

tpopela commented Dec 15, 2020

I was able to update without any workaround needed today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants