0

apt and the associated tools are not working using any of them: sudo apt, apt-get, apt-config, aptitude, ..., just returns me to the prompt. I checked /var/log/apt and nothing is getting written to the logs.

Any idea what is going on and how to fix it?

Output from uname -a:

Linux raspberrypi 4.1.14+ #4 PREEMPT Wed Mar 23 15:16:24 UTC 2016 armv6l GNU/Linux
  • You are obviously running an obsolete OS (which has probably never been updated) – Milliways Apr 15 at 3:24
  • Okay, and . . . – gxs Apr 15 at 4:49
  • Start by providing some information and the commands you are trying and any errors – Milliways Apr 15 at 5:00
  • 1
    Is there a reason you can’t just reflash your SD Card with the latest Raspbian Stretch? – CoderMike Apr 15 at 6:51
  • I probably can just overwrite the card. It have a small HAT with a 3" screen, I'll track down the packages for that and reinstall afterward. What I was curious about is that is just stopped one day. For example 'sudo apt --help' returns to the prompt with no output. – gxs Apr 15 at 16:36
2

If /etc/apt/sources.list and /etc/apt/sources.list.d/raspi.list are empty then you get the behavior you described. apt tools just return to the prompt because there is no repository to manage. I don't know what operating system and version do you use but with Raspbian Stretch the list files should contain:

rpi ~$ cat /etc/apt/sources.list
deb http://raspbian.raspberrypi.org/raspbian/ stretch main contrib non-free rpi
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
#deb-src http://raspbian.raspberrypi.org/raspbian/ stretch main contrib non-free rpi

rpi ~$ cat /etc/apt/sources.list.d/raspi.list
deb http://archive.raspberrypi.org/debian/ stretch main ui
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
#deb-src http://archive.raspberrypi.org/debian/ stretch main ui
  • Yes these files are populated, pointed to jessie archives. I was editing them, so I'll take a look to make sure I didn't fat finger them. Thank you. – gxs Apr 15 at 16:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.