每当我尝试使用终端安装程序时,都会收到此错误:
home@ubuntu:~$ apt-get install myunity
E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?
Run Code Online (Sandbox Code Playgroud)
我也无法使用终端安装更新。
每隔一段时间,我就会看到用户由于这样的错误而遇到需要更新的问题:
E:Type 'ain' is not known on line 1 in source list /etc/apt/sources.list.d/some-ppa.list'
Run Code Online (Sandbox Code Playgroud)
具有不同类型/行号/源列表文件(通常在删除 PPA 之后)。
如何修复这样的错误?
Ubuntu 12.04.2 LTS
这里发生了什么?
# apt-get install openjdk-7-jdk
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
consolekit cryptsetup-bin dbus-x11 dconf-gsettings-backend dconf-service
gconf-service gconf-service-backend gconf2 gconf2-common gvfs gvfs-common
gvfs-daemons gvfs-libs libatasmart4 libavahi-glib1 libbonobo2-0
libbonobo2-common libcairo-gobject2 libcanberra0 libck-connector0
libcryptsetup4 libdconf0 libfontenc1 libgconf-2-4 libgconf2-4 libgdu0
libgl1-mesa-dri libgl1-mesa-glx libglapi-mesa libgnome-keyring-common
libgnome-keyring0 libgnome2-0 libgnome2-bin libgnome2-common libgnomevfs2-0
libgnomevfs2-common libgtk-3-0 libgtk-3-bin libgtk-3-common libgudev-1.0-0
libidl-common libidl0 libllvm3.0 libltdl7 liblvm2app2.2 liborbit2
libpam-ck-connector libpolkit-agent-1-0 libpolkit-backend-1-0 libsgutils2-2
libtdb1 libvorbisfile3 libx11-xcb1 libxaw7 …Run Code Online (Sandbox Code Playgroud) 我想向该文件添加设置apt.conf,但我意识到它已被一个名为etc/apt/apt.conf.d/.
我如何配置这个新模型?
在 MonoDevelop 中,我创建了一个新的解决方案(C# 控制台应用程序)。它给了我一个简单的 hello world 程序。我按下运行按钮。我看到“构建成功”终端出现并说:
Cannot open assembly '/home/beauxq/MonoProjects/cstest/cstest/bin/Debug/cstest.exe': No such file or directory.
Press any key to continue...
Run Code Online (Sandbox Code Playgroud)
我查看那个 bin/Debug 目录,它是空的。
构建输出:
Building: cstest (Debug|x86)
Build started 7/28/2016 9:29:40 AM.
__________________________________________________
Project "/home/beauxq/MonoProjects/cstest/cstest/cstest.csproj" (Build target(s)):
Target PrepareForBuild:
Configuration: Debug Platform: x86
Target GenerateSatelliteAssemblies:
No input files were specified for target GenerateSatelliteAssemblies, skipping.
Target GenerateTargetFrameworkMonikerAttribute:
Skipping target "GenerateTargetFrameworkMonikerAttribute" because its outputs are up-to-date.
Done building project "/home/beauxq/MonoProjects/cstest/cstest/cstest.csproj".-- FAILED
Build FAILED.
0 Warning(s)
---------------------- Done ----------------------
Build successful.
Run Code Online (Sandbox Code Playgroud)
当我从菜单中选择“构建”时,也会发生同样的情况。“构建成功”但目录为空。
我希望有比我更聪明的人可以帮助我解决这个问题。看来我的 apt 数据库中有些东西搞砸了。
我正在运行 Ubuntu 16.04.2 LTS。我已经从 ossec.wazuh.com 下载了 ossec-hids_2.8.3-4xenial_amd64.deb,当我尝试安装它时,我得到:
# dpkg -i ossec-hids_2.8.3-4xenial_amd64.deb
Selecting previously unselected package ossec-hids.
(Reading database ... 162578 files and directories currently installed.)
Preparing to unpack ossec-hids_2.8.3-4xenial_amd64.deb ...
Unpacking ossec-hids (2.8.3-4xenial) ...
dpkg: dependency problems prevent configuration of ossec-hids:
ossec-hids depends on expect; however:
Package expect is not installed.
dpkg: error processing package ossec-hids (--install):
dependency problems - leaving unconfigured
Errors were encountered while processing:
ossec-hids
Run Code Online (Sandbox Code Playgroud)
当我去安装expect时,我得到:
# apt-get install expect
Reading package lists... Done …Run Code Online (Sandbox Code Playgroud) 关于我提出的前一个问题(使用 -y 运行 apt-get(或 aptitude)但不提示替换配置文件?)我遇到了一个有点奇怪且难以解释的行为。也许有人仍然可以解释它。
当我debootstap在目标内部之后立即执行以下命令时chroot,包mercurial似乎需要比看起来更合理的更多内容:
apt-get -s -y -o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confold install mercurial
Reading package lists...
Building dependency tree...
The following extra packages will be installed:
ca-certificates fontconfig-config fonts-dejavu-core libdrm-intel1
libdrm-nouveau2 libdrm-radeon1 libelf1 libfontconfig1 libfontenc1
libfreetype6 libgl1-mesa-dri libgl1-mesa-glx libglapi-mesa libice6
libllvm3.4 libpciaccess0 libsm6 libtcl8.6 libtk8.6 libtxc-dxtn-s2tc0
libutempter0 libx11-6 libx11-data libx11-xcb1 libxau6 libxaw7 libxcb-dri2-0
libxcb-dri3-0 libxcb-glx0 libxcb-present0 libxcb-shape0 libxcb-sync1 libxcb1
libxcomposite1 libxdamage1 libxdmcp6 libxext6 libxfixes3 libxft2 libxi6
libxinerama1 libxmu6 libxmuu1 libxpm4 …Run Code Online (Sandbox Code Playgroud) 当我apt-get install使用特定软件包时,如何避免安装推荐的软件包和建议的软件包以及升级软件包?
在 Ubuntu 18.04(或 20.04 等)上将安装推荐的软件包以及apt-get install,我知道应该安装依赖的软件包,但为什么推荐?谁决定推荐?
但我想会有一个合理的理由,理由是什么?