This is a bit difficult to answer without knowing how the web cam provides its stream.

One server that will probably be able to do what you want is rygel.  If you install it and the rygel-gst-launch plugin, you can configure it to serve arbitrary streams.

In the ~/.config/rygel.conf file, you'd need to include something like:

[GstLaunch]
enabled=true
launch-items=webcam
webcam-title=Web Camera
webcam-mime=video/mpeg
webcam-launch=souphttpsrc location=http://url-to-webcam-stream

Depending on the details of your webcam, you might need a different -mime and -launch lines.  The launch line is a GStreamer pipeline description, as you might pass to gst-launch-0.10 (minus the parts used to display/play the stream).


Ubuntu 18.04 won't boot after resizing disk with Gparted

Managed to solve the issue!

Step 1: Boot from flash USB-drive, select option try ubuntu

Step 2: Launch Gparted, expand HDD partition again so that it has more space

Step 3: Launc terminal,  sudo apt-add-repository ppa:yannubuntu/boot-repair

Step 4: sudo apt-get update

Step 5: sudo apt-get install -y boot-repair

Step 6: Launch bootrepair, under GRUB options select "purge GRUB before reinstalling it"

Step 7: click apply and reboot, HDD boots again!


df -h shows you space on all partitions, not just /home, and to see all kernels, do dpkg -l linux-image*

You can remove multiple old kernels at once with a command like
sudo apt-get remove linux-image-2.6.32-{21,37,38,39,40,41,42,43,44}-server (substitute your numbers based on what you find with dpkg) but be very careful not to remove the current kernel, nor the latest kernel!

uname -r shows you what you are currently using.

Note:
sudo apt-get autoremove is good to run after removing old kernels as it removes obsolete dependencies.


Ubuntu Server 18.04 = Ubuntu Desktop - all GUI and other stuff?

You can see the difference between the desktop and server editions by downloading and comparing the .manifest files on the 18.04 download page.

There are many tools to do this, I like meld (it's in the standard repos)

There are lots of differences, here's the first page of the comparison.


Is there any reason to use multiple mdraids instead of just one with multiple partitions?

A lot of information around partitioning and RAID setup are based on opinion, requirements specific to a use-case, or outdated information.
Addressing a few of your specific points:

I personally don't see a need to have a separate array for /boot.  It is true that Grub used to not be able to read your kernel off a /boot located on a mdadm created array but that is no longer the case.  I say this having this exact setup for a non-EFI booting server.
I would never put a swap partition on a mdadm created array.  Under practically all circumstances, swap never needs redundant disks.  If you're looking at RAID-0, you can just stripe swap across multiple disks.

As a side note, mdadm schedules monthly disk checks and I'm not sure it's smart enough to not schedule simultaneous checks if the arrays use the same backing disk.


Backup of GRUB2 on both UEFI and BIOS systems

read: https://www.dedoimedo.com/computers/grub-2.html
Download and burn DVD:   https://www.dedoimedo.com/computers/grub-2.html

These can help reset GRUB2 or solve GRUB2 problems.

If you need 'bit by bit' replacement on to a hard rive (old type, SSD or NVMe) you may need similar to Macrium reflect program. I use software from Paragon-software GmbH , Germany "Hard Disk Manager" paid edition but they have free editions available for download. I know it can write completely to a new hard drive exactly what was on old hard drive including GRUB2.


Can I mount two USB3 'flash' thumb-drives in a RAID configuration?

Yes, that is possible, but it is not going to be a good solution. You can add pretty much every block device to a software RAID. But the limitations of that device will limit the whole array. In case of USB the limiting factors are speed (yes, even with USB 3.0) and reliability. Also the devices will have to be plugged in all the time. If one is not accessible even for a short time, the RAID will be degraded and has to be rebuilt. This might take hours. So, there is no hot-plugging.

Overall what you are trying to do can work, but it is no recommended and your goal of getting more speed will not be reached.

It you need extra USB RAID storage for your computer: there are dual hard drive enclosures on the market that can combine the drive to a RAID and have USB 3.0 connectors. Unluckily they will need external power.


Not able to set group and permissions using udev rule

I restarted udev and disconnected usb cable and connected back. It seems to work. I kind of not sure if I had done that before or not. I tried multiple rules and combination so I might have missed when I got the right rule.
It seems to work now.


Could try to shut the card off with a logon script. Something like,

#!/bin/bash
sudo iwconfig wlan0 down

This would leave the eth0 card up and running for your intranet use.


Status : Failure -Test failed: IO Error: The Network Adapter could not establish the connection in Oracle SQL Developer

According to this answer on Stack Overflow, you may try the following:

Make sure your tnsnames.ora is complete and has the databases you wish to connect to
Make sure you can tnsping the server you wish to connect to
On the server, make sure it will be open on the port you desire with the specific application you are using.


NVIDIA QUADRO 4000 graphics card not working

sounds like your graphics card is conflicting with the installation indeed.
Try installing from the alternate cd. Which is an more "low fi" installation method for ubuntu.

If you manage to install from the alternate cd. But you get similair lockups when booting into unity maybe its the open source driver that fails to work properly with your card.

From the grub boot loaders boot into recovery mode. Drop to root shell.
From the root shell install the proprietary nvidia drivers.

First make sure you have internet connection since the drivers will be downloaded from nvidia.
type the command:
dhclient eth0

should make youre computer request an IP.
after that  type:
jockey-text

which is the console based wizzard to install  proprietary drivers.
install the nvidia drivers and reboot, hopefully this was enough to get you going.

If not , retry this procedure with the latest Ubuntu LTS 12.04 , maybe more modern drivers/ kernel work betters


LUKS Disk Encryption on Raspberry Pi 4 and Ubuntu Desktop 20.10

EDIT: I misread the original question, but everything still applies. Using /dev/mmcblk0p2 below is for installing to the microSD card. To install to an external SSD/HD the device will likely be /dev/sda2. Use the appropriate device when editing cmdline.txt, crypttab, and booting for the first time via (initramfs).

The latest Ubuntu image includes cryptsetup, so you can convert the "writeable" (root) partition to LUKS using your desktop PC. I began with the 20.10 64-bit Server image.
Prepare your SD card but do not install into the RPi. Keep it on your desktop PC.
Unmount the SD card (/dev/sdc2 is my "writeable" (root) partition - yours may be different).
sudo umount /dev/sdc2
Check the partition...   sudo e2fsck -f /dev/sdc2
Shrink the partition...   sudo resize2fs -M /dev/sdc2
Encrypt the partition (RPi does not have hardware AES support, Adiantum seems to perform better)...
sudo cryptsetup-reencrypt --new --reduce-device-size=16M --type=luks2 -c xchacha12,aes-adiantum-plain64 -s 256 -h sha512 --use-urandom /dev/sdc2
Decrypt the LUKS partition...   sudo cryptsetup luksOpen /dev/sdc2 rootfs
Expand the partition...   sudo resize2fs /dev/mapper/rootfs
Mount the partition...   sudo mkdir mnt; sudo mount /dev/mapper/rootfs mnt;
Edit etc/crypttab... sudo vim mnt/etc/crypttab

Add rootfs  /dev/mmcblk0p2 none    luks

Edit etc/fstab... sudo vim mnt/etc/fstab

Change the first line to /dev/mapper/rootfs    /    ext4   defaults,noatime    0 0

On the system-boot partition, edit cmdline.txt...

change root=LABEL=writable to root=/dev/mapper/rootfs
remove splash (so it prompts for the passphrase on boot)
add cryptdevice=/dev/mmcblk0p2:sdcard to the end of the line

It should look like this...
dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=/dev/mapper/rootfs rootfstype=ext4 elevator=deadline rootwait fixrtc quiet cryptdevice=/dev/mmcblk0p2:sdcard
Unmount the microSD card and install into the Raspberry Pi. It will fail to boot and enter (initramfs) because initramfs hasn't been updated yet.
Manually decrypt from initramfs...   (initramfs) cryptsetup luksOpen /dev/mmcblk0p2 rootfs
Continue booting...   (initramfs) exit
Login (ubuntu/ubuntu) and update initramfs...   sudo update-initramfs -u
Reboot...   sudo reboot
It should reboot, prompt for the passphrase, then start the OS.


Maybe light locker is installed on his system. Try uninstalling light locker if so:

sudo apt-get remove light-locker

And install xscreen saver instead of it:

sudo apt-get install xscreensaver xscreensaver-gl-extra xscreensaver-data-extra

See here for more info: Ubuntu forums


This means that the file has some more ACL entries associated with it. Use

getfacl /dev/kvm

to get a list of all ACL entries attached to this file.


Installing Steam in some sandbox/container

What about a linux container? (like this)

Or freebsd jails? (wiki here)

Or chroot?

Maybe run a virtual machine with virtual box?

Probably a separate box with no real user info and connect it to a network that doesn't have a bunch of goodies on it?


In the control file, the Source field was set to the project path in our version control system. That path contained slashes of course, which is obviously not allowed. That error message sure could be a bit more precise.


File system is reported full with half of it use by ecrypt and other half by the /home/user

After following the advice from Xen2050 I found the root of my problems. When the error occur the "doubled" sized did exceed the disk space, the disc is thus not full due to eCrypt virtual mounting (as expected). After investigation it appear that the disk is effectively used by the /home partition on one hand (~120G) but also by the /var/lib which contain 62G of docker libs ...

The initial misconsception came from the output of df for the user using eCrypt which show :

/dev/mapper/ubuntu--vg-root 226G 199G 16G 93% /
/home/username/.Private     226G 199G 16G 93% /home/username

leading me to beleive that all the space was eaten by the /home/username partition


I think the best way of making your files and configuration portable (as you say) is to have an exclusive partition for your /home folder. That way you would be able to install and reinstall Ubuntu as many times you wish, and all your configuration will be intact.


Set all users' $HOME to /var/www and use system-wide aliases

If you just need them to start their sessions in /var/www by default, you don't want to change their $HOME (which is a bad idea anyway since /var/www won't belong to them). A much cleaner approach is to add this to their ~/.profile files:

cd /var/www

As for the aliases, all you need to do is modify their ~/.profile files to source the alias file you've created. Add this line to each user's ~/.profile:

. /path/to/.aliases

This way, they'll move to /var/www each time they log in (since login shells load ~/.profile) and they'll also have access to the aliases defined in /path/to/.aliases.


Install on HP 110-210 - Error: No Media Present

