Amazon-ssm-agent unrecognized service (just installed it via Docker) - linux

I am trying to figure out why I cannot start and stop the amazon-ssm-agent service manually in a Kali Linux Focker image running on an Ubuntu 20.04.1 LTS host. Per their instructions, I have obtained the .deb file and installed it with dpkg -i. Although I can interact with it via amazon-ssm-agent -h and registering it just fine, etc., I cannot restart the service which sometimes fixes the Connection Lost issue after registering.
As you can see below, I am using wget to get the .deb file, and installing it:
➜ ~ wget https://s3.us-east-1.amazonaws.com/amazon-ssm-us-east-1/latest/debian_amd64/amazon-ssm-agent.deb
--2020-12-27 22:21:32-- https://s3.us-east-1.amazonaws.com/amazon-ssm-us-east-1/latest/debian_amd64/amazon-ssm-agent.deb
Resolving s3.us-east-1.amazonaws.com (s3.us-east-1.amazonaws.com)... 52.217.109.126
Connecting to s3.us-east-1.amazonaws.com (s3.us-east-1.amazonaws.com)|52.217.109.126|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 41537900 (40M) [binary/octet-stream]
Saving to: 'amazon-ssm-agent.deb'
amazon-ssm-agent.deb 100%[========================================================================================================================================================================================================================================>] 39.61M 105MB/s in 0.4s
2020-12-27 22:21:33 (105 MB/s) - 'amazon-ssm-agent.deb' saved [41537900/41537900]
➜ ~ dpkg -i amazon-ssm-agent.deb
Selecting previously unselected package amazon-ssm-agent.
(Reading database ... 231292 files and directories currently installed.)
Preparing to unpack amazon-ssm-agent.deb ...
Preparing for install
Unpacking amazon-ssm-agent (3.0.431.0-1) ...
Setting up amazon-ssm-agent (3.0.431.0-1) ...
Starting agent
➜ ~ service amazon-ssm-agent status
amazon-ssm-agent: unrecognized service
➜ ~
I also cannot use systemctl because of the following error:
➜ ~ systemctl status amazon-ssm-agent
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down
➜ ~
I tried looking in /etc/init.d as well, but no luck:
➜ ~ ls /etc/init.d -l
total 240
-rwxr-xr-x 1 root root 2489 Aug 8 07:47 apache-htcacheclean
-rwxr-xr-x 1 root root 8181 Aug 8 07:47 apache2
-rwxr-xr-x 1 root root 1614 Jul 14 2019 atftpd
-rwxr-xr-x 1 root root 2401 May 26 2020 avahi-daemon
-rwxr-xr-x 1 root root 1175 Apr 17 2020 binfmt-support
-rwxr-xr-x 1 root root 2948 Sep 16 07:49 bluetooth
-rwxr-xr-x 1 root root 1232 Dec 1 01:02 console-setup.sh
-rwxr-xr-x 1 root root 937 Sep 3 22:30 cryptdisks
-rwxr-xr-x 1 root root 896 Sep 3 22:30 cryptdisks-early
-rwxr-xr-x 1 root root 3152 Jul 2 13:19 dbus
-rwxr-xr-x 1 root root 1408 Aug 4 23:00 dns2tcp
-rwxr-xr-x 1 root root 7159 May 23 2020 exim4
-rwxr-xr-x 1 root root 3708 Nov 25 21:07 hwclock.sh
-rwxr-xr-x 1 root root 3615 Sep 5 2019 inetsim
-rwxr-xr-x 1 root root 4113 Sep 26 16:48 iodined
-rwxr-xr-x 1 root root 1479 Oct 9 2016 keyboard-setup.sh
-rwxr-xr-x 1 root root 2044 Apr 18 2020 kmod
-rwxr-xr-x 1 root root 5966 Nov 22 15:42 mariadb
-rwxr-xr-x 1 root root 2882 Jul 26 2019 miredo
-rwxr-xr-x 1 root root 4486 Sep 21 14:45 networking
-rwxr-xr-x 1 root root 5658 Jul 26 12:02 nfs-common
-rwxr-xr-x 1 root root 4579 May 28 2020 nginx
-rwxr-xr-x 1 root root 1934 Jul 7 05:55 nmbd
-rwxr-xr-x 1 root root 1494 Sep 23 11:46 ntp
-rwxr-xr-x 1 root root 9138 Oct 28 18:37 openvpn
-rwxr-xr-x 1 root root 3720 Jun 14 2020 pcscd
-rwxr-xr-x 1 root root 1490 Nov 15 2019 postgresql
-rwxr-xr-x 1 root root 924 May 16 2020 procps
-rwxr-xr-x 1 root root 3699 Jul 22 2017 ptunnel
-rwxr-xr-x 1 root root 3836 Jan 2 2017 redsocks
-rwxr-xr-x 1 root root 1615 Aug 19 2018 rlinetd
-rwxr-xr-x 1 root root 2507 Jul 13 01:22 rpcbind
-rwxr-xr-x 1 root root 4417 Aug 26 20:23 rsync
-rwxr-xr-x 1 root root 2864 Oct 20 19:45 rsyslog
-rwxr-xr-x 1 root root 1661 Jun 5 2013 rwhod
-rwxr-xr-x 1 root root 2259 Jul 7 05:55 samba-ad-dc
-rwxr-xr-x 1 root root 1222 Apr 2 2017 screen-cleanup
-rwxr-xr-x 1 root root 3088 Oct 10 2019 smartmontools
-rwxr-xr-x 1 root root 2061 Jul 7 05:55 smbd
-rwxr-xr-x 1 root root 1175 Sep 24 23:10 snmpd
-rwxr-xr-x 1 root root 4056 Dec 2 10:32 ssh
-rwxr-xr-x 1 root root 4440 Sep 5 2019 sslh
-rwxr-xr-x 1 root root 5730 Sep 13 10:43 stunnel4
-rwxr-xr-x 1 root root 1030 Dec 2 03:10 sudo
-rwxr-xr-x 1 root root 1581 Dec 16 08:36 sysstat
-rwxr-xr-x 1 root root 6871 Dec 3 22:53 udev
-rwxr-xr-x 1 root root 2757 Oct 9 08:13 x11-common
➜ ~
However, you can see that running the amazon-ssm-agent command works just fine:
➜ ~ amazon-ssm-agent
Error occurred fetching the seelog config file path: open /etc/amazon/ssm/seelog.xml: no such file or directory
Initializing new seelog logger
New Seelog Logger Creation Complete
2020-12-27 22:24:08 ERROR error fetching the instanceID, Failed to fetch instance ID. Data from vault is empty. EC2MetadataError: failed to make EC2Metadata request
status code: 404, request id:
caused by: not found
2020-12-27 22:24:08 ERROR error occurred when starting amazon-ssm-agent: error fetching the instanceID, Failed to fetch instance ID. Data from vault is empty. EC2MetadataError: failed to make EC2Metadata request
status code: 404, request id:
caused by: not found
➜ ~
The only reason that I need to restart the service after registering is because sometimes I get a "Connection Lost" on the managed instance's ping status after registering. Usually restarting the service seem to do the trick for me.
I'm able to restart the service successfully when just using the host (Ubuntu 20.04) and even when the host is running Kali Linux as well, but not when it's a docker container, which doesn't make any sense to me because everything is functional with the exception of being able to start/stop the service manually.

