LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-02-2022, 10:07 AM   #1
HannemanThrashKing
Member
 
Registered: Oct 2017
Location: Canada
Distribution: Ubuntu MATE
Posts: 35

Rep: Reputation: Disabled
Question How do I have all of the lines from an update done in a terminal to a log file? Ubuntu Mate doesn't and I need the text


Screengrabs do not fit my purpose.

I know about /var/log/apt and history.log and term.log in there but it doesn't get logged in there in Ubuntu MATE 20.04.3. In fact it gets logged nowhere, since UM comes with the handy Log File Viewer, I've been able to verify that,I could copypaste lines as it happens but I then would likely be told that the log is not complete, there's a certain limit to how many lines the screen will show. I need to be able to copy paste lines from an updating process, it's not as simple as "command > result.txt" with sudo apt update then sudo apt upgrade. I'm not really a newbie but I guess I never had to do this, I could always find logs for anything before, but I never needed to get update lines from an update to catch an error I cannot show otherwise (screengrabs are not good enough apparently).

Thank you very much, I hope it is possible at all, this one error I have figured everything about except for one last step to fix, I can't find how or get help to fix it without update logs I can copypaste and put in bbcode tags.

Last edited by HannemanThrashKing; 02-02-2022 at 10:09 AM.
 
Old 02-02-2022, 10:12 AM   #2
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 3,670

Rep: Reputation: Disabled
/var/log/dpkg.log perhaps?
 
Old 02-02-2022, 10:25 AM   #3
HannemanThrashKing
Member
 
Registered: Oct 2017
Location: Canada
Distribution: Ubuntu MATE
Posts: 35

Original Poster
Rep: Reputation: Disabled
Nope, it's on the options right on the left in the Log-File Viewer in MATE. The updates do not get logged at all, we have to get past that. Maybe there is a way to create a log file when one does sudo apt-update && sudo apt-upgrade , some parameters added to it or something maybe?
 
Old 02-02-2022, 10:29 AM   #4
HannemanThrashKing
Member
 
Registered: Oct 2017
Location: Canada
Distribution: Ubuntu MATE
Posts: 35

Original Poster
Rep: Reputation: Disabled
I have found this as a solution, but someone will have to tell me if it would only work for a single package as in the example I found

Code:
sudo apt-get install <package-name> | tee Log.txt
tee command does it all apparently, first time I hear of it in 11 years of usage, always learning something new lol

Now, I'm just afraid to proceed without confirmation that it will work for a general update, not just for one package.
 
Old 02-02-2022, 11:25 AM   #5
HannemanThrashKing
Member
 
Registered: Oct 2017
Location: Canada
Distribution: Ubuntu MATE
Posts: 35

Original Poster
Rep: Reputation: Disabled
To be clear, DPKG will show some installations, but not the error message that is only shown during the install process I experience since a while, that I have a good idea how to get rid of, but I need a copypaste of the install process entirely.
 
Old 02-02-2022, 11:33 AM   #6
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 3,670

Rep: Reputation: Disabled
Are you sure that error message is displayed on stdout and not on stderr?

You may have to redirect stderr.

Code:
sudo apt-get install <package-name> 2>&1 | tee Log.txt

Last edited by shruggy; 02-03-2022 at 02:44 AM.
 
Old 02-03-2022, 01:11 AM   #7
suramya
Member
 
Registered: Jan 2022
Location: Earth
Distribution: Debian
Posts: 249

Rep: Reputation: 102Reputation: 102
Quote:
Originally Posted by shruggy View Post
Are you sure that error message is displayed on stdin and not on stderr?

You may have to redirect stderr.

Code:
sudo apt-get install <package-name> 2>&1 | tee Log.txt
This is good to know. I have been using tee to log the results for apt-get dist-upgrade for a while now and didn't realize that the stderr wasn't getting logged. Luckily I didn't need to but going forward I can ensure all errors are also logged.
 
Old 02-03-2022, 01:19 AM   #8
!!!
Member
 
Registered: Jan 2017
Location: Fremont, CA, USA
Distribution: Trying any&ALL on old/minimal
Posts: 997

Rep: Reputation: 382Reputation: 382Reputation: 382Reputation: 382
Code:
man script
 
1 members found this post helpful.
  


Reply

Tags
20.04, log, text, ubuntu mate, update



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Which is less likely to have crashes, Mint Mate or Ubuntu Mate? Rock8J Linux - Newbie 6 12-12-2019 08:38 PM
LXer: How To Empty a File, Delete N Lines From a File, Remove Matching String From a File, And Remove Empty/Blank Lines From a File In Linux LXer Syndicated Linux News 0 11-22-2017 12:30 PM
LXer: MATE 1.14 Desktop Environment Available for Ubuntu MATE 16.04 LTS, Update Now LXer Syndicated Linux News 0 06-09-2016 04:03 AM
LXer: Ubuntu MATE 15.04 Arrives With MATE Desktop 1.8.2 and MATE Tweak LXer Syndicated Linux News 0 05-15-2015 09:30 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:15 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration