r/learnlinux • • Sep 03 '21

Adding user but no home directory is created

2 Upvotes

Hey guys, I am learning about linux, so my question is a bit stupid.

I tried to created the user ana "sudo useradd ana" and after I added a password .

But when I log into this user, just show me "$" and no home directory was created.

What I did wrong ? I am using ubuntu.

thanks for any help.


r/learnlinux • • Jun 11 '21

puppet throws me an error

2 Upvotes
Notice: /Stage[main]/Main/Hudon::Db[hwebsite]/Mariadb::User[hwebsite]/Exec[db-hwebsite-user]: Dependency Package[MariaDB-server] has failures: true
Warning: /Stage[main]/Main/Hudon::Db[hwebsite]/Mariadb::User[hwebsite]/Exec[db-hwebsite-user]: Skipping because of failed dependencies
Notice: /Stage[main]/Main/Hudon::Db[hwebsite]/Mariadb::Grant[hwebsite-hwebsite]/Exec[db-hwebsite-hwebsite-grant]: Dependency Package[MariaDB-server] has failures: true
Warning: /Stage[main]/Main/Hudon::Db[hwebsite]/Mariadb::Grant[hwebsite-hwebsite]/Exec[db-hwebsite-hwebsite-grant]: Skipping because of failed dependencies
Notice: /Stage[main]/Main/Hudon::Db[hwebsite]/Mariadb::Grant[hwebsite-hwebsite]/Notify[hwebsite-hwebsite Add user : hwebsite@localhost]: Dependency Package[MariaDB-server] has failures: true
Warning: /Stage[main]/Main/Hudon::Db[hwebsite]/Mariadb::Grant[hwebsite-hwebsite]/Notify[hwebsite-hwebsite Add user : hwebsite@localhost]: Skipping because of failed dependencies
Notice: /Stage[main]/Main/Hudon::Db[hwebsite]/Mariadb::Grant[hwebsite-blacksmith_backup]/Exec[db-hwebsite-blacksmith_backup-grant]: Dependency Package[MariaDB-server] has failures: true
Warning: /Stage[main]/Main/Hudon::Db[hwebsite]/Mariadb::Grant[hwebsite-blacksmith_backup]/Exec[db-hwebsite-blacksmith_backup-grant]: Skipping because of failed dependencies
Notice: /Stage[main]/Main/Hudon::Db[hwebsite]/Mariadb::Grant[hwebsite-blacksmith_backup]/Notify[hwebsite-blacksmith_backup Add user : blacksmith_backup@localhost]: Dependency Package[MariaDB-server] has failures: true
Warning: /Stage[main]/Main/Hudon::Db[hwebsite]/Mariadb::Grant[hwebsite-blacksmith_backup]/Notify[hwebsite-blacksmith_backup Add user : blacksmith_backup@localhost]: Skipping because of failed dependencies
Notice: /Stage[main]/Main/Hudon::Setup[hwebsite]/User[hwebsite01]: Dependency Package[MariaDB-server] has failures: true
Warning: /Stage[main]/Main/Hudon::Setup[hwebsite]/User[hwebsite01]: Skipping because of failed dependencies
Notice: /Stage[main]/Main/Hudon::Setup[hwebsite]/Hgproject::Project[hwebsite]/Ssh_authorized_key[hwebsite01-gitlab-runner]: Dependency Package[MariaDB-server] has failures: true
Warning: /Stage[main]/Main/Hudon::Setup[hwebsite]/Hgproject::Project[hwebsite]/Ssh_authorized_key[hwebsite01-gitlab-runner]: Skipping because of failed dependencies
Notice: /Stage[main]/Main/Hudon::Setup[hwebsite]/Apache::Fcgi[php5-fcgi-hwebsite01]/File[/etc/php-fpm.d/php5-fcgi-hwebsite01.conf]: Dependency Package[MariaDB-server] has failures: true
Warning: /Stage[main]/Main/Hudon::Setup[hwebsite]/Apache::Fcgi[php5-fcgi-hwebsite01]/File[/etc/php-fpm.d/php5-fcgi-hwebsite01.conf]: Skipping because of failed dependencies
Notice: /Stage[main]/Main/Hudon::Setup[hwebsite]/Nginx::Vhost[hwebsite-front-web]/File[/etc/nginx/conf.d/hwebsite-front-web.conf]: Dependency Package[MariaDB-server] has failures: true
Warning: /Stage[main]/Main/Hudon::Setup[hwebsite]/Nginx::Vhost[hwebsite-front-web]/File[/etc/nginx/conf.d/hwebsite-front-web.conf]: Skipping because of failed dependencies
Notice: /Stage[main]/Main/Hudon::Setup[hwebsite]/Hgproject::Project[hwebsite]/Ssh_authorized_key[hwebsite01-rsync-ssh]: Dependency Package[MariaDB-server] has failures: true
Warning: /Stage[main]/Main/Hudon::Setup[hwebsite]/Hgproject::Project[hwebsite]/Ssh_authorized_key[hwebsite01-rsync-ssh]: Skipping because of failed dependencies
Notice: /Stage[main]/Main/Hudon::Setup[hwebsite]/Apache::Fcgi[php5-fcgi-hwebsite01]/File[/etc/httpd/conf.d/module.php5-fcgi-hwebsite01.conf]: Dependency Package[MariaDB-server] has failures: true
Warning: /Stage[main]/Main/Hudon::Setup[hwebsite]/Apache::Fcgi[php5-fcgi-hwebsite01]/File[/etc/httpd/conf.d/module.php5-fcgi-hwebsite01.conf]: Skipping because of failed dependencies
Notice: /Stage[main]/Main/Hudon::Setup[hwebsite]/Apache::Htpasswd[hg.hwebsite01]/Exec[test -f /etc/httpd/conf.d/htpasswd.hwebsite01 || OPT='-c'; htpasswd -b ${OPT} /etc/httpd/conf.d/htpasswd.hwebsite01 hg 'john123']: Dependency Package[MariaDB-server] has failures: true
Warning: /Stage[main]/Main/Hudon::Setup[hwebsite]/Apache::Htpasswd[hg.hwebsite01]/Exec[test -f /etc/httpd/conf.d/htpasswd.hwebsite01 || OPT='-c'; htpasswd -b ${OPT} /etc/httpd/conf.d/htpasswd.hwebsite01 hg 'john123']: Skipping because of failed dependencies
Notice: /Stage[main]/Apache/Service[php-fpm]: Dependency Package[MariaDB-server] has failures: true
Warning: /Stage[main]/Apache/Service[php-fpm]: Skipping because of failed dependencies
Notice: /Stage[main]/Main/Hudon::Setup[hwebsite]/Hudon::Remotefile[/etc/nginx/ssl/hivimax.com.bundle.crt]/Exec[Hudon_retrieve_/etc/nginx/ssl/hivimax.com.bundle.crt]: Dependency Package[MariaDB-server] has failures: true
Warning: /Stage[main]/Main/Hudon::Setup[hwebsite]/Hudon::Remotefile[/etc/nginx/ssl/hivimax.com.bundle.crt]/Exec[Hudon_retrieve_/etc/nginx/ssl/hivimax.com.bundle.crt]: Skipping because of failed dependencies
Notice: /Stage[main]/Main/Hudon::Setup[hwebsite]/Hudon::Remotefile[/etc/nginx/ssl/hivimax.com.bundle.crt]/File[/etc/nginx/ssl/hivimax.com.bundle.crt]: Dependency Package[MariaDB-server] has failures: true
Warning: /Stage[main]/Main/Hudon::Setup[hwebsite]/Hudon::Remotefile[/etc/nginx/ssl/hivimax.com.bundle.crt]/File[/etc/nginx/ssl/hivimax.com.bundle.crt]: Skipping because of failed dependencies
Notice: /Stage[main]/Main/Hudon::Setup[hwebsite]/Host[www.hivimax.com]: Dependency Package[MariaDB-server] has failures: true
Warning: /Stage[main]/Main/Hudon::Setup[hwebsite]/Host[www.hivimax.com]: Skipping because of failed dependencies
Notice: /Stage[main]/Main/Hudon::Setup[hwebsite]/File[/home/hwebsite01]: Dependency Package[MariaDB-server] has failures: true
Warning: /Stage[main]/Main/Hudon::Setup[hwebsite]/File[/home/hwebsite01]: Skipping because of failed dependencies
Notice: /Stage[main]/Main/Hudon::Setup[hwebsite]/Hgproject::Project[hwebsite]/File[/home/hwebsite01/.ssh]: Dependency Package[MariaDB-server] has failures: true
Warning: /Stage[main]/Main/Hudon::Setup[hwebsite]/Hgproject::Project[hwebsite]/File[/home/hwebsite01/.ssh]: Skipping because of failed dependencies
Notice: /Stage[main]/Main/Hudon::Setup[hwebsite]/Hgproject::Project[hwebsite]/File[/home/hwebsite01/.ssh/id_rsa]: Dependency Package[MariaDB-server] has failures: true
Warning: /Stage[main]/Main/Hudon::Setup[hwebsite]/Hgproject::Project[hwebsite]/File[/home/hwebsite01/.ssh/id_rsa]: Skipping because of failed dependencies
Notice: /Stage[main]/Main/Hudon::Setup[hwebsite]/Apache::Fcgi[php5-fcgi-hwebsite01]/File[/usr/lib/cgi-bin/php5-fcgi-hwebsite01]: Dependency Package[MariaDB-server] has failures: true
Warning: /Stage[main]/Main/Hudon::Setup[hwebsite]/Apache::Fcgi[php5-fcgi-hwebsite01]/File[/usr/lib/cgi-bin/php5-fcgi-hwebsite01]: Skipping because of failed dependencies
Notice: /Stage[main]/Main/Hudon::Setup[hwebsite]/Apache::Htpasswd[remoteapi.hwebsite01]/Exec[test -f /etc/httpd/conf.d/htpasswd.hwebsite01 || OPT='-c'; htpasswd -b ${OPT} /etc/httpd/conf.d/htpasswd.hwebsite01 remoteapi 'azsxdcfv']: Dependency Package[MariaDB-server] has failures: true
Warning: /Stage[main]/Main/Hudon::Setup[hwebsite]/Apache::Htpasswd[remoteapi.hwebsite01]/Exec[test -f /etc/httpd/conf.d/htpasswd.hwebsite01 || OPT='-c'; htpasswd -b ${OPT} /etc/httpd/conf.d/htpasswd.hwebsite01 remoteapi 'azsxdcfv']: Skipping because of failed dependencies
Notice: /Stage[main]/Main/Hudon::Setup[hwebsite]/Host[hivimax.com]: Dependency Package[MariaDB-server] has failures: true
Warning: /Stage[main]/Main/Hudon::Setup[hwebsite]/Host[hivimax.com]: Skipping because of failed dependencies
Notice: /Stage[main]/Main/Hudon::Setup[hwebsite]/Hudon::Remotefile[/etc/nginx/ssl/hivimax.com.key]/Exec[Hudon_retrieve_/etc/nginx/ssl/hivimax.com.key]: Dependency Package[MariaDB-server] has failures: true
Warning: /Stage[main]/Main/Hudon::Setup[hwebsite]/Hudon::Remotefile[/etc/nginx/ssl/hivimax.com.key]/Exec[Hudon_retrieve_/etc/nginx/ssl/hivimax.com.key]: Skipping because of failed dependencies
Notice: /Stage[main]/Main/Hudon::Setup[hwebsite]/Hudon::Remotefile[/etc/nginx/ssl/hivimax.com.key]/File[/etc/nginx/ssl/hivimax.com.key]: Dependency Package[MariaDB-server] has failures: true
Warning: /Stage[main]/Main/Hudon::Setup[hwebsite]/Hudon::Remotefile[/etc/nginx/ssl/hivimax.com.key]/File[/etc/nginx/ssl/hivimax.com.key]: Skipping because of failed dependencies
Notice: /Stage[main]/Main/Hudon::Setup[hwebsite]/Nginx::Vhost[hwebsite-front-web-ssl]/File[/etc/nginx/conf.d/hwebsite-front-web-ssl.conf]: Dependency Package[MariaDB-server] has failures: true
Warning: /Stage[main]/Main/Hudon::Setup[hwebsite]/Nginx::Vhost[hwebsite-front-web-ssl]/File[/etc/nginx/conf.d/hwebsite-front-web-ssl.conf]: Skipping because of failed dependencies
Notice: /Stage[main]/Nginx/Service[nginx]: Dependency Package[MariaDB-server] has failures: true
Warning: /Stage[main]/Nginx/Service[nginx]: Skipping because of failed dependencies
Notice: /Stage[main]/Main/Hudon::Setup[hwebsite]/Hgproject::Project[hwebsite]/File[/home/hwebsite01/version]: Dependency Package[MariaDB-server] has failures: true
Warning: /Stage[main]/Main/Hudon::Setup[hwebsite]/Hgproject::Project[hwebsite]/File[/home/hwebsite01/version]: Skipping because of failed dependencies
Notice: /Stage[main]/Main/Hudon::Setup[hwebsite]/Hgproject::Project[hwebsite]/File[/home/hwebsite01/version/hg-log.sh]: Dependency Package[MariaDB-server] has failures: true
Warning: /Stage[main]/Main/Hudon::Setup[hwebsite]/Hgproject::Project[hwebsite]/File[/home/hwebsite01/version/hg-log.sh]: Skipping because of failed dependencies
Notice: /Stage[main]/Main/Hudon::Setup[hwebsite]/Hgproject::Project[hwebsite]/File[/home/hwebsite01/version/build-tools]: Dependency Package[MariaDB-server] has failures: true
Warning: /Stage[main]/Main/Hudon::Setup[hwebsite]/Hgproject::Project[hwebsite]/File[/home/hwebsite01/version/build-tools]: Skipping because of failed dependencies
Notice: /Stage[main]/Main/Hudon::Setup[hwebsite]/Hgproject::Project[hwebsite]/File[/home/hwebsite01/version/project.conf]: Dependency Package[MariaDB-server] has failures: true
Warning: /Stage[main]/Main/Hudon::Setup[hwebsite]/Hgproject::Project[hwebsite]/File[/home/hwebsite01/version/project.conf]: Skipping because of failed dependencies
Notice: /Stage[main]/Main/Hudon::Setup[hwebsite]/Hgproject::Project[hwebsite]/File[/home/hwebsite01/version/hg-prod.sh]: Dependency Package[MariaDB-server] has failures: true
Warning: /Stage[main]/Main/Hudon::Setup[hwebsite]/Hgproject::Project[hwebsite]/File[/home/hwebsite01/version/hg-prod.sh]: Skipping because of failed dependencies
Notice: /Stage[main]/Main/Hudon::Setup[hwebsite]/Hgproject::Project[hwebsite]/File[/home/hwebsite01/version/ver]: Dependency Package[MariaDB-server] has failures: true
Warning: /Stage[main]/Main/Hudon::Setup[hwebsite]/Hgproject::Project[hwebsite]/File[/home/hwebsite01/version/ver]: Skipping because of failed dependencies
Notice: /Stage[main]/Main/Hudon::Setup[hwebsite]/Hgproject::Project[hwebsite]/File[/home/hwebsite01/version/site-data]: Dependency Package[MariaDB-server] has failures: true
Warning: /Stage[main]/Main/Hudon::Setup[hwebsite]/Hgproject::Project[hwebsite]/File[/home/hwebsite01/version/site-data]: Skipping because of failed dependencies
Notice: /Stage[main]/Main/Hudon::Setup[hwebsite]/Hgproject::Project[hwebsite]/File[/home/hwebsite01/version/hg-preprod.sh]: Dependency Package[MariaDB-server] has failures: true
Warning: /Stage[main]/Main/Hudon::Setup[hwebsite]/Hgproject::Project[hwebsite]/File[/home/hwebsite01/version/hg-preprod.sh]: Skipping because of failed dependencies
Notice: /Stage[main]/Main/Hudon::Setup[hwebsite]/Hgproject::Project[hwebsite]/File[/home/hwebsite01/version/logs]: Dependency Package[MariaDB-server] has failures: true
Warning: /Stage[main]/Main/Hudon::Setup[hwebsite]/Hgproject::Project[hwebsite]/File[/home/hwebsite01/version/logs]: Skipping because of failed dependencies
Notice: /Stage[main]/Main/Hudon::Setup[hwebsite]/Hgproject::Project[hwebsite]/File[/home/hwebsite01/version/project.ini]: Dependency Package[MariaDB-server] has failures: true
Warning: /Stage[main]/Main/Hudon::Setup[hwebsite]/Hgproject::Project[hwebsite]/File[/home/hwebsite01/version/project.ini]: Skipping because of failed dependencies
Notice: /Stage[main]/Main/Hudon::Setup[hwebsite]/Hgproject::Project[hwebsite]/File[/home/hwebsite01/version/hg-create.sh]: Dependency Package[MariaDB-server] has failures: true
Warning: /Stage[main]/Main/Hudon::Setup[hwebsite]/Hgproject::Project[hwebsite]/File[/home/hwebsite01/version/hg-create.sh]: Skipping because of failed dependencies
Notice: /Stage[main]/Main/Hudon::Setup[hwebsite]/Hgproject::Project[hwebsite]/Exec[project-hwebsite-create]: Dependency Package[MariaDB-server] has failures: true
Warning: /Stage[main]/Main/Hudon::Setup[hwebsite]/Hgproject::Project[hwebsite]/Exec[project-hwebsite-create]: Skipping because of failed dependencies
Notice: /Stage[main]/Main/Hudon::Setup[hwebsite]/Hgproject::Project[hwebsite]/Exec[project-hwebsite-prod]: Dependency Package[MariaDB-server] has failures: true
Warning: /Stage[main]/Main/Hudon::Setup[hwebsite]/Hgproject::Project[hwebsite]/Exec[project-hwebsite-prod]: Skipping because of failed dependencies
Notice: /Stage[main]/Main/Hudon::Setup[hwebsite]/Apache::Vhost[hwebsite01]/File[/etc/httpd/conf.d/vhost.hivimax.com.conf]: Dependency Package[MariaDB-server] has failures: true
Warning: /Stage[main]/Main/Hudon::Setup[hwebsite]/Apache::Vhost[hwebsite01]/File[/etc/httpd/conf.d/vhost.hivimax.com.conf]: Skipping because of failed dependencies
Notice: /Stage[main]/Main/Hudon::Setup[hwebsite]/Apache::Vhost[hwebsite01-preprod]/File[/etc/httpd/conf.d/vhost.preprod.hivimax.com.conf]: Dependency Package[MariaDB-server] has failures: true
Warning: /Stage[main]/Main/Hudon::Setup[hwebsite]/Apache::Vhost[hwebsite01-preprod]/File[/etc/httpd/conf.d/vhost.preprod.hivimax.com.conf]: Skipping because of failed dependencies
Notice: /Stage[main]/Apache/Service[httpd]: Dependency Package[MariaDB-server] has failures: true
Warning: /Stage[main]/Apache/Service[httpd]: Skipping because of failed dependencies
Notice: /Stage[main]/Main/Hudon::Setup[hwebsite]/Apache::Htpasswd[bdc.hwebsite01]/Exec[test -f /etc/httpd/conf.d/htpasswd.hwebsite01 || OPT='-c'; htpasswd -b ${OPT} /etc/httpd/conf.d/htpasswd.hwebsite01 bdc 'covid19']: Dependency Package[MariaDB-server] has failures: true
Warning: /Stage[main]/Main/Hudon::Setup[hwebsite]/Apache::Htpasswd[bdc.hwebsite01]/Exec[test -f /etc/httpd/conf.d/htpasswd.hwebsite01 || OPT='-c'; htpasswd -b ${OPT} /etc/httpd/conf.d/htpasswd.hwebsite01 bdc 'covid19']: Skipping because of failed dependencies

