当我想在我的AWS机器上安装apt-get install libmagic-dev时,我有这样的错误:
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
libmagic-dev : Depends: libmagic1 (= 1:5.14-2ubuntu3.3) but 1:5.14-2ubuntu3.2 is to be installed
redis-server : Depends: redis-tools (= 2:2.8.4-2) but 3:3.0.4-1chl1~trusty1 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
所以我输入sudo apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following extra packages will be installed:
redis-server
The following packages will be upgraded:
redis-server
1 upgraded, 0 newly installed, 0 to remove and 275 not upgraded.
1 not fully installed or removed.
Need to get 0 B/333 kB of archives.
After this operation, 144 kB of additional disk space will be used.
Do you want to continue? [Y/n] yes
(Reading database ... 69616 files and directories currently installed.)
Preparing to unpack .../redis-server_3%3a3.0.4-1chl1~trusty1_amd64.deb ...
/etc/init.d/redis-server: 16: .: Can't open /etc/rc.d/init.d/functions
invoke-rc.d: initscript redis-server, action "stop" failed.
dpkg: warning: subprocess old pre-removal script returned error exit status 2
dpkg: trying script from the new package instead ...
/etc/init.d/redis-server: 16: .: Can't open /etc/rc.d/init.d/functions
invoke-rc.d: initscript redis-server, action "stop" failed.
dpkg: error processing archive /var/cache/apt/archives/redis-server_3%3a3.0.4-1chl1~trusty1_amd64.deb (--unpack):
subprocess new pre-removal script returned error exit status 2
update-rc.d: warning: /etc/init.d/redis-server missing LSB information
update-rc.d: see <http://wiki.debian.org/LSBInitScripts>
/etc/init.d/redis-server: 16: .: Can't open /etc/rc.d/init.d/functions
invoke-rc.d: initscript redis-server, action "start" failed.
dpkg: error while cleaning up:
subprocess installed post-installation script returned error exit status 2
Errors were encountered while processing:
/var/cache/apt/archives/redis-server_3%3a3.0.4-1chl1~trusty1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
这是一台带有redis-server的Ruby on Rails项目的机器。我做错了什么?
答案 0 :(得分:0)
我在一个月前遇到过这个问题。我给你一个适合我的代码。
sudo apt-get install libmagick++-dev