I was able to get this running by cloning this repository: https://github.com/gdraheim/docker-systemctl-replacement
After cloning, I ran the following:
/root/docker-systemctl-replacement/files/docker/systemctl.py restart amazon-ssm-agent

Related

How to view logs of container before restart

I have a container which was restart 14 hours ago. The container is running since 7 weeks. I want to inspect the container logs during a certain interval. When i run below command, I see there is no output
docker container logs pg-connect --until 168h --since 288h
When i run below commands i only see logs since the container was restarted.
docker logs pg-connect
Any idea how to retrieve older logs for the container?
More info if helps
> docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
9f08fb6fb0fb kosta709/alpine-plus:0.0.2 "/connectors-restart…" 7 weeks ago Up 14 hours connectors-monitor
7e919a253a29 debezium/connect:1.2.3.Final "/docker-entrypoint.…" 7 weeks ago Up 14 hours pg-connect
>
>
> docker logs 7e919a253a29 -n 2
2022-08-26 06:37:10,878 INFO || WorkerSourceTask{id=relations-0} Committing offsets [org.apache.kafka.connect.runtime.WorkerSourceTask]
2022-08-26 06:37:10,878 INFO || WorkerSourceTask{id=relations-0} flushing 0 outstanding messages for offset commit [org.apache.kafka.connect.runtime.WorkerSourceTask]
> docker logs 7e919a253a29 |head
org.apache.kafka.common.KafkaException: Producer is closed forcefully.
at org.apache.kafka.clients.producer.internals.RecordAccumulator.abortBatches(RecordAccumulator.java:766)
at org.apache.kafka.clients.producer.internals.RecordAccumulator.abortIncompleteBatches(RecordAccumulator.java:753)
at org.apache.kafka.clients.producer.internals.Sender.run(Sender.java:279)
at java.base/java.lang.Thread.run(Thread.java:834)
2022-08-24 16:13:06,567 ERROR || WorkerSourceTask{id=session-0} failed to send record to barclays.public.session: [org.apache.kafka.connect.runtime.WorkerSourceTask]
org.apache.kafka.common.KafkaException: Producer is closed forcefully.
at org.apache.kafka.clients.producer.internals.RecordAccumulator.abortBatches(RecordAccumulator.java:766)
at org.apache.kafka.clients.producer.internals.RecordAccumulator.abortIncompleteBatches(RecordAccumulator.java:753)
at org.apache.kafka.clients.producer.internals.Sender.run(Sender.java:279)
>
> ls -lart /var/lib/docker/containers/7e919a253a296494b74361e258e49d8c3ff38f345455316a15e1cb28cf556fa1/
total 90720
drwx------ 2 root root 6 Jul 1 10:39 checkpoints
drwx--x--- 2 root root 6 Jul 1 10:39 mounts
drwx--x--- 4 root root 150 Jul 1 10:40 ..
-rw-r----- 1 root root 10000230 Aug 24 16:13 7e919a253a296494b74361e258e49d8c3ff38f345455316a15e1cb28cf556fa1-json.log.9
-rw-r----- 1 root root 10000163 Aug 24 16:13 7e919a253a296494b74361e258e49d8c3ff38f345455316a15e1cb28cf556fa1-json.log.8
-rw-r----- 1 root root 10000054 Aug 24 16:16 7e919a253a296494b74361e258e49d8c3ff38f345455316a15e1cb28cf556fa1-json.log.7
-rw-r----- 1 root root 10000147 Aug 24 16:42 7e919a253a296494b74361e258e49d8c3ff38f345455316a15e1cb28cf556fa1-json.log.6
-rw-r----- 1 root root 10000123 Aug 24 16:42 7e919a253a296494b74361e258e49d8c3ff38f345455316a15e1cb28cf556fa1-json.log.5
-rw-r----- 1 root root 10000019 Aug 24 16:42 7e919a253a296494b74361e258e49d8c3ff38f345455316a15e1cb28cf556fa1-json.log.4
-rw-r----- 1 root root 10000159 Aug 24 16:42 7e919a253a296494b74361e258e49d8c3ff38f345455316a15e1cb28cf556fa1-json.log.3
-rw-r----- 1 root root 10000045 Aug 24 16:42 7e919a253a296494b74361e258e49d8c3ff38f345455316a15e1cb28cf556fa1-json.log.2
-rw-r--r-- 1 root root 199 Aug 25 16:30 hosts
-rw-r--r-- 1 root root 68 Aug 25 16:30 resolv.conf
-rw-r--r-- 1 root root 25 Aug 25 16:30 hostname
-rw------- 1 root root 7205 Aug 25 16:30 config.v2.json
-rw-r--r-- 1 root root 1559 Aug 25 16:30 hostconfig.json
-rw-r----- 1 root root 10000085 Aug 25 16:31 7e919a253a296494b74361e258e49d8c3ff38f345455316a15e1cb28cf556fa1-json.log.1
drwx--x--- 4 root root 4096 Aug 25 16:31 .
-rw-r----- 1 root root 2843232 Aug 26 06:38 7e919a253a296494b74361e258e49d8c3ff38f345455316a15e1cb28cf556fa1-json.log
As stated by [the official guide][1]:
The docker logs command batch-retrieves logs present at the time of execution.```
To solve this issue you should instrument the container software to log its output to a persistent (rotated if you want) log file.
[1]: https://docs.docker.com/engine/reference/commandline/logs/

How to flash MB1355C and/or MB1293C from the STM32WB55 Nucleo Pack on Linux?

I would like to program the (MB1355C and/or MB1293C) devices from an STM32WB55 Nucleo Pack on my (Ubuntu 18.04.3 LTS) machine - preferably with the convenience of an eclipse based IDE that supports debugging features.
I installed
STM32CubeProgrammer (version 2.2.1)
Atolic TrueStudio (version 9.3.0)
STM32CubeIDE (version 1.1.0)
and I now have the following udev rules
chandran#chandran-OptiPlex-9020:~$ ll /etc/udev/rules.d/
total 160
drwxr-xr-x 2 root root 4096 Dec 13 14:11 ./
drwxr-xr-x 4 root root 4096 Dec 4 13:44 ../
-rw-rw-r-- 1 root root 270 Oct 14 18:10 49-stlinkv1.rules
-rw-rw-r-- 1 root root 270 Oct 14 18:10 49-stlinkv1.rules.O
-rw-rw-r-- 1 root root 464 Oct 14 18:10 49-stlinkv2-1.rules
-rw-rw-r-- 1 root root 464 Oct 14 18:10 49-stlinkv2-1.rules.O
-rw-rw-r-- 1 root root 278 Oct 14 18:10 49-stlinkv2.rules
-rw-rw-r-- 1 root root 278 Oct 14 18:10 49-stlinkv2.rules.O
-rw-r--r-- 1 root root 458 Dec 11 17:26 49-stlinkv3loader.rules
-rw-rw-r-- 1 root root 845 Oct 14 18:10 49-stlinkv3.rules
-rw-rw-r-- 1 root root 845 Oct 14 18:10 49-stlinkv3.rules.O
-rw-r--r-- 1 root root 381 Dec 6 17:10 '#61-msp430uif.rules#'
-rw-r--r-- 1 root root 381 Dec 4 15:09 61-msp430uif.rules
-rwxr-xr-x 1 root root 2145 Dec 4 15:09 70-mm-no-ti-emulators.rules*
-rw-r--r-- 1 root root 58549 Dec 4 12:29 70-snap.core.rules
-rw-r--r-- 1 root root 79 Dec 5 12:11 77-msp430-blacklist.rules
-rw-r--r-- 1 root root 0 Dec 5 12:10 77-msp430-blacklist.rules~
-rw-rw-r-- 1 root root 18450 Oct 14 17:33 99-jlink.rules
-rw-rw-r-- 1 root root 18450 Oct 14 17:33 99-jlink.rules.O
I am in the dialout group
chandran#chandran-OptiPlex-9020:~$ groups chandran
chandran : chandran adm dialout cdrom sudo dip plugdev lpadmin sambashare
I downloaded an example project called STM32100E-EVAL_USART_IrDA_Transmit and it builds successfully, but I get the following error message when I connect the evaluation board(s) and click on debug to flash the micro controller
ST-Link enumeration failed
Error in initializing ST-Link device.
Reason: (2) ST-Link DLL error.
I get the same error message when I try the above with STM32CubeIDE.
I have tried shifting JP1 as described in section 7.6 of the users manual but to no avail.
A previous question on stack overflow deals with the same error message so I got STM32CubeProgrammer to launch and tried making the changes suggested by #IsaBostan, but the development boards don't seem to be detected
How can I proceed to resolve this problem and program the boards?
Debugging ideas or suggestions are welcome, even if they haven't been tested...
It was just a question of permissions as suggested by KamilCuk
Launching TrueStudio as root and then clicking on debug solved the problem.
This is what worked on my machine:
sudo su
/opt/Atollic_TrueSTUDIO_for_STM32_x86_64_9.3.0/ide/./TrueSTUDIO
STM32CubeIDE's debugger also works when launched as follows on my machine:
sudo su
/opt/st/stm32cubeide_1.1.0/./stm32cubeide
and STM32CubeProgrammer connects to the device straight away when launched as follows:
sudo su
/usr/local/STMicroelectronics/STM32Cube/STM32CubeProgrammer/bin/./STM32CubeProgrammer
My device shows up under /dev/ttyACM0 with the following permissions:
crw-rw----+ 1 root dialout 166, 0 Dec 28 11:56 ttyACM0
openocd and st-flash were not required.

npm erased Plesk 12 on Ubuntu 16.04

My issue is pretty simple to explain and I guess hard to solve: I commited the stupidity of installing npm on a cloud based server with Ubuntu 16.04 with Plesk 12.
After reading this article I realized it was too late and after trying to connect to my Plesk GUI got an 403 error.
Also if I execute plesk on the CLI, it shows:
user#server:~$ plesk repair
plesk: command not found
So, I erased Plesk... All my hosted sites on Plesk are reachable with their databases in their URLs or by SSH.
The hosting provider told me there is no way to restore Plesk without losing everything unless I made a backup, but I didn't. Maybe there is an alternative... Do you know it?
Edit: Content of /var/lib/psa/dumps:
user#server:/var/lib/psa/dumps$ ls -lrta
total 5708
drwxr-xr-x 3 root root 4096 ene 4 2017 ..
-rw------- 1 root root 206315 ene 4 2017 mysql.preupgrade.12.0.18-12.0.18.20170104-173632.dump.gz
-rw------- 1 root root 3417 ene 4 2017 mysql.preupgrade.apsc.12.0.18-12.0.18.20170104-173633.dump.gz
-rw------- 1 root root 208481 ene 4 2017 mysql.preupgrade.12.0.18-12.5.30.20170104-174155.dump.gz
-rw------- 1 root root 3002 ene 4 2017 mysql.preupgrade.apsc.12.0.18-12.5.30.20170104-174156.dump.gz
-rw------- 1 root root 220725 ene 23 2017 mysql.preupgrade.12.5.30-12.5.30.20170123-062554.dump.gz
-rw------- 1 root root 3002 ene 23 2017 mysql.preupgrade.apsc.12.5.30-12.5.30.20170123-062556.dump.gz
-rw------- 1 root root 236736 feb 8 06:27 mysql.preupgrade.12.5.30-12.5.30.20170208-062713.dump.gz
-rw------- 1 root root 3003 feb 8 06:27 mysql.preupgrade.apsc.12.5.30-12.5.30.20170208-062715.dump.gz
-rw------- 1 root root 262580 feb 24 06:26 mysql.preupgrade.12.5.30-12.5.30.20170224-062621.dump.gz
-rw------- 1 root root 4603 feb 24 06:26 mysql.preupgrade.apsc.12.5.30-12.5.30.20170224-062623.dump.gz
-rw------- 1 root root 258785 mar 22 06:26 mysql.preupgrade.12.5.30-12.5.30.20170322-062626.dump.gz
-rw------- 1 root root 4898 mar 22 06:26 mysql.preupgrade.apsc.12.5.30-12.5.30.20170322-062627.dump.gz
-rw------- 1 root root 251339 abr 17 06:25 mysql.preupgrade.12.5.30-12.5.30.20170417-062540.dump.gz
-rw------- 1 root root 4899 abr 17 06:25 mysql.preupgrade.apsc.12.5.30-12.5.30.20170417-062543.dump.gz
-rw------- 1 root root 244219 may 16 06:25 mysql.preupgrade.12.5.30-12.5.30.20170516-062533.dump.gz
-rw------- 1 root root 4373 may 16 06:25 mysql.preupgrade.apsc.12.5.30-12.5.30.20170516-062535.dump.gz
-rw------- 1 root root 248044 jun 1 06:25 mysql.preupgrade.12.5.30-12.5.30.20170601-062529.dump.gz
-rw------- 1 root root 4381 jun 1 06:25 mysql.preupgrade.apsc.12.5.30-12.5.30.20170601-062530.dump.gz
-rw------- 1 root root 273341 jul 17 06:25 mysql.preupgrade.12.5.30-12.5.30.20170717-062542.dump.gz
-rw------- 1 root root 4379 jul 17 06:25 mysql.preupgrade.apsc.12.5.30-12.5.30.20170717-062544.dump.gz
-rw------- 1 root root 367277 jul 20 06:26 mysql.daily.dump.8.gz
-rw------- 1 root root 367218 jul 21 06:25 mysql.daily.dump.7.gz
-rw------- 1 root root 368954 jul 22 06:25 mysql.daily.dump.6.gz
-rw------- 1 root root 369279 jul 23 06:25 mysql.daily.dump.5.gz
-rw------- 1 root root 368767 jul 24 06:25 mysql.daily.dump.4.gz
-rw------- 1 root root 369629 jul 25 06:26 mysql.daily.dump.3.gz
-rw------- 1 root root 370169 jul 26 06:25 mysql.daily.dump.2.gz
-rw------- 1 root root 368027 jul 27 06:25 mysql.daily.dump.1.gz
-rw------- 1 root root 368128 jul 28 06:26 mysql.daily.dump.0.gz
drwxr-xr-x 2 psaadm psaadm 4096 jul 29 01:32 .
-rw------- 1 root root 20 jul 29 01:32 mysql.plesk.core.prerm.12.5.30.20170729-013250.dump.gz
First of all, I recommend to change the hosting provider, as their answer is incorrect and it seems, that they don't have much experience with Plesk, nor do they seem to have much knowledge about Plesk.
Second, your statements are a bit unclear, as you state:
although I made a backup
and directly afterwards you stated:
and I didn't
Could you pls. clarify WHAT you did and what you forgot to do?
Third, pls. have a look at => "/var/lib/psa/dumps" and inform us about the possible content.
Fourth, if you have dumps located at "/var/lib/psa/dumps", you will always have the choice to re-install Plesk and to re-import the latest "psa", "mysql" and "horde" - databases from your dumps. How to restore a Plesk database dump is explained at:
=> https://support.plesk.com/hc/en-us/articles/213904125
If you have further Plesk related questions, I recommend a new thread at the official Plesk Community Forum ( => https://talk.plesk.com ) , where experienced Plesk users will help you with Plesk - related questions/issues/errors/problems! ;-)

Libcurl not updated

I am on Ubuntu 14.04 and need curl version > 7.40 so I have followed some steps to install latest curl version (7.48)
As root
wget http://curl.haxx.se/download/curl-7.48.0.tar.gz
apt-get install libtool
apt-get install make
Extracted the file
tar -xvf curl-7.48.0.tar.gz
then in the extracted folder:
./buildconf
./configure
make
make install
Updated the binaries
mv /usr/bin/curl /usr/bin/curl.bak
cp /usr/local/bin/curl /usr/bin/curl
then restarted the machine.
I can see the new curl version but the libcurl library is not updated, is still 7.35
root:~# curl -V
curl 7.48.0 (x86_64-unknown-linux-gnu) libcurl/7.35.0, OpenSSL/1.0.1f zlib/1.2.8 libidn/1.28 librtmp/2.3
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp smtp smtps telnet tftp
Features: AsynchDNS IDN IPv6 Largefile NTLM NTLM_WB SSL libz TLS-SRP
I've checked the file /etc/ld.so.conf
but it doesn't give me much info
include /etc/ld.so.conf.d/*.conf
As well the folder:
root:/etc/ld.so.conf.d# ll
total 52
drwxr-xr-x 2 root root 4096 Feb 18 14:17 ./
drwxr-xr-x 167 root root 12288 Apr 26 14:30 ../
-rwxr-xr-x 1 root root 26 Nov 21 2007 agnclient-compat.conf*
-rw-r--r-- 1 root root 14 Aug 24 2009 agns.conf
-rw-rw-r-- 1 root root 38 Mar 24 2014 fakeroot-x86_64-linux-gnu.conf
lrwxrwxrwx 1 root root 40 Feb 5 16:42 i386-linux-gnu_GL.conf -> /etc/alternatives/i386-linux-gnu_gl_conf
-rw-r--r-- 1 root root 108 Apr 12 2014 i686-linux-gnu.conf
-rw-r--r-- 1 root root 44 Aug 9 2009 libc.conf
-rw-r--r-- 1 root root 33 Aug 1 2014 symav.conf
-rw-r--r-- 1 root root 68 Apr 12 2014 x86_64-linux-gnu.conf
lrwxrwxrwx 1 root root 43 Feb 3 12:05 x86_64-linux-gnu_EGL.conf -> /etc/alternatives/x86_64-linux-gnu_egl_conf
lrwxrwxrwx 1 root root 42 Feb 3 12:05 x86_64-linux-gnu_GL.conf -> /etc/alternatives/x86_64-linux-gnu_gl_conf
-rw-r--r-- 1 root root 56 Apr 12 2014 zz_i386-biarch-compat.conf
-rw-r--r-- 1 root root 58 Apr 12 2014 zz_x32-biarch-compat.conf
root:/etc/ld.so.conf.d#
Update
going through each conf file I have found 3 places where there is libcurl library
under /usr/lib/agnclient-compat (agnclient is an AT&T VPN agent client)
lrwxrwxrwx 1 root root 16 Feb 3 12:11 libcurl.so.3 -> libcurl.so.3.0.0
-rw-r--r-- 1 root root 248028 Nov 21 2007 libcurl.so.3.0.0
under /usr/local/lib
lrwxrwxrwx 1 root root 16 Apr 25 12:34 libcurl.so -> libcurl.so.4.4.0*
lrwxrwxrwx 1 root root 16 Apr 25 12:34 libcurl.so.4 -> libcurl.so.4.4.0*
-rwxr-xr-x 1 root root 376889 Apr 25 12:34 libcurl.so.4.4.0*
and under /usr/lib/x86_64-linux-gnu
lrwxrwxrwx 1 root root 19 Jan 26 20:05 libcurl-gnutls.so.3 -> libcurl-gnutls.so.4
lrwxrwxrwx 1 root root 23 Jan 26 20:05 libcurl-gnutls.so.4 -> libcurl-gnutls.so.4.3.0
-rw-r--r-- 1 root root 401512 Jan 26 20:05 libcurl-gnutls.so.4.3.0
lrwxrwxrwx 1 root root 12 Jan 26 20:05 libcurl.so.3 -> libcurl.so.4
lrwxrwxrwx 1 root root 16 Jan 26 20:05 libcurl.so.4 -> libcurl.so.4.3.0
-rw-r--r-- 1 root root 422696 Jan 26 20:05 libcurl.so.4.3.0
So the latest lib which I've installed yesterday is under /usr/local/lib, but it loads the one from the VPN client.
It was an easy fix after the update.
I've modified the file /etc/ld.so.conf
include /usr/local/lib
include /etc/ld.so.conf.d/*.conf
then executed
ldconfig -v
Now I have what I need
root#carlo-ThinkPad-W541:~# curl -V
curl 7.48.0 (x86_64-unknown-linux-gnu) libcurl/7.48.0 zlib/1.2.8
Protocols: dict file ftp gopher http imap pop3 rtsp smtp telnet tftp
Features: IPv6 Largefile libz UnixSockets

Reading package lists... Error! on EC2

I am running Ubuntu 14.04.1 LTS on a t1.micro on ec2. Just a moment ago I logged in, ran sudo apt-get update and got Reading package lists... Error!
I also realized that I no longer can install packages using sudo apt-get install.
Any idea what went wrong here? And how to fix it?
I have tried the answer suggested in this thread https://unix.stackexchange.com/questions/139441/reading-package-lists-error but that did not fix the problem. What makes things a little annoying also is the lack of error logs (or the fact I do not know where to look). For example the sudo apt-get install just fails and I do not know how to run it in verbose mode or where to look to find the specific reason why it is failing...
Here is the content of /var/lib/apt/lists
total 105476
drwxr-xr-x 3 root root 4096 Mar 15 23:05 .
drwxr-xr-x 6 root root 4096 Mar 9 05:58 ..
-rw-r----- 1 root root 0 Mar 15 20:02 lock
drwxr-xr-x 2 root root 4096 Mar 15 23:05 partial
-rw-r--r-- 1 root root 822 Mar 15 19:23 pkg.jenkins-ci.org_debian_binary_Packages
-rw-r--r-- 1 root root 2046 Mar 15 19:23 pkg.jenkins-ci.org_debian_binary_Release
-rw-r--r-- 1 root root 181 Mar 15 19:23 pkg.jenkins-ci.org_debian_binary_Release.gpg
-rw-r--r-- 1 root root 19466 Mar 13 10:29 ppa.launchpad.net_webupd8team_java_ubuntu_dists_trusty_main_binary-amd64_Packages
-rw-r--r-- 1 root root 6192 Mar 13 10:29 ppa.launchpad.net_webupd8team_java_ubuntu_dists_trusty_main_i18n_Translation-en
-rw-r--r-- 1 root root 15111 Mar 13 10:29 ppa.launchpad.net_webupd8team_java_ubuntu_dists_trusty_Release
-rw-r--r-- 1 root root 316 Mar 13 10:29 ppa.launchpad.net_webupd8team_java_ubuntu_dists_trusty_Release.gpg
-rw-r--r-- 1 root root 1410166 Mar 12 21:35 security.ubuntu.com_ubuntu_dists_trusty-security_main_binary-amd64_Packages
-rw-r--r-- 1 root root 1140580 Mar 11 00:34 security.ubuntu.com_ubuntu_dists_trusty-security_main_i18n_Translation-en
-rw-r--r-- 1 root root 349379 Mar 12 21:40 security.ubuntu.com_ubuntu_dists_trusty-security_main_source_Sources
-rw-r--r-- 1 root root 61968 Mar 12 21:40 security.ubuntu.com_ubuntu_dists_trusty-security_Release
-rw-r--r-- 1 root root 933 Mar 12 21:40 security.ubuntu.com_ubuntu_dists_trusty-security_Release.gpg
-rw-r--r-- 1 root root 542657 Mar 12 21:35 security.ubuntu.com_ubuntu_dists_trusty-security_universe_binary-amd64_Packages
-rw-r--r-- 1 root root 250304 Mar 11 00:34 security.ubuntu.com_ubuntu_dists_trusty-security_universe_i18n_Translation-en
-rw-r--r-- 1 root root 72494 Mar 12 21:40 security.ubuntu.com_ubuntu_dists_trusty-security_universe_source_Sources
-rw-r--r-- 1 root root 8234934 May 8 2014 us-west-2.ec2.archive.ubuntu.com_ubuntu_dists_trusty_main_binary-amd64_Packages
-rw-r--r-- 1 root root 4149211 Apr 15 2014 us-west-2.ec2.archive.ubuntu.com_ubuntu_dists_trusty_main_i18n_Translation-en
-rw-r--r-- 1 root root 5000095 May 8 2014 us-west-2.ec2.archive.ubuntu.com_ubuntu_dists_trusty_main_source_Sources
-rw-r--r-- 1 root root 58512 May 8 2014 us-west-2.ec2.archive.ubuntu.com_ubuntu_dists_trusty_Release
-rw-r--r-- 1 root root 933 May 8 2014 us-west-2.ec2.archive.ubuntu.com_ubuntu_dists_trusty_Release.gpg
-rw-r--r-- 1 root root 31726252 May 8 2014 us-west-2.ec2.archive.ubuntu.com_ubuntu_dists_trusty_universe_binary-amd64_Packages
-rw-r--r-- 1 root root 18635427 May 8 2014 us-west-2.ec2.archive.ubuntu.com_ubuntu_dists_trusty_universe_i18n_Translation-en
-rw-r--r-- 1 root root 27857155 May 8 2014 us-west-2.ec2.archive.ubuntu.com_ubuntu_dists_trusty_universe_source_Sources
-rw-r--r-- 1 root root 2881415 Mar 15 22:58 us-west-2.ec2.archive.ubuntu.com_ubuntu_dists_trusty-updates_main_binary-amd64_Packages
-rw-r--r-- 1 root root 1784682 Mar 12 18:07 us-west-2.ec2.archive.ubuntu.com_ubuntu_dists_trusty-updates_main_i18n_Translation-en
-rw-r--r-- 1 root root 938350 Mar 15 22:58 us-west-2.ec2.archive.ubuntu.com_ubuntu_dists_trusty-updates_main_source_Sources
-rw-r--r-- 1 root root 61966 Mar 15 22:58 us-west-2.ec2.archive.ubuntu.com_ubuntu_dists_trusty-updates_Release
-rw-r--r-- 1 root root 933 Mar 15 22:58 us-west-2.ec2.archive.ubuntu.com_ubuntu_dists_trusty-updates_Release.gpg
-rw-r--r-- 1 root root 1538422 Mar 15 22:58 us-west-2.ec2.archive.ubuntu.com_ubuntu_dists_trusty-updates_universe_binary-amd64_Packages
-rw-r--r-- 1 root root 669587 Mar 12 18:27 us-west-2.ec2.archive.ubuntu.com_ubuntu_dists_trusty-updates_universe_i18n_Translation-en
-rw-r--r-- 1 root root 510829 Mar 15 22:58 us-west-2.ec2.archive.ubuntu.com_ubuntu_dists_trusty-updates_universe_source_Sources
and a little snippet from /var/lib/dpkg/status
Package: node-normalize-package-data
Status: install ok installed
Priority: extra
Section: web
Installed-Size: 58
Maintainer: Ubuntu Developers <ubuntu-devel-discuss#lists.ubuntu.com>
Architecture: all
Version: 0.2.2-1
Depends: nodejs, node-github-url-from-git, node-semver (>= 2)
Description: Normalizes package metadata - Node.js module
This module is used by node-read-package-json to normalize data it
reads from a package.json file typically found in Node.js modules,
but in principle it could come from any source.
.
Node.js is an event-based server-side javascript engine.
Original-Maintainer: Debian Javascript Maintainers <pkg-javascript-devel#lists.alioth.debian.org>
Homepage: https://github.com/meryn/normalize-package-data
A restart of the instance fixed the issue. Why this worked, I cannot explain!
You can try out the below commands to fix the issue
sudo rmdir /var/lib/dpkg/status
sudo touch /var/lib/dpkg/status
sudo apt-get update
The first command will remove the empty directory, second will create the new directory and the last command will populate the lists files.
Also, Restart your EC2 instance to make the above changes effective.

Resources