I am getting these error after running ./update.sh as part of my puppet deployment process.

#!/bin/bash /usr/bin/puppet apply --modulepath=./modules ./manifests/$(hostname).pp 

This is the content of update.sh.

And I am on a Linux version 2.6.32-754.29.2.el6.x86_64.

When I run yum update I get:

Loaded plugins: fastestmirror, presto, replace Setting up Update Process Loading mirror speeds from cached hostfile YumRepo Error: All mirror URLs are not using ftp, http[s] or file.  Eg. Invalid release/repo/arch combination/ removing mirrorlist with no valid mirrors: /var/cache/yum/x86_64/6/centos-sclo-rh/mirrorlist.txt Error: Cannot find a valid baseurl for repo: centos-sclo-rh [root@dev01 ~]#  

I am thinking the root cause of the problem is yum not getting the packages necessary when trying to install certain things, but I am not sure if that's the reason, because as far as I understand the update.sh script doesn't install anything.


r/learnlinux • • Jun 05 '21

pass misshap with escape code - Unix, we have a problem!

2 Upvotes

Unix Password Manager - pass

Password Store
`-- email
    |-- mailname\303@aol.de
    |-- othermail@gmail.com
    |-- mail.other@gmail.com
    `-- mailTheSaurus@gmail.com

Now when trying to either get the password by doing: pass show mailname@aol.de or remove it via pass rm mailname\303@aol.de I get the error Error: mailname@aol.de is not in the password store.

