samsonbull
Posts: 3
Joined: Fri Jul 20, 2018 3:38 am

Scratching my head- getting started

Fri Jul 20, 2018 3:44 pm

I have a Pi 3 + b and am using the latest build of Raspian. At first I was unable to sudo apt-get update because it would throw an error:
E: Malformed line 1 in source list /etc/apt/sources.list.d/raspi.list (type)
E: The list of sources could not be read.

When I ran a cat of /etc/apt/sources.list.d/raspi.list it had a bunch of special characters $$$$$$$

I then did a sudo vi of the file and deleted the lines and then added:

deb http://mirrordirector.raspbian.org/raspbian/ jessie main contrib non-free rpi
deb-src http://archive.raspbian.org/raspbian/ jessie main contrib non-free rpi

The i re ran the sudo apt-get update and it worked like a champ.

Next I wanted to install tcpreplay. I issued the command: sudo apt-get install tcpreplay and it seeed to go normally until it asked to very that I wanted to install it and showed the small disk space. After pressing "Y" and enter I got:

"dpkg: error: fgets gave an empty string from '/var/lib/dpkg/triggers/File'
E: Sub-process /usr/bin/dpkg returned an error code (2)"

Did my image come down as corrupt, or are others having problems as well? Any suggestions would be greatly appreciated.

fruitoftheloom
Posts: 19795
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: Scratching my head- getting started

Fri Jul 20, 2018 5:38 pm

samsonbull wrote:
Fri Jul 20, 2018 3:44 pm
I have a Pi 3 + b and am using the latest build of Raspian. At first I was unable to sudo apt-get update because it would throw an error:
E: Malformed line 1 in source list /etc/apt/sources.list.d/raspi.list (type)
E: The list of sources could not be read.

When I ran a cat of /etc/apt/sources.list.d/raspi.list it had a bunch of special characters $$$$$$$

I then did a sudo vi of the file and deleted the lines and then added:

deb http://mirrordirector.raspbian.org/raspbian/ jessie main contrib non-free rpi
deb-src http://archive.raspbian.org/raspbian/ jessie main contrib non-free rpi

The i re ran the sudo apt-get update and it worked like a champ.

Next I wanted to install tcpreplay. I issued the command: sudo apt-get install tcpreplay and it seeed to go normally until it asked to very that I wanted to install it and showed the small disk space. After pressing "Y" and enter I got:

"dpkg: error: fgets gave an empty string from '/var/lib/dpkg/triggers/File'
E: Sub-process /usr/bin/dpkg returned an error code (2)"

Did my image come down as corrupt, or are others having problems as well? Any suggestions would be greatly appreciated.

Raspbian Jessie went end of life a year ago and pre-dates the RPi 3B+.

I would suggest you grab a new genuine Class10 SD Card and use Etcher to create a bootable Raspbian Stretch with Debian SD Card:

https://www.raspberrypi.org/downloads/raspbian/
adieu

My other Computer is an Asus CS10 ChromeBit running Chrome Operating System.
HP Envy 4500 Wireless Printer supported by HPLIP software in Raspbian Buster.
Raspberry Pi Model 2B v1.1

User avatar
B.Goode
Posts: 7868
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Scratching my head- getting started

Fri Jul 20, 2018 5:43 pm

I have a Pi 3 + b and am using the latest build of Raspian. At first I was unable to sudo apt-get update because it would throw an error:
E: Malformed line 1 in source list /etc/apt/sources.list.d/raspi.list (type)
E: The list of sources could not be read.

When I ran a cat of /etc/apt/sources.list.d/raspi.list it had a bunch of special characters $$$$$$$

I then did a sudo vi of the file and deleted the lines and then added:

deb http://mirrordirector.raspbian.org/raspbian/ jessie main contrib non-free rpi
deb-src http://archive.raspbian.org/raspbian/ jessie main contrib non-free rpi

The i re ran the sudo apt-get update and it worked like a champ.

Unfortunately you probably now have a broken, confused or unstable Operating System.

The current/latest release of Raspbian at the time of writing is based on the Stretch version, and has been since mid-August 2017. Adding repositories for the prior Jessie release is probably not appropriate.

The underlying cause may be a faulty or failing microSD card rather than an issue with the image distributed by the Raspberry Pi Foundation.

Return to “Troubleshooting”