The small linux problem thread

The thing is, I haven’t edited the .bashrc file myself - So I don’t know why this has happened

@jrwagh333 How about pasting the file as preformated text (edit original post) so it’s easier to read and count lines.

To make sure my counting was right, I used pastebin.

Pastebin also does syntax highlighting.

https://pastebin.com/SjWiUeYa

Just made a paste. It will expire in a week.

I wish I could find the bashrc that Ubuntu uses in 18,04 online so I can compare. ( I don’t Ubuntu )

The fi that the error is complaining about belongs to bash autocompletion.

I edited your post to make it more readable.
You can post code blocks by nesting inside three backticks like this

```
Paste Code here
```

Debian Stretch:

Install nvidia 390.xx drivers from backports
Install steam, install fails: needs 32-bit drivers
Install libgl1-nvidia-glx:i386, install fails: needs nvidia 384 dependencies
Install dependencies, dependencies fail: you have 390.XX drivers
Remove 390.xx drivers
Reinstall nouveau
Blackscreen, add nomodeset to boot
Back in

granted this is my own fault for pulling the new drivers from the backports and expecting no hiccups, but 7-months on debian with zero issues; my confidence was high. lesson learned.

Decided to play around with lxc. It doesn’t seem to be going well. Host is Fedora 28. After some searching it appears to either be an issue with SELinux or a bug or a combination of the two.

Basically this is what I get when trying to create a Fedora container:

[admin@homeserver]$ sudo lxc-create -t fedora -n fedora-c1
Host CPE ID from /etc/os-release: cpe:/o:fedoraproject:fedora:28
Checking cache download in /var/cache/lxc/fedora/x86_64/28/rootfs ... 
Cache found. Updating...
chroot: failed to run command ‘yum’: No such file or directory
Update finished
Copy /var/cache/lxc/fedora/x86_64/28/rootfs to /var/lib/lxc/fedora-c1/rootfs ... 
Copying rootfs to /var/lib/lxc/fedora-c1/rootfs ...
Storing root password in '/var/lib/lxc/fedora-c1/tmp_root_pass'
chpasswd: cannot open /etc/passwd
Expiring password for user root.
passwd: Libuser error at line: 425 - Error replacing `/etc/passwd': Permission denied.
passwd: Error
installing fedora-release package
chroot: failed to run command ‘yum’: No such file or directory
sed: can't read /var/lib/lxc/fedora-c1/rootfs/etc/sysconfig/init: No such file or directory

Container rootfs and config have been created.
Edit the config file to check/enable networking setup.

The temporary root password is stored in:

        '/var/lib/lxc/fedora-c1/tmp_root_pass'


The root password is set up as expired and will require it to be changed
at first login, which you should do as soon as possible.  If you lose the
root password or wish to change it without starting the container, you
can change it from the host by running the following command (which will
also reset the expired flag):

        chroot /var/lib/lxc/fedora-c1/rootfs passwd

I can’t log in to the container using the temporary password, and I can’t change the password from the host.

Anyone have experience doing this?

I get the same error:

$ . bashrc.sh 
-bash: ./bashrc.sh: line 97: unexpected EOF while looking for matching `)'
-bash: ./bashrc.sh: line 118: syntax error: unexpected end of file

Maybe a new bash release was installed, then reboot caused a the new version run?

Fixed by removing the extra tick on line 93:

alias l='ls -CF''

After changing to this:

alias l='ls -CF'

All is well, error is gone.

$ . bashrc.sh
$ bash --version
GNU bash, version 4.4.23(1)-release (x86_64-redhat-linux-gnu)
2 Likes

Sorry.

I googled this, though: https://www.hiroom2.com/2018/05/22/fedora-28-lxd-en/

Looks like there is a container-selinux rpm.

1 Like

I installed that, but I still get the same errors.

If I try to change the password from the host:

sudo chroot /var/lib/lxc/fedora-c1/rootfs passwd

I get:

Changing password for user root.
New password: 
BAD PASSWORD: The password is shorter than 8 characters
Retype new password: 
passwd: Authentication token manipulation error

Looks like it works for me. I’ve selinux disabled (I consider selinux a bug, not a feature), so that’s probably the reason it is not working.