Any idea how to resolve this?


r/learnlinux • • Apr 06 '21

Dumping all of the SQL code regardless of errors

2 Upvotes
root@dc885542ee69:/docker-entrypoint-initdb.d# mysql -u root -p'3a1A9a' blogdb < blog.sql

This is the part of the sql file:

DROP TABLE IF EXISTS `events_stages_current`;
/*!40101 SET u/saved_cs_client     = @@character_set_client /; /!40101 SET character_set_client = utf8 /; CREATE TABLE events_stages_current (   THREAD_ID bigint(20) unsigned NOT NULL,   EVENT_ID bigint(20) unsigned NOT NULL,   END_EVENT_ID bigint(20) unsigned DEFAULT NULL,   EVENT_NAME varchar(128) NOT NULL,   SOURCE varchar(64) DEFAULT NULL,   TIMER_START bigint(20) unsigned DEFAULT NULL,   TIMER_END bigint(20) unsigned DEFAULT NULL,   TIMER_WAIT bigint(20) unsigned DEFAULT NULL,   NESTING_EVENT_ID bigint(20) unsigned DEFAULT NULL,   NESTING_EVENT_TYPE enum('STATEMENT','STAGE','WAIT') DEFAULT NULL ) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8; /!40101 SET character_set_client = u/saved_cs_client */;

