精确穿山甲上的 sqlite3:已安装但未找到?

精确穿山甲上的 sqlite3:已安装但未找到?
vagrant@precise64:~$ sudo apt-get install sqlite3
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  libsqlite3-0
Suggested packages:
  sqlite3-doc
The following NEW packages will be installed:
  sqlite3
The following packages will be upgraded:
  libsqlite3-0
1 upgraded, 1 newly installed, 0 to remove and 147 not upgraded.
Need to get 375 kB of archives.
After this operation, 174 kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://us.archive.ubuntu.com/ubuntu/ precise-updates/main libsqlite3-0 amd
64 3.7.9-2ubuntu1.1 [349 kB]
Get:2 http://us.archive.ubuntu.com/ubuntu/ precise-updates/main sqlite3 amd64 3.
7.9-2ubuntu1.1 [26.8 kB]
Fetched 375 kB in 0s (413 kB/s)
(Reading database ... 59795 files and directories currently installed.)
Preparing to replace libsqlite3-0 3.7.9-2ubuntu1 (using .../libsqlite3-0_3.7.9-2
ubuntu1.1_amd64.deb) ...
Unpacking replacement libsqlite3-0 ...
Selecting previously unselected package sqlite3.
Unpacking sqlite3 (from .../sqlite3_3.7.9-2ubuntu1.1_amd64.deb) ...
Processing triggers for man-db ...
Setting up libsqlite3-0 (3.7.9-2ubuntu1.1) ...
Setting up sqlite3 (3.7.9-2ubuntu1.1) ...
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
vagrant@precise64:~$ sqlite
**The program 'sqlite' is currently not installed.**  You can install it by typing:
sudo apt-get install sqlite
vagrant@precise64:~$ cd ..
vagrant@precise64:/home$ cd ..
vagrant@precise64:/$ sqlite
The program 'sqlite' is currently not installed.  You can install it by typing:
sudo apt-get install sqlite
vagrant@precise64:/$ pwd
/
vagrant@precise64:/$ cd etc
vagrant@precise64:/etc$ sqlite
The program 'sqlite' is currently not installed.  You can install it by typing:
sudo apt-get install sqlite
vagrant@precise64:/etc$ cd ..
vagrant@precise64:/$ cd var
vagrant@precise64:/var$ sqlite
The program 'sqlite' is currently not installed.  You can install it by typing:
sudo apt-get install sqlite
vagrant@precise64:/var$ find sqlite
find: `sqlite': No such file or directory
vagrant@precise64:/var$ find sqlite3
find: `sqlite3': No such file or directory
vagrant@precise64:/var$

怎么回事?谢谢。

答案1

sqlite并且sqlite3是同一程序的两个不同、不兼容的版本。

sqlite适用于 SQLite 数据库版本 2。sqlite3适用于 SQLite 数据库版本 3。 之所以有两个版本,是因为数据库格式在版本 2 和版本 3 之间发生了变化,所以这两种格式不兼容。

如果您安装了该sqlite3软件包,则需要使用该sqlite3命令。 如果您安装了该sqlite软件包,则需要使用该sqlite命令。

另外需要注意的是,二进制文件安装在/bin或中/usr/bin,而不是 中/var,后者通常用于程序数据。您还需要使用 命令which,它会根据您的 打印命令的位置$PATH。运行which sqlite3会返回/usr/bin/sqlite3

相关内容