WhitewaterFoundry / Fedora-Remix-for-WSL

Fedora Remix for Windows Subsystem for Linux.
Other
696 stars 51 forks source link

dnf check-update fails when a regular user run it #131

Open liusen373 opened 2 years ago

liusen373 commented 2 years ago

Describe the bug dnf check-update fails when a regular user run it

To Reproduce Steps to reproduce the behavior:

  1. Using Windows 10 and WSL1 install 34.5.6.0 Final from the releases
  2. Create a user
  3. Login
  4. run dnf check-update
  5. see errors
error: sqlite failure: CREATE TABLE IF NOT EXISTS 'Packages' (hnum INTEGER PRIMARY KEY AUTOINCREMENT,blob BLOB NOT NULL): attempt to write a readonly database
error: cannot open Packages index using sqlite - No such file or directory (2)
error: cannot open Packages database in /var/lib/rpm
Error: Error: rpmdb open failed

Expected behavior

dnf works fine

Screenshots 图片

Additional context Add any other context about the problem here.

Basic Troubleshooting Checklist

[x] I have searched Google for the error message. [x] I have checked official WSL troubleshooting documentation: https://docs.microsoft.com/en-us/windows/wsl/troubleshooting#confirm-wsl-is-enabled. [x] I have searched the official Microsoft WSL issues page: https://github.com/Microsoft/WSL/issues. [x] I have searched the WLinux issues page: https://github.com/WhitewaterFoundry/WLinux/issues. [x] I have reset WLinux: Settings->Apps->Apps & features->WLinux->Advanced Options->Reset. [x] I have disabled and re-enabled WSL in Windows Features. [x] I have run Windows 10 updates and restarted.

What other troubleshooting have you attempted?

  1. remove and reinstall Fedora-Remix-for-WSL

WLinux Version

Find: Settings->Apps->Apps & features->WLinux->Advanced Options->Version.

图片

Windows Build

Run 'systeminfo | findstr /C:"OS"' in Command Prompt and insert here:

OS ??:          Microsoft Windows 10 ???
OS ??:          10.0.19043 ?? Build 19043
OS ???:        Microsoft Corporation
OS ??:          ?????
OS ????:      Multiprocessor Free
BIOS ??:        Dell Inc. 2.16.0, 2021/6/9
crramirez commented 2 years ago

Hello @liusen373,

You should run this command as root: sudo dnf check-update. Since Fedora 33 they have migrated the RPM database from BerkeleyDB to SQLLite and now you need elevated permissions to read the database.

Regards, Carlos

TeamChocolate commented 2 years ago

For anyone getting this error sqlite failure when using yum install etc, after running command @crramirez mentioned; sudo dnf check-update

Then run sudo dnf upgrade

And choose Y to install the packages, then yum worked for me

liusen373 commented 2 years ago

Hello @liusen373,

You should run this command as root: sudo dnf check-update. Since Fedora 33 they have migrated the RPM database from BerkeleyDB to SQLLite and now you need elevated permissions to read the database.

Regards, Carlos

When using Fedora 33 and Fedora 34, dnf check-update command dont require root permission.

liusen373 commented 2 years ago

When using Fedora Remix, if I first run sudo dnf update, then dnf check-update command works fine. But if I run dnf check-update command directly, It may fail.

crramirez commented 2 years ago

@liusen373 Ok good to know.

When did you say Fedora 33 and Fedora 34 you mean in bare metal?

liusen373 commented 2 years ago

@liusen373 Ok good to know.

When did you say Fedora 33 and Fedora 34 you mean in bare metal?

A normal Fedora(linux) system, not Fedora-Remix-for-WSL.

Only some (not all) dnf sub-commands require root permission.

timjim333 commented 2 years ago

Just to add, you get the same error as the OP on running dnf search, which now works by running sudo dnf search. Not a very intuitive error!