ubuntu 18.04 – How to stop apt-get using /tmp for install scripts

I have a CIS-benchmark-compliant base image.
Pulling this to differentiate an immutable image for my application, if I attempt to do

apt-get install -y docker.io

I get an error

==> amazon-ebs: Can't exec "/tmp/docker.io.config.NzitwJ": Permission denied at /usr/share/perl/5.26/IPC/Open3.pm line 178.

==> amazon-ebs: open2: exec of /tmp/docker.io.config.NzitwJ configure  failed: Permission denied at /usr/share/perl5/Debconf/ConfModule.pm line 59.

This is because CIS-compliant images have noexec set on the /tmp filesystem.

Does anyone know of a command line or equivalent way to make apt-get use a different file system for install scripts, or am I going to have to schedule tasks to install from source? Note, this does not only affect docker.io, but others as well. I’m looking for an apt-get-level solution, not an app-specific package method.

18.04 – Fresh instal Ubuntu server takes lots of memory

I just installed Ubuntu server 18.04.5 on a VM with 4 VCPU and 8GB Ram. Except for the SSH server, I didn’t install anything else.
I noticed the ram usage on this server is standing around 6.77G when I use htop/free command.

If I run free -h, it shows me 6.6G used. (Please look at the screenshot below)

I noticed for about a minute after I reboot the system, htop reports around 150MB memory usage, but shortly after it jumps to 6+GB plus. so I am thinking there is a service using all the memory?!
I have tried both Ubuntu 18.04.5 and 20.04.1. In both of them memory usage is high.

NAME="Ubuntu"
VERSION="18.04.5 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.5 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic

All idea/suggestions are welcome.
Thank you.

htop screenshot

Screenshot of free command

networking – ubuntu 18.04 server – systemd-networkd does not work for static ip

The OS is ubuntu 18.04.5.
There is a network interface named ‘enp4s0’ on my device. I use netplan to setup static ip for the interface, but the interface gets no ip and seems no error in system log.

the netplan configuration is very simple:

network
  version: 2
  renderer: networkd
  ethernets:
    enp4s0:
      dhcp4: no
      dhcp6: no
      addresses: [192.168.200.45/24]

In /var/log/syslog, networkd said only:

systemd-networkd[3350]: enp4s0: IPv6 successfully enabled

I think it’s not netplan’s issue, it generates .network file in /run/systemd/network/

[Match]
Name=enp4s0

[Network]
LinkLocalAddressing=ipv6
Address=192.168.200.45/24

systemd-networkd doesn’t set the static ip on the interface.

I don’t know is there any matter with the installation of the OS. I installed OS on VirtualBox VM first, then converted the vdi file to the raw format and used ‘dd’ command to dump the image to a physical machine’s SSD to run. Of course the network interface count and name in VM are different from the both in physical machine, but I think it doesn’t matter, the system can recognize the all network interfaces in physical machine. It is supposed if we add new network interfaces on the physical machine?

I also tried running netplan with same configuration on another machine whose OS is installed manually, it was OK.

I can’t figure out the reason, maybe I miss something I don’t know.
Could any one help me, thanks.

How to make Ubuntu 18.04 remember the brightness setting after rebooting?

I’m currently using Ubuntu 18.04.5LTS, and I found that every time I reboot my PC, the brightness automatically goes back to 66%. However, it seems that the volume setting is remembered every time I reboot. Is there any way to make sure that the system remembers the brightness setting before shutting down?

boot – Ubuntu 18.04 Black Screen after restart – Need urgent help

What happened:

I restarted my desktop computer. But, when the computer reboots, the display shows a complete black screen (there is no mouse. The monitor does receive signal from HDMI input), and nothing shows up for a long time.

Therefore, I wanted to shutdown the computer. I pressed the power button lightly for a few seconds. The ubuntu logo with a few dots shows up. The color of the dots changed,for a few seconds. Then the computer shut down.

Then, I pressed the power button to boot the computer. No Dell logo screen shows up (that is, the screen that prompts F12 or DEL for boot options does not show up). Complete black screen again. I repeated the above, lightly pressed the power button, and the ubuntu logo screen would show up before the compute shuts down.

I repeated the above for several times. Always black screen. I was not able to log in, of course.

To believe this is an Ubuntu issue, what I have tried:

One time, after pressing the power button, I repeatedly pressed DEL, hoping the screen of Boot Options would show up. It did not. However, then, I pressed the Down arrow button, for two times, and then hit Enter. Then, the computer boots into Windows (I have a dual boot of Windows 10 and Ubuntu 18.04). Windows behaves completely normally. I repeated this procedure one more time, and I was able to get into Windows, without looking at the menu screen in Boot Options.

