安装 SNMP 并不像我想象的那么简单

安装 SNMP 并不像我想象的那么简单

查找如何安装 SNMP。找到多个示例:

只需运行“apt-get install snmpd”.....

但当我这样做时,我得到了错误。我按照它说的做:首先运行 ap-get install snmpd,但它失败了,并告诉我尝试“apt-get -f install”,但失败了,并告诉我尝试“apt autoremove”,但失败了,并告诉我尝试“apt-get -f install”,但失败了,并且……[重复有趣的循环]。

只想让这台 Linux 服务器(Ubuntu 16.04.1 LTS)在公共端口 161 上运行 SNMP。基本上是默认设置。

有什么想法吗?我对 Linux 还不熟悉。对于所有依赖项,我是否只需运行以下命令?:

apt-get 安装 linux-image-4.4.0-62-generic

apt-get 安装 linux-image-4.4.0-64-generic

apt-get 安装 linux-image-generic

apt-get 安装 thermald

apt-get 安装 libsnmp30

apt-get 安装 libsnmp-base

等等...等等...

我不熟悉 Linux,所以如果您有任何建议,请解释如何实现这些建议。

以下是我正在经历的确切循环:

root@MYSERVER:/etc# apt-get install snmpd
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:
 linux-image-extra-4.4.0-62-generic : Depends: linux-image-4.4.0-62-generic but it is not going to be installed
 linux-image-extra-4.4.0-64-generic : Depends: linux-image-4.4.0-64-generic but it is not going to be installed
 linux-image-generic : Depends: linux-image-4.4.0-64-generic but it is not going to be installed
                       Recommends: thermald but it is not going to be installed
 snmpd : Depends: libsnmp30 (= 5.7.3+dfsg-1ubuntu4) but it is not going to be installed
         Depends: libsnmp-base but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
root@MYSERVER:/etc# apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
  linux-headers-4.4.0-51 linux-headers-4.4.0-51-generic linux-headers-4.4.0-62 linux-headers-4.4.0-62-generic linux-image-4.4.0-51-generic linux-image-4.4.0-62-generic linux-image-extra-4.4.0-51-generic
  linux-image-extra-4.4.0-62-generic
Use 'apt autoremove' to remove them.
The following additional packages will be installed:
  linux-image-4.4.0-62-generic linux-image-4.4.0-64-generic
Suggested packages:
  fdutils linux-doc-4.4.0 | linux-source-4.4.0 linux-tools
The following NEW packages will be installed:
  linux-image-4.4.0-62-generic linux-image-4.4.0-64-generic
0 upgraded, 2 newly installed, 0 to remove and 198 not upgraded.
21 not fully installed or removed.
Need to get 0 B/43.1 MB of archives.
After this operation, 131 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 346980 files and directories currently installed.)
Preparing to unpack .../linux-image-4.4.0-64-generic_4.4.0-64.85_amd64.deb ...
Done.
Unpacking linux-image-4.4.0-64-generic (4.4.0-64.85) ...
dpkg: error processing archive /var/cache/apt/archives/linux-image-4.4.0-64-generic_4.4.0-64.85_amd64.deb (--unpack):
 cannot copy extracted data for './boot/vmlinuz-4.4.0-64-generic' to '/boot/vmlinuz-4.4.0-64-generic.dpkg-new': failed to write (No space left on device)
No apport report written because the error message indicates a disk full error
                                                                              dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 4.4.0-64-generic /boot/vmlinuz-4.4.0-64-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 4.4.0-64-generic /boot/vmlinuz-4.4.0-64-generic
Preparing to unpack .../linux-image-4.4.0-62-generic_4.4.0-62.83_amd64.deb ...
Done.
Unpacking linux-image-4.4.0-62-generic (4.4.0-62.83) ...
dpkg: error processing archive /var/cache/apt/archives/linux-image-4.4.0-62-generic_4.4.0-62.83_amd64.deb (--unpack):
 cannot copy extracted data for './boot/vmlinuz-4.4.0-62-generic' to '/boot/vmlinuz-4.4.0-62-generic.dpkg-new': failed to write (No space left on device)
No apport report written because the error message indicates a disk full error
                                                                              dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 4.4.0-62-generic /boot/vmlinuz-4.4.0-62-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 4.4.0-62-generic /boot/vmlinuz-4.4.0-62-generic
Errors were encountered while processing:
 /var/cache/apt/archives/linux-image-4.4.0-64-generic_4.4.0-64.85_amd64.deb
 /var/cache/apt/archives/linux-image-4.4.0-62-generic_4.4.0-62.83_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
root@MYSERVER:/etc#

相关内容