Thursday, May 2, 2024
 Popular · Latest · Hot · Upcoming
3
rated 0 times [  3] [ 0]  / answers: 1 / hits: 933  / 2 Years ago, mon, july 4, 2022, 3:53:09

Every time I launch a terminal it attempts to execute sudo apt-get update



This happens regardless of which terminal emulator is used - both guake and gnome-terminal do it at least.



It also does the behavior upon creating new tabs within either terminal application or when logging into different ttys. Any time a new bash is started it seems.



Additionally, the command inexplicably fails (command not found) - though it executes perfectly if I type it in manually.



How can I make this strange terminal quirk desist?



enter image description here


More From » 12.10

 Answers
4

The error message



sudo apt-get update: command not found


means that something is trying to execute a command called "sudo apt-get update", not the command sudo with arguments apt-get and update.



There must be such a command in one of the several scripts that are invoked when bash starts. It could be any of:




  • /etc/profile

  • ~/.bash_profile

  • ~/.bash_login

  • ~/.profile

  • ~/.bashrc



or something invoked by any of them. Try grepping for apt-get in those files. If that fails, look at other scripts and commands they invoke.



For example, I just reproduced the error message by (temporarily) adding this line:



"sudo apt-get full-upgrade"


(including the quotes) to my ~/.bashrc.



You can also try running bash -lx from the prompt; -l makes it a login shell, and -x causes it to trace commands. To save the output in a file:



bash -lx < /dev/null > bash-lx.log 2>&1

[#33739] Tuesday, July 5, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ronicod

Total Points: 71
Total Questions: 111
Total Answers: 111

Location: Montenegro
Member since Fri, Dec 10, 2021
2 Years ago
;