在AWS EC2实例上安装软件包时出错

时间:2019-02-23 05:29:52

标签: amazon-web-services amazon-ec2

我需要安装S3FS软件包才能将S3存储安装到EC2实例上。
为此,我执行了以下命令。

更新

ubuntu@ip-172-31-28-212:~$ sudo apt-get update
Hit:1 http://us-east-1.ec2.archive.ubuntu.com/ubuntu xenial InRelease
Hit:2 http://us-east-1.ec2.archive.ubuntu.com/ubuntu xenial-updates InRelease  
Hit:3 http://us-east-1.ec2.archive.ubuntu.com/ubuntu xenial-backports InRelease
Hit:4 http://security.ubuntu.com/ubuntu xenial-security InRelease              
Hit:5 https://nvidia.github.io/libnvidia-container/ubuntu16.04/amd64  InRelease
Hit:6 https://nvidia.github.io/nvidia-container-runtime/ubuntu16.04/amd64  InRelease
Hit:7 https://nvidia.github.io/nvidia-docker/ubuntu16.04/amd64  InRelease
Hit:8 http://ppa.launchpad.net/openjdk-r/ppa/ubuntu xenial InRelease
Reading package lists... Done

安装依赖包

ubuntu@ip-172-31-28-212:~$ sudo apt-get install automake autotools-dev fuse g++ git libcurl4-gnutls-dev libfuse-dev libssl-dev libxml2-dev make pkg-config
E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?

删除/ var / lib / dpkg / lock-frontend

ubuntu@ip-172-31-28-212:~$ sudo rm /var/lib/dpkg/lock-frontend

重试安装软件包

ubuntu@ip-172-31-28-212:~$ sudo apt-get install automake autotools-dev fuse g++ git libcurl4-gnutls-dev libfuse-dev libssl-dev libxml2-dev make pkg-config
E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?

删除/ var / lib / dpkg / lock

ubuntu@ip-172-31-28-212:~$ sudo rm /var/lib/dpkg/lock

安装软件包

ubuntu@ip-172-31-28-212:~$ sudo apt-get install automake autotools-dev fuse g++ git libcurl4-gnutls-dev libfuse-dev libssl-dev libxml2-dev make pkg-config
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem. 

sudo dpkg --configure -a

ubuntu@ip-172-31-28-212:~$ sudo dpkg --configure -a
Setting up libgs9-common (9.26~dfsg+0-0ubuntu0.16.04.5) ...
Setting up libapt-inst2.0:amd64 (1.2.29ubuntu0.1) ...
Processing triggers for ufw (0.35-0ubuntu2) ...
Setting up linux-image-4.4.0-1075-aws (4.4.0-1075.85) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.4.0-1075-aws /boot/vmlinuz-4.4.0-1075-aws
run-parts: executing /etc/kernel/postinst.d/dkms 4.4.0-1075-aws /boot/vmlinuz-4.4.0-1075-aws
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.4.0-1075-aws /boot/vmlinuz-4.4.0-1075-aws
update-initramfs: Generating /boot/initrd.img-4.4.0-1075-aws
W: mdadm: /etc/mdadm/mdadm.conf defines no arrays.
run-parts: executing /etc/kernel/postinst.d/unattended-upgrades 4.4.0-1075-aws /boot/vmlinuz-4.4.0-1075-aws
run-parts: executing /etc/kernel/postinst.d/update-notifier 4.4.0-1075-aws /boot/vmlinuz-4.4.0-1075-aws
run-parts: executing /etc/kernel/postinst.d/x-grub-legacy-ec2 4.4.0-1075-aws /boot/vmlinuz-4.4.0-1075-aws
locale: Cannot set LC_ALL to default locale: No such file or directory
Searching for GRUB installation directory ... found: /boot/grub
Searching for default file ... found: /boot/grub/default
Testing for an existing GRUB menu.lst file ... found: /boot/grub/menu.lst
Searching for splash image ... none found, skipping ...
Found kernel: /boot/vmlinuz-4.4.0-1073-aws
Found kernel: /boot/vmlinuz-4.4.0-1072-aws
Found kernel: /boot/vmlinuz-4.4.0-1075-aws
Found kernel: /boot/vmlinuz-4.4.0-1073-aws
Found kernel: /boot/vmlinuz-4.4.0-1072-aws
Replacing config file /run/grub/menu.lst with new version
Updating /boot/grub/menu.lst ... done