You have to enter BIOS settings and set your HDD as a primary boot device.
Press ESC key almost immediately after Power-on then press F10 to enter BIOS utility. (the hotkeys are especially valid for HP hardware, different manufacturers' computers may have other keyboard shortcuts to enter BIOS)


Is it 'safe' to use a proprietary microcode updater on Ubuntu 16?

This is not a driver. This is a CPU microcode updater.

It installs proprietary microcode released by AMD.

You get this message because Canonical does not control that microcode.

The same microcode is implemented in your BIOS. Ubuntu updates it if it is newer than the one in your BIOS.

It is quite safe to use the updater.

The question is very similar to this one.

You can check if the updated really installs some microcode by running

dmesg | grep microcode

You will see if some microcode is loaded. If not, then it does not matter if you install it or not.


There is a plugin for ALSA called vdownmix that converts audio output from 2 to 4 or 6 channels. It is included in the ALSA library additional plugins package, that you can install from the Software Centre.

Checkout out this guide for usage details.


I am guessing that  at some stage when installing something I must typed a password into the wrong field to get this problem.
The userid for "subroot" is 1001, so it is probably not a "system" user that should be hidden.
Now that I am aware of the probable source of the issue, I can wait before deleting the "subroot" user until I am sure that no recent installations are unworkable because of my carelessness ;)


Can't find libasound_module_pcm_a52.la and .so when trying to fix surround sound

Try running locate libasound_module_pcm_a52.la and locate libasound_module_pcm_a52.so and see what they return.

I belive you mentioned you may have already installed this but please confirm if you have installed this package: libasound2-plugins.


Using a VPS service, can I prevent my data from being accessible by the VPS host?

Unfortunately it is not possible at all. Here you are few short explanations about this:

  Even with encryption, the provider could snapshot the current state of memory and disk and clone a new instance to get as much access you did. (source)

  Even if you're running a VPS with encrypted filesystems, all of the in-RAM data will be unencrypted, which the VPS host sysadmins would have access to, including the decryption passphrase. If you really have this stringent of security requirements, it sounds like you need to run your own physically-secured systems or find a dedicated server hosting company that specializes in this sort of thing. (source)

  ...bear in mind that anyone with access to the VPS image can potentially add bug your code to detect the pass phrase you use. (source)

  [Encryption] makes some sense if you have control over the hardware; when someone else controls the hardware there's little point in it unless you trust that the host doesn't really want to look at it ... (source)

  Physical access is root access, so if someone has physical access to the server, regardless on if it is on a VM or bare metal, they have root access. In the case of KVM the owner of the bare metal host can access the guest. You can always encrypt the data, but, that may be of limited benefit as the data will be decrypted when you access it.

  Same with the network. The owner of the VM can see your network traffic. Again you can encrypt some of the traffic (https, ssh, etc). (source)

Here is a particular solution in case you want just to store some sensitive data on your VPS:

How to create and use encrypted directory via eCryptfs and mount it remotely

Pre-requirements

Install the packages ecryptfs-utils and sshfs and reboot the system:

sudo apt update && sudo apt -y install ecryptfs-utils sshfs
sudo apt update && sudo systemctl reboot

Standard Setup and Usage

Open a terminal window and run this command:

ecryptfs-setup-private

Then you will be asked to:

Enter your login passphrase [<user>]: this passphrase must match with the current user's password and will be used to unlock (decrypt) your encrypted information.
Enter your mount passphrase [leave blank ...]: this passphrase will be used automatically when your encrypted data is mounting, but you need it in case there is an emergency situation and you must recovery your data, so write it down on a safe place.

The above command will create two directories:

~/.Private where your encrypted data will be stored.
~/Private where the directory ~/.Private will be mounted as decrypted.

While ~/.Private is not mounted within the directory ~/Private has two files with instructions.

When you login to the system via user's password (login passphrase) the directory ~/.Private will be automatically mounted to ~/Private and you will be able to work there. When you logout or exit, the directory ~/.Private will be unmounted. To achieve this manually you can use the commands: ecryptfs-mount-private and ecryptfs-umount-private. More about these options can be found in the article eCryptfs from ArchLinux Wiki. See also: how to use ecryptfs with a random directory.

If you authenticate your SSH/SFTP connection via password, the above shall works. But if you authenticate yourself via SSH key pair you need to use ecryptfs-mount-private to mount ~/.Private. In this case first you need to SSH to the system and run ecryptfs-mount-private then you will be able to use SFTP to the directory ~/Private. You can add the command ecryptfs-mount-private to the bottom of ~/.bashrc to automate this process:

echo -e "\n# Mount my Private directory\necryptfs-mount-private\n" | tee -a ~/.bashrc

Mount a remote encrypted directory and unlock (decrypt) it locally

On the remote machine (VPS) and on the local machine execute the following command and enter identical data for login passphrase and for mount passphrase on both machines:

ecryptfs-setup-private --nopwcheck --noautomount

The option --nopwcheck enables you to choose a passphrase different to the user login passphrase and the option --noautomount is self-explanatory.

On the remote machine:

Run the command:

ecryptfs-mount-private

Note: While I testing this approach I had to perform the above command two times!
Create some simple content:

echo "Hello Word!" > ~/Private/hello.txt

Unmount ~/.Private:

ecryptfs-umount-private

Further you can remove the directory ~/.ecryptfs (from the VPS), where your decryption data is stored.

On the local machine:

Mount the remote encrypted folder ~/.Private to the local folder ~/.Private via sshfs, and masque the ownership to the files (replace <user>@<host_name_or_ip>):

sshfs -o idmap=user,uid=$(id -u),gid=$(id -g) <user>@<host_name_or_ip>:.Private ~/.Private

To unmount, use the command: fusermount -u ~/.Private or sudo umount -l ~/.Private.
Then mount (and decrypt) the local directory ~/.Private to ~/Private

ecryptfs-mount-private

Check if the file hello.txt is there:

$ cat ~/Private/hello.txt
Hello Word!

If you face a trouble with the command ecryptfs-umount-private (umount.ecryptfs_private) you can unmount the local ~/Private directory by the command sudo umount -l ~/Private.
eCryptfs has bugs and sometimes ecryptfs-mount-private and ecryptfs-umount-private don't work properly.
According to the above you can create two functions within ~/.bashrc that will automate the entire (mount/unmount) process (replace <user>@<host_name_or_ip>):

function ecryptfs-remote-mount {
        sshfs -o idmap=user,uid=$(id -u),gid=$(id -g) <user>@<host_name_or_ip>:.Private ~/.Private > /dev/null 2>&1
        sudo keyctl clear @u
        sudo ecryptfs-insert-wrapped-passphrase-into-keyring $HOME/.ecryptfs/wrapped-passphrase
        # Attempt to mount, and loop the function unless it is true - due to  CLI usage bug
        ecryptfs-mount-private && echo "Done!" || ecryptfs-remote-mount
}

function ecryptfs-remote-umount {
        ecryptfs-umount-private > /dev/null 2>&1 || sudo umount -l $HOME/Private
        fusermount -u $HOME/.Private > /dev/null 2>&1 || sudo umount -l $HOME/.Private
        echo "Done!"
}

export -f ecryptfs-remote-mount ecryptfs-remote-umount

Then source ~/.bashrc and you will be able to use ecryptfs-remote-mount and ecryptfs-remote-umount as commands.

References and further reading

Create an encrypted archive file (tar), where your sensitive data is hiding:

Encrypt tar.gz file on create
How to Create an Encrypted (Password Protected) Tar or Zip Archive in Linux
How to password protect gzip files on the command line?
How do I password protect a .tgz file with tar in Unix?.

Create an encrypted directory:

Encrypted backup to an SFTP server (WebSpace) with ecryptfs
Secure Encrypted Remote Volume How-to
How to encrypt individual folders?
How to Encrypt Directories with eCryptfs on Ubuntu 16.04
YouTube: How to Encrypt Folder in Ubuntu

Use encryption of user's home directory:

Encrypted Home Folder
Encrypted Home Directory How-to
HOW-TO encrypt your home directory
Accessing your encrypted home directory in Ubuntu
Migrating to an Encrypted Home Directory
SSH message after login, then restrict the user from using account


Since fuse is a part of kernel I think its missing wdfs(webdav filesystem) which is NOT in the repository.

Install underlying libraries:

sudo apt-get install checkinstall libfuse-dev libneon27 libneon27-dev
sudo apt-get install python-fuse fuse-utils

Get & install wdfs:

wget http://noedler.de/projekte/wdfs/wdfs-1.4.2.tar.gz
tar xzvf wdfs-1.4.2.tar.gz
cd wdfs-1.4.2
./configure
sudo checkinstall
sudo dpkg -i wdfs_1.4.2-1_*.deb

  If this doesn't work, then its probably this Bug:575061

Other Workaround:

Use SSH note sync instead.
Use wdfs to mount your webdav share somewhere, and use Local
Directory note sync and have it point at your webdav share. This is
exactly what the Tomboy add-in does, anyway.


How do I set the GNOME Classic login to be the default with autologin?

Run the following in a gome-terminal:

If you want GNOME Classic with effects:
sudo /usr/lib/lightdm/lightdm-set-defaults -s gnome-classic

If you want GNOME Classic without effects:
sudo /usr/lib/lightdm/lightdm-set-defaults -s gnome-fallback


In *nix, the convention is that "no command line output" means that the command worked as instructed.

In this case, your command

g++ p.cpp

should have produced an executable file with the default name a.out which you can run from the terminal using ./a.out


Ubuntu 14.04 GCC 4.8.2 link dynamically against (older) GLIBC 2.11.1

It looks like you can download any version of GLIBC here:

http://ftp.gnu.org/gnu/libc/

Then just link like any other I would think..


Here is what you need to do:

Log out of Ubuntu.
In the top right corner of the text area where you place your password (next to your name), you should see an Ubuntu icon. Click it.
Select Gnome.
Log back in.
Profit!


Possible to have xrandr not react to unplug of secondary monitor, removal of HDMI/ DisplayPort cable?

This may work HDMI/VGA ports but not DP due to some standards for DP that should always pass detection events.

I could test this on Dell E6410 with VGA/DP. Removing cable from VGA now does not trigger xrandr resettings and move windows.

gksu nvidia-settings
Go to X configuration tab then export configuration
Copy only device section
sudo mkdir /etc/X11/xorg.conf.d/
sudo nano /etc/X11/xorg.conf.d/90_my_nvidia_hacks.conf
Paste the device section

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "NVS 3100M"
EndSection

Add to it this line Option "UseHotplugEvents" "false"

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "NVS 3100M"
    Option "UseHotplugEvents" "false"
EndSection

Reboot or restart lightdm

sudo systemctl restart lightdm

You may find this useful too Option "AllowEmptyInitialConfiguration" "true" which create empty monitor section even no screen is connected on X start.

