LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   10.3 Terminal problem (https://www.linuxquestions.org/questions/debian-26/10-3-terminal-problem-4175672831/)

DownSouth 04-09-2020 01:07 AM

10.3 Terminal problem
 
Installed 32bit Deb 10.3 on 16GB USB via net install CD. Install went well.

First boot, all appeared fine - Net access etc. all OK. Looked to be a nice
responsive up-to-date system. Have re-booted several times and all OK.

Then i went to the terminal... and it refused to accept the root password.
I know this password is OK because I used it to access Synaptic which also
requires root password..

Checking this and other forums, discovered that "sudo" is no longer used
and has been replaced by "su' - but after experimenting, the only thing this
does is allow me to switch to username - so still no command funtions.

EG: If after switching to "username" I type "apt-get clean" it tells me...

E: Could not open lock file /var/cache/apt/archives/lock - open (13: Permission denied)
E: Unable to lock directory /var/cache/apt/archives/
E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied)
E: Unable to lock directory /var/lib/apt/lists/
W: Problem unlinking the file /var/cache/apt/pkgcache.bin - RemoveCaches (13: Permission denied)
W: Problem unlinking the file /var/cache/apt/srcpkgcache.bin - RemoveCaches (13: Permission denied)

And I assume these messages are a result of using my normal log-in password for
the switch to username, rather than the root password for access to the terminal
to use commands, even though this is the only time it's accepted ANY password.


As I've had no problems with the terminal in any other versions of Linus that I've installed, I'm wondering
just what is wrong. Everything, apart from the terminal, appears fine and functions properly.


Anyone have any plain-English solutions to this problem?


And er - hello BTW.

berndbausch 04-09-2020 02:50 AM

Quote:

Originally Posted by DownSouth (Post 6109399)
Then i went to the terminal

What do you mean by that? Did you open a terminal window? Did you access a text console? Perhaps a serial terminal? What exactly did you do to "go to the terminal"?

It is possible that whatever terminal you used is blocked from root access. The file /etc/securetty contains terminals where root access is allowed.
Quote:

Checking this and other forums, discovered that "sudo" is no longer used
and has been replaced by "su'
I don't think so. You can easily install sudo.
Quote:

- but after experimenting, the only thing this
does is allow me to switch to username - so still no command funtions.
su allows you to switch to root, normally. Although it can be configured so that it doesn't.
Quote:

EG: If after switching to "username" I type "apt-get clean" it tells me...

E: Could not open lock file /var/cache/apt/archives/lock - open (13: Permission denied)
...
That's normal. These actions require superuser privileges, which username probably doesn't have.

Quote:

Anyone have any plain-English solutions to this problem?
Log on as username, type su, type the superuser password and you are in business. If this doesn't work, I am interested in the content of /etc/pam.d/su, the file that configures who is allowed to become root.

Or log on to the graphical environment as root. This is frowned upon, but hey, you want to achieve something.

Or log on to the graphical environment as username, open a terminal window and use su to become root. You don't need a text console to run apt-get clean.

michaelk 04-09-2020 03:00 AM

Welcome to linuxquestions.
sudo has not been replaced, it's just not enabled by default.

su allows you to become another user whereas sudo allows you to run commands with another users priviledges usually roots. With sudo you would use your password but su requires the password of the user your switching to.

su without a username defaults to root. The - option also switches to that user's environment.

At first guess your still not logged in as root which is why your seeing the permission errors.

Turbocapitalist 04-09-2020 03:47 AM

So if you have set the password for the root account during, or after, installation, you can use it to do the updates and such:

Code:

su -l
apt update
apt upgrade
apt autoremove

That will switch you to the root account and from there apt or apt-get will work as expected.

Note that if you are going to be scripting any of that then look at apt-get and the -y option.

DownSouth 04-09-2020 11:13 AM

First off, thanks for the prompt responses.

*Turbocap - yes, root password was set during installation - will try your advice
and report back.

*MichaelK - thanks for clarification re 'sudo' - will (hopefully!!) explain more
fully when I report back.

*Berndbau - briefly, I used the Terminal Emulator window.

DownSouth 04-09-2020 11:52 PM

TurboCap, what can I say? Your advice was perfect and worked like a charm!
I don't know - the words 'thank you' frankly seem a tiny bit inadequate, even though
to someone who 'knows stuff' etc. it may seem like nothing but it made a big difference.

Did a 'test-drive' - typed "autoremove" and it wanted to take out about 260 items (= 370MB)
but as some of the items on the list seemed useful, I declined. Made me wonder though if
other people actually look through the listing before typing 'y'?

One last thing, in the menu are UXTerm & XTerm - haven't used them, but I wondered what
the advantages / differences are?

As mentioned originally, everything about this system (now the terminal functions normally)
is satisfying - Deb with an xfce DE so, nice & lean. Thoroughly recommend it.

I'd send you an Easter egg, but... I've er - eaten it. However, I can
tell you it was delicious, and I'm sure you would have enjoyed it. :-)


My gratitude once again - have a peaceful Easter and stay healthy.
(and that goes to everyone else at LinuxQuestions...)

Turbocapitalist 04-10-2020 01:45 AM

Quote:

Originally Posted by DownSouth (Post 6109797)
...
Made me wonder though if other people actually look through the listing before typing 'y'?

If you go down the rabbit hole of systemd admnistration and dig around in the advanced capabilities, you can hold specific versions, either old, normal, or bleeding edge, or keep certain dependencies in or out, and so on.

I mention the -y option because, using the shell is basically programming and anything you can type you can keep in a script for replay later, either manual replay or automatic, or local or remote.

Quote:

Originally Posted by DownSouth (Post 6109797)
...
One last thing, in the menu are UXTerm & XTerm - haven't used them, but I wondered what
the advantages / differences are?

[edit: just to be clear, uxterm runs xterm for you, but with better UTF-8 support]

They're both rather minimal, though UXTerm should have better UTF-8 support. You can see if there are any obvious differences by running them side by side and looking at the menus. The manual pages don't show much. Some terminals do get quite fancy but your own scripts can do more.

A good Easter to you too.


All times are GMT -5. The time now is 02:35 AM.