Terminal and the SUDO command output missing - AstroBerry for Raspberry PI


This is my first post. I can never seem to get the correct syntax to find the solution. Here is the problem

astroberry@astroberry: sudo apt-get -f install

Examply 2:

astroberry@astroberry: sudo apt-get install synaptic

astroberry@astroberry: syanptic

Command 'synaptic' not found, but can be installed with:

sudo apt install synaptic

astroberry@astroberry: sudo apt install synaptic
astroberry@astroberry: synaptic

Command 'synaptic' not found, but can be installed with:

sudo apt install synaptic

From example 2, no expected messages of any good or problems are displayed. Nothing happens under sudo.

Example 3:

astroberry@astroberry: sudo pluma

pluma executes

From example 3, sudo will shell Root to applications.

I am investigating APT for bad installs. Everything has to be under sudo. SUDO APT-GET UPGRADE/CLEAN/AUTOCLEAN does nothing. SYSLOG shows nothing unusual. There must be some place SUDO should be making logs of its output. I am not finding it. This version for UM for PI is from INDI, Astroberry.

Software Updater is working. I had a bad install of an application that seemed to be the problem of it not working. The software was 1.0 version of oacapture.

Ubuntu-Mate 18.04 armhf Raspberry PI 3B+
Astroberry server

Thank you.

Welcome to the forums! And sorry to hear that your APT is broken. That really puts you in a chicken-and-egg problem because the normal way to fix broken software is via apt...

What's the return code when you run apt-get? That might tell you something. Find out via:

sudo apt-get install -y synaptic
echo $?

You can also see if apt-get has other functionality that still works like -v (print version), --print-uris, or even --help.

Once you have an idea of where things are broken at a high level, you can dig into where apt-get install is getting cut off via strace:

sudo strace apt-get install -y synaptic

And once you get far enough there might be useful stuff under /var/log/apt/

Also, given you had sudo pluma running I'm a bit unclear whether your missing-output problem is tied to sudo or sudo apt per se. If you run sudo ls -la does it show anything? strace would be of help in either case.

Hello Jdonald,

Thank you for your gracious reply. I have looked at the command offered. Here is output.

ECHO $? = 100

Very descriptive to say the least. I noticed both history.log and Term.log are terminated at 7/21/2019. This is strange. I am attempting to install synaptic. I should have every output attempt logged somewhere.

The 100 code based on the Strace says the Synaptic package cannot be found. Then the 100 code is displayed.

Looks like your apt-get is running to completion. 100 is the correct return code for a package not found. So indeed something is hiding stdout for your commands.

My /var/lib/apt/ logs don't update when I attempt to apt-get a package not found, so I think your log timestamps are actually correct.

I'm still unsure whether the output getting hidden is a problem with sudo per se or apt. What happens when you just do:

sudo echo hello


And if that has no output, when you do:

sudo su

do you end up in a shell where you can type regular commands without seeing any output until you exit?

And if it's only sudo that's the problem, could you avoid it for now and just use su to troubleshoot?

# log in as root via password
apt update
apt-cache search synaptic
# troubleshoot...
apt-get install synaptic

Hello JDonald,

I found the culprit. Some install did a change to ~/.bashrc. "&>/dev/null" was added to the ALIAS line for sudo='sudo env PATH=$PATH' . I removed it the errant code and now I get the expect output. Thank you for getting me to look at other things.

I did find out on the Astroberry image SU is a different password from SUDO. The SUDO password does not work. We can close this

1 Like