Ask Your Question
1

How to recover yum/dnf/rpm after uninstall Sqlite?

asked 2015-09-20 10:11:46 -0600

paladini gravatar image

I removed Anki package from my computer for reinstall purposes and this bad designed package removed a lot of important packages from my Fedora 22, including Sqlite.

Packages that I've accepted to remove

Now my system is broken and I can't run rpm, yum or dnf. I was trying to download sqlite and sqlite3-devel package at RPMFind and it didn't work, because rpm is broken too. What can I do to save my broken system?

When I try to install sqlite via dnf:

[paladini@starstuff Documents]$ sudo dnf install sqlite
error: Failed to initialize NSS library
Traceback (most recent call last):
  File "/bin/dnf", line 35, in <module>
    from dnf.cli import main
  File "/usr/lib/python2.7/site-packages/dnf/__init__.py", line 31, in <module>
    import dnf.base
  File "/usr/lib/python2.7/site-packages/dnf/base.py", line 29, in <module>
    from dnf.yum import history
  File "/usr/lib/python2.7/site-packages/dnf/yum/history.py", line 26, in <module>
    from .sqlutils import sqlite, executeSQL, sql_esc_glob
  File "/usr/lib/python2.7/site-packages/dnf/yum/sqlutils.py", line 26, in <module>
    import sqlite
ImportError: No module named sqlite

When I try to install sqlite module for Python:

[paladini@starstuff Downloads]$ sudo pip install pysqlite
 gcc -pthread -shared -Wl,-z,relro build/temp.linux-x86_64-2.7/src/module.o build/temp.linux-x86_64-2.7/src/connection.o build/temp.linux-x86_64-2.7/src/cursor.o build/temp.linux-x86_64-2.7/src/cache.o build/temp.linux-x86_64-2.7/src/microprotocols.o build/temp.linux-x86_64-2.7/src/prepare_protocol.o build/temp.linux-x86_64-2.7/src/statement.o build/temp.linux-x86_64-2.7/src/util.o build/temp.linux-x86_64-2.7/src/row.o -L/usr/lib64 -lpython2.7 -lsqlite3 -o build/lib.linux-x86_64-2.7/pysqlite2/_sqlite.so
    /bin/ld: cannot find -lsqlite3
    collect2: error: ld returned 1 exit status
    error: command 'gcc' failed with exit status 1

    ----------------------------------------
Command "/usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-wh1uoJ/pysqlite/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-4zXdsz-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-wh1uoJ/pysqlite

When I try to install sqlite via rpm:

[paladini@starstuff Downloads]$ rpm -i sqlite-3.8.11-1.fc22.x86_64.rpm 
error: Failed to initialize NSS library

I also tried to install sqlite from source, but Sqlite don't provide a good way to do that. The "source" version just includes some .h and .c files, nothing more, nothing less. No readme, no makefile. The pre-compiled version just include a "sqlite" executable that I've moved into /usr/bin, without effects.

What can I do? Please, help me! And yes, I can download and make a Fedora LiveCD, just don't know what to do.

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted
3

answered 2015-09-20 11:22:27 -0600

geforce gravatar image

updated 2015-09-20 11:50:05 -0600

Try

   cd /home/paladini/Downloads
   rpm2cpio sqlite-3.8.11-1.fc22.x86_64.rpm | cpio -idmv
   sudo cp -Rp usr/ /
   sudo dnf --best --allowerasing install sqlite.x86_64

It works here ok

[leigh@pc-main Desktop]$ sudo rpm -e sqlite-3.8.10.2-1.fc22.x86_64 --nodeps
[leigh@pc-main Desktop]$ sudo dnf --best --allowerasing install sqlite
error: Failed to initialize NSS library
Traceback (most recent call last):
  File "/bin/dnf", line 35, in <module>
    from dnf.cli import main
  File "/usr/lib/python2.7/site-packages/dnf/__init__.py", line 31, in <module>
    import dnf.base
  File "/usr/lib/python2.7/site-packages/dnf/base.py", line 29, in <module>
    from dnf.yum import history
  File "/usr/lib/python2.7/site-packages/dnf/yum/history.py", line 26, in <module>
    from .sqlutils import sqlite, executeSQL, sql_esc_glob
  File "/usr/lib/python2.7/site-packages/dnf/yum/sqlutils.py", line 26, in <module>
    import sqlite