$ sudo lxc-create -t fedora -n fedora-c1
Host CPE ID from /etc/os-release: cpe:/o:fedoraproject:fedora:28
Checking cache download in /var/cache/lxc/fedora/x86_64/28/rootfs ... 
Cache found. Updating...
chroot: failed to run command ‘yum’: No such file or directory
Update finished
Copy /var/cache/lxc/fedora/x86_64/28/rootfs to /var/lib/lxc/fedora-c1/rootfs ... 
Copying rootfs to /var/lib/lxc/fedora-c1/rootfs ...
Storing root password in '/var/lib/lxc/fedora-c1/tmp_root_pass'
Expiring password for user root.
passwd: Success
installing fedora-release package
chroot: failed to run command ‘yum’: No such file or directory
sed: can't read /var/lib/lxc/fedora-c1/rootfs/etc/sysconfig/init: No such file or directory

Container rootfs and config have been created.
Edit the config file to check/enable networking setup.

The temporary root password is stored in:

        '/var/lib/lxc/fedora-c1/tmp_root_pass'


The root password is set up as expired and will require it to be changed
at first login, which you should do as soon as possible.  If you lose the
root password or wish to change it without starting the container, you
can change it from the host by running the following command (which will
also reset the expired flag):

        chroot /var/lib/lxc/fedora-c1/rootfs passwd

$ sudo chroot /var/lib/lxc/fedora-c1/rootfs passwd
Changing password for user root.
New password: 
Retype new password: 
passwd: all authentication tokens updated successfully.

$ sudo lxc-start -F -n fedora-c1
systemd 238 running in system mode. (+PAM +AUDIT +SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN2 -IDN +PCRE2 default-hierarchy=hybrid)
Detected virtualization lxc.
Detected architecture x86-64.

Welcome to Fedora 28 (Twenty Eight)!

Fedora 28 (Twenty Eight)
Kernel 4.17.11-200.fc28.x86_64 on an x86_64 (console)

fedora-c1 login: root
Password: 
[root@fedora-c1 ~]# 

I did modify /etc/lxc/default.conf

$ cat /etc/lxc/default.conf 
lxc.network.type = veth
#lxc.network.link = lxcbr0
lxc.network.link = virbr0
lxc.network.flags = up
lxc.network.hwaddr = 00:16:3e:xx:xx:xx
1 Like

Disabling selinux was essentially the fix I saw when searching around. I’ll probably have to just do that. I’ll give it shot when I get home from work later today.

I would have thought the selinux policies would have been updated/altered to allow lxc to work after I installed that package, container-selinux. Doesn’t appear to have done anything.

1 Like

Nice catch bro!

1 Like

I had a bunch of lxc containers running on a fedora server. Worked great and I also had disabled selinux because of multiple reasons . Ran an update one day and lxc containers disappeared. Fought with it about a day and then moved to a Ubuntu server install since they are the ones backing the lxc project.

Thank you :slight_smile:

1 Like

Using LXD you mean. Yeah, I would only use it on Ubuntu. Pretty scary story there.

Ubuntu uses apparmor instead of selinux, which also sucks, but in different and entertaining ways.

Hello! I would like some help. I am used to install texlive through a package manager and everything was working fine, more or less. Now I am on a new OS environment (latest Manjaro KDE) and I would like to install the version from https://www.tug.org/ with TexStudio. I have tried in the past but TexStudio was complaining of not finding a tex installation.

I have added the texlive paths to my .profile and I can use tex from the terminal. But TexStudio cannot pick up the tex installation. I understand that this is something fundamental and I would like to know how to deal with this situation. I think that my .profile is read by the bash terminal and other applications may look elsewhere (?). I was running the application from the launcher menu.

I have uninstalled and deleted any TexStudio and TexLive config files, then I installed TexLive from https://www.tug.org/, I have added the paths to my .profile and now I am waiting to install TexStudio – I haven’t done this yet though because previously it did not work.

What should I do next? Any ideas? Thanks in advance (and sorry for my English)!

Securing containers with selinux is non-trivial. It amazes me how after 15 years, selinux still breaks things constantly and mysteriously, nearly every complex problem in this thread is selinux related. At least windows gives you an OK button to click.