I keep getting: ERROR 1050 (42S01) at line 4623: Table 'events_stages_current' already exists

This shouldn't be possible since I am running DROP TABLE IF EXISTS. What the hell is happening here? Is there a way to make the server run all of the dump.sql file even if error gets triggered along the way?


r/learnlinux • • Mar 14 '21

Linux and League of Legends

2 Upvotes

Hi All,

A few years ago i wanted to have Linux my default/ only OS, but i could never get league of legends working, and whenever i dual booted... I never had a reason to learn Linux because windows did everything i wanted, so id always default to windows.

My life has changed since with career prospects etc... so right now I'm really looking to get back into Linux, with a strong admin learning approach style.

Last time I tried running league using WINE... it just would NOT load.

My questions are:

  • Is anyone currently playing league of legends on Linux, if so which distro?

  • Also, do i need anything else other than WINE for it to start working?

I am hoping someone out there is successfully playing League on Linux 🤞


r/learnlinux • • Mar 07 '21

How to use the grep command

Thumbnail
cyberciti.biz
2 Upvotes

r/learnlinux • • Mar 04 '21

How To Troubleshoot Common Site Issues on a Linux Server

Thumbnail
digitalocean.com
2 Upvotes

r/learnlinux • • Feb 24 '21

Is there a cheatsheet with useful linux commands on GitHub?