ImportError: No module named sqlite
[leigh@pc-main Desktop]$ rpm2cpio sqlite-3.8.10.2-1.fc22.x86_64.rpm | cpio -idmv
error: Failed to initialize NSS library
./usr/bin/sqlite3
./usr/lib64/libsqlite3.so.0
./usr/lib64/libsqlite3.so.0.8.6
./usr/share/doc/sqlite
./usr/share/doc/sqlite/README.md
./usr/share/man/man1/sqlite3.1.gz
1847 blocks
[leigh@pc-main Desktop]$ sudo  cp -R usr/ /
[leigh@pc-main Desktop]$ sudo dnf --best --allowerasing install sqlite
Last metadata expiration check performed 0:04:10 ago on Sun Sep 20 17:33:11 2015.
Package sqlite-3.8.10.2-1.fc22.i686 is already installed, skipping.
Dependencies resolved.
================================================================================================================================================================================
 Package                                Arch                                   Version                                            Repository                               Size
================================================================================================================================================================================
Installing:
 sqlite                                 x86_64                                 3.8.10.2-1.fc22                                    updates                                 465 k

Transaction Summary
================================================================================================================================================================================
Install  1 Package

Total download size: 465 k
Installed size: 922 k
Is this ok [y/N]: y
Downloading Packages:
sqlite-3.8.10.2-1.fc22.x86_64.rpm                                                                                                               781 kB/s | 465 kB     00:00    
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                           320 kB/s | 465 kB     00:01     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Installing  : sqlite-3.8.10.2-1.fc22.x86_64                                                                                                                               1/1 
  Verifying   : sqlite-3.8.10.2-1.fc22.x86_64                                                                                                                               1/1 

Installed:
  sqlite.x86_64 3.8.10.2-1.fc22                                                                                                                                                 

Complete!
[leigh@pc-main Desktop]$
edit flag offensive delete link more

Comments

1

This worked! Thank you so much!!! :)

paladini gravatar imagepaladini ( 2015-09-20 12:21:41 -0600 )edit

had a similar issue when doing dnf remove akonadi. not sure how it's possible to uninstall depended-upon packages without specific flags, but here we are... thanks

eddygeek gravatar imageeddygeek ( 2016-05-29 16:31:40 -0600 )edit
0

answered 2016-02-19 15:25:02 -0600

For Fedora 23 x86_64

wget ftp://195.220.108.108/linux/fedora/linux/updates/23/x86_64/s/sqlite-3.10.2-1.fc23.x86_64.rpm rpm2cpio sqlite-3.10.2-1.fc23.x86_64.rpm | cpio -idmv sudo cp -Rp usr/ / sudo dnf --best --allowerasing install sqlite.x86_64

edit flag offensive delete link more

Comments

I have also this problem with F23 y x86_64 but this solution is not working. Console says:

wget: error while loading shared libraries: libuuid.so.1: cannot open shared object file: No such file or directory
cpio: fin prematuro del archivo
davidparracatalan gravatar imagedavidparracatalan ( 2016-03-18 10:08:06 -0600 )edit
0

answered 2016-02-22 04:38:47 -0600

drjan gravatar image

For Fedora 23 and sqlite 3.11 I had to install the sqlite-libs rpm too. Download both packages into a new directory and then run these commands:

rpm2cpio sqlite-3.11.0-1.fc23.x86_64.rpm | cpio -idmv
rpm2cpio sqlite-libs-3.11.0-1.fc23.x86_64.rpm |cpio -idmv
sudo cp -R usr/ /
sudo dnf --best --allowerasing install sqlite

Sorted. Be careful in future how you resolve update conflicts :-)

edit flag offensive delete link more

Comments

Thanks guys I had made same blunder due to geeking without sufficient coffee and this fixed it

cdhgold gravatar imagecdhgold ( 2016-02-25 05:18:47 -0600 )edit

Phew - Uninstalled Midori using dnf and had the same thing happened - you guys saved me.

MtbAllDay gravatar imageMtbAllDay ( 2016-05-03 09:45:51 -0600 )edit

drjan, Thank you SOOO much! These exact steps saved my bacon when I removed docker from my system (F23) and it decided (oh, let's just go ahead and remove sqlite too!). Thanks a TON!!!

atari1050 gravatar imageatari1050 ( 2017-01-21 13:16:21 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2015-09-20 10:11:46 -0600

Seen: 7,124 times

Last updated: Sep 20 '15