I believe something happened with Ubuntu, which made both the first boot up screen blank, and the UEFI Boot Option selection screen blank. If I don’t blindly enter the Boot Options screen with DEL, the computer boots into Ubuntu by default, and the blank screen continues, until I lightly press the power button which causes a brief display of ubuntu logo before shutdown, as described above.

What happened before I first restarted:

I remember two things: First, I did a sudo apt-get update command. I didn’t do upgrade following it. I attempted to download and install Steam, following this link, using the wget command to download the .deb file and then install it. The installation was not successful. Therefore I wanted to switch to windows, by rebooting. And then the whole things started.

More info
I have a Dell XPS Tower 8930. I previously had a dual boot of Ubuntu 16.04 and Windows 10. Lately I upgraded the Ubuntu to 18.04.

Please help!

xrandr – How do I run xandr command on startup under Ubuntu 18.04 Kernel 5.4.0-58-generic?

I have tried to run the following command, for a dual monitor set up, on Uxterm terminal manually once Ubuntu 18.04 Kernel 5.4.0-58-generic has started up and it works fine:

/bin/bash -c "sleep 60&&xrandr --output HDMI-1 --primary --mode 1440x900 --pos 0x180 --rotate normal --output eDP-1 --mode 1920x1080 --pos 1440x0 --rotate normal"

Nonetheless, adding this line to the start up applications within LXSession, does not take any effect.

Does anyone have any idea that might help to fix this?

Thanks

nginx – Drupal 8 installation failed with lemp on ubuntu 18.04

I am novice on web development so perhaps reading this question will be wastage of time. My IDE on ubuntu 18.04 includes –

  • nginx/1.14.0 (Ubuntu),
  • mysql Ver 14.14 Distrib 5.7.32, for Linux (x86_64),
  • PHP 7.2.24-0ubuntu0.18.04.7
  • phpmyadmin

I have Domains with shared hosting provided named- photopost.in, epostnews.in, telegrampost.in (All not installed). I also configured photopost.in, epostnews.in and some others with no domain in my local server (nginx).

Following installation instruction for Drupal 8 with link 1 I started installation.

I have domain with godaddy account and changed name server with shared hosting provider

Nameserver
in.solidhosting.pro
eu.solidhosting.pro

Started downloading drupal with sudo composer create-project drupal-composer/drupal-project:8.x-dev /var/www/photopost.in/public_html --stability dev --no-interaction

Download process completed successfully.

Next step was

$ cd /var/www/photopost.in/public_html
$ sudo vendor/bin/drush site-install --db-url=mysql://drupaluser:password@localhost/drupal

Do you want to continue? (yes/no) (yes):
 > y
(success) Installation complete. I have now user admin and password-xxxxxxx

Started configuring Encrypt SSL Cert for Nginx on Ubuntu with link 2 because as described in link 1 it’s necessary to be continue on installation process.

This process failed with output message —

Domain: photopost.in
   Type:   unauthorized
   Detail: Invalid response from
   http://photopost.in/.well-known/acme-challenge/Z3AImrdRbz7P-wgUjX1Ipih26kgl3fvJ-5NuuhZSYkg
   (103.108.220.100): "<!DOCTYPE html>n<html
   style="height:100%">n<head>n<meta name="viewport"
   content="width=device-width, initial-scale=1, shrink-to-"

   To fix these errors, please make sure that your domain name was
   entered correctly and the DNS A/AAAA record(s) for that domain
   contain(s) the right IP address.
 - Your account credentials have been saved in your Certbot
   configuration directory at /etc/letsencrypt. You should make a
   secure backup of this folder now. This configuration directory will
   also contain certificates and private keys obtained by Certbot so
   making regular backups of this folder is ideal.

At this point command executed command

$ sudo nano /etc/nginx/sites-available/photopost.in

output is

##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# https://www.nginx.com/resources/wiki/start/
# https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/
# https://wiki.debian.org/Nginx/DirectoryStructure
#
# In most cases, administrators will remove this file from sites-enabled/ and
# leave it as reference inside of sites-available where it will continue to be
# updated by the nginx packaging team.
#
# This file will automatically load configuration files provided by other
# applications, such as Drupal or WordPress. These applications will be made
# available underneath a path with that package name, such as /drupal8.
#
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
##