Reference:

  My displays are reconfigured in unexpected ways when I plug in or unplug a display, or power a display off and then power it on again.

  This is a special case of the issues described in “The display
  settings I configured in nvidia-settings do not persist.”. Some
  desktop environments which include advanced display configuration
  tools will automatically configure the display layout in response to
  detected configuration changes. For example, when a new display is
  plugged in, such a desktop environment may attempt to restore the
  previous layout that was used with the set of currently connected
  displays, or may configure a default layout based upon its own policy.

  On X servers with support for RandR 1.2 or later, the NVIDIA X driver
  reports display hotplug events to the X server via RandR when displays
  are connected and disconnected. These hotplug events may trigger a
  desktop environment with advanced display management capabilities to
  change the display configuration. These changes may affect settings
  such as the set of active displays, their resolutions and positioning
  relative to each other, per-display color correction settings, and
  more.

  In addition to hotplug events generated by connecting or disconnecting
  displays, DisplayPort displays will generate a hot unplug event when
  they power off, and a hotplug event when they power on, even if no
  physical plugging in or unplugging takes place. This can lead to
  hotplug-induced display configuration changes without any actual
  hotplug action taking place.

  If display hotplug events are resulting in undesired configuration
  changes, try the solutions and workarounds listed in “The display
  settings I configured in nvidia-settings do not persist.”. Another
  workaround would be to disable the NVIDIA X driver's reporting of
  hotplug events with the UseHotplugEvents X configuration option. Note
  that this option will have no effect on DisplayPort devices, which
  must report all hotplug events to ensure proper functionality.

  Option "UseHotplugEvents" "boolean"

  When this option is enabled, the NVIDIA X driver will generate RandR display changed events when displays are plugged into or
  unplugged from an NVIDIA GPU. Some desktop environments will listen
  for these events and dynamically reconfigure the desktop when displays
  are added or removed.

  Disabling this option suppresses the generation of these RandR events for non-DisplayPort displays, i.e., ones connected via VGA,
  DVI, or HDMI. Hotplug events cannot be suppressed for displays
  connected via DisplayPort.

  Note that probing the display configuration (e.g. with xrandr or nvidia-settings) may cause RandR display changed events to be
  generated, regardless of whether this option is enabled or disabled.
  Additionally, some VGA ports are incapable of hotplug detection: on
  such ports, the addition or removal of displays can only be detected
  by re-probing the display configuration.

  Default: on. The driver will generate RandR events when displays are added or removed.

  Option "AllowEmptyInitialConfiguration" "boolean"

  Normally, the NVIDIA X driver will fail to start if it cannot find any display devices connected to the NVIDIA GPU.
  AllowEmptyInitialConfiguration overrides that behavior so that the X
  server will start anyway, even if no display devices are connected.

  Enabling this option makes sense in configurations when starting the X server with no display devices connected to the NVIDIA GPU is
  expected, but one might be connected later. For example, some monitors
  do not show up as connected when they are powered off, even if they
  are physically connected to the GPU.

  Another scenario where this is useful is in Optimus-based laptops, where RandR 1.4 display offload (see Chapter 33, Offloading Graphics
  Display with RandR 1.4) is used to display the screen on the
  non-NVIDIA internal display panel, but an external display might be
  connected later.

  Default: off. The driver will refuse to start if it can't find at least one connected display device.


ps awx | grep nautilus

find the process using nautilus

in my case it was

1869 ?        Sl     0:01 nautilus -n

then kill process

sudo kill -TERM 1869

do not forget to use the same number


Kernel Lockdown on 18.10 is blocking personally signed DKMS Modules. Can I disable it?

I had something similar happen if I logged out and closed the laptop lid, afterwards everything was frozen and I could not boot, even into recovery.  I finally found that my BIOS had changed to secure boot enabled and fast boot enabled and disks configured as RAID.  This was not what I had set my BIOS to at install.  After resetting BIOS I was able to boot normally.  I now keep my laptop lid open unless I power down.


Does ubuntu run on any other devices besides pc's?

Ubuntu for tablets and smartphones is in development.You can already try to use them if you feel adventurous.There is also Ubuntu for netbooks.

However Ubuntu is a version of GNU/Linux.And there are versions of Linux that run on devices ranging from microwaves up to supercomputers.There are cars with Linux.Android is also a version of Linux.

With enough knowledge and tweaking you could run Ubuntu on anything with sufficient processing power.


No grub after installing Ubuntu 16.04 alongside Windows 10

The problem solved by downloading grubx64.efi and other stuff from the link below:

linux/fedora/releases

and copying them to a created folder in C:\EFI named ubuntu and running the command below in cmd:

Bcdedit /set {bootmgr} path \EFI\ubuntu\grubx64


You can install opencv from the repository (at least with Ubuntu 12.04 or newer). To get started, the easiest way is probably sudo apt-get install python-opencv. If you need or want to use the C instead of Python, sudo apt-get install libcv-dev. It does not hurt to have both installed.

I am not sure what other ways of plotting you're thinking, but off the top of my head, at least gnuplot, matplotlib, octave, and R have easy plotting capabilities and are available in the default repositories.


I have the exact same problem as you and I get around by doing this:

get rid of gnome-screensaver by:

sudo apt-get purge gnome-screensaver

Install the X screensaver by:

sudo apt-get install xscreensaver xscreensaver-data xscreensaver-gl

Whenever you forgot to switch back to English before the system locks itself, hit Ctrl+Alt+F1 log in as your admin user and kill -9 xscreensaver and you're back in!

(It's just a workaround and not a real "solution" but it works for me and is definitely better then shutting down and restarting)


Dual monitor with different Applications. Ubuntu 14.04

No. There is no feature like this built in to Unity. There are three alternative options:

Run two X sessions, one outputting to each monitor, but you can only have your keyboard and mouse connected to one xserver, and will have to configure the other to be accessed remotely. See How to run two X sessions at the same time?
Run VirtualBox or KVM full-screen on one monitor. 3D speed on the guest monitor will be reduced. You can avoid this if you have two different graphics cards, and configure PCI pass-through and then run two guest VMs, each connected directly to one graphics card, and hence one monitor. The downside of this approach is that to share files between the two operating systems you would have to export a shared directory between them. The main downside, though, is that it is tricky to set up and has problems with some hardware. See How to use NVIDIA GeForce M310 on Ubuntu 12.10 running as guest in Virtualbox? (the answer is not specific to either Nvidia or Ubuntu 12.10) and also The VGA passthrough club - did you succeed, and how?
Use a desktop that supports assigning a workspace to a monitor, see Switch workspaces individually on each monitor


maas node failed commisioning , failed to connect node via ssh

MAAS doesn't require Juju.  And if commissioning failed, you wont be able to log in with the ssh key.

To create a working server using MAAS, there is a two part process.  First "Commission", then "Deploy".  If Commissioning succeeds, then you can deploy, and THEN you can log in with the SSH key.

Commissioning should result in a powered-off node.  So if the node is powered on and at a login prompt, you are probably seeing the previously-installed operating system.  This is a common outcome when PXE fails, the old OS boots, and commissioning fails (times out) after 20mins.

Commissioning is a three phase process 1) boot the node using IPMI or BMC mechanism, 2) Use PXE to load an ephemeral operating system for inspection/testing, 3) run hardware tests and take inventory.

Since you see the node turning on and booting to the PXE prompt, I think you are okay with #1.  My guess is #2 is failing -- even though it looks like it is succeeding.  When PXE works, it should work quickly, you should see a message that the boot files are being downloaded, there shouldn't be any errors, and you should clearly see a message "Booting under MAAS direction".

If PXE isn't working, you may need to adjust physical networking, or the subnet/DHCP configuration in MAAS.  If PXE is working, and commissioning is still failing, then you might have the wrong MAC address configured when you added the machine to MAAS.  Look at the links below for a few details.  If you have the wrong MAC (e.g. because you used the wrong physical port on the server), commissioning fails because MAAS doesn't know that the booting machine is the same machine as what you configured in MAAS.

How do you add a machine to MAAS with IPMI power using CLI

What are the power parameters for MAAS when using Cisco UCS blades for machines


Video games are not developed due to the lack of market share. A majority of users are on OS X or Windows systems. The kernel version has nothing to do with it as it is largely the same system after a kernel update. Windows runs has the NT kernel which has different versions, yet it still can run the same games on different versions.

Now that Linux is popularizing games are being made for it. Steam is reportedly coming to Linux, which will probably increase the amount of games developed for the platform.


How do I install only Chrome on a minimal installation?

Just install Xorg, your graphic card driver, and Chrome. Then put Chrome in Xorg's startup script (.xinitrc). Though if you want something minimal like that you'd probably be more suited with Arch Linux, which is designed to let you build up your whole system from the ground (without too much effort).

Some command line web browsers are Links and Lynx.

I'm not sure, but this should be how to achieve it...