run-parts: executing /etc/kernel/postinst.d/zz-update-grub 4.4.0-1075-aws /boot/vmlinuz-4.4.0-1075-aws
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.4.0-1075-aws
Found initrd image: /boot/initrd.img-4.4.0-1075-aws
Found linux image: /boot/vmlinuz-4.4.0-1073-aws
Found initrd image: /boot/initrd.img-4.4.0-1073-aws
Found linux image: /boot/vmlinuz-4.4.0-1072-aws
Found initrd image: /boot/initrd.img-4.4.0-1072-aws
done
Setting up libpam-systemd:amd64 (229-4ubuntu21.16) ...
locale: Cannot set LC_ALL to default locale: No such file or directory
Setting up libisc160:amd64 (1:9.10.3.dfsg.P4-8ubuntu1.12) ...
Setting up linux-aws-headers-4.4.0-1075 (4.4.0-1075.85) ...
Setting up libisc-export160 (1:9.10.3.dfsg.P4-8ubuntu1.12) ...
Processing triggers for mime-support (3.59ubuntu1) ...
Processing triggers for ureadahead (0.100.0-19) ...
Setting up libarchive13:amd64 (3.1.2-11ubuntu0.16.04.6) ...
Setting up apt-utils (1.2.29ubuntu0.1) ...
Setting up tzdata (2018i-0ubuntu0.16.04) ...
locale: Cannot set LC_ALL to default locale: No such file or directory

Current default time zone: 'Etc/UTC'
Local time is now:      Sat Feb 23 05:06:41 UTC 2019.
Universal Time is now:  Sat Feb 23 05:06:41 UTC 2019.
Run 'dpkg-reconfigure tzdata' if you wish to change it.