# Default server configuration
#
server {
    listen 80;
    listen (::):80;

    # SSL configuration
    #
    # listen 443 ssl default_server;
    # listen (::):443 ssl default_server;
    #
    # Note: You should disable gzip for SSL traffic.
    # See: https://bugs.debian.org/773332
    #
    # Read up on ssl_ciphers to ensure a secure configuration.
    # See: https://bugs.debian.org/765782
    #
    # Self signed certs generated by the ssl-cert package
    # Don't use them in a production server!
    #
    # include snippets/snakeoil.conf;

    root /var/www/photopost.in/public_html;

    # Add index.php to the list if you are using PHP
    index index.html index.htm index.nginx-debian.html;

    server_name photopost.in www.photopost.in;

    location / {
        # First attempt to serve request as file, then
        # as directory, then fall back to displaying a 404.
        try_files $uri $uri/ =404;
    }

    # pass PHP scripts to FastCGI server
    #
    #location ~ .php$ {
    #   include snippets/fastcgi-php.conf;
    #
    #   # With php-fpm (or other unix sockets):
    #   fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
    #   # With php-cgi (or other tcp sockets):
    #   fastcgi_pass 127.0.0.1:9000;
    #}

    # deny access to .htaccess files, if Apache's document root
    # concurs with nginx's one
    #
    #location ~ /.ht {
    #   deny all;
    #}
}


# Virtual Host configuration for example.com
#
# You can move that to a different file under sites-available/ and symlink that
# to sites-enabled/ to enable it.
#
#server {
#   listen 80;
#   listen (::):80;
#
#   server_name example.com;
#
#   root /var/www/example.com;
#   index index.html;
#
#   location / {
#       try_files $uri $uri/ =404;
#   }
#}

Now link 1 says to configure nginx.

At this stage I removed old Certbot and reinstalled new one with this link 3.

Again I became hopeless to see this output.

Which names would you like to activate HTTPS for?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: 25dec.com
2: www.25dec.com
3: epostnews.in
4: www.epostnews.in
5: jeeva.local
6: blog.rakhikamakshi.in
7: www.blog.rakhikamakshi.in
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate numbers separated by commas and/or spaces, or leave input
blank to select all options shown (Enter 'c' to cancel): 1, 3, 6
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for 25dec.com
http-01 challenge for blog.rakhikamakshi.in
http-01 challenge for epostnews.in
Waiting for verification...
Cleaning up challenges
Failed authorization procedure. 25dec.com (http-01): urn:ietf:params:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from https://www.hugedomains.com/domain_profile.cfm?d=25dec&e=com (2606:4700:20::681a:625): "n<!doctype html>n<html lang="en">n<head>nn<meta charset="utf-8">n<meta name="viewport" content="width=device-width, initial-scal", epostnews.in (http-01): urn:ietf:params:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from http://epostnews.in/.well-known/acme-challenge/Z3AImrdRbz7P-wgUjX1Ipih26kgl3fvJ-5NuuhZSYkg (103.108.220.100): "<!DOCTYPE html>n<html style="height:100%">n<head>n<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-", blog.rakhikamakshi.in (http-01): urn:ietf:params:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from https://blog.rakhikamakshi.in/.well-known/acme-challenge/dzDl_TZX4oIP_OnqErWgnyYPCpZaBCqmkc5ZBxGddT8 (103.108.220.100): "<!DOCTYPE html>n<html style="height:100%">n<head>n<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-"

IMPORTANT NOTES:
 - The following errors were reported by the server:

   Domain: 25dec.com
   Type:   unauthorized
   Detail: Invalid response from
   https://www.hugedomains.com/domain_profile.cfm?d=25dec&e=com
   (2606:4700:20::681a:625): "n<!doctype html>n<html
   lang="en">n<head>nn<meta charset="utf-8">n<meta
   name="viewport" content="width=device-width, initial-scal"

   Domain: epostnews.in
   Type:   unauthorized
   Detail: Invalid response from
   http://epostnews.in/.well-known/acme-challenge/Z3AImrdRbz7P-wgUjX1Ipih26kgl3fvJ-5NuuhZSYkg
   (103.108.220.100): "<!DOCTYPE html>n<html
   style="height:100%">n<head>n<meta name="viewport"
   content="width=device-width, initial-scale=1, shrink-to-"

   Domain: blog.rakhikamakshi.in
   Type:   unauthorized
   Detail: Invalid response from
   https://blog.rakhikamakshi.in/.well-known/acme-challenge/dzDl_TZX4oIP_OnqErWgnyYPCpZaBCqmkc5ZBxGddT8
   (103.108.220.100): "<!DOCTYPE html>n<html
   style="height:100%">n<head>n<meta name="viewport"
   content="width=device-width, initial-scale=1, shrink-to-"

   To fix these errors, please make sure that your domain name was
   entered correctly and the DNS A/AAAA record(s) for that domain
   contain(s) the right IP address.
 - Your account credentials have been saved in your Certbot
   configuration directory at /etc/letsencrypt. You should make a
   secure backup of this folder now. This configuration directory will
   also contain certificates and private keys obtained by Certbot so
   making regular backups of this folder is ideal.

Please help me what should I do to Configure Nginx (SSL certificate not installed) and Test the Installation within my browser. Thanks in advance.