我遵循基于此链接的命令 https://docs.mongodb.com/compass/master/install/
1. Download the package:
mongodb-compass_1.15.1_amd64.deb
2. Install Compass:
sudo dpkg -i mongodb-compass_1.15.1_amd64.deb;
(Reading database ... 195489 files and directories currently installed.)
Preparing to unpack mongodb-compass_1.15.1_amd64.deb ...
Unpacking mongodb-compass (1.15.1-1) ...
dpkg: dependency problems prevent configuration of mongodb-compass:
mongodb-compass depends on libgconf-2-4; however:
Package libgconf-2-4 is not installed.
dpkg: error processing package mongodb-compass (--install):
dependency problems - leaving unconfigured
Processing triggers for desktop-file-utils (0.23-1ubuntu3.18.04.2) ...
Processing triggers for gnome-menus (3.13.3-11ubuntu1.1) ...
Processing triggers for mime-support (3.60ubuntu1) ...
Errors were encountered while processing:
mongodb-compass
“如何修复Ubuntu中的“安装”错误”,有人可以帮助解决我的问题吗?
答案 0 :(得分:1)
如果您检查日志,则会看到此错误:
dpkg:依赖性问题阻止了mongodb-compass的配置:
mongodb-compass取决于libgconf-2-4;但是:包裹
libgconf-2-4未安装。
因此,安装libgconf-2-4。
public String GetRealPathFromURI(Android.Net.Uri contentURI)
{
try
{
ICursor imageCursor = null;
string fullPathToImage = "";
imageCursor = ContentResolver.Query(contentURI, null, null, null, null);
imageCursor.MoveToFirst();
int idx = imageCursor.GetColumnIndex(MediaStore.Images.ImageColumns.Data);
if (idx != -1)
{
fullPathToImage = imageCursor.GetString(idx);
}
else
{
ICursor cursor = null;
var docID = DocumentsContract.GetDocumentId(contentURI);
var id = docID.Split(':')[1];
var whereSelect = MediaStore.Images.ImageColumns.Id + "=?";
var projections = new string[] { MediaStore.Images.ImageColumns.Data };
cursor = ContentResolver.Query(MediaStore.Images.Media.InternalContentUri, projections, whereSelect, new string[] { id }, null);
if (cursor.Count == 0)
{
cursor = ContentResolver.Query(MediaStore.Images.Media.ExternalContentUri, projections, whereSelect, new string[] { id }, null);
}
var colData = cursor.GetColumnIndexOrThrow(MediaStore.Images.ImageColumns.Data);
cursor.MoveToFirst();
fullPathToImage = cursor.GetString(colData);
}
return fullPathToImage;
}
catch (Exception ex)
{
Toast.MakeText(Xamarin.Forms.Forms.Context, "Unable to get path", ToastLength.Long).Show();
}
return null;
}
答案 1 :(得分:1)
万一缺少多个包裹
sudo apt install ...
将很乏味。跑步后
sudo dpkg -i <package-name>
出现依赖关系错误,您可以运行
sudo apt --fix-broken install
它将安装所有缺少的依赖项,并在运行后
sudo dpkg -i <package-name>
将安装您所需的软件包。
答案 2 :(得分:0)
使用sudo apt install -f
,然后使用sudo dpkg -i <your file.deb>