Setting up linux-libc-dev:amd64 (4.4.0-142.168) ...
Setting up libdns-export162 (1:9.10.3.dfsg.P4-8ubuntu1.12) ...
Setting up libtiff5:amd64 (4.0.6-1ubuntu0.5) ...
Setting up libkrb5support0:amd64 (1.13.2+dfsg-5ubuntu2.1) ...
Setting up libisccc140:amd64 (1:9.10.3.dfsg.P4-8ubuntu1.12) ...
Setting up krb5-locales (1.13.2+dfsg-5ubuntu2.1) ...
Processing triggers for libc-bin (2.23-0ubuntu10) ...
Setting up udev (229-4ubuntu21.16) ...
addgroup: The group `input' already exists as a system group. Exiting.
update-initramfs: deferring update (trigger activated)
insserv: warning: script 'K01S100AMI' missing LSB tags and overrides
insserv: warning: script 'S100AMI' missing LSB tags and overrides
Processing triggers for systemd (229-4ubuntu21.16) ...
Setting up liblwres141:amd64 (1:9.10.3.dfsg.P4-8ubuntu1.12) ...
Setting up linux-image-aws (4.4.0.1075.77) ...
dpkg: error processing package unattended-upgrades (--configure):
 package is in a very bad inconsistent state; you should
 reinstall it before attempting configuration
Setting up libtiffxx5:amd64 (4.0.6-1ubuntu0.5) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up linux-headers-4.4.0-1075-aws (4.4.0-1075.85) ...
Examining /etc/kernel/header_postinst.d.
run-parts: executing /etc/kernel/header_postinst.d/dkms 4.4.0-1075-aws /boot/vmlinuz-4.4.0-1075-aws
Setting up binutils (2.26.1-1ubuntu1~16.04.8) ...
Setting up initramfs-tools-bin (0.122ubuntu8.14) ...
Processing triggers for dbus (1.10.6-1ubuntu3.3) ...
Setting up libpoppler58:amd64 (0.41.0-0ubuntu1.12) ...
Processing triggers for hicolor-icon-theme (0.15-0ubuntu1.1) ...
Setting up libgs9:amd64 (9.26~dfsg+0-0ubuntu0.16.04.5) ...
Setting up libpolkit-gobject-1-0:amd64 (0.105-14.1ubuntu0.4) ...
Setting up libavahi-common-data:amd64 (0.6.32~rc+dfsg-1ubuntu2.3) ...
Setting up libk5crypto3:amd64 (1.13.2+dfsg-5ubuntu2.1) ...
Setting up initramfs-tools-core (0.122ubuntu8.14) ...
Setting up libpolkit-agent-1-0:amd64 (0.105-14.1ubuntu0.4) ...
Setting up libtiff5-dev:amd64 (4.0.6-1ubuntu0.5) ...
Setting up libtiff-tools (4.0.6-1ubuntu0.5) ...
Setting up initramfs-tools (0.122ubuntu8.14) ...
update-initramfs: deferring update (trigger activated)
Setting up ghostscript (9.26~dfsg+0-0ubuntu0.16.04.5) ...
Setting up linux-headers-aws (4.4.0.1075.77) ...
Setting up libpolkit-backend-1-0:amd64 (0.105-14.1ubuntu0.4) ...
Setting up linux-aws (4.4.0.1075.77) ...
Setting up libkrb5-3:amd64 (1.13.2+dfsg-5ubuntu2.1) ...
Setting up libavahi-common3:amd64 (0.6.32~rc+dfsg-1ubuntu2.3) ...
Setting up policykit-1 (0.105-14.1ubuntu0.4) ...
Removed symlink /run/systemd/system/polkitd.service.
Setting up libgssapi-krb5-2:amd64 (1.13.2+dfsg-5ubuntu2.1) ...
Setting up libavahi-client3:amd64 (0.6.32~rc+dfsg-1ubuntu2.3) ...
Setting up openssh-client (1:7.2p2-4ubuntu2.7) ...
Setting up libdns162:amd64 (1:9.10.3.dfsg.P4-8ubuntu1.12) ...
Setting up libcurl3:amd64 (7.47.0-1ubuntu2.12) ...
Setting up libcurl3-gnutls:amd64 (7.47.0-1ubuntu2.12) ...
Setting up libisccfg140:amd64 (1:9.10.3.dfsg.P4-8ubuntu1.12) ...
Setting up snapd (2.34.2ubuntu0.1) ...
snapd.snap-repair.service is a disabled or a static unit, not starting it.
Setting up openssh-sftp-server (1:7.2p2-4ubuntu2.7) ...
Setting up ubuntu-core-launcher (2.34.2ubuntu0.1) ...
Setting up libbind9-140:amd64 (1:9.10.3.dfsg.P4-8ubuntu1.12) ...
Setting up libcurl4-openssl-dev:amd64 (7.47.0-1ubuntu2.12) ...
Setting up bind9-host (1:9.10.3.dfsg.P4-8ubuntu1.12) ...
Setting up apt-transport-https (1.2.29ubuntu0.1) ...
Setting up curl (7.47.0-1ubuntu2.12) ...
Setting up dnsutils (1:9.10.3.dfsg.P4-8ubuntu1.12) ...
Setting up openssh-server (1:7.2p2-4ubuntu2.7) ...
locale: Cannot set LC_ALL to default locale: No such file or directory
insserv: warning: script 'K01S100AMI' missing LSB tags and overrides
insserv: warning: script 'S100AMI' missing LSB tags and overrides
Setting up libnss3-nssdb (2:3.28.4-0ubuntu0.16.04.4) ...
Setting up libnss3:amd64 (2:3.28.4-0ubuntu0.16.04.4) ...
Setting up openjdk-8-jre-headless:amd64 (8u191-b12-2ubuntu0.16.04.1) ...
Installing new version of config file /etc/java-8-openjdk/net.properties ...
Setting up openjdk-8-jdk-headless:amd64 (8u191-b12-2ubuntu0.16.04.1) ...
Setting up openjdk-8-jre:amd64 (8u191-b12-2ubuntu0.16.04.1) ...
Setting up openjdk-8-jdk:amd64 (8u191-b12-2ubuntu0.16.04.1) ...
Processing triggers for libc-bin (2.23-0ubuntu10) ...
Processing triggers for initramfs-tools (0.122ubuntu8.14) ...
update-initramfs: Generating /boot/initrd.img-4.4.0-1075-aws
W: mdadm: /etc/mdadm/mdadm.conf defines no arrays.
Errors were encountered while processing:
 unattended-upgrades
ubuntu@ip-172-31-28-212:~$ 

Q1。为什么我无法在原始EC2实例上安装具有/ var / lib / dpkg / lock-frontend和/ var / lib / dpkg / lock

错误的软件包

Q2。前几天,我可以解决这些问题
通过删除这些目录; / var / lib / dpkg / lock-frontend和/ var / lib / dpkg / lock,然后是sudo dpkg --configure -a

但是奇怪的是,这次没有用。为什么没有用?
以及如何解决此问题?

1 个答案:

答案 0 :(得分:0)

您的实例是否正在初始化?

TableAttribute

初始化过程中会安装很多东西,可能会保持锁定状态。

相关问题