sudo apt-get install xorg chromium-browser
Install your graphic card driver. You can choose whether you want the open source or the proprietary one. If you can tell me what graphic card you have, I'll try to tell you which driver you need. The MESA driver should work with any card, if I'm not mistaken, but has terrible performance.
echo chromium-browser >> .xinitrc (Might be a different command. once again; I'm not sure.)
startx


How can I set the date format to my country setting?

If you want to change the time format to German , you must install the German language from the Language Support and then set the "Regional Settings" in German

If you want to change the format in Date and Time , you must install dconf-tool . From terminal do

sudo apt-get install dconf-tools

Find it through Dash by writing dconf open it and goto Com > Canonical > Indicator > Datetime and from there you can change the format.

Logout and Login for changes to take effect.

The default format is %l:%M %p , you will change it to %M:%l %p


What's the name of an application similiar to gnome-tweak tool?

I believe you are looking for the Ubuntu Tweak Tool.

How do I install Ubuntu-Tweak?


KDE - Displays only shows monitor or laptop screen, not both

When multiple monitors display the same content, have the same resolution and are not unified, they are stacked exactly on top of each other in the GUI. Just drag the monitor in front to the side to reveal the other monitor(s):


How to remove error message when installing new softwares

Running these commands should fix your problem:

sudo apt-get update
sudo apt-get --purge reinstall oracle-java7-installer
sudo apt-get upgrade

If they do not, then please edit your question to include all the text from the Terminal from when you ran them (as the output would still be diagnostically useful).


How to start Openssh server after install in WSL?

WSL does not automatically start sshd
Try removing the ssh server with:
sudo apt remove openssh-server

And then install it again with:
sudo apt install openssh-server

Then check the server status to see if it is running. If not, try:
sudo service ssh start

to start the server. See more here
Hope this helps


Can't commission node in MAAS due to "Failed to power on node" error

Try adjusting your hardware clock.
If you are using Cisco switches, try to enable Portfast.
Try to dig and ping your fully qualified domain name of your node and make sure DNS and network connectivity are set right.


is software updater application in ubuntu like sudo apt-get update?

The Software Update application is just a GUI frontend to the apt and dpkg backends in the command line, which actually maintain and manage the packages.

The ultimate underlying commands being run are about equivalent to sudo apt-get update when you hit "Refresh" or "Check for Updates".  The about-equivalent command being run when you have all the packages selected in the graphical list of packages is sudo apt-get dist-upgrade, or for specific packages selected and others not selected, sudo apt-get install PACKAGE1 PACKAGE2 PACKAGE3 ... (where PACKAGE# is just a placeholder for selected packages).

Ultimately, apt-get update, apt-get upgrade, and the Software Update application are just different interfaces to the same goal - the updating of packages in the system, ultimately handled by dpkg in the end.


How to list all files where the first line is a blank line

No need to use | xargs, find has an -exec flag to execute a command on matching files. Also, you need to escape the *java or bash will expand the arguments and find will complain.

This awk oneliner then should do what you need:

find . -name '*java' -exec awk 'NR==1&&/^$/{print FILENAME}' {} \;

NR==1 selects just the first line. /^$/ matches the empty line. print FILENAME prints the file that matches.

If the first line is not really empty but contains only whitespace, you can modify the regular expression in

/^\s*$/

where \s* matches 0 or more whitespace characters.


Usb Modeswitch

When a USB Modem device with drivers for other OS is plugged in, first it is recognized as Flash device. after identifying the device, this mode is switched to Mass Storage or Modem device. This switching is done by USB Modeswitch.

You can install it by:

sudo apt-get install usb-modeswitch usb-modeswitch-data

No need to run it. It works automatically.

To plug and play a device, you should install usb-modeswitch

Accessing the Data

You can access the data with applications like Wammu or Gmobile Media

Wammu

sudo apt-get install gammu wammu

Gmobile Media

sudo apt-get install gmobilemedia

In Ubuntu 13.10 there is a application called modem-manager-gui

sudo apt-get install modemmanager modem-manager-gui


Duplicate sources.list entry Ubuntu 14.04

Edit sources.list and comment out the duplicate entry.

Edit sources.list:

sudo nano /etc/apt/sources.list

Place a # in front of the duplicate entry
Save:

Ctrl + X, Y, Enter
Update:

sudo apt-get update

Now try again.


I have installed Ubuntu 12.04 on my laptop for several times and I never encountered such problem. Looks like your guessing is right. Either your CD or your downloaded copy of Ubuntu has corrupted.

Generally a CD have around 700MB storage. But size of Ubuntu is a little bit larger than that. So, you need a DVD.(Some CD may have the required amount of storage. But it's not common.)


Update source.list file :

sudo apt-get update

Open terminal :

sudo apt-get install compiz compizconfig-settings-manager compiz-fusion-plugins-extra compiz-fusion-plugins-main compiz-plugins

Open compiz :

ccsm


What is the default password for the `tomcat7` user on my system?

Firstly, there should be zero reason to login as the tomcat7 user.  There's no logical use case for this, so therefore I'm not sure why you'd try and use it.

  You state in your question you want to set up a virtual X server for a webapp - you don't need to login as tomcat7 to do this, though your question isn't "How can I launch a virtual X server for my web app as tomcat7 without logging in", so don't expect help here with that in this question.

Having said this, it's likely that this is a System User Account and not an actual user; these users typically have no passwords associated with it, as it is designed to be used by system daemons and services, rather than users.  Therefore, you cannot login as that user as it isn't designed to be logged into by users - to use the user, you have to use su to switch user to it, and you have to do so as superuser or root or with sudo.  Also note that there's the option of setting a password, but it's ill-advised to do so, for that user.

Option 1 (Recommended, and the Proper Way to do this): su as sudo or root/superuser

You will need to have sudo power, or access to the root user to get this working with these instructions.

With sudo:

sudo su tomcat7

As root user:

su tomcat7

Option 2 (NOT RECOMMENDED, because it introduces security concerns and other issues): Set a password

You will need to have sudo power, or access to the root user to get this working with these instructions, and it is VERY likely you will break things by doing this.  I HIGHLY RECOMMEND not doing this!

Set a password.

With sudo:

sudo passwd tomcat7
[set a password with the prompts]

As root:

passwd tomcat7

Once the password is set, then you can just login to the user (either via SSH or the console directly).

Again, I strongly recommend that you do not do this method - this could break Tomcat7, and can actually put your system at  risk because someone can now brute-force the password and have access to the tomcat instance as the tomcat user itself.

To reiterate though: there is no logical reason to need to login as the tomcat7 user.  Do so at your own risk as you can affect evilness on your system if you're not careful.


Trying it can't do any harm.

Use the following command before and after the switch. >ou should see a drop/rise in mW being used:

# grep rate /proc/acpi/battery/BAT0/state

switch off your NVIDIA card using

# echo OFF > /sys/kernel/debug/vgaswitcheroo/switch

If your laptop now uses less mW, then you get a longer battery life.


You probably haven't configured clamav, hence the error message:

  !NotifyClamd: Can't find or parse configuration file
  /etc/clamav/clamd.conf

But that's ok it's just a !Notify.  You don't need to do anything more if you don't want to.

The defaults for clamav are good, and you were able to download all the signatures, so it's working.

If you want to customise your installation, then read man clamd.conf


Compiling 32-bit app on 64-bit, cannot find -lX11

You need the header files, which are provided by -dev packages, and not in the library packages themselves. So, try installing libx11-dev. That should fix this particular build error, though you may get similar errors about other libraries (and then you can install their -dev packages.)

Even though these packages provide header files rather than binaries, and in general header files account for all supported architectures through the use of preprocessor macros, nonetheless -dev packages in Ubuntu tend to be architecture-specific, and this is the case for libx11-dev (as can be seen here by expanding a release and finding the .deb packages listed for libx11-dev in that release). Since your Ubuntu system is 64-bit and you're compiling a 32-bit program which must link against the 32-bit version of the library, you'll probably need to install the 32-bit version of libx11-dev. If you're installing with apt-get or aptitude, you can specify that by indicating libx11-dev:i386 as the package to install (since multarch is supported and being used).

http://packages.ubuntu.com/ is a good resource for finding the name of the -dev package corresponding to a library package. It's not always the library package's name immediately followed by -dev; sometimes version numbers present in the library package name, especially after a -, are absent in the name of the corresponding -dev package.


After upgrading from 17.10 Ubuntu 18.04 won't sleep/suspend

I've been experiencing what appears to be this very same issue with an HP Pavilion 11 x360.

I have installed Ubuntu and Kubuntu 18.04 a couple of times on my friend's and my own laptops without any suspend issues, but this one 'problem child' has been very much misbehaving.

The Pavilion goes to a black screen but the power LED stays on and the fan continues to spin (if it had been doing so already). The laptop remains unresponsive to anything until I shut it down.

It has done this with both Ubuntu and Kubuntu 18.04 but worked fine with Ubuntu and Kubuntu 17.10.

Edit - There are a few issues that look similar - an nVidia graphics driver problem, the machine going into s2idle instead of suspend and this specific issue that seems to only be affecting a small number of people. Take a look at the steps here to help identify your issue: Ubuntu 18.04 - Dell XPS13 9370 no longer suspends on lid close

It doesn't seem to be affecting everyone (otherwise I assume it'd be all over the forums by now) but after trying things like pm-utils and adjusting grub configurations to no avail, I found this answer from matalak's question:

Ubuntu 18.04 crashes on resuming from suspend

Following the suggestion, I used UKUU to install an older kernel (4.14.47 - the most up to date 4.14 kernel) and suspend worked again as it should.

Edit - If you have nVidia graphics, there seems to be a fix that is working for a number of people, helpfully provided by cascagrossa in the answer to the question linked above.

A bug report has been opened https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1774950 and there is a patch that resolves the issue, so the suspend problem should be fixed in an update in the near future.

Using an older kernel is only a temporary solution and I'd quite like to be using 4.15 and onwards (4.16 and 4.17 and had the same suspend problems when i tried them out)..

Could you also add what machine you are using to your question?

Can you let us know if trying the 4.14 kernel lets suspend work as normal for you too?


How to selectively purge old kernels all at once

The advantage of this answer is native Ubuntu Bash is used without installing third-party applications. Users of custom kernels who didn't use apt or dpkg can change this bash script to suit their needs.

Zenity based solution

Zenity provides a GUI interface to the terminal. Here it's used to process a list of kernels and select individual ones:

The dialog title reports the number of kernels, their total size and the current kernel version booted. The current kernel is excluded from the title's totals and does not appear the kernel list.

The Modified Date is normally the date the kernel was released. On my system that date is "touched" every time the kernel is booted using a  cron reboot script (How do you find out when a specific kernel version was last booted?).

For each kernel its size within the /boot directory is reported. Then the kernel's total size is summed for the three directories; /boot, /usr/src/kernel_version and /lib/modules/kernel_version.

If no parameter is passed to rm-kernels the total size is estimated and the title shows "Est. Total". This saves time running the du command which can take 30 seconds to 90 minutes depending on how many kernels you have and whether you have an SSD or an HDD. If you pass any parameter at all then du is used to obtain kernel sizes and the title shows "Real Total" as the sample screen above illustrates.

apt-get purge gives you chance to abort

You get to view everything that will be purged by apt purge and are given the option to proceed or abort:

The following packages will be REMOVED:
  linux-headers-4.4.0-78* linux-headers-4.4.0-78-generic*
  linux-headers-4.4.8-040408* linux-headers-4.4.8-040408-generic*
  linux-headers-4.6.3-040603* linux-headers-4.6.3-040603-generic*
  linux-headers-4.8.12-040812* linux-headers-4.8.12-040812-generic*
  linux-headers-4.9.0-040900* linux-headers-4.9.0-040900-generic*
  linux-headers-4.9.9-040909* linux-headers-4.9.9-040909-generic*
  linux-image-4.4.0-78-generic* linux-image-4.4.8-040408-generic*
  linux-image-4.6.3-040603-generic* linux-image-4.8.12-040812-generic*
  linux-image-4.9.0-040900-generic* linux-image-4.9.9-040909-generic*
  linux-image-extra-4.4.0-78-generic*
0 upgraded, 0 newly installed, 19 to remove and 1 not upgraded.
After this operation, 1,794 MB disk space will be freed.
Do you want to continue? [Y/n]

apt purge reports 1,784 MB will be freed but the real total 2,379 MB. I don't know why it is different.

Rather than purging kernels one at a time and update-grub being repetitively called in time-consuming loop, the selections are purged all at once.

The Code

Copy this code to a file named rm-kernels in /usr/local/bin:

#!/bin/bash

# NAME: rm-kernels
# PATH: /usr/local/bin
# DESC: Provide zenity item list of kernels to remove

# DATE: Mar 10, 2017. Modified Aug 5, 2017.

# NOTE: Will not delete current kernel.

#       With 10 kernels on an SSD, empty cache from sudo prompt (#) using:
#       # free && sync && echo 3 > /proc/sys/vm/drop_caches && free
#       First time for `du` 34 seconds.
#       Second time for `du` 1 second.
#       With a magnetic hard disk, and empty memory cache:
#       the first `du` command averages about 20 seconds per kernel.
#       the second `du` command averages about 2.5 seconds per kernel.

# PARM: If any parm 1 passed use REAL kernel size, else use estimated size.
#       By default `du` is not used and estimated size is displayed.

# Must be running as sudo
if [[ $(id -u) != 0 ]]; then
    zenity --error --text "root access required. Use: sudo rm-kernels"
    exit 99
fi

OLDIFS="$IFS"
IFS="|"
choices=()

current_version=$(uname -r)

for f in /boot/vmlinuz*
do
    if [[ $f == *"$current_version"* ]]; then continue; fi # skip current version
    [[ $f =~ vmlinuz-(.*) ]]
    v=${BASH_REMATCH[1]}        # example: 4.9.21-040921-generic
    v_main="${v%-*}"            # example: 4.9.21-040921

    n=$(( n + 1 ))              # increment number of kernels

    # Kernel size in /boot/*4.9.21-040921-generic*
    s=$(du -ch /boot/*-$v* | awk '/total/{print $1}')

    if [[ $# -ne 0 ]] ; then    # Was a parameter passed?
        if [[ -d "/usr/src/linux-headers-"$v_main ]] ; then
             # Kernel headers size in /usr/src/*4.9.21-040921*
             s2=$(du -ch --max-depth=1 /usr/src/*-$v_main* | awk '/total/{print $1}')
        else
             s2="0M"            # Linux Headers are not installed
        fi
        # Kernel image size in /lib/modules/4.9.21-040921-generic*
        s3=$(du -ch --max-depth=1 /lib/modules/$v* | awk '/total/{print $1}')
    else
        # Estimate sizof of optional headers at 125MB and size of image at 220MB
        if [[ -d "/usr/src/linux-headers-"$v_main ]] ; then
             s2="125M"
        else
             s2="0M"            # Linux Headers are not installed
        fi
        s3="220M"
    fi

    # Strip out "M" provided by human readable option of du and add 3 sizes together
    c=$(( ${s//[^0-9]*} + ${s2//[^0-9]*} + ${s3//[^0-9]*} ))
    s=$(( ${s//[^0-9]*} )) # Strip out M to make " MB" below which looks nicer
    t=$(( t + c ))
    s=$s" MB"
    c=$c" MB"
    d=$(date --date $(stat -c %y $f) '+%b %d %Y') # Last modified date for display
    choices=("${choices[@]}" false "$v" "$d" "$s" "$c")
done

# Write Kernel version and array index to unsorted file
> ~/.rm-kernels-plain # Empty any existing file.
for (( i=1; i<${#choices[@]}; i=i+5 )) ; do
    echo "${choices[i]}|$i" >> ~/.rm-kernels-plain
done

# Sort kernels by version number
sort -V -k1 -t'|' ~/.rm-kernels-plain -o ~/.rm-kernels-sorted

# Strip out keys leaving Sorted Index Numbers
cut -f2 -d '|' ~/.rm-kernels-sorted > ~/.rm-kernels-ndx

# Create sorted array
SortedArr=()
while read -r ndx; do
    end=$(( ndx + 4 ))
    for (( i=$(( ndx - 1 )); i<end; i++ )); do
        SortedArr+=("${choices[i]}")
    done
done < ~/.rm-kernels-ndx

rm ~/.rm-kernels-plain ~/.rm-kernels-sorted ~/.rm-kernels-ndx

if [[ $# -ne 0 ]] ; then    # Was a parameter passed?
    VariableHeading="Real Total"
else
    VariableHeading="Est. Total"
fi

# adjust width & height below for your screen 640x480 default for 1920x1080 HD screen
# also adjust font="14" below if blue text is too small or too large

choices=(`zenity \
        --title "rm-kernels - $n Kernels, Total: $t MB excluding: $current_version" \
        --list \
        --separator="$IFS" \
        --checklist --multiple \
        --text 'Check box next to kernel(s) to remove' \
        --width=800 \
        --height=480 \
        --column "Select" \
        --column "Kernel Version Number" \
        --column "Modified Date" \
        --column "/boot Size" \
        --column "$VariableHeading" \
        "${SortedArr[@]}"`)
IFS="$OLDIFS"

i=0
list=""
for choice in "${choices[@]}" ; do
    if [ "$i" -gt 0 ]; then list="$list- "; fi # append "-" from last loop
    ((i++))

    short_choice=$(echo $choice | cut -f1-2 -d"-")
    header_count=$(find /usr/src/linux-headers-$short_choice* -maxdepth 0 -type d | wc -l)

    # If -lowlatency and -generic are purged at same time the _all header directory
    # remains on disk for specific version with no -generic or -lowlatency below.
    if [[ $header_count -lt 3 ]]; then
        # Remove all w.x.y-zzz headers
        list="$list""linux-image-$choice- linux-headers-$short_choice"
    else
        # Remove w.x.y-zzz-flavour header only, ie -generic or -lowlatency
        list="$list""linux-image-$choice- linux-headers-$choice"
    fi

done

if [ "$i" -gt 0 ] ; then
     apt-get purge $list
fi

NOTE: You need to use sudo powers to save the file with your favorite editor.

To make file executable use:

sudo chmod +x /usr/local/bin/rm-kernels

Server Version

rm-kernels-server is the server version to selectively delete kernels all at once. Instead of a GUI (graphical) dialog box a text-based dialog box is used to select kernels to purge.

Before running the script you need to install the dialog function using:

sudo apt install dialog

Dialog is in the default Ubuntu Desktop installation but not in Ubuntu Server.

Sample screen

rm-kernels-server bash code

#!/bin/bash

# NAME: rm-kernels-server
# PATH: /usr/local/bin
# DESC: Provide dialog checklist of kernels to remove
#       Non-GUI, text based interface for server distro's.

# DATE: Mar 10, 2017. Modified Aug 5, 2017.

# NOTE: Will not delete current kernel.

#       With 10 kernels on an SSD, empty cache from sudo prompt (#) using:
#       # free && sync && echo 3 > /proc/sys/vm/drop_caches && free
#       First time for `du` 34 seconds.
#       Second time for `du` 1 second.
#       With a magnetic hard disk, and empty memory cache:
#       the first `du` command averages about 20 seconds per kernel.
#       the second `du` command averages about 2.5 seconds per kernel.

# PARM: If any parm 1 passed use REAL kernel size, else use estimated size.
#       By default `du` is not used and estimated size is displayed.

# Must be running as sudo
if [[ $(id -u) != 0 ]]; then
    echo "root access required. Use: sudo rm-kernels-server"
    exit 99
fi

# Must have the dialog package. On Servers, not installed by default
command -v dialog >/dev/null 2>&1 || { echo >&2 "dialog package required but it is not installed.  Aborting."; exit 99; }

OLDIFS="$IFS"
IFS="|"
item_list=() # Deviate from rm-kernels here.

current_version=$(uname -r)
i=0
for f in /boot/vmlinuz*
do
    if [[ $f == *"$current_version"* ]]; then continue; fi # skip current version
    [[ $f =~ vmlinuz-(.*) ]]
    ((i++)) # Item List
    v=${BASH_REMATCH[1]}        # example: 4.9.21-040921-generic
    v_main="${v%-*}"            # example: 4.9.21-040921

    n=$(( n + 1 ))              # increment number of kernels

    # Kernel size in /boot/*4.9.21-040921-generic*
    s=$(du -ch /boot/*-$v* | awk '/total/{print $1}')

    if [[ $# -ne 0 ]] ; then    # Was a parameter passed?
        if [[ -d "/usr/src/linux-headers-"$v_main ]] ; then
             # Kernel headers size in /usr/src/*4.9.21-040921*
             s2=$(du -ch --max-depth=1 /usr/src/*-$v_main* | awk '/total/{print $1}')
        else
             s2="0M"            # Linux Headers are not installed
        fi
        # Kernel image size in /lib/modules/4.9.21-040921-generic*
        s3=$(du -ch --max-depth=1 /lib/modules/$v* | awk '/total/{print $1}')
    else
        # Estimate sizof of optional headers at 125MB and size of image at 220MB
        if [[ -d "/usr/src/linux-headers-"$v_main ]] ; then
             s2="125M"
        else
             s2="0M"            # Linux Headers are not installed
        fi
        s3="220M"
    fi

    # Strip out "M" provided by human readable option of du and add 3 sizes together
    c=$(( ${s//[^0-9]*} + ${s2//[^0-9]*} + ${s3//[^0-9]*} ))
    s=$(( ${s//[^0-9]*} )) # Strip out M to make " MB" below which looks nicer
    t=$(( t + c ))
    s=$s" MB"
    c=$c" MB"
    d=$(date --date $(stat -c %y $f) '+%b %d %Y') # Last modified date for display
    item_list=("${item_list[@]}" "$i" "$v ! $d ! $s ! $c" off)
done

# Write Kernel version and array index to unsorted file
> ~/.rm-kernels-plain # Empty any existing file.
for (( i=1; i<${#item_list[@]}; i=i+3 )) ; do
    echo "${item_list[i]}|$i" >> ~/.rm-kernels-plain
done

# Sort kernels by version number
sort -V -k1 -t'|' ~/.rm-kernels-plain -o ~/.rm-kernels-sorted

# Strip out keys leaving Sorted Index Numbers
cut -f2 -d '|' ~/.rm-kernels-sorted > ~/.rm-kernels-ndx

# Create sorted array
SortedArr=()
i=1
while read -r ndx; do
    SortedArr+=($i "${item_list[$ndx]}" "off")
    (( i++ ))
done < ~/.rm-kernels-ndx

rm ~/.rm-kernels-plain ~/.rm-kernels-sorted ~/.rm-kernels-ndx

cmd=(dialog --backtitle "rm-kernels-server - $n Kernels, Total: $t MB excluding: $current_version" \
    --title "Use space bar to toggle kernel(s) to remove" \
    --column-separator "!" \
    --separate-output \
    --ascii-lines \
    --checklist "         Kernel Version  ------  Modified Date /boot Size  Total" 20 70 15)

selections=$("${cmd[@]}" "${SortedArr[@]}" 2>&1 >/dev/tty)

IFS=$OLDIFS

if [ $? -ne 0 ] ; then
    echo cancel selected
    exit 1
fi

i=0
choices=()

for select in $selections ; do
    ((i++))
    j=$(( 1 + ($select - 1) * 3 ))
    choices[i]=$(echo ${SortedArr[j]} | cut -f1 -d"!")
done

i=0
list=""
for choice in "${choices[@]}" ; do
    if [ "$i" -gt 0 ]; then list="$list- "; fi # append "-" from last loop
    ((i++))

    short_choice=$(echo $choice | cut -f1-2 -d"-")
    header_count=$(find /usr/src/linux-headers-$short_choice* -maxdepth 0 -type d | wc -l)

    # If -lowlatency and -generic are purged at same time the _all header directory
    # remains on disk for specific version with no -generic or -lowlatency below.
    if [[ $header_count -lt 3 ]]; then
        # Remove all w.x.y-zzz headers
        list="$list""linux-image-$choice- linux-headers-$short_choice"
    else
        # Remove w.x.y-zzz-flavour header only, ie -generic or -lowlatency
        list="$list""linux-image-$choice- linux-headers-$choice"
    fi

done

if [ "$i" -gt 0 ] ; then
    apt-get purge $list
fi

NOTE: In the call to dialog the directive --ascii-lines is passed to replace line-draw extended character set (which ssh doesn't like) with "+-----+" for drawing boxes. If you do not like this appearance you can use the --no-lines directive for no box at all. If you aren't using ssh you can delete the --ascii-lines and your display will be formated with line-draw characters:

July 28, 2017 Updates

The calculated size of each kernel was taken from /boot/*kernel_version* which were 5 files totaling ~50 MB. The formula has changed to include the files in /usr/src/*kernel_version* and /lib/modules/*kernel_version*. The calculated size for each kernel is now ~400 MB.

The default is to estimate the size of files for linux-headers at 125 MB and linux-image at 220 MB because du can be painfully slow unless files are in cached in memory. To get the real size using du pass any parameter to the script.

The total of all kernel sizes (excluding the current running version which cannot be removed) is now show in the title bar.

The dialog box used to display each Kernel's Last Access Date. This date can get mass overwritten for all kernels during backup or similar operations. The dialog box now shows the Modified Date instead.

August 5, 2017 Updates

The kernel list is now sorted by Kernel Version rather than alpha-numerically.

An additional column has been added for /boot size. In the graphical Zenity version the last column changes between "Real Total" and "Est. Total" (Estimated) depending on parameter 1 being passed or not.


ssh: connect to host xxx.xxx.xxx.xxx port 22: Connection refused

The remote server appears to operate on a different port than the default(22). You need to specify it using ssh user@host -p port syntax. It works locally since the port is the default, which is 22. The server and local server both require a package to provide SSH server, sshd or openssh. They can be installed with:

sudo apt-get install openssh-server

or

sudo apt-get install sshd


ERROR(): Provision failed - Provisioning Error:

Specify a valid domain name; it needs to have a dot in it. E.g.:

Realm: BDDC.COM
Domain: bddc.com

(This causes the short domain name to be "BDDC", and thus it won't be the same as the realm - "BDDC.COM")


How do I get a live-USB to use a partition for persistence?

This is very easy to do, although the "casper-rw" name will still show up once :)

Your target USB disk must have at least two partitions; I recommend using GParted to create a new partition table.

The first partition must be vfat/FAT32, and minimum size 750 MB (or more if you are using a live DVD image).
The second partition should be ext4, sized to whatever you want your persistent storage to be (no limits), but it must be labeled casper-rw (all lower case, no quotes)

You can, of course, add third, fourth, extended/logical partitions, etc. if you would like to.

  Note: I prefer to use UNetbootin because it makes editing the syslinux configuration easy. You can use your own USB creator, but you should then modify the below steps appropriately. Also note that GParted 0.18.0 seems to have problems partitioning the USB stick. So if you have the issue then use live GParted CD for partitioning.

Use UNetbootin to write your chosen live CD ISO to the first (vfat) USB partition.

Put a tiny size for UNetbootin's persistence option (say, 10 MB) to make life easier; don't worry, we won't actually be using this casper-rw file.

Once everything is done, the final step is to delete the small casper-rw file created on the vfat partition you installed the live CD on, so that the large ext4 casper-rw partition is used instead. Mount this partition (here, sdb1), and delete /casper-rw.
Persistence (via the persistent kernel option) should already be set up if you used UNetbootin, so safely eject the USB and you're ready to go!

PS: If you don't want to use UNetbootin and you are using the "Startup disk creator" in Ubuntu then you need to do some edits to your syslinux/txt.cfg file as follows:

default live
label live
  menu label ^Try Ubuntu without installing
  kernel /casper/vmlinuz.efi
  append  file=/cdrom/preseed/ubuntu.seed boot=casper cdrom-detect/try-usb=true persistent noprompt floppy.allowed_drive_mask=0 ignore_uuid initrd=/casper/initrd.lz quiet splash --
label live-install
  menu label ^Install Ubuntu
  kernel /casper/vmlinuz.efi
  append  file=/cdrom/preseed/ubuntu.seed boot=casper only-ubiquity cdrom-detect/try-usb=true persistent noprompt floppy.allowed_drive_mask=0 ignore_uuid initrd=/casper/initrd.lz quiet splash --
label check
  menu label ^Check disc for defects
  kernel /casper/vmlinuz.efi
  append  boot=casper integrity-check cdrom-detect/try-usb=true persistent noprompt floppy.allowed_drive_mask=0 ignore_uuid initrd=/casper/initrd.lz quiet splash --
label memtest
  menu label Test ^memory
  kernel /install/mt86plus
label hd
  menu label ^Boot from first hard disk
  localboot 0x80


To my knowledge, you cannot stop Docky from using the window manager feature. The best you can do is find another Dock that allows you to do that.


Network is taking a lot of time at startup

The NetworkManager-wait-online.service simply waits until the system is connected to a network (for a maximum of 30 seconds). You can safely disable it.
NetworkManager.service on the other hand won't cause delays, and you should leave it on (unless you want to manually start the service when you want to connect).


In Ubuntu 15.10, how can I replace the toolbar on the left side with a normal menu like in Ubuntu 12.04?

You can't in Ubuntu. The launcher is a integral part of the Unity experience and Ubuntu. In the new 16.04 you will be able to place the launcher elsewhere. But the launcher will still be there. By the way: this method was chosen because it looks the best on ALL Ubuntu devices: from 4:3, 16:10 notebooks through to phones and is part of the Ubuntu path to convergence.

If you want another desktop experience you will need to install another desktop. The  Mate desktop is a version that supports the old gnome2.

Random image from the internet with the panel at the bottom:

The way to add a desktop is by using apt-get to install it:

sudo apt-get install ubuntu-mate-desktop

After it is installed you can pick this desktop (and any other that is installed) at login. You will need to turn off auto-login. If you are satisfied with this desktop you can remove the old Ubuntu desktop with ...

sudo apt-get purge ubuntu-desktop

The same is applicable for any other desktop. A small list:

Kubuntu, KDE desktop: sudo apt-get install kubuntu-desktop
Xubuntu, XFCE desktop: sudo apt-get install xubuntu-desktop
Lubuntu, LXDE desktop: sudo apt-get install lubuntu-desktop
Ubuntu GNOME, Gnome 3 desktop: sudo apt-get install ubuntu-gnome-desktop

Technically you should be able to add ALL of them to 1 operating system and switch between them from login. But I would try to avoid it, it is likely software will conflict, and/or when removing it might leave traces, make the system unstable.

If testing is the goal (to decide what to go for): use a virtual box and install your operating system in there.

Here is how the login works (from linuxpitstop, theswitchtolinux has also got a good blogpost on it) :

In general it is best to re-install and stick to one desktop. That will remove all traces of the old desktop. Every desktop also comes with a different set of pre-installed software. Not all of them have "gedit" as an editor, not all will have Nautilus as file manager or Firefox as default browser. Some of these desktops focus on the lowest footprint possible so it will work on very old systems. That means less focus on perfectly looking software with all kinds of effects and features. So a focus on performance over a visually good looking desktop with lots of features.


can i install kubuntu desktop on ubuntu with windows 8 dual boot?

Just type sudo apt-get install kubuntu-desktop in the terminal.


How do I change my @ubuntu.com email alias?

Your @ubuntu.com email address forwards email to the contact address associated with your Launchpad account, as described here:

https://wiki.ubuntu.com/UbuntuEmail

You can select a different contact address or register additional email addresses to your account at the following page:

https://launchpad.net/~/+editemails


Evince opening pdf via terminal but not via file manager

After playing around with file naming conventions it turns out that the # character was the culprit. I used a bulk renaming script to remove them as well as all other non-alphanumeric characters and now everything is peachy.

I am not sure if this is the general rule because the files opened normally on Ubuntu Gnome Remix (nautilus file manager).

Maybe this is only an issue when using Lubuntu (pcfileman file manager).


I was able to try to install Wine again but I used the command sudo apt-get install wine-stable. Something must have changed since I last tried to install Wine because it worked this time.

I now have wine successfully installed.

Thanks for your help.


ridgy posted a comment explaining this, and the original poster has verified that the explanation is correct:
The manpage (man dmesg) says:

Be aware that the timestamp could be inaccurate! The time source used
for the logs is not updated after system SUSPEND/RESUME.

Maybe your system was suspended before?


Can't show line numbers in sublime after editing preferences

You need to add that feature like this:

{
    "gutter": true,
    "line_numbers": true
}

The gutter part and a restart is needed!


TP-LINK TL-WN722N can't connect on 17.04

I had a similar problem while updating from 16.10 to 17.04. The problem was solved by adding the following lines to /etc/NetworkManager/NetworkManager.conf and then restarting the computer.

[device]
wifi.scan-rand-mac-address=0


When to expect driver support for Qualcom Atheros (rev 20) wifi cards?

This device is not supported yet. There is a bug report.

Device [168c:0040] QCA99X0_2_0 is already supported in linux-next.

There is a good chance that same driver supports 0041 device too. But it will need a kernel patch to include the device ID.

I can build a module for testing and post it to the bug report. If you spend some effort on testing, the solution may come faster.

There is no kernel 3.20. Linus Torvalds decided to rename it to 4.0.

But still your device is not supported by any kernel yet.


Ubuntu 17.10 - Pulseaudio don't start at boot

You might have to add it to systemd startup

systemctl --user enable pulseaudio && systemctl --user start pulseaudio

The flags can be configured (from the manual):

  Depending on whether --system, --user, --runtime, or --global is
  specified, this enables the unit for the system, for the calling user
  only, for only this boot of the system, or for all future logins of
  all users, or only
             this boot.


How can I use tab completion in the 'Run a command' box?

Couldn't find any solution to this.. as a result, got used to with the default Unity behavior :-/


Installation of dual-boot 13.10 on MBP freezes

Macbook pro's boot in EFI mode, whereas the bootcamp loader emulates a legacy bios in order to boot windows.

This is not the best solution for installing ubuntu 13.10 to a mac, as it can be handled natively in efi mode via grub2, or if you prefer refind.

Decide on a bootloader that will manage your operating systems. I suggest grub as it can be repaired in the event of problems using the boot-repair app (which works very well with my mac5,5), and it can detect your OSX/Windows partitions. Alternatively as already mentioned refind is an elegant solution for mac's.
Follow the steps here to get a live USB working for your mac, then hold 'alt' on boot. This should give you the option to boot and install ubuntu in EFI mode.
When installing select the 'something else' option to partition your disk. Ensure you only install the grub bootloader to the partition of your ubuntu installation.
Refind will detect a linux partition automatically, however if you have opted for grub you may (as in my case)
need to run boot-repair from the live usb.

To download the boot-repair you will need to enable networking (use the proprietary driver to get this up and running on the macbook):

open a new Terminal, then type:

$ sudo add-apt-repository ppa:yannubuntu/boot-repair && sudo apt-get update

$ sudo apt-get install -y boot-repair && (boot-repair &)
Press ENTER

Follow the instructions, then reboot. You should now have ubuntu working natively on the macbook pro.

Good luck, I hope this helps.


/dev/null permission denied in chroot environment

From man null:

   These devices are typically created by:

          mknod -m 666 /dev/null c 1 3
          mknod -m 666 /dev/zero c 1 5
          chown root:root /dev/null /dev/zero

These commands would have to be executed in the chroot environment.


CPU running at 100% all the time in the Ubuntu VM

I had similar issue sometime back i had disable nested paging and it worked like a charm

Can you check if Nested Paging is Disabled? if not please shut the VM down and disable Nested Paging under System :) see below

Start the VM back and let us know if that helped.

Waiting for your reply


Lenovo u400, Ubuntu 12.04. Sudden reboots / power down

I had the same problem with the U400. I didn't found any hints to solve this so I completely reinstalled Ubuntu. That seems to fixed it.

I am interested if the Intel virtualization could be the reason. Do you have enabled it in the BIOS settings? At my first installation it was enabled. Now I've done a reinstallation with the Intel virtualization disabled and it runs without any reboots. Maybe it's just a hazard.


Why does 14.04 say there are no updates, when there are?

That's probably due to the phased updates.

New updates may introduce new bugs.
So, to minimize the impact of those bugs, the updates are released gradually to more users.

This only affects the Update Manager, not apt-get.
If you run the Update Manager tomorrow, it will probably show some of those updates that apt-get is reporting now.

In short, I think it's normal.

EDIT: Yes, it's due to that. Check the Launchpad page of evolution-data-server in Trusty: https://launchpad.net/ubuntu/trusty/amd64/evolution-data-server . There's a column for "Phased updates".


Two mice: change primary button of just *one* of them?

you can't by design from the GUI! Because the configuration thinks in term of class of devices indeed any modification affect the whole mouse class.

But like pointed from Charles Green you can use xinput

here one possible answer with 2 mouse with different configuration:
How can I change mouse keymapping


I had similar behaviour.

Only thing that helped for me was reinstalling 14.04 with the option of keeping all the installed applications. Took several hours but the malady was gone.

The thing I did not try and that might help, however, is deleting the .Xauthority file from Your home directory as described here somewhere:
Unity doesn't load, no Launcher, no Dash appears

I have had similar issue with an earlier Ubuntu and then it resolved like that.


Error when installing Xubuntu: 'grub-efi-amd64-signed'package failed to install into /target/

Did you try following this guide UEFI? It really helped me out. Seems to me that you need to go into Boot Menu in you BIOS and select the UEFI: USB Hard Drive.


Check if cron is running, may be you have it disabled/not installed:

leonid@Desktop:~$ /etc/init.d/cron status
● cron.service - Regular background program processing daemon
   Loaded: loaded (/lib/systemd/system/cron.service; enabled; vendor preset: enabled)
   Active: active (running)

And redirect error output of commands to some log file, to check what's wrong.


A generic method for installing a missing library in Ubuntu Systems

Maybe the dependencies are found on another version of Ubuntu or a version of Debian. Run this command to find out.

sudo apt install devscripts
rmadison -u ubuntu,debian first-package-name next-package-name last-package-name

Replace  the package-names in the above code with the names of the packages that you are searching for.

The problem with this command is that sometimes the package version number is part of the package name, so the rmadison program will only find packages that have the same version number in their names. To overcome this limitation I have written a bash shell script that allows for searching for packages that match part of the package name, e.g. match only the name part of the package name without needing to match the version number too.

Create a shell script to query if the multiple packages exist named Open-multiple-URLs-in-Firefox.sh. The script contains the following code:

#!/bin/bash
while read line; do
    firefox --new-tab "https://packages.ubuntu.com/$line"
done < packages.txt

Make the script executable.

chmod +x Open-multiple-URLs-in-Firefox.sh

Create a file named packages.txt that contains the names of all the required dependency packages, each package on a separate line. Save packages.txt in the same directory as Open-multiple-URLs-in-Firefox.sh.
Run the script.

./Open-multiple-URLs-in-Firefox.sh

The webpage that has information about each required dependency package will open in a separate tab in Firefox.

In order to search for multiple packages in Debian replace https://packages.ubuntu.com/ in the shell script with https://packages.debian.org/search?keywords=


If you installed Ubuntu along with Windows, when you open up Ubuntu, in your file manager there should be a side bar that lists all your primary folders, Music, Documents, Desktop, Etc. At the top there should be a section that says "Devices" under that there should be a device that says "64 GB Filesystem" (fill in 64 GB with whatever size your partition is) if you click on that it should show your Windows files. You might need a password, but I doubt it.  Hope I answered your question correctly! :)


Ubuntu 18.04 use top panel for program like in old version

You can still use Unity 7.5 in Ubuntu 18.04. When you login click the "gear" next to the Sign In button and select Unity from the drop down menu:

If you did a fresh install of Ubuntu 18.04 the Unity desktop option will be missing. You can install it using:

sudo apt install ubuntu-unity-desktop

You will be prompted if you want to change the login screen to the old Unity format of lightdm:

If you want Unity like login screen: select lightdm
If you want to keep the default login screen in Ubuntu 18.04: select gdm3


'which python' and 'echo PYTHONPATH' give different directories, what does this mean?

From man python:

   PYTHONPATH
          Augments  the  default search path for module files.  The format
          is the same as the shell's $PATH: one or  more  directory  path‐
          names   separated   by  colons.   Non-existent  directories  are
          silently ignored.   The  default  search  path  is  installation
          dependent,  but  generally begins with ${prefix}/lib/python<ver‐
          sion> (see PYTHONHOME above).  The default search path is always
          appended  to  $PYTHONPATH.   If  a script argument is given, the
          directory containing the script is inserted in the path in front
          of  $PYTHONPATH.  The search path can be manipulated from within
          a Python program as the variable sys.path.

The $PYTHONPATH variable just specifies additional locations from which you can import modules. It has nothing to do with the location of the Python interpreter executable that you get as output from which python.


Will Unity be considered as interface for Kubuntu?

The Kubuntu team has a wide degree of freedom in how they structure Kubuntu - which apps they include and how they configure it by default. I doubt they will embrace Unity immediately, unless it proves extremely popular amongst Kubuntu users.

That said, we have done a lot of work to ensure that many key aspects of the interface and API's work across both GNOME and KDE. Menu's, indicators, notifications and lots of other goodness have been built for both GTK and Qt apps and are tested across both Ubuntu and Kubuntu. So Unity should work very nicely as the shell for Kubuntu if you want that yourself or if the Kubuntu folks decide to go that route.


sbuild error: Only one build is permitted

Start sbuild with double quotes for the repository:

sbuild --extra-repository="deb http://ports.ubuntu.com/ubuntu-ports/ vivid main"

Check if your user is in the sbuild group with:

groups

If not, use this command:

sudo usermod --append --groups sbuild $USER


My Ubuntu 10.10 is not supported. How do I totally get rid of 10.10 and go to a new version?

Backup your data and see How do I install Ubuntu? for how to install a new version.

As 15.10 will be released tomorrow I'd rather install that (supported until July 2016) or 14.04LTS (supported until April 2019) then 15.04 (supported until January 2016).


There are several reasons the ESP that may need to be accessed in a variety of circumstances:

/boot/efi/EFI/ubuntu/grubx64.efi -- This is the EFI GRUB 2 binary, which must be replaced if the GRUB package is updated.
/boot/efi/EFI/ubuntu/grub.cfg -- This is a GRUB configuration file that does very little; mainly it loads /boot/grub/grub.cfg. This redirection is done to enable a "hook" for Secure Boot systems; without Secure Boot, the grubx64.efi binary can be built locally and points directly at /boot/grub/grub.cfg; but as the location of /boot/grub/grub.cfg varies (as seen by the ESP) from one system to another, putting a grub.cfg file on the ESP is necessary for Secure Boot, which doesn't permit grubx64.efi to be built locally. IMHO, it would make more sense to put the main grub.cfg and other GRUB support files on the ESP, but the developers in charge of this have opted for a more conservative approach, relative to what a BIOS-based system does. In any event, the grub.cfg on the ESP will rarely, if ever, be updated; but that might be necessary at some point, particularly if the GRUB Debian package is updated.
/boot/efi/EFI/ubuntu/shimx64.efi -- This is the Shim binary, which is required for Secure Boot to function. Like the GRUB 2 binary, it might be updated by a Debian package update, but of the shim-signed package.
/boot/efi/EFI/ubuntu/MokManager.efi -- This is the MokManager binary, which is a Shim support tool. Like Shim, it might be updated in a package update.
/boot/efi/EFI/ubuntu/fwupx64.efi -- This is a tool to assist in automating the update of firmware on an EFI-based computer. As with the preceding EFI binaries, it might be updated by a Debian package update.
EFI firmware files -- Updating the firmware is likely to necessitate copying firmware files to the ESP. This could be a manual process or something that's at least partially automated using the Linux fwupdate binary and matching fwupx64.efi EFI binary. (I'm not 100% positive that the latter requires writing files to the ESP, though. It's pretty new and has minimal documentation at this point.)
Other EFI-related tools -- Programs like my rEFInd boot manager and other non-standard EFI boot managers and tools might need to be installed to the ESP. The sheer number of tools that might need to be installed is significant, but most of them are exotic, so the number of systems impacted is small.
Manual configuration file adjustments -- If you want to reconfigure a boot loader, you may need to read its configuration file on the ESP, edit it, and save the edited file back out. For that matter, simply examining the configuration requires that the ESP be mounted (although it could be a read-only mount).
System information tools -- Tools like the Boot Info Script read configuration files on the ESP in order to generate a report on how the system is configured. The Boot Info Script probably mounts the ESP even if it's unmounted to do its work, but I'm not 100% positive of that. There may be other tools that assume the ESP is already mounted, and their functionality would be degraded if this assumption was not met.

In sum, there are quite a few reasons that the OS itself or you might want or need to read from or write to the ESP. That said, these reasons are few enough in number that a mechanism to temporarily mount the ESP and to then unmount it when done might be beneficial. Certainly a Debian package installation script could do the job, for instance, as could automated tools that modify configuration files on the ESP. AFAIK, though, changing the mount status of the ESP is not on the horizon.

Note that the ESP is mounted with fairly restrictive permissions by default. Recently (starting with 15.10 or 16.04, perhaps -- I'm not sure exactly when), mount permissions were changed so that only root can read from /boot/efi. Even before then, only root could write to the ESP, although read permissions were looser. Since root can mount partitions, there's minimal security benefit to leaving the ESP unmounted at this point, although there would be a benefit in that there'd be less risk of filesystem damage to the ESP because of a bug, power failure, etc.


This should do the trick:

for file in $(find /usr/include/ -name '*.h'); do
  echo "$file,$(grep -c '#define' $file)"; done \
  | sort -n -k2 -t, -r

Find list all files matching /usr/include/*.h pattern
Print the file name, the comma and the number of lines matching '#define' pattern
Sort numerically, using a comma as a delimiter by the second field (reverse order).

You can append | head -10 to get the top 10 files.


HP Envy x360 Ryzen 5 : 17.10 not booting

I just read on fedoraforum that both Ubuntu 18.04 and Fedora 28 boot and run nicely, although the touchscreen is not working. kernel 4.17 is scheduled for mid-June release, so you could get most functionality now and everything working in a few weeks.


How can I use an ATI Radeon HD 6450 on Ubuntu 13.04?

You could try using "nomodeset" boot parameter to boot Ubuntu, install the drivers and boot normally.
What is nomodeset?

To add boot parameters temporary at the grub boot menu press “e” while certain menu entry is select. Boot parameter should be added to the end of the line where it says "quiet splash" and to boot with these settings press f10. You can find more guides for setting boot parameters from grub here.

At least you should be able to use command line then. Here are some guides about installing AMD drivers from command line.


"Install alongside" option missing. How do I install Ubuntu beside Windows using "Something Else"?

Usually, Ubuntu's installer gives you the option to shrink your Windows partition and install alongside it. In your case, that option did not appear. This sometimes happens, and possible causes include:

Windows was hibernated rather then shut down.
Windows was not properly shut down. (Perhaps there was a power failure, or it bluescreened last time it ran?)
The Windows partition is damaged, and should be fixed with chkdsk in Windows.
The Windows partition is too full to be shrunk.
The Windows partition cannot be shrunk because the files in it are too badly fragmented, preventing them from being constrained to exist only within the new boundaries.
The Windows partition cannot be shrunk because of immovable files near the boundary.
The drive has been formatted as a "Windows Dynamic Disk" - Ubuntu can not be installed on a Dynamic Disk, you will need to convert the drive to a Basic Disk.

Since you're running Windows 7 (this also applies to Windows Vista, and to the corresponding Server versions, and will apply to Windows 8 as well), you can try to shrink the Windows partition using Windows, and then try again to install Ubuntu.

To do this, right click My Computer (sometimes just Computer) on the desktop or Start Menu in Windows and click Manage. Go to Disk Management.

(Alternatively, enter diskmgmt.msc into the text box in the Start Menu and press enter.)

Then you can use Disk Management to attempt to shrink your Windows partition. It will schedule the operation for when the system is shut down, so that even files that are in use when the system is running can be moved.

However, system files marked immovable still usually will not be moved in this way. So you may need to disable hibernation, and even disable swap (i.e., the page file), in order to make this succeed. (You can re-enable them afterwards.)

As Mitch says, it's advisable to ensure all backups of documents and other important files are current, before dynamically resizing a partition (no matter how you do it).


In principal, the problem is that AMD has stopped to provide updates for their fglrx drivers and change to a new one, called AMDGPU.
In this deprecated state, ubuntu 16.04.0 and 16.04.1- and 14.04.5, whose hardware enablement stack is based on 16.04,does not longer work with the fglrx drivers (or see this blog post).

The options you have is

to downgrade to ubuntu 14.04.1 to use the propietary driver until the end of life of ubuntu 14.04 in 2019
Install 16.04 and use the open source driver, since your Radeon HD6000 series card is pre-GCN and will never be supported by the new AMDGPU


First of all, environment variables are better set at end of ~/.profile.

The correct syntax is:

PATH=$PATH:/media/wern/Files/tools/vendor/eher/phpunit/bin
PATH=$PATH:/media/wern/Files/tools/vendor/bin

so that the two directories are added to PATH and do not substitute the previous content.
Also, see that I added a / before media, because a relative path has no meaning in this context, and I think you did an error.

Last advice, you have to restart your session to see the changes.


how to get the path of current open folder without using terminal?

To get the path of current open folder without using terminal

Right click on folder and click on Properties option.

And you'll get location of folder in Basic tab.


Help, linux beginner! How do I put ubuntu on usb and boot/install on a PC with blank harddrive?

If you downloaded the correct file for installing Ubuntu, then the .iso is the same as the file itself that you downloaded, and you didn't need to extract anything from the archive. In order to make an Ubuntu bootable live USB you need to use the .iso file itself instead of a file or files from the contents of the archive that you extracted.

The instructions for preparing an Ubuntu live USB on Windows are found at the official Ubuntu How to create a bootable USB stick... webpage (see the step-by-step instructions below).

Open Rufus and select your USB stick in the Device dropdown menu.

Click the CD-ROM icon next to the FreeDOS dropdown menu, then find your downloaded Ubuntu ISO and click Open and then Start.

Click Yes when it asks to download Syslinux software.

Click OK to write in ISO Image mode.

Confirm that your USB stick is selected and then click OK to continue. It is very important to verify that the device that you are installing the Ubuntu live USB to is indeed your flash drive, so that you don't overwrite any of your system or personal files which may make your operating system unbootable.

When it is finished, just restart your computer and start using Ubuntu, or you can install Ubuntu.

In order to enable your computer to boot from the USB flash drive, you must enter your BIOS setup utility by pressing one of these keys: Delete, F2 or F10 as soon as the motherboard splash screen appears when the computer is booting. In the BIOS menu, you need to change the boot order so that the USB flash drive, which is usually called USB-HDD in newer computers, is the first entry in the boot sequence, and then save your new settings and exit the setup utility.


How to connect to an IPSec VPN with a short (<20chars) PSK

Shrew Soft VPN client (https://www.shrew.net/; can be installed with apt install ike and apt install ike-qtgui) allows a wide range of IPSec VPN connections including PSK/XAuth with short keys, and IKE v1 and v2.  In these respects it is more flexible than Strongswan.

I have managed to get it installed and connected to the VPN on Ubuntu 18.04, but only intermittently and it won't actually pass any network traffic.  YMMV.


Setup a cron job to archive a directory and all its sub-directories including hidden files using tar

Use the -C option, like this: tar -zcC /home/username -f output.tgz .mozilla
Read this answer.
Use the -p option.
I do not understand your question.


Disk I/O makes desktop unusable. System consumes too much memory

This sounds awfully like kernel bug 12309, which I've been suffering from for a long time and with several linux distros. I've tried several solutions, the only remaining is zramswap and putting in an SSD with a big load of RAM. I tried with different IO schedulers  and setting noatime in fstab and that didnt help. Funny thing is that a friend of mine has a older laptop than me, and he dosen't suffer at all from this problem.


How do I find the temperatures without 3rd party software?

It sounds like what you want is /sys/class/hwmon and /sys/class/thermal.

Both of these provide simple shell based access to the data you want (the hwmon directory will also include other sensor types).  Each has one directory for each sensor interface in your system (which may have more than one sensor).

Three other things to note though:

Unless you have a really bad system, running the sensors command even once a second shouldn't have any percievable effect.  In fact, regularly reading the files in the above mentioned directories may have more of an effect.
Graphs are your friend here.  I would suggest getting something like netdata or collectd running so you have realtime (or near realtime) data to look at.
Check your voltages too.  What your describing could also be due to having a power supply that can't keep up with your system's power requirements.  This will be indicated by voltages dropping significantly when the system is under high load.


I have the exact same webcam; my computer is a Dell XPS M1530. For quite some time I have not been able to use my webcam with the Video4Linux drivers, which I wanted to because they seem to have more active development.

I found out that this webcam is supported by another driver, UVC Video. There is a list of the supported devices here, and it includes the webcam you mention.

Use your webcam with UVC Video

Each of the commands shown here you have to run in a terminal window.

Check if you have the driver by running $ sudo modprobe uvcvideo.

If you get an error saying FATAL: Module uvcvideo not found., then you should follow the steps in this Ubuntu Community Documentation article to install the module. After you're done, retry this step.

Check if other drivers are loaded, that are conflicting with uvcvideo: Run the following commands:

$ sudo modprobe -r videodev
$ sudo modprobe -r v4lTab (repeat this command for every entry listed when you press Tab).

Unload and load back again uvcvideo by running:
$ sudo modprobe -r uvcvideo && sudo modprobe uvcvideo.
Open Cheese or any other application that will allow you to view through your webcam to see if you are getting video.
If this worked,  you should blacklist videodev and make uvcvideo load everytime you boot.

To blacklist videodev run the following command:
$ sudo echo blacklist videodev >> /etc/modprobe.d/blacklist-local.conf
To enforce the load of uvcvideo on every boot, run this other command:
$ sudo echo uvcvideo >> /etc/modules

Comment

I only wrote this guide because this is how I got this problem fixed in my case; however, I don't know whether each of the commands I cited are mandatory or optimal.


Try setting nomodeset in kernel parameters.

When grub loads and you get a screen to choose OS to load (if in dual-boot) or press Shift to load grub menu if you have only Ubuntu installed. Then with the Ubuntu option highlighted press e.

You will see something like this:

recordfall=1
save_env recordfall
set quiet=1
insmod ext2
set roothd(0,1)
search --no-floppy --fs-uuld --set 9009-9234
linux /boot,mlinuz-2.6.91.-9 root=i1U10=90.7bf99-923.1 ro quiet  splash
                                                                       ^
                                                                       |
initrd /boot/initrd.ing-2.6.91-9-generic

Add the nomodeset at the arrow indicated so the line looks like:

linux /boot,mlinuz-2.6.91.-9 root=i1U10=90.7bf99-923.1 ro quiet  splash nomodeset

Now press F10 to boot.

If this works we set the nomodeset permanently as follows:

Do the above again, and...

Open a terminal app and type "sudo nano /etc/default/grub"
Enter your password if prompted.
Move the cursor to the line that looks like the following:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

Add the nomodeset here so that the line looks:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nomodeset"

Press Ctrl-O the Enter to save, Then Ctrl-X to exit.

In the terminal, type sudo update-grub and hit enter.
Once complete, you should be able to reboot your computer with this change made.


Can the bootloader be stored outside the HDD?

Yes, you can.

You just need to choose where to install the bootloader in the installation process. Watch out for where is mounted your media (eg. /dev/sdc1) and mark it by choosing 'advanced' options just before you confirm, when the screen shows you the resume of the information, where the new system will be, and stuff. Something like those images in this link in portuguese.

Or, if you have a system running already, change the location and reinstall it. There's a lot of information about how to do this.

My sister have a laptop running windows, and sometimes I took it borrowed to do something. Asked her for install a linux partition on her disk and she not wanted because of the bootloader before windows starts, and was affraid of any problem with her own data.
So I maked a tiny place in her disk, and install ubuntu. In the installation settings I done what I have explained: with a usb plugged, choose its location for bootloader install and done.

So I changed the boot options in pc setup, saying for computer try to boot first by usb, then the HDD.

When my usb is plugged, the bootloader works and starts ubuntu, when not plugged, windows starts and even know nothing about linux existence.
(:

Hope it helps, sorry with any bad english.


16.04 LTS Suspends after Resume from Hibernate

You system seems confused as to why you want don't want it to sleep when the lid is closed.  You can try disabling the feature that suspends the laptop when closing the lid.  The downside to this is that you'll have to suspend it manually.

Open a terminal and edit the logind.conf file using gksudo gedit /etc/systemd/logind.conf

Look for the line that says HandleLidSwitch=.

Change this line from whatever it is, to HandleLidSwitch=ignore and make sure it's not commented out (Make sure there's no # symbol before it).

Save and close the file.

Now back in terminal, run sudo restart systemd-logind.  You can also double-check the "Power" options in the control center to make sure nothing is telling it to sleep with the lid closed.

Try closing the lid, it should now do nothing.  Just make sure to remember to suspend it manually when you want it to by using the power menu in the top right corner of the screen, on the Unity panel.


Ubuntu 20.04 fingerprint device disconnect during scan

What do you have in /var/log/syslog ? And in dmesg -T ?
Is a bit complicated if you never used, when you can see the system calls being performed by launching the program with strace.
Cheers