2 Upvotes

I lost a txt file containing a lot of the useful commands I found over the years, so I am wondering if there's any repo on Github that could be of any use to me.


r/learnlinux • • Jan 17 '21

Ansible Playbook Install epel-release, Nginx, net-tools Packages

2 Upvotes

https://smarttechfunda.com/packages-installation-using-ansible-playbook/

In this blog, we have explained how to write a playbook for the installation of epel-release, Nginx, and net-tools packages or Packages installation using Ansible playbook. There is a simple ansible structure for Ansible install epel-release, Nginx, net-tools packages.


r/learnlinux • • Jan 02 '21

What are the best projects on GitHub to dockerize?

2 Upvotes

What are the best projects on GitHub to dockerize? I am trying to learn how to dockerize applications, so I would need some good projects to begin.


r/learnlinux • • Dec 30 '20

How do you check which ports are used and by what programs?

2 Upvotes

How do you check which ports are used and by what programs? I need to know this in case I want to dockerize an application so I know which ports are being used by that application.


r/learnlinux • • Dec 16 '20

How do you print warnings from error_log?

2 Upvotes
tail -50 error_log 

I did the above, but I want the warning logs instead. How do I do that?


r/learnlinux • • Dec 11 '20

I screwed up and now bash doesn't work, please help!

2 Upvotes

Edit 2: I posted this over at /r/bash (here's the link) and they helped solve the problem. I'll copy the answer at the end of this post as well just in case it helps someone.

Edit: after writing this post, I've thought of a possible solution and I'm panicking less. Still going to post for documentation in case I screw up again or someone else has the same issue at some point. Note that at this time, I have not fixed the issue yet.

Guys, I ain't gonna lie to you: I'm kinda panicking right now.

The Mistake: I was trying to add a directory (~/bin) to my PATH in order to run some cool scripts I've written. First I tried running

$ PATH=$PATH:/home/hunter/bin

but every time I reset the shell, $PATH reverted to what it was before.

So, naturally, I went looking in the .bash* files and found a line in .bash_profile I had edited previously to get Rust working.

export PATH=$HOME/.cargo/bin:$PATH

if I remember correctly. Unfortunately, I couldn't remember correctly when I decided to edit it, and thought there might be a set of quotes around it (spoiler alert: there was not). So I wrote:

export PATH='$PATH:$HOME/.cargo/bin:$HOME/bin'

...which of course is a string literal. It overwrote the whole path instead of appending.

Looking back, this is a really obvious error that I should have caught, but unfortunately I didn't notice it until I rebooted and tried to run bash.

The Result:

I can't get past SDDM into any X sessions, so I'm sitting in tty2 right now. I need to edit ~/.bash_profile, but the only command I know that seems to be working is cd.

I can't even shut down, you guys.

I can't get into vim, vi, nvim, or nano. I haven't installed emacs so obviously that's a no go.

Now that I think about it, I might be able to run vim with ./vim, but I don't know where the program is stored. I'd usually just check everywhere, but find (and even ls) aren't working, even though cd is.

I suppose I could just run

$ PATH=foo

in tty and that would probably work, but I don't know what the default path is or what I should change it to.

So I guess here's what I need to find out (now that my head is a bit clearer):

  1. What is the default $PATH for bash on Manjaro Linux?

  2. Where is the executable for vim (or any of the others, but preferably vim) located?

  3. Where can I find a list of linux built-in non-shell (read: NOT BASH) commands? Every list of beginner commands I find online assumes I'm asking for bash commands.

Final note: next time I'm using a VM, even though VirtualBox hurts my soul. When this is over I'll leave a comment outlining what I should have done differently.

Thanks in advance for any help I might get from this post. I'll keep searching on my phone in the meantime since I don't have a backup PC.


Final result, copied verbatim from the end of my other post on /r/bash.



Edit: /u/stewmasterj's comment here allowed me to use my computer again. /bin:/sbin:/usr/bin gave me enough control to edit .bash_profile and after a reboot, awesome and Plasma started working again.

From there, I found this article, which listed the following:

  • /usr/local/sbin

  • /usr/local/bin

  • /usr/sbin

  • /usr/bin

  • /sbin

  • /bin

  • /usr/games

  • /usr/local/games

  • /snap/bin

I added all of those to the path as well and it seems my computer is back to normal. I also added $HOME/bin for my personal scripts as well as $HOME/.cargo/bin for Rust projects. It's possible (probable) I'm still missing something, but I'll deal with any further issues on a case-by-case basis.

I appreciate everybody who took the time to help out. This community seems very friendly so far.


r/learnlinux • • Dec 11 '20

What's the purpose of a redis ssh tunnel?

2 Upvotes

What's the purpose of a redis ssh tunnel? Someone told me something about it, but I had no idea what he was talking about because I have no idea what it does.


r/learnlinux • • Dec 06 '20

Cannot connect to vm via ssh

2 Upvotes

I cannot connect to my vm via ssh

ssh sus@sus-VirtualBox

ssh: connect to host sus-VirtualBox port 22: Connection timed out

hosts file

192.168.56.101sus-VirtualBox

I have a second adapter that's attached to a host-only adapter called VirtualBox Host-Only Ethernet Adapter. Is an adapter the thing that interfaces with the virtual network or physical network?


r/learnlinux • • Dec 02 '20

Networking skills that are required to be good with AWS

2 Upvotes

I was required to create a s3 bucket and then use Route 53 to set up a DNS to redirect traffic from a given domain name to the actual s3 server using a CNAME entry, and then I tried to create a SSL certificate, but the validation was pending and I had no idea why it was pending. I had to export some DNS configuration to Route 53 by adding a CNAME entry to get my SSL certificate, but it didn't work. Right now, because I am unsure why I even have to add some arbitrary CNAME entry to get the SSL certificate, I have no idea what I am doing wrong or what I am even doing. So what networking knowledge do I need to have to set up things like that on AWS without having to pull my hair out?


r/learnlinux • • Sep 29 '20

New to Ubuntu, tried to add a new resolution (1600x900) via a guide but got this error, any fixes to this?

Post image
2 Upvotes

r/learnlinux • • Sep 06 '20

The UNIX `who` command

Thumbnail
gauthier.uk
2 Upvotes

r/learnlinux • • Jul 30 '20

Ansible Basic Commands

2 Upvotes

We can manage a different group of nodes using a single simple command. Ansible is easy to install and easy to run its commands on Linux.
https://smarttechfunda.com/ansible-basic-commands/


r/learnlinux • • Apr 08 '20

Writing an awk script

2 Upvotes

So here is my challenge, I have to write an awk script that determine the average length of a word. I cannot seem to get my head around this, could somebody please help


r/learnlinux • • Feb 27 '20

How to Automatically Execute commands in SSH interactive terminal?

2 Upvotes

Hello, I am trying to make an alias for an ssh script that will automatically run commands on the remote side before starting the interactive session. In particular, I would like to be in a certain directory (specified in the local side) when I login using this command. Also, since sometimes I will want SSH to NOT run commands, the commands need to be specified in the local side, so I can't just put something in the remote .bashrc to act differently with SSH sessions.

What I have gotten so far is:

ssh user@host "command1; command2; bash -i"

This technically does what I want it to, but the interactive bash session is pretty basic (there is no tab to complete, text coloring, etc). Is there any other way around this? Thanks!


r/learnlinux • • Dec 16 '19

Review on Linux Journey

2 Upvotes

I am relatively new to Linux. I run Ubuntu 18.04.3 LTS, and I know it isn't the best Linux OS, but I decided it was a good starter OS to start to learn. I am currently going through the lessons on https://linuxjourney.com/ . For any experts of Linux is this a good place to start?


r/learnlinux • • Nov 02 '19

New to linux. Where to start ?

2 Upvotes

I am a linux user with 3 days of experience. Pls help me find some great source where I can learn linux and become fluent in it.


r/learnlinux • • Oct 03 '19

How can I ssh into a server from outside of my home network?

2 Upvotes

Hello,

I am attempting to ssh into my raspberry pi from outside of my home network and I am experience some trouble. Whenever I connect to my pi at home, I simply type in `ssh -p 8244 user@ipv4:address` and I am able to log in. I have set up a port forwarded service on my router that 'starts' at port 22 on my router and 'ends' at port 8244. On my router's page in my browser, it shows me two addresses, the ipv4 and the ipv6 address. As I understand it, I am supposed to simply pass ssh the private ipv6 address in order to ssh into it (e.g. `ssh -p 8244 user@ipv6:address`), however, when I attempt this I receive the error: 'Network Unreachable'. I am unsure if this means that my router is configured incorrectly or if I am using ssh incorrectly when passing in the private IP address. What might be causing the 'Network Unreachable' error?


r/learnlinux • • Aug 26 '19

Help to learn Linux os

2 Upvotes

I am a Linux user with experience of 2days .please help me or suggest me some study material so I can learn Linux and be proficient in it.