Ubuntu 20.04 Screen Flickering on DELL G5 5590 I am experiencing screen flickering (graphics glitches) every few seconds, after a clean installation of Ubuntu 20.04 on a new DELL G5 5590. Besides the screen glitching, there seems to be no other problem. Some details regarding the problem:

The laptop came with Windows 10  OS pre-installed, but I chose to remove it during the Ubuntu installation.

I did not see any flickering issues during a session with the previous OS, Windows 10.

The second monitor which I have connected on the laptop does not have flickering problems. It is only the laptop monitor that flickers.

I chose installation of third party drivers during the Ubuntu installation

Given the default settings in Displays, the laptop monitor is at 144Hz refresh rate and the second monitor at 60Hz

After installation, I installed the suggested nvidia drivers with sudo ubuntu-drivers autoinstall. The output of ubuntu-drivers devices was
== /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0 ==
modalias : pci:v000010DEd00001F11sv00001028sd000008EAbc03sc00i00
vendor   : NVIDIA Corporation
model    : TU106M [GeForce RTX 2060 Mobile]
driver   : nvidia-driver-418-server - distro non-free
driver   : nvidia-driver-435 - distro non-free
driver   : nvidia-driver-440-server - distro non-free
**driver   : nvidia-driver-450 - distro non-free recommended**
driver   : nvidia-driver-450-server - distro non-free
driver   : xserver-xorg-video-nouveau - distro free builtin

Update: Today I experienced a different problem, the screen glitching got worse. After a few minutes the graphics glitched for good and manual restart was required  (happened 2 times randomly).  I am thinking about re-installing Ubuntu but this time without checking the "third-party drivers software" option, but I am not sure if this a good idea  e.g. missing important drivers, or even related to the problem.
What approach do you recommend to solve this problem? Let me know if I should post additional information. Thank you!

Go to Software & Updates → Additional Drivers and select one of the offered drivers (see screenshot).


Synaptic touchpad right-click not working I'm having the same problem as in previous Ubuntu versions. The workaround to the problem for 11.10 was to use https://launchpad.net/~sergio91pt/+archive/synaptics+clickpads, but for 12.04 I haven't found a solution that works.

HP 210-1095tu netbook
Atom n450
RAM 2GB

I had that problem (touchpad right click not working) with ubuntu 12.04, and found this link very useful:

https://wiki.archlinux.org/index.php/Touchpad_Synaptics#Buttonless_TouchPads_.28aka_ClickPads.29

In my case, all I had to do was to define the area of the right button, adding the line

Option "SoftButtonAreas"  "50% 0 82% 0 0 0 0 0"

to the configuration file as explained there.

sudo su
echo options psmouse proto=exps > /etc/modprobe.d/psmouse.modprobe
reboot

This does have some side effects: you may lose other touchpad features, like two-finger scrolling.  In fact, this removes the touchpad tab from the mouse config settings window.


How change what  kernel boots Ubuntu  XEN VPS? I have a VPS running Ubuntu server 12.04. A while ago, my host installed an alternative kernel (one of Amazon's EC2 kernels) to fix a boot issue I was having. Now, 2 Ubuntu releases later, this kernel (2.6.31-302-ec2) is still being used even though later (3.2.xx) kernels have been installed.

How can I make the server use the most recent installed kernel, preferably without just uninstalling the EC2 kernel just in case doing so causes issues?

Congratulations, you're on PyGrub!

Your menu.lst file, the different kernel images in your /boot directory and most importantly, the kernel you're running (an Amazon EC2 version extremely unlikely to be running on a physical host) strongly imply you do have pygrub enabled.

This is because non-Pygrub XenPVs must use the same kernel as the host

The oddly empty dmesg is likely a side-effect of the customizations in the EC2 kernel; compare with the very informative output of a normal kernel on a XenPV 3.4

A little bit on XenPV kernel options:

Your current custom EC2 kernel boots with the options root=/dev/sda1 xencons=tty (see end of menu.lst)
The standard XenPV boot options on stock kernels, instead are root=/dev/xvda1 console=hvc0

xvda is the paravirtualized (and more efficient)  disk device, while sda is the less efficient emulated device -- this is the first time I've seen the latter used in a 3.x XenPV.
xencons=tty and console=hvc0 are very similar, but I believe the former is an older (legacy) usage; you can stack them with no ill-effects; it simply tells the kernel that the standard virtual terminal is unavailable for the console, and to use the specialized hvc0 device instead.

How to switch kernels:

This part may be slightly hairy, and you should be in your provider's good books because you may need their help with a simple cp operation once or twice! After that, you'll know what options you need and should be set for the future.

To give you some context if you need it, here are some files from my XenPV VPS on the latest 64-bit kernel: ls -l /boot, menu.lst and a full post-boot dmesg
Add the following at the top of your menu.lst, adapting to the kernel version you need:

default=0
title vmlinuz-3.2.0-25-generic
root            (hd0)
kernel          /boot/vmlinuz-3.2.0-25-generic ro root=/dev/sda1 xencons=tty console=hvc0
initrd      /boot/initrd.img-3.2.0-25-generic

Cross your fingers, reboot, and hope it comes back up!
If not, try changing to root=/dev/xvda1 and that should almost certainly work.
Remember to decline installing "new" menu.lst when upgrading kernels!

Search Grub Customizer in software center.

Install the program.

Then open Grub Customizer.

It you can uncheck any of the older kernels and check the newer ones.

When ubuntu boots it will only see the ones that are checked.

Hope this helps,

Leinardo


Booting system without full network configuration I was trying to solve internet problems, and seem to have made things worse: Now when I start the computer it gets stuck on "Booting system without full network configuration".

Does anyone know how to make it unstuck?

Alternatively: It got messed up when I changed the contents of /etc/network/interfaces, so presumably would work again if I changed it back. How can I edit this file during boot?

I'm using Ubuntu 12.10.

After you see "Booting system without full network configuration" press CtrlAltF1. It should get you to the shell prompt. Use a shell text editor to change /etc/network/interfaces.

For example, with nano text editor it would be

sudo nano /etc/network/interfaces

Press CtrlO and CtrlX to save changes and exit nano after you've done with it. (Pressing CtrlX and then N discards changes) sudo reboot restarts the system.

The default contents of the /etc/network/interfaces file look something like this:

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet dhcp

I seen this error while booting ubuntu with virtual-box.I followed below line.Next time while booting i didnt see "Booting system without full network configuration" message.

remove /etc/udev/rules.d/70-persistent-net.rules file ,then  reboot.

Actually whenever change in MAC address linux add interface in above file.so recent change in mac address not in eth0.

so remove file and reboot ,it automatically create with mac address at eth0


Automatic syncing USB HD drive to local HD (different computers) I have a desktop PC at work, and a laptop at home.... or elsewhere.

What I want to do is use a USB HD to store my documents (about 130 Gb, maybe more). That would serve as backup and also port my files to my laptop. I'd like any of both computers to automatically sync all files there with local copies, so that I can work at either of them and keep updated copies of everything in both (plus the USB drive, which would allow me to work in other computers, too, apart from being another backup). Dropbox ins't a solution for me, due to pricing and 100Gb limit.

The workflow would be as follows, to clear things up:

I work on PC1. Changes in files are automatically synced to USB whenever a file is modified.
I go home and boot PC2. I plug the usb drive and local files are synced (if changed) with the most recent usb copies.
While I work at PC2, again, changes in files spread to my USB drive.
Whenever I go to PC1 again, I plug my usb and again everything synces.

So the questions would be:
a) Am I crazy?
b) Can it be done?
c) Will I have any file conflicts (provided I'm the only one that will modify the files)?

A vague answer would be to use rsync to sync to and from your HDD to a selected file structure on your systems. I typically just use rsync to push changes from my server to backup HDDs, but (without trying this on my own) I can't see why you couldn't rsync to and from the drive. This, however probably wouldn't be something you would do automagically. Just have a script you could call when you want to sync up the drive. You could go hog wild and write a script to listen for when you plug in that specific HDD and then kick off the rsync scripts if you really wanted.

rsync on wikipedia
Basic rsync tutorial

Thanks for the links... I'll take a look at them because, actually, I haven't ever used rsync, as I recently moved from the 'other side' of OS's. There I used Viceversa Pro, which was good but wasn't automatic, and each execution needed to scan all files in source and all files in target to sync.... Took long, of course.
I was thinking about something as what is described in this page... would something like that do the trick? ...and could I somehow set the script described there to run whenever the filesystem (the part of it I choose: one or more folders) is changed? (i.e. not timed events, but HD events driven)


HP Stream 11 Touchpad buttons not working correctly So I have just bought a HP stream 11 and installed Ubuntu Gnome 14.10. I am having trouble with the touch pad it is expressing this functionality

https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1409192

An optical USB mouse plugged into the laptop works normally IF the trackpad mouse buttons are never used.
Clicking the left or right button sections of the trackpad does NOT result in any left or right click action occurring (e.g. opening right click menu).
Using basic click touchpad gestures that are on the main section of the trackpad work normally (i.e. single finger tap to left click, two finger tap to right click, two finger drag to scroll).

I realise that this is a bug but in this review on Amazon
http://www.amazon.com/review/R28HR668I6LU8Y/ref=cm_cd_pg_next?ie=UTF8&asin=B00NSHLUBU&cdForum=Fx32V5DBEJH4RUL&cdPage=3&cdThread=Tx1I5CUWGAIAGT5&store=pc#wasThisHelpful

The reviewer talks about how clicking the "Enable Mouse Clicks With Touchpad" solves the problem. I can't find this option in gnome I presume that he found the button in Unity.

Any help much appreciated.

I wasn't sure about that option myself.

what fixed the touchpad for me was upgrading the kernel.  I think someone mentioned 3.16 fixed it (or not) but I went ahead and jumped to 3.19.

Warning - I have terrible wifi issues.  it disconnects every few minutes.  I hope it's not a result of this upgrade as the touchpad is terrible without it.

I don't want to give any false or misleading information so just do a little research on how to upgrade your kernel, its a very simple process.

once the touchpad is working you can do two-finger scrolling and two-finger tap to right-click.  The mechanical buttons will also function without breaking everything.

I had the same problem and magically, the simulated secondary click seems to work -- I can now 'right click', and it re-enables my drag/drop function, which was hanging before. I have an HP Stream 11, running Ubuntu 15.10. No other issues so far.

https://help.ubuntu.com/stable/ubuntu-help/a11y-right-click.html


Creating an install drive - can not open output file autorun.inf I am trying to make an install/boot drive for a computer that has no operating system and no optical drive. I used the ISO from Ubuntu.com and the burner from pendrivelinux.com. When the program starts writing to the flash drive, there is an error displayed that says :

"0    can not open output file E:\autorun.inf"

But continues to write data. After it has finished, I remove the drive and insert to the other computer and turn it on, but it never finds a drive to boot from.

What is causing this problem and how can I fix it ?

Run the PenDriveLinux USB Installer tool as adminstrator.

In Windows right-click on Universal USB Installer and select "Run as administrator".

In my experience, it may be your antivirus program preventing the installer for opening the file. Try disabling it.


How to easily start a webserver in any folder? I'm looking for a relatively painless way to launch a web server with document root in any folder I specify (or better yet, where I'm launching).

I often try out new things like JS frameworks or so in a new folder somewhere here:

/home/alexander/code/angularjs/

It would then be convenient to just go into this directory and type something like:

start-webserver-here

so that a web server starts listening on port 80 and serving this directory, and I can try out whatever I'm working on.

I've installed XAMPP but it seems that it's basic apache with a document root I'd have to change, with root privileges even, along with granting permissions for every folder etc.

Is there an easier way?

Use

python2 -m SimpleHTTPServer 80

or

python3 -m http.server 80

to start a simple HTTP server.

Replace 80 with  another number if you want it to listen on a different port. For ports < 1024 it needs to run with root privileges.

Since there's angularjs in your folder's name, it seems like it's an angular js app. In such case, be sure to check yeoman out.

To quote it's site

  Yeoman 1.0 is more than just a tool. It's a workflow; a collection of tools and best practices working in harmony to make developing for the web even better.

One of many other things is the bundled grunt server.


What is the safest way to clean up /boot partition? I have 200 MB assigned for the /boot partition.  Whenever I try to update the kernel, I receive an error message that basically states /boot is full.

What can I do to cleanup /boot and remove/backup the older kernels?

Command line method:
First check your kernel version, so you won't delete the in-use kernel image, running:
uname -r

Now run this command for a list of installed kernels:
dpkg --list 'linux-image*' | grep ^ii

and delete the kernels you don't want/need anymore by running this:
sudo apt-get remove linux-image-VERSION

Replace VERSION with the version of the kernel you want to remove.
When you're done removing the older kernels, you can run this to remove ever packages you won't need anymore:
sudo apt-get autoremove

And finally you can run this to update grub kernel list:
sudo update-grub

the short answer is to use my script: ubuntu-kernel-cleanup


Locale variables have no effect in remote shell (perl: warning: Setting locale failed.) I have a fresh ubuntu 12.04 installation. When i connect to my remote server i got errors like this:

~$ ssh example.com sudo aptitude upgrade
...
Traceback (most recent call last):
  File "/usr/bin/apt-listchanges", line 33, in <module>
    from ALChacks import *
  File "/usr/share/apt-listchanges/ALChacks.py", line 32, in <module>
    sys.stderr.write(_("Can't set locale; make sure $LC_* and $LANG are correct!\n"))
NameError: name '_' is not defined
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LC_TIME = "de_DE.UTF-8",
    LC_MONETARY = "de_DE.UTF-8",
    LC_ADDRESS = "de_DE.UTF-8",
    LC_TELEPHONE = "de_DE.UTF-8",
    LC_NAME = "de_DE.UTF-8",
    LC_MEASUREMENT = "de_DE.UTF-8",
    LC_IDENTIFICATION = "de_DE.UTF-8",
    LC_NUMERIC = "de_DE.UTF-8",
    LC_PAPER = "de_DE.UTF-8",
    LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_ALL to default locale: No such file or directory
No packages will be installed, upgraded, or removed.
0 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B of archives. After unpacking 0 B will be used.
...

I don't have this problem when i connect from an older ubuntu installation.
This is output from my ubuntu 12.04 installation, LANG and LANGUAGE are set

$ locale
LANG=de_DE.UTF-8
LANGUAGE=de_DE:en_GB:en
LC_CTYPE="de_DE.UTF-8"
LC_NUMERIC=de_DE.UTF-8
LC_TIME=de_DE.UTF-8
LC_COLLATE="de_DE.UTF-8"
LC_MONETARY=de_DE.UTF-8
LC_MESSAGES="de_DE.UTF-8"
LC_PAPER=de_DE.UTF-8
LC_NAME=de_DE.UTF-8
LC_ADDRESS=de_DE.UTF-8
LC_TELEPHONE=de_DE.UTF-8
LC_MEASUREMENT=de_DE.UTF-8
LC_IDENTIFICATION=de_DE.UTF-8
LC_ALL=

Does anybody know what has changed in ubuntu to get this error message on remote servers?

That's because your locale in your local machine is set to German, which SSH forwards to and tries to use on the server, but your server does not have it installed.

You've got several options:

Generate the locale. Generate the German locale on the server with sudo locale-gen de.
Stop forwarding locale from the client. Do not forward the locale environment variable from your local machine to the server. You can comment out the SendEnv LANG LC_* line in the local /etc/ssh/ssh_config file.
Stop accepting locale on the server.  Do not accept the locale environment variable from your local machine to the server. You can comment out the AcceptEnv LANG LC_* line in the remote /etc/ssh/sshd_config file.
Set the server locale to English. Explicitly set the locale to English on the server. As an example, you can add the following lines to your remote ~/.bashrc or ~/.profile files:

export LANGUAGE="en"
export LANG="C"
export LC_MESSAGES="C"

If you don't have root access to the server, the Stop forwarding locale from the client option might be the best (and only) way to go.

I was facing the issue that I attributed to ssh passing the locale settings, so I tried with disabling it on client site, then on server site as well and still the locale was complaining after logging in.

Turned out to be a messy locale on the destination server itself, where the setting was taken from /etc/default/locale

I had to clean it completely, run # dpkg-reconfigure locales which fixed the issue.


copying and pasting url from clipboard on my android For the last couple of days I have been trying to figure out how to copy a YouTube URL from the clipboard and paste it into VLC on my Android to no avail.

If someone knows how to walk me through this task, it would be deeply appreciated.

PUSHBULLET is a wonderful tool that lets you share links, files, and other things to all your devices from your computer.

See also THIS link for Android.


Unity not showing after 11.04 upgrade. Cannot log out to switch to classic? I have upgraded an old desktop that I use as HTPC from 10.10 to 11.04. It has an old 256MB Nvidia card. After the upgrade ubuntu will boot but all that shows is the wallpaper, no unity, windows, nothing. The problem is I had the box configured to auto login and so now I cannot log out to switch to Classic mode (which I know works because it works on the liveCD!).

How can I log out when I cannot see anything? Terminal will not display. Is there some key combination at boot that will allow me to force it to classic mode (unlikely). Can I boot into a liveCD, mount the hard drive and change some config file to turn off auto login?

Any help much appreciated! I don't want to format the drive and start over!

Try typing CTRL ALT F1 and logging in.

Then type

sudo killall Xorg

this should kill the Xserver and leave you at the login screen.

When selecting your user account, click the Session drop-down at the bottom of the screen and choose Ubuntu Classic

You can see how i resolved my issue here:

http://jansouza.com/2011/04/29/unity-nvidia-geforce/

Tell me if you have a problem with the language ;-)

Thanks


blank terminal and default theme is lost in ubuntu I am using Ubuntu 12.04. Accidentally lost my default Ubuntu theme and the gnome terminal become blank. Please help me to restore my old Ubuntu setting.its very urgent.Pls help

Log in to a tty (press Ctrl+Alt+F1 for tty1, Ctrl+Alt+F2 for tty2 and tty7 is for login screen/desktop)
and type your username, and enter and type in your password. Nothing will show up in the password field as a security feature.
At the prompt type in the following to reset all settings:

sudo apt-get install -y dconf gconftool

(type in your password)

dconf reset -f /org/compiz
gconftool --recursive-unset
sudo reboot

The next time you log in, it should work again. You will have to change the settings again to have it the same, but stuff (files,apps,themes) should still be  there.

Thanks friends... I done my complaint. I just re-installing the default theme in ubuntu by using:

sudo apt-get install light-themes.


Lenovo T510 taking too long to boot. (Ubuntu Gnome) I am quite new to Ubuntu. I ve just installed them to my Lenovo T510 (4384) laptop which also has a freshly installed SSD. The loading time (I 'm talking about the time it spends on the purple screen when it boots with that circle thing in the middle ) is about 90seconds every time i start Ubuntu. I m appending the part of the dmesg log which seems to be problematic.

    [    5.682189] input: HDA Intel MID HDMI/DP,pcm=8 as /devices/pci0000:00/0000:00:1b.0/sound/card0/input15
[    5.782308] iwlwifi 0000:03:00.0 wlp3s0: renamed from wlan0
[   50.080429] random: crng init done
[   95.277708] Bluetooth: BNEP (Ethernet Emulation) ver 1.3

Thanks in Advance!!
EDIT: My ubuntu version 17.04

It could be an error in the swap configuration. I had a swap parition configured in /etc/fstab but the partition did not exist. I created a small swapfile instead and the system is booting fine now. The boot will pause at random points when the system is waiting for swap to become available.


'docker exec' command is not working When I tried to start a stooped container using docker execcommand, it shows command not found. How can I run the container again?

sudo docker exec -it 26a6ce216479 /bin/bash
Error: Command not found: exec
Error: Command not found: -it

docker exec is used to spawn a process inside an already running container. I guess the command you are looking for is docker start.


Gitlab Debian Package I need to install GitLab in my ubuntu 12.04 64-bit

Found the following link but it doesn't work for me.

We need it to be a debian package to simplify installation in my company network

I know there is a bitnami installer but I don't like it (no trust with 3rd party)

Note: I don't want to accumulate scripts! I need a simple install one-click

GitLab is the ultimate git server manager for local networks and private companies

New solution:

sudo apt-get install curl openssh-server ca-certificates postfix
curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash
sudo apt-get install gitlab-ce
dpkg -i gitlab-ce-XXX.deb
sudo gitlab-ctl reconfigure

Old answer:

There is a debian package available for Ubuntu 12.04 LTS 64 bit at www.gitlab.com/downloads. There you can also find Virtual Machine Images with GitLab.

You can just not found what you do need...

if you wish to give a try. This tutorial is great for you.

Also, you can check this script,it may help....


Ubuntu 16.04 Unity GUI slow performance I just installed Ubuntu 16.04 on my SSD in dual boot aside of Windows 10 and I can't use it because the GUI is really slow. Previously I have installed Ubuntu on my  sdb(hard drive rather than SSD) but the GUI was really slow. Then I decided to install it on my SSD but I have the same problem. I believe I have a good PC and here are the specs:

Intel I7 6700k Quad Core processor
Nvidia Geforce 1070 GTX.
16 GB RAM

...

I tried to install Arch Linux too last time but I have the same problem. Then I don't think the problem is just on Ubuntu.

During the installation, I can choose if I want to turn off the UEFI secure boot and set a password. But if I do that I have an warning message. This message said that if I choose this option it's possible that I can't boot on other operators system currently installed. Then I didn't choose this option because I need to keep windows.

So maybe I should choose this option on the installation to fix this problem ?

What is wrong ?

UEFI Strikes Again!

Specifically the SECURE BOOT Option as explained in the AskUbuntu Community Wiki link above. PCs implementing support for SECURE BOOT only became widespread in 2012 and it is possible that you will encounter problems booting Ubuntu under SECURE BOOT. -paraphrased from Luis Alvarado in the above UEFI link

My research on this matter is based in AskUbuntu, Nvidia, and various bugs listed on Github.

"Since Ubuntu kernel 4.4.0-20 the EFI_SECURE_BOOT_SIG_ENFORCE kernel config has been enabled. That prevents from loading unsigned third party modules if UEFI Secure Boot is enabled." -Pilot6

The Nvidia drivers are considered unsigned third party modules. - derived from Nvidia

"The easiest way to fix this issue is to disable Secure Boot in UEFI (BIOS) settings." -Pilot6

Github may also point to some of the troubles you experienced.


How can I add a backslash using sed? I want to add a backslash \ printed between Hello and World in command line using sed. It should show output Hello \ World.

What do I have to do?

If you have a file named hw containing Hello World, the sed command would be:

sed 's/ / \\ /' hw

This displays the wanted result on the screen. If you want to edit the file, add -i:

sed -i 's/ / \\ /' hw

The command replaces the space by space\space. You need two \\ because \ is an escape character.

I used \ at the end of code like this:

sed -i -r "Hello \\ World \\" mytext.txt

This resulted in Hello \ World, as desired. But thank you, all.


Can sudo be reinstalled after being removed? This seems to be a chicken-egg problem.
The most common task using sudo is installing and removing software.

sudo apt-get purge <appname>

But sudo itself can be removed.

sudo apt-get purge sudo # Do not run this command on production computers!

This is where the fun comes

ubuntu@ubuntu:~$ sudo
bash: /usr/bin/sudo: No such file or directory

Although it's obvious that no person in his right mind will purge sudo (other than me), someone can be fooled to run this command (not directly, in its hex mode, or whatever it's called) or a person could SSH in disguised as tech guru and do the mess.

So is there a way of reinstalling sudo?

I can install applications using:

pkexec apt-get install <appname>

From man pkexec:

  pkexec allows an authorized user to execute PROGRAM as another user. If
  username is not specified, then the program will be executed as the
  administrative super user, root.

So, I suppose that pkexec apt-get install sudo should work as well.

Edit: now I can confirm: yes, sudo can be installed using using pkexec  apt-get install sudo:

(click to enlarge)

This problem seems to be very ubuntu-specific. As non-ubuntu user I didn't even understand at first why sudo would be a special case in any way (a lot of distributions don't install it by default).

You don't need sudo at all. It's just a lazy shortcut that allows you to execute a root command without actually logging in as root. However, if you have to do anything more than a single command, it's just awful constantly prefixing everything with sudo. Not to mention that using sudo makes users ignorant about how permissions and root account work. It makes much more sense to just login as root, do the administration of the system and logout. That you do with su if you are already logged in as a regular user. Or you could log in directly as root.

Of course you need to have root password set, that's the reasonable configuration, otherwise you have a windows-like system where there are actions that nobody can perform and you are really locked out if somehow sudo isn't available (it requires working /etc/, set $PATH and other things mounted - which you may not have if something goes wrong early in boot).


How do I install ubuntu server from a usb stick? How do I install ubuntu server system from a usb stick?

First you need to download the Server ISO that you require.  Go Here to get either the 32bit or 64bit 12.04 LTS or the 64bit 13.04 version.  Once you get that done, I recommend that you download Yumi to create you bootable USB stick.  Once created, make sure that you switch you BIOS to boot fro the USB stick, and just follow the steps.

Note: With Yumi you can also add other distros to either install or try, as well as other utilities.


How to update to the latest version of Ubuntu (12.10) I am attempting to update my computer's operating system with ubuntu 12.10.  How do I update my operating system to ubuntu 12.10 when I am already using 12.04? How can I create a disc onto which to load ubuntu 12.10 O/S from the ubuntu 12.04 O/S?

If you are updating from 12.04, you can simply update through the update manager. Since 12.04 is a LTS release (Long Term Support), you will first need to go to the window Software Sources and in the last option of the third tab (Updates) state that you are interested in being informed of every new release of Ubuntu (first option in the drop-down list). You will need to enter your code.

Now you can close the window, open the software updater and it will tell you that Ubuntu 12.10 is available.

Another option is to burn it to a disc or make a USB for booting by downloading the image from www.ubuntu.com and use either Brasero for burning CD's or the USB creator application to make a start-up USB, which you can boot from upon system start-up.

I'm a bit confused by the title of your question. Are you using Windows or Ubuntu already?

there are two option

1- update by using Terminal

>sudo apt-get update

then

>sudo do-release-upgrade

2 - update by using update-manager

2.1 open update-manager

2.2 click Settings in the Update Manger

2.3 then select Normal Releases from the Release Upgrade menu.

2.4 check for upgrades again, and you’ll be notified that Ubuntu 12.10 is available for   upgrade.

2.5 Click the Upgrade button to get started.

click here to watch my video that show you how to update Ubuntu 12.04 to 12.10


Make a backup of the installed packages on Ubuntu like Linux Mint On the Linux mint you have a tool that list and save all your installed packages in a simple way. There is any way to do the same on Ubuntu/Xubuntu/Lubuntu/...?

Aptik

After seeing the various answers here (and not disagreeing with any of them) it strikes me that you asked for simplicity. In my comment, I linked to an application called Aptik and I'm going to show you why I think this meets your criteria best.

Aptik is simple to install and trivially easy to use. It is also a handy dandy GUI (Graphical User Interface) that has easy to use buttons and requires absolutely no real advanced knowledge. If you can click on a button with your mouse then you can install Aptik.

If you'd like to try read more about Aptik then you can click here and visit their home page. I'm not actually sure what good that will do. Their home page doesn't seem to have a whole lot of information.

It is Simple and it Does Work!

Not only does it do what you asked, it does a bit more. I think a screen shot should be fairly self-explanatory.

How to Install Aptik

Open your terminal by pressing CTRL+ALT+T.
Copy and Paste this to the terminal:

sudo apt-add-repository ppa:teejee2008/ppa

Press ENTER
Enter your password. Nothing will show on your screen, the cursor will not move, no asterisks will appear - this is normal behaviour.
Copy and paste this to your terminal:

sudo apt-get update

Press ENTER.
Copy and paste this to your terminal:

sudo apt-get install aptik

Press ENTER.
Allow the application to install and follow any on-screen prompts.

Running Aptik

If your computer is anything like mine then Aptik should magically appear in the Start menu. In my case, it appears under System Tools. Your case is probably not like mine. Open the launcher and search for aptik. If, for some peculiar reason, Aptik is not available then it can be launched from the terminal (use above commands) by running sudo aptik-launcher.

If, for some even stranger reason, you want to go ahead and run the application from the terminal, entirely, you can do that too but you're on your own. For the sake of completeness, this is a list of commands.

Aptik v1.6.4 by Tony George (teejee2008@gmail.com)

Syntax: aptik [options]

Options:

  --list-available      List available packages
  --list-installed      List installed packages
  --list-top            List top-level installed packages
  --list-{manual|extra} List top-level packages installed by user
  --list-default        List default packages for linux distribution
  --list-ppa            List PPAs
  --list-themes         List themes in /usr/share/themes
  --list-icons          List icon themes in /usr/share/icons
  --backup-ppa          Backup list of PPAs
  --backup-packages     Backup list of manual and installed packages
  --backup-cache        Backup downloaded packages from APT cache
  --backup-themes       Backup themes from /usr/share/themes
  --backup-icons        Backup icons from /usr/share/icons
  --restore-ppa         Restore PPAs from file 'ppa.list'
  --restore-packages    Restore packages from file 'packages.list'
  --restore-cache       Restore downloaded packages to APT cache
  --restore-themes      Restore themes to /usr/share/themes
  --restore-icons       Restore icons to /usr/share/icons
  --take-ownership      Take ownership of files in your home directory
 --backup-dir          Backup directory (defaults to current directory)
  --[show-]desc         Show package description if available
  --yes                 Assume Yes for all prompts
  --h[elp]              Show all options

Closure

Regardless of which method you choose, this has been included to ensure that there's a nice, simple, GUI way to do this. There are many ways to accomplish things in Linux and it is always nice to have options.

Try sudo dpkg --get-selections > /path/to/packagelist.txt That will have dpkg list all of the installed packages (from apt-get, and from DEB files) and output them to a text file. In this case, /path/to/packagelist.txt. Replace that with somewhere you can find it.


Software recommendations for writing a novel? This is my first time using Ubuntu so I'm little lost about which softwares are good in use and which are not... I have now LibreOffice and that will do for now but when my first draft is ready I'm going to need something where I can view my text one chapter or scene at the time. That really helps me with editing. So basically what I need is something like yWriter where I can put that massive textwall from LibreOffice as chpaters and scenes. I heard that I can get it work with Wine or something but if there is already similar sofware designed for Ubuntu, I would prefer to try that. Any recommendations?

LibreOffice Writer can turn any document into a PDF document. Not only that it can turn any document into a nicely formatted document. LibreOffice Writer can even turn any document into an exactly formatted PDF document that is indistinguishable from an ebook. In short, LibreOffice Writer is a very versatile and powerful application if you don't mind the learning curve.

Once you have created the PDF document, you can use PDF-Shuffler from the Ubuntu Software Center to rearrange the pages of your document any way you want to like dealing out cards from a deck of cards. You can "deal" out the pages individually or in groups and merge, rearrange, split and crop the document. You can also view the whole document as a massive textwall made of individual pages and scroll through the document and zoom in and out.

This solution has one limitation. The only easy way to edit the text of the document is to make a copy of the original document and edit the changes in the text using LibreOffice Writer. So you would be using PDF-Shuffler to help you to visualize possible changes in the flow of your document, rather than to edit the text of the document.

try installing story boards where you can actually create some scenes animated and you can get detailed view of what's going on with your story


How can I fix my keyboard layout? For a long time, I've had my keyboard configured to use the layout currently known as "English (international AltGr dead keys)." I like this layout because without any modifier keys, it's identical to the US English keyboard, but when I hold Right Alt I can get accented letters and other characters not available on a standard US English keyboard.

In Oneiric, however, the layout is messed up. Right Alt+N produces "ñ" as expected. And another method works: Right Alt+`, E produces "è", also as expected. But there's no way to type "é", which is probably the accented letter I type the most. I expect Right Alt+A, E to do the trick. But instead of a dead key for the acute accent, it uses a method for combining characters to create the hybrid "́e". This hybrid looks like the proper "é" in some settings, but it isn't the same character and doesn't always work. (For example, in the text input box as I type this, it looks the same as the proper character, but when displayed on the site for all so see, it looks very wrong--at least on my machine.) Ditto for all other characters with an acute accent, though some are available directly as pre-composed characters: For example, Right Alt+I yields "í".

How can I change the acute accent on the A key to a proper dead key? Perhaps the more general version of this is: How can I tweak my keyboard layout?

Update

I just tested this on my other machine, also running Oneiric, but upgraded from previous versions. I have no problems with the second machine. The problem machine was a fresh install of Oneiric, but I kept my old $HOME when I did the fresh install.

Clarification

Even if an answer doesn't address my specific examples, I would still accept it if it provided enough detail for me to find the layout and tweak it according to my needs.

Major Update

After working through the information gained through Jim C's and Chascon's helpful replies, I've learned something new: The problem isn't with the layout itself, but with the fact that the selected layout isn't being applied. When I look at the definition in /usr/share/X11/xkb/symbols/us of the layout I've been running for a long time, I found that the definition doesn't match what I get when I type. In addition, the keyboard layout dialog that's supposed to show the current layout looks different from the way the layout is defined in the file I mentioned, and matches what actually happens when I type.

Following Jim C's suggestion, I created a new layout in /usr/share/X11/xkb/symbols/us containing some modifications to the layout I want. I can select my layout from the keyboard properties, and I can use in on the console following Chascon's post, but the layout I get when typing is unchanged.

Apparently, there's a different layout defined somewhere that's overriding what I've set. Where is that layout hiding?

This problem occurs in Unity (3D and 2D), but I was able to get the correct layout set in Xfce.

In case it's relevant, this problem has occurred since I installed Oneiric fresh on this machine (though I preserved my $HOME). I don't recall whether this problem occurred before the reinstall.

Also, in case it's relevant, I also run iBus so I can type Korean. I have a few difficulties with iBus, but I doubt they're related.

I'll tell you what eventually worked best for me.

Open the gnome preference "keyboard layout" pane
Move the layout order, if you have more than one
Delete all layouts except the default one (mine was a US layout)

The previous two steps have been suggested as fixes on their own (on the Ubuntu forums?). They did not work for me. I tried them together consecutively and this again did not work for me. Thus my next step.

Press, "Reset to Defaults"
Layout changes effectuated from both the layout pane and indicator now result in a change in layout.
Of course, add layouts back before attempting to change to them. Use the preview function to find a layout that easily produces the diacritical marks you seek.

I think my problem was from the fact that some of the layouts had changed in name, at least that's my take considering that the layout names weren't exactly what I expected when reassigning them. Deleting my extra layouts and then assigning new ones from a fresh list seems to have circumvented my issues, that being that the layouts of my choice now point to existing layouts with names to match.

I had this problem / here  was my solution.

1. remove the keyboard layout.
2. add the layout back
3. make sure 3rd layer is set to Right Alt

then test Right Alt + backtick  ->  Shift + E = È & Right Alt + Shift + i = Í

also if this does not work remove and or reinstall xkb-data


What is the correct way to sync Thunderbird + Lightning I already tried to manually copy and the paste the profile folder from one instance to another, but the Lightning extension is not added when doing this and thus my tasks and events can't be synced.

For now I don't need to sync emails, just the calendar events and tasks and also the feed subscriptions.

If possible, I would prefer an offline solution, for example via pendrive instead of a storage service such as Dropbox.

I don't know of any offline solution, but there is an online solution. I'm using Google Calendar and it works really well. Do this to get it up and running:

In the calendar list, right-click and select "New calendar".
Choose "On the Network" and click "Next".
Select "CalDAV".
Enter "https://www.google.com/calendar/dav/yourname@gmail.com/events" as "Location".
Specify options on the next page.
Use your full e-mail address as username when prompted.

There are some instructions here:

http://support.google.com/calendar/bin/answer.py?hl=en&answer=99358

I got this to work, and here's how I did it:

I use Thunderbird/Lightning as my email/calendar client on my main computer (Thinkpad W541, Ubuntu Unity, 16.04) and my travel Chromebook (Acer C720, Ubuntu XFCE, 16.04), and I wanted to regularly sync the calendar data between both machines.  Suggestions online often mention Google Calendar, but I'd rather use open-source tools (that I control) to do the job.  I use SeaFile (a FOSS DropBox equivalent) to sync folders & files between my machines.

Step 1:  On my new Chromebook, I copy over my entire Thunderbird directory:
rsync -zarv user@thinkpad:~/.thunderbird/  ~/.thunderbird/
Then, I install Thunderbird and open it: presto, all my accounts, old emails, and (most importantly) calendar events are accessible. Great!

Step 2: It looks like all relevant Thunderbird data are stored in ~/.thunderbird/blah.default/, with calendar data in ~/.thunderbird/blah.default/calendar-data/.  On the Chromebook, I create a new calendar event, save it, and see that ~/.thunderbird/blah.default/calendar-data/local.sqlite has increased in size and has a newer "last-modified" timestamp.  I conclude that local.sqlite contains all relevant calendar data.

Step 3: I close Thunderbird on both machines, then use SeaFile to sync the entire calander-data/ folder on both.  I see that the newer filesize and timestamp have successfully synced on the Thinkpad. I open Thunderbird on the new machine, and there in the calendar is my new event.  Success!

Drawbacks:
The main drawback seems to be that if Thunderbird is open on both machines and either calendar is edited, syncing the calendar-data files sometimes causes the other machine's Thunderbird to crash.  They just weren't built to handle that sort of I/O.  But otherwise: it works great!


add unallocated space to extended partion My Primary partitions are full (4).
I have the extended partition holding my Ubuntu and its Swap.
Now, There are these two separate Unallocated spaces which have failed to be used and I cant even add them to the Extended partitions.
Please guide me how to have them in use.
Gparted have failed.

The unallocated space must follow a partition to expand the partition into that space.  You may need to move partitions around to make this happen.  Moving partitions can take a very long time, and if the process is interrupted, your data will be lost, so make sure you backup first.

I don't know how you used gparted but once you open your hard drive right click over extended, then resize, move the slider to add the unallocated space to the extended and then resize the partition you want.


How can I integrate Firefox with KDE's theme? When using Firefox in Kubuntu the difference between KDE's theme and Firefox's theme is huge. Is there any way to make the theme in Firefox look like the one in Ubuntu all smooth, fonts with correct size, etc.. Right now, Firefox in KDE makes everything like it was made 10 years ago with mspaint. The fonts are very small and it does not look good.

install a GTK+ theme that's compatible with your KDE theme

i'm using oxygen for KDE and installed the oxygen-gtk theme to have all my GTK+ apps look like my Qt apps

First you need to conpfigure GTK fonts on KDE control center (now don't ask me how because I haven't used KDE in a while)

Second, for eeh theme, download the kde4 theme from mozilla addons or from kde look

https://addons.mozilla.org/es-ES/firefox/addon/oxygen-kde/

http://kde-look.org/content/show.php?content=117962


mp4 video playback is horrible How can I get mp4 video to playback normal. They skip and look horrible. I was able to get them to playback on Fedora using a different setting with smplayer but nothing seems to work with Ubuntu.

Playback of cpu intensive video can be problematic if your CPU is not fast enough.

Smplayer is a frontend for mplayer.
You can install mplayer and start the playback from the console. Reading the console output is mostly very helpful. You can change the output driver.
Changing you Graphics-driver can also sometimes solve the problem.

ffplay it from a command line, although I have some issues with the subtitles.
You can try puppy linux, no lags and it works fine with the Gnome player, except that you may have the HDMI audio issues... VLC did not solve it for me either...


Downloaded MMS stream has very long duration I have successfully downloaded a one minute long stream:

$ mimms -t 1 mms://stream.polskieradio.pl/program3 out.asf
mms://stream.polskieradio.pl/program3 => out.asf
744.45 kB / ∞ B (12.00 kB/s, ∞ s remaining)
Download stopped after user-specified timeout.

$ avprobe out.asf 2>&1 | grep Duration
  Duration: 00:00:59.55, start: 0.000000, bitrate: 99 kb/s

Then I just coppied audio stream to another file:

$ avconv -i out.asf -c:a copy out2.asf
avconv version 9.16-6:9.16-0ubuntu0.14.04.1, Copyright (c) 2000-2014 the Libav developers
  built on Aug 10 2014 18:16:02 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
[asf @ 0x14af020] max_analyze_duration reached
[asf @ 0x14af020] Estimating duration from bitrate, this may be inaccurate
Guessed Channel Layout for  Input Stream #0.0 : stereo
Input #0, asf, from 'out.asf':
  Metadata:
    WMFSDKVersion   : 12.0.7601.17514
    WMFSDKNeeded    : 0.0.0.0000
    IsVBR           : 0
  Duration: 00:00:59.55, start: 0.000000, bitrate: 99 kb/s
    Stream #0.0(eng): Audio: wmav2, 48000 Hz, stereo, fltp, 96 kb/s
    Stream #0.1(eng): Data: [0][0][0][0] / 0x0000, 4 kb/s
Output #0, asf, to 'out2.asf':
  Metadata:
    WMFSDKVersion   : 12.0.7601.17514
    WMFSDKNeeded    : 0.0.0.0000
    IsVBR           : 0
    WM/EncodingSettings: Lavf54.20.4
    Stream #0.0(eng): Audio: wmav2, 48000 Hz, stereo, 96 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
Press ctrl-c to stop encoding
size=    1119kB time=1810474.72 bitrate=   0.0kbits/s
video:0kB audio:717kB global headers:0kB muxing overhead 56.223058%

And this happens:

$ avprobe out2.asf 2>&1 | grep Duration
  Duration: 502:54:34.71, start: 0.000000, bitrate: 0 kb/s

Is there any way to make it back to 1 minute as it should be?

Not sure why it matters - you have the orig. file.

But try using FFmpeg instead, should work better. A standalone binary can be had here to test with. Choose either the git master or release, download, extract & run ffmpeg from extracted folder

http://johnvansickle.com/ffmpeg/

Or build your own - https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu


Wireless card doesn't work for an HP DV2104 HP laptop upgraded from 10.10 to 11.10, model DV2104.  I used a wired connection for the install, but now it does not even seem to recognise that there is a wireless card.  I think I need help with this one.

Question input on another connected device!

Installed WICD & WICD network manager & removed network manager - using Software Centre. Wired connection is OK, but WICD NM says there are no wireless networks available although I am less than 6ft from a (working) wireless router.

The hardware wireless switch on the HP is at left for on, but the light shows orange ! (it's normally blue when connected wirelessly)

STUMPED !!

I had this problem with a HP DV5000 series laptop, so it may not be the same as yours, but maybe you can use some of the steps to get you in the right place.

1st you need to identify your driver, and they way I do that is get a list of my hardware on my computer.  Open terminal and see if the program that you need is installed.  More than likely it is.sudo apt-get install lshw  lshw is a Hardware Lister.  If and when the program is loaded, now you can send a copy of your hardware to your home folder and you can save it in you Ubuntu One or Dropbox folder to keep as long as you have your laptop.  Now in terminal type sudo lshw -html > your-file-name.html and if you want you can change where it says your-file-name to whatever you want.  When the program is complete just go to your home folder and open the html file created.  It should open with Firefox, Chromium, Chrome... When it is open, scroll down to where your wireless lan controller, it should look like this.

Under configuration on my laptop it says its a b43 driver.  Now I downloaded the older Synaptic Package Manager in the USC (Ubuntu Software Center).  After downloading I opened the Synaptic Package Manager a did a search on B43 and this is what I got;

Notice what choices I made and the choices I did not make.  If we are lucky and the drivers are same, all should work.  If you have a different driver then search what your driver is.  With a little good luck it should work.

Have you tried to install WICD? It worked great for me! Download and install it, then remove network-manager.


How to install OpenCV 3.1 for Python 3.5 On Ubuntu 16.04 LTS? How to install OpenCV version 3.1 on Ubuntu 16.04 LTS to work with Python 3.5.1?

I tried this on a VM but obviously that is useful to do if you want to work with Python 2.

I found this.

OpenCV on wheels.

  Unofficial OpenCV packages for Python.

Installation was painless for Ubuntu 16.04:

pip3 install opencv-python

Check the installation:

python3
Python 3.5.2 (default, Nov 17 2016, 17:05:23)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
>>> cv2.__version__
'3.2.0'

OpenCV can be installed using pip/pip3 and homebrew. I've tried installing it before using pip3 (Python 3.6.0), but i had problems with VideoCapture, which requires the ffmpeg package. cv2.VideoCapture('videofilename'). This is why I used homebrew for installing OpenCV. Open a Terminal with Ctrl + Alt + T and type the following commands:

brew install ffmpeg
brew install opencv3 --with-ffmpeg -v (Python 2.7)
brew install opencv3 --with-python3 --with-ffmpeg -v (Python 3.6)


Use case where script filenames have leading numbers to determine execution order I'm looking for documentation or a use case where in Linux there is a directory with shell scripts where each filename is led with a number, and the files are run in that particular order. What is this convention called, and where is it used?

For example:

0001-motd.sh
0002-proxy.sh
0300-ssh.sh

I know I have seen this before, just not sure where or what it is called.

It sounds like you are referring to run-parts

NAME
       run-parts - run scripts or programs in a directory

SYNOPSIS
       run-parts  [--test]  [--verbose] [--report] [--lsbsysinit] [--regex=RE]
       [--umask=umask] [--arg=argument] [--exit-on-error] [--help] [--version]
       [--list] [--reverse] [--] DIRECTORY

       run-parts -V

DESCRIPTION
       run-parts  runs  all  the  executable  files  named  within constraints
       described below, found in directory directory.  Other files and  direc‐
       tories are silently ignored.

       If neither the --lsbsysinit option nor the --regex option is given then
       the names must consist entirely of ASCII upper- and lower-case letters,
       ASCII digits, ASCII underscores, and ASCII minus-hyphens.

       If  the  --lsbsysinit  option  is given, then the names must not end in
       .dpkg-old  or .dpkg-dist or .dpkg-new or .dpkg-tmp, and must belong  to
       one  or more of the following namespaces: the LANANA-assigned namespace
       (^[a-z0-9]+$);   the   LSB   hierarchical   and   reserved   namespaces
       (^_?([a-z0-9_.]+-)+[a-z0-9]+$);  and  the  Debian cron script namespace
       (^[a-zA-Z0-9_-]+$).

       If the --regex option  is  given,  the  names  must  match  the  custom
       extended regular expression specified as that option's argument.

       Files  are  run  in  the  lexical  sort order (according to the C/POSIX
       locale character collation rules) of their names unless  the  --reverse
       option is given, in which case they are run in the opposite order.

I don't know, either this method/hack will work or not for your case. But, I think this will work If I got you right.

[feddy@localhost ~]$ mkdir test
[feddy@localhost ~]$ cd test
[feddy@localhost test]$ ls
[feddy@localhost test]$ vi 0001-ko.sh
[feddy@localhost test]$ cp 0001-ko.sh 0002-ko.sh
[feddy@localhost test]$ cp 0001-ko.sh 0004-ko.sh
[feddy@localhost test]$ cp 0001-ko.sh 0005-ko file.sh
[feddy@localhost test]$ cp 0001-ko.sh 0008-ko.sh
[feddy@localhost test]$ ls
0001-ko.sh  0002-ko.sh  0004-ko.sh  0005-ko file.sh  0008-ko.sh

[feddy@localhost test]$ for i in *
> do
> bash "$i"
> done
file 0001-ko.sh
file 0002-ko.sh
file 0004-ko.sh
file 0005-ko file.sh
file 0008-ko.sh
[feddy@localhost test]$

OR

$ find . -iname "*.sh"|while read f; do bash "$f"; done
file ./0001-ko1.sh
file ./0002-ko1.sh
file ./0005-ko1 file.sh
file ./0005-ko1.sh

You can make a script and use it to execute scripts in order (according to numbers which included in the filename i.e xxxx-abcdef ) in any folder.

Please correct me If I got you wrong.


Video driver under lxc container? Since LXC (Linux Containers) is a kernel level super-chroot, I've been wondering what sort of video driver the containers have:

My host is Ubuntu 12.04 64-bit machine with ATI gpu. Will the LXC container have access to the same driver? Or do they need to be installed on each container?

Please, take a look at this script to create a LXC container that runs steam with sound and video acceleration:

http://bazaar.launchpad.net/~ubuntu-lxc/lxc/steam-lxc/view/head:/steam-lxc

The magic comes here:

Outside LXC:

    # Add the bind mounts to the container's fstab
    self.container.set_config_item("lxc.mount.entry",
                                   "/tmp/.X11-unix tmp/.X11-unix "
                                   "none bind,ro")
    self.container.set_config_item("lxc.mount.entry",
                                   "/dev/dri dev/dri none bind,ro")
    self.container.set_config_item("lxc.mount.entry",
                                   "%s/pulse.socket home/%s/.pulse_socket "
                                   "none bind,ro" % (self.config_path,
                                                     self.user.pw_name))

We export X11 with a bind mount the /tmp/.X11-unix directory to allow container to use host X11. Do the same with /dev/dri directory and audio socket.

Inside LXC:

    # Get pulseaudio to listen on the socket
    with self.user_privileges():
        subprocess.call(['pactl', 'load-module',
                        'module-native-protocol-unix',
                        'socket=%s' % self.pulse_socket,
                        'auth-cookie-enabled=0'])

    # Start steam
    self.run_command(
        ["steam"], {'DISPLAY': os.environ['DISPLAY'],
                    'PULSE_SERVER': "/home/%s/.pulse_socket" %
                                    self.user.pw_name})

Uses pactl to use a unix socket to communicate with host pulse audio server and later export the socket and DISPLAY environment variable to allow steam to use local X11 server and socket to audio server.

Take a look at the script and enjoy it :)

With that environment variables inside LXC you could play (theoretically) almost all games.

Best regards!

To the best of my knowledge the lxc containers will have acess to the driver. check out this site for more info
http://libvirt.org/drvlxc.html


airodump-ng fopen failed: No such file or directory I was trying to test a wpa wifi network. I wrote the following command

airodump-ng -c 11 --bssid 34:5B:34:7B:AC:66 -w /root/Desktop/ mon2

Note: The BSSID I have posted here is wrong for of course reasons. And I get the following errors:

fopen failed: No such file or directory
Could not create "/root/Desktop/-01.csv"

I can clearly see that is there is C language fopen error. Its trying create a csv file. I think mainly for maintaining the passowords it tests. I don't know what is this csv files for just made a guess.

I tried to create a simple .csv file with C Program using fopen and the csv file got created. So, there is not problem with C env is guess.

I need  help how do I fix this error?

The -w parameter of airodump-ng is for specifying a file prefix, not a folder.

The right command would be:

airodump-ng -c 11 --bssid 34:5B:34:7B:AC:66 -w /root/Desktop/capture_file mon2

This will create a file on this path:

/root/Desktop/capture_file-01.csv

Quote from the airodump-ng man page:

  -w , --write
      Is the dump file prefix to use. If this option is not given, it will only show data on the screen.

Put your wireless card in monitoring mode

airmon-ng start wlan0

Command to listen to the wireless network around you and get details about them

airodump-ng mon0

Sniff on channel 6 (-c 3), filtering on a BSSID (–bssid 11:22:33:44:55:66 ), writing the capture to disk (-w capture), using the monitor mode interface (mon0):

airodump-ng –w [File name of packet] –c [Target channel no] --bssid BSSID [of target name] mon0

(eg: airodump-ng –w MTNL –c 3 –bssid 11:22:33:44:55:66 mon0)
Using the provided wordlist (-w /usr/share/wordlists/nmap.lst), attempt to crack passwords in the capture file

aircrack-ng -w wordlist.lst -b 00:11:22:33:44:55 MTNL.cap

[ -w=The name of the dictionary file

-b=The MAC address of the access point

MTNL.cap=The name of the file that contains the authentication handshake ]

For more details click here


How to completely remove PHP? I need to clean up my server from PHP 5.3 packages (there are plenty of them) in order to be able to compile PHP 5.2. What is the easiest/safest method to get rid of them all?

This method is not advised to be used without careful review. Read below comments.

This should completely remove any package with a name that starts with php and anything related to it.

sudo apt-get purge 'php*'

DON'T PRESS y UNTIL YOU ENSURE that in the removing packages list there are no other packages (besides related to php packages), like:

php-common* python-openssl* php-curl* ... and tons of packages

If so, type n, copy the list (& tidy up from the unrelated packages), and manually remove them:

sudo apt-get purge      php-common* php-curl*    ... and tons of packages

apt list --installed 2>/dev/null | awk -F '/' '{print $1}' | grep '^php' | xargs -r sudo apt purge;
sudo rm -rfv /etc/php/5.3;

Explanation
apt list --installed 2>/dev/null - list of installed packages with version and other info;
apt list --installed 2>/dev/null | awk -F '/' '{print $1}' - list of installed package names only;
apt list --installed 2>/dev/null | awk -F '/' '{print $1}' | grep '^php' - list of installed package names only starting in php;
apt list --installed | awk -F '/' '{print $1}' | grep '^php' | xargs -r sudo apt purge- pass list of installed package names only starting in php as arguments for sudo apt purgecommand;
sudo rm -rfv /etc/php/5.3 - remove all configuration files for php5.3;
If necessary
sudo rm -rfv /etc/php/5* - remove all configuration files of all php5 versions (php5.3, php5.4, php5.5 etc.);
sudo rm -rfv /etc/php - remove all configuration files of all php versions (php5, php7 etc.);


How to use Virtualbox in full screen? I am running Ubuntu 18.04.1 on Virtualbox on a Windows 10 host and I can't figure out how to get the screen to take up the full window. I've tried installing virtualbox-dkms and virtualbox-guest-dkms in the terminal and it didn't work.

Before installing VirtualBox guest additions tool, run the commands below on the Ubuntu guest machine first.

sudo apt install linux-headers-$(uname -r) build-essential dkms

After installing the packages above, restart and continue installing the Guest Additions Tool.

To install VirtualBox Guest Additions software on Ubuntu virtual machine operating systems, select the Devices from VirtualBox host application menu and click Insert Guest Additions CD image…
view image

Click run to begin installation.
view image

After installation is done reboot and you should be full screen.

Run these commands while in Ubuntu's Virtual Machine:

cd /media
sudo mkdir cdrom1
sudo mount /dev/cdrom /media/cdrom1
cd cdrom1
ls  #look for VBoxLinuxAdditions.run
sudo ./VBoxLinuxAdditions.run
sudo reboot

Source: VirtualBox Unable to Install Guest Additions CD Image - 2019 - YouTube


How do you get a list of all starting services? I know about the update-rc.d SERVICE OPTIONS command to add and remove services from startup, but how do I use it to get a list of all the services that are currently configured to start at startup?

Is there some other way to get this list?

See the attached link.

UbuntuBootupHowto

The command is

service --status-all


Nginx failing to reload - how to track down why? Hi I've had my Nginx server running great on Ubuntu server 12.04 for a while.

I've been gradually bolting on various bits, and got as far as optimising load times on my wordpress page.

After making a few changes to my hosts file I decided to:

sudo /etc/init.d/nginx reload

To which I get:

* Reloading nginx configuration nginx                           [fail]

No additional info or reasoning is given. How can I restart my server so that it prints any error statements whilst reloading so I can begin to track down the error.

For a bonus question:

For those Nginx sysadmins, when you've made a bunch of changes to hosts and bolted on a few other bits and suddenly your nginx server won't reload (incidentally everything still appears to be running!) how do you begin your approach to isolating why or begin breaking things down to debug!

Check syslog (/var/log/syslog) for messages about config file issues.

From the commandline you can run:

nginx -c /etc/nginx/nginx.conf -t

to have nginx check your configuration for errors.

If it is giving you such errors you can check journalctl -xe out.
It has bunch of information about what happened in an operation system matter.
you can find the line or simply journalctl -xe | grep nginx to find what has happened to nginx when it tried to run itself.


How can I make a Multiseat with Xephyr? I'm trying to use multiseat with Ubuntu, but I can't make this work.

I've read a lot of "how to", and the most of them are about doing a multiseat with some distro with GDM2, or KDM. But, I'm using the lightdm of Ubuntu.

So now I'm trying to make this multiseat with Xephyr, which I've already used to make a multiseat with the Debian 4 version. But I don't know how to call Xephyr in lightdm.conf.

There is a sample of LightDM setup for multiseat using Xephyr. It looks like Andrzej Pietrasiewicz (the author of the blog copied/referenced below) created a PPA with all the code displayed below. By installing that PPA, you should be able to get a lightdm installation to work "magically".

Note: As I have been trying to get that to work, I have not succeeded yet. However, I can tell you that there are a certain number of contradictory parameters in what follows.

Some important parts:

The [Seat:0] entry which defines the "hardware server". That starts the X server. It represents Display :0
The xserver-command entries that define exactly what needs to be started to get seats. Xephyr is started with Display :1 and Display :2. So in effect the users will log in Display :1 and :2, but not in :0.

Something like that:

+------------------------------- Display :0 -----------------------------+
|  X server                                                              |
|                                                                        |
|  +--------- Display :1 ----------+  +--------- Display :2 ----------+  |
|  |  Xephyr 1                     |  |  Xephyr 2                     |  |
|  |  User A                       |  |  User B                       |  |
|  |                               |  |                               |  |
|  |                               |  |                               |  |
|  |                               |  |                               |  |
|  +-------------------------------+  +-------------------------------+  |
|                                                                        |
+------------------------------------------------------------------------+

The xorg.conf file:

# File: /etc/X11/xorg.conf

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0" 0 0
    Option         "Xinerama" "0"
EndSection

Section "Files"
EndSection

Section "Module"
    Load           "dbe"
    Load           "extmod"
    Load           "type1"
    Load           "freetype"
    Load           "glx"
EndSection

Section "ServerFlags"
    # start even without the mouse
    Option "AllowMouseOpenFail" "yes"
    # disable VT switching
    #Option "DontVTSwitch" "yes"
    # Ctrl+Alt+Backspace disable
    #Option "DontZap" "yes"
EndSection

Section "Monitor"
    # HorizSync source: edid, VertRefresh source: edid
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "Philips 170B4"
    HorizSync       30.0 - 82.0
    VertRefresh     56.0 - 76.0
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce 8400 GS"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "TwinView" "1"
    Option         "TwinViewXineramaInfoOrder" "DFP-0"
    Option         "metamodes" "CRT: nvidia-auto-select +0+1080, DFP: nvidia-auto-select +0+0"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

Source: http://beforeafterx.blogspot.com/2011/02/multiseat-setup-xorgconf.html

The script in lightdm.conf:

# File: /etc/lightdm/lightdm.conf
[LightDM]
greeter-user=root
user-authority-in-system-dir=false
common-vt=true

[SeatDefaults]
xserver-allow-tcp=false
greeter-hide-users=true
user-session=lightdm-xsession
session-wrapper=/etc/X11/Xsession

[Seat:0]
xserver-command=X -br -dpms -s 0 -novtswitch
greeter-session=xinerama

[Seat:1]
xserver-command=/etc/multiseat/scripts/Xephyr-seat-1
greeter-session=multiseat-greeter-1

[Seat:2]
xserver-command=/etc/multiseat/scripts/Xephyr-seat-2
greeter-session=multiseat-greeter-2

Source: http://beforeafterx.blogspot.com/2012/08/multiseat-setup-lightdmconf.html

The multiseat scripts start Xephyr with parameters describing the mouse and keyboard to use for that seat. I will do my best to find out that information and provide it here too.

#!/bin/bash
# File: /etc/multiseat/scripts/Xephyr-seat1, Xephyr-seat2, ..., Xephyr-seatN
#
# $1 - display number of this Xephyr

. /etc/multiseat/scripts/helper-functions

trap "" usr1

XEPHYR=/root/Xephyr-new
export DISPLAY=:0
export XAUTHORITY=/var/run/lightdm/root/:0

SEAT=1

SIZE=`get_conf $SEAT SIZE`
KEYBOARD=`get_conf $SEAT KEYBOARD`
LAYOUT=`get_conf $SEAT LAYOUT`
MOUSE=`get_conf $SEAT MOUSE`
DPI=`get_conf $SEAT DPI`

exec $XEPHYR -retro -screen ${SIZE} -keybd evdev,,device=/dev/input/${KEYBOARD},xkbrules=evdev,xkbmodel=evdev,xkblayout=${LAYOUT} -mouse evdev,,device=/dev/input/${MOUSE} -dpi ${DPI} $1

Source: http://beforeafterx.blogspot.com/2012/08/multiseat-configuration-xephyr-seat-1.html

The greater referenced in the lightdm is also a separate shell script. Note that I would recommend you reference /bin/sh instead of /bin/bash. I did not see anything that would require bash. Note that it references the default lightdm-gtk-greeter at the end.

#!/bin/bash
# File: /etc/multiseat/scripts/multiseat-greeter-1, ..., multiseat-greeter-n
#
# multiseat wrapper around ligthdm greeter in order to position a Xephyr instance
#
. /etc/multiseat/scripts/helper-functions

PRIMARY=`get_conf 0 PRIMARY`
SEAT=1

if [ $SEAT != $PRIMARY ]; then
    XEP=`XAUTHORITY=/var/run/lightdm/root/:0 xwininfo -root -children -display :0 | grep "Xephyr on :$SEAT" --max-count=1`;
    XEPHYR_WIN_ID=`echo ${XEP} | cut -d' ' -f1`;
    DISPLACEMENT=`get_conf $SEAT DISPLACEMENT`
    DISPLAY=:0 XAUTHORITY=/var/run/lightdm/root/:0 wmctrl 2>&1 -v -i -r ${XEPHYR_WIN_ID} -e 0,0,${DISPLACEMENT},-1,-1;
fi

XAUTHORITY=/var/run/lightdm/root/:$SEAT
DISPLAY=:$SEAT
exec /usr/sbin/lightdm-gtk-greeter

Some of the functions may be defined in the following script. Somehow, it includes yet another multiseat script that I haven't seen yet...

# File: /etc/multiscript/scripts/helper-functions

. /etc/default/multiseat

#
# private implementation of get_sect
#
# get given section's contents from the given config file
#
# $1 filename
# $2 section number
#
__get_sect()
{
    cat $1 | awk -v sect=$2 '
    BEGIN {
        SECT="^\\[" sect "\\]"
        NEXT_SECT="^\\[" (sect + 1) "\\]"
    }
    $0 ~ SECT, $0 ~ NEXT_SECT {
        if ($0 ~ SECT)
            next;
        if ($0 ~ NEXT_SECT)
            next;
        if (substr($1, 1, 1) == "#")
            next;
        print
    }
    '
}

#
# private implementation of get_conf
#
# get given key's contents from the given section
# from the given config file
#
# does not work for tables in the config file
#
# $1 filename
# $2 section name
# $3 key name
#
__get_conf()
{
    __get_sect $1 $2 | awk -F"=" -v key=$3 '
    BEGIN {
        KEY=key
    }
    $1==KEY {
        print substr($0, index($0, "=") + 1)
    }
    '
}

#
# private implementation of get_num_seats
#
# get number of seats from the default config file
#
# $1 filename
#
__get_num_seats()
{
    cat $1 | awk '
    BEGIN {
        count=0
    }
    /^\[[0-9]*\]/ {count++}
    END {
        print count - 1
    }
    '
}

#
# get given section's contents from the default config file
#
# $1 section name
#
get_sect()
{
    __get_sect $CONFIG $1
}

#
# private implementation of get_table
#
# $1 filename
# $2 section number
# $3 table name
# $4 size/entry switch [-size => size, <number> for entry]
#
__get_table()
{
    SIZE=0;
    ENTRY=-1

    if [ $4 == "-size" ];
    then
        SIZE=1;
    else
        ENTRY=$4
    fi

    RESULT=`__get_sect $1 $2 | awk -v table=$3 -v get_size=$SIZE -v entry=$ENTRY '
    BEGIN {
        print BEGIn
        TABLE=table "\\\=" "\\\("
        GET_SIZE=get_size
        ENTRY=entry
        size=0
    }
    $0 ~ TABLE, /^\)/ {
        if ($0 ~ TABLE)
            next;
        if ($0 ~ /^\)/)
            next;
        if (substr($1, 1, 1) == "#")
            next;
        if (get_size == 0 && size == entry){
                print
                exit
        }
        size++;
    }
    END {
        if (get_size)
            print size;
    }
    '`
    RESULT=`echo $RESULT | sed 's/^[ \t]*//g'`

    echo $RESULT
}

#
# get given key's contents from the given section
# from the default config file
#
# does not work for tables in the config file
#
# $1 section name
# $2 key name
#
get_conf()
{
    __get_conf $CONFIG $1 $2
}

#
# get number of seats from the default config file
#
get_num_seats()
{
    __get_num_seats $CONFIG
}

#
# get size of a given table in the given section of the config file or
# get specified entry of the table
#
# $1 section number
# $2 table name
# $3 size/entry switch [-size => size, <number> for entry]
#
get_table()
{
    __get_table $CONFIG $1 $2 $3
}

The fake-greeter script is a sleeper. It just sleeps until it gets killed by a full shutdown. Apparently, this is not required. According to a comment, the -noreset option is enough to avoid having to wait like this. I will report later once I tested for myself.

#!/bin/bash
# File: /etc/multiseat/scripts/fake-greeter

pid_set=0

kill_sleep()
{
    if [ $pid_set -ne 0 ];
    then
        kill -15 $pid
    fi
    exit 0
}

trap 'kill_sleep' TERM

while true;
do
    sleep 1000 &

    pid=$!
    pid_set=1

    wait $pid
done

The same blog says that he is having problems with udev and he has to re-reset it so multi-seat works properly. This was in August 2012 so I do not know whether that would still apply in 2014.

#!/bin/sh
# File: /etc/init.d/multiseat
### BEGIN INIT INFO
# Provides:          multiseat
# Required-Start:    bootlogs
# Required-Stop:
# Default-Start:     1 2 3 4 5
# Default-Stop:
# Short-Description: Trigger udev rules
# Description:       For some reason the rules for multiseat config need to be
#                    fired once more and later than at the very beginning.
### END INIT INFO

/sbin/udevadm trigger

To properly setup this script on your system, run the following command:

sudo update-rc.d multiseat defaults

Again, I do not know whether this script is required at this point. Just organizing the scripts offered by Before after X.

Source: http://beforeafterx.blogspot.com/2012/08/multiseat-setup-initdmultiseat.html

There is a wonderful blog detailing the process of getting an Xephyr based multiseat set up. He also is using Lightdm. Hope it helps.


Ubuntu can't see the D: windows partition I have installed ubuntu in my laptop and everything was going well, but I had a problem that ubuntu's file manager can't see the windows D: partition.

Here is some photos of the problem:

in the left side I can just see the OS partition which is C:

I think that ubuntu sees the D: partition because it is the /dev/sda5:

What shall I do to access my Windows' D: partition?

Your partition D is mounted on /windows :

cd /windows && ls -lA

If you have issue with the mountpoint, show us the line of your /etc/fstab which mounted the /dev/sda5:

grep -A1 "/dev/sda5" /etc/fstab

Maybe you just need to install the NTFS support on your distribution:

sudo apt-get install ntfs-3g

Go to disk utility and mount all those partitions (D: in your case).

If you had win 8 or more installed in your computer previously, then use

  sudo ntfsfix /dev/sdX

where X is your drive


20.04.1 offline installation of 'make' to compile network driver I got a system with the Realtek RTL8125B chip which is supported in Kernel 5.9. To install the driver from the Realtek website, I need to compile it, but 20.04.1 lacks the make package.
I tried apt-get install make --Download-only in a Virtualbox installation of 20.04.1 to get all dependent packages of make, but that downloads only the make package (most likely as the virtual machine is using the host systems working network interface to download updates previously). Manual installation of separate downloaded make_4.2.1-1.2_amd64.deb with dpkg fails on the offline machine with missing dependent packages.
installing an additional compatible network card is not possible as all PCIe slots are in use.
Any ideas?

I recently had a similar problem, installing a dkms wifi driver. Here's how I did it:
I had a working Ubuntu system, wombat, connected to the internet.
I also had bk, with Ubuntu installed, but no internet. The driver for its wifi chip was available via dkms, which required compiling.
I used a USB key and SneakerNET, along with this process.
On wombat, download the .deb package for the driver with apt download, storing it on the USB key.
AGAIN:
Move the USB key to bk, and sudo dpkg -i *.deb.
If/when that fails, save the error log to the USB key.
Move the USB key back to wombat, use apt download to download the missing packages, saving the .deb files to the USB key.
Go back to AGAIN.
Eventually, after 3-5 iterations, you'll have downloaded the original driver, its dependencies and their dependencies and ...
The sudo dpkg -i *.deb will succeed, and we're done.

Download all dependencies from ubuntu.pkgs.org and install. This will allow you to install the driver.
Here is the list:
autoconf_2.69-11.1_all.deb
automake_1.16.1-4ubuntu6_all.deb
autotools-dev_20180224.1_all.deb
binutils_2.34-6ubuntu1_amd64.deb
binutils-common_2.34-6ubuntu1_amd64.deb
binutils-x86-64-linux-gnu_2.34-6ubuntu1_amd64.deb
cpp-9_9.3.0-10ubuntu2_amd64.deb
debianutils_4.9.1_amd64.deb
dpkg_1.19.7ubuntu3_amd64.deb
gcc-10-base_10-20200411-0ubuntu1_amd64.deb
gcc_9.3.0-1ubuntu2_amd64.deb
gcc-9_9.3.0-10ubuntu2_amd64.deb
gcc-9-base_9.3.0-10ubuntu2_amd64.deb
lib32asan5_9.3.0-10ubuntu2_amd64.deb
lib32atomic1_10-20200411-0ubuntu1_amd64.deb
lib32gcc1_10-20200411-0ubuntu1_amd64.deb
lib32gcc-9-dev_9.3.0-10ubuntu2_amd64.deb
lib32gcc-s1_10-20200411-0ubuntu1_amd64.deb
lib32gomp1_10-20200411-0ubuntu1_amd64.deb
lib32itm1_10-20200411-0ubuntu1_amd64.deb
lib32quadmath0_10-20200411-0ubuntu1_amd64.deb
lib32stdc++6_10-20200411-0ubuntu1_amd64.deb
lib32ubsan1_10-20200411-0ubuntu1_amd64.deb
libacl1_2.2.53-6_amd64.deb
libasan5_9.3.0-10ubuntu2_amd64.deb
libatomic1_10-20200411-0ubuntu1_amd64.deb
libbinutils_2.34-6ubuntu1_amd64.deb
libbz2-1.0_1.0.8-2_amd64.deb
libc6_2.31-0ubuntu9_amd64.deb
libc6-i386_2.31-0ubuntu9_amd64.deb
libc6-x32_2.31-0ubuntu9_amd64.deb
libcrypt1_4.4.10-10ubuntu4_amd64.deb
libctf0_2.34-6ubuntu1_amd64.deb
libctf-nobfd0_2.34-6ubuntu1_amd64.deb
libdb5.3_5.3.28+dfsg1-0.6ubuntu2_amd64.deb
libgcc-9-dev_9.3.0-10ubuntu2_amd64.deb
libgcc-s1_10-20200411-0ubuntu1_amd64.deb
libgmp10_6.2.0+dfsg-4_amd64.deb
libgomp1_10-20200411-0ubuntu1_amd64.deb
libisl22_0.22.1-1_amd64.deb
libitm1_10-20200411-0ubuntu1_amd64.deb
liblsan0_10-20200411-0ubuntu1_amd64.deb
liblzma5_5.2.4-1_amd64.deb
libmpc3_1.1.0-1_amd64.deb
libmpfr6_4.0.2-1_amd64.deb
libpcre2-8-0_10.34-7_amd64.deb
libperl5.30_5.30.0-9build1_amd64.deb
libquadmath0_10-20200411-0ubuntu1_amd64.deb
libselinux1_3.0-1build2_amd64.deb
libsigsegv2_2.12-2_amd64.deb
libstdc++6_10-20200411-0ubuntu1_amd64.deb
libtsan0_10-20200411-0ubuntu1_amd64.deb
libubsan1_10-20200411-0ubuntu1_amd64.deb
libx32asan5_9.3.0-10ubuntu2_amd64.deb
libx32atomic1_10-20200411-0ubuntu1_amd64.deb
libx32gcc1_10-20200411-0ubuntu1_amd64.deb
libx32gcc-s1_10-20200411-0ubuntu1_amd64.deb
libx32gomp1_10-20200411-0ubuntu1_amd64.deb
libx32itm1_10-20200411-0ubuntu1_amd64.deb
libx32quadmath0_10-20200411-0ubuntu1_amd64.deb
libx32stdc++6_10-20200411-0ubuntu1_amd64.deb
libx32ubsan1_10-20200411-0ubuntu1_amd64.deb
libzstd1_1.4.4+dfsg-3_amd64.deb
list
m4_1.4.18-4_amd64.deb
make_4.2.1-1.2_amd64.deb
perl_5.30.0-9build1_amd64.deb
perl-base_5.30.0-9build1_amd64.deb
perl-modules-5.30_5.30.0-9build1_all.deb
tar_1.30+dfsg-7_amd64.deb
zlib1g_1.2.11.dfsg-2ubuntu1_amd64.deb


Is ZFS on Ubuntu 20.04 using a ton of memory? I have 64GB installed but htop shows 20GB in use:

Running ps aux  | awk '{print $6/1024 " MB\t\t" $11}'  | sort -n gives me the largest processes using only a few 100 megabytes and adding up the whole output only gets me to 2.8GB (ps aux | awk '{print $6/1024}' | paste -s -d+ - | bc). This is more or less what I was getting with Ubuntu 19.04 from which I upgraded yesterday - 3 to 4GB used when no applications are running. So why is 20GB in use on htop?

Now it's true that I have installed ZFS (total 1.5 GB of SSD drives, in 3 pools, one of which is compressed), and I've been moving some pretty big files around so I could understand if there was some cache allocation. The htop Mem bar is mostly green which means "memory in use" as opposed to buffer (blue) or cache (orange) so it's quite concerning.

Is this ZFS using up a lot of RAM, and if so, will it release some if other applications need it?

EDIT

Here is the output of smem:

tbrowne@RyVe:~$ smem -tw
Area                           Used      Cache   Noncache
firmware/hardware                 0          0          0
kernel image                      0          0          0
kernel dynamic memory      20762532     435044   20327488
userspace memory            2290448     519736    1770712
free memory                42823220   42823220          0
----------------------------------------------------------
                           65876200   43778000   22098200

So it's "kernel dynamic memory" that's the culprit. Why so much?

EDIT 2 --> seems to be linked to huge file creation

I rebooted and RAM usage was circa 5GB. Even running a bunch of tags in firefox, running a few VMs, taking RAM up to 20GB, then closing all the applications it dropped back to 5GB. Then I created a big file in Python (1.8G of random number CSV), then concatenated that to itself 40x to produce a 72GB file:

tbrowne@RyVe:~$ python3
Python 3.8.2 (default, Mar 13 2020, 10:14:16)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy as np
>>> import pandas as pd
>>> pd.DataFrame(np.random.rand(10000, 10000)).to_csv("bigrand.csv")
>>> quit()
tbrowne@RyVe:~$ for i in {1..40}; do cat bigrand.csv >> biggest.csv; done

Now after it's all done, and nothing running on the machine, I have 34G in use by the kernel!

FINAL EDIT (to test the answer)

This python 3 script (you need to pip3 install numpy) will allocate about 1GB at a time until it fails. And as per the answer below, as soon as you run it, kernel memory gets freed so I was able to allocate 64 GB before it got killed (I have very little swap). In other words it confirms that ZFS will release memory when it's needed.

import numpy as np
xx = np.random.rand(10000, 12500)
import sys
sys.getsizeof(xx)
# 1000000112
# that's about 1 GB
ll = []
index = 1
while True:
    print(index)
    ll.append(np.random.rand(10000, 12500))
    index = index + 1

ZFS will cache data and metadata so given a lot of free memory this will be used by ZFS.  When memory pressure starts to occur (for example, loading programs that require lots of pages) the cached data will be evicted.  If you have lots of free memory it will be used as cache until it is required.

You can use the arc_summary tool to see the resources used by the ZFS ARC (adaptive replacement cache)

ALL storage systems in UNIX/Linux will use all the available free memory they can add a cache when any RAM is available. Doesn't matter if it's. ZFS, LVM, ext, xfs, it's just how the kernel was designed. Leads to much confusion depending on the program being used to look at available memory.  top often shows all allocated memory including what is used for IO cache, whereas free does not. Has confused people since the early days of computing.


Fail2Ban or DenyHosts to block invalid username SSH login attempts Is there a way to automatically block IP address when a user tries to login as any invalid username? I already have:

[ssh]

enabled  = true
port     = ssh
filter   = sshd
logpath  = /var/log/auth.log
maxretry = 3
bantime = 31536000

in /etc/fail2ban/jail.conf

First, define the filter for invalid users in filter.d/sshd-invaliduser.conf:

[INCLUDES]
before = common.conf

[Definition]
_daemon = sshd

failregex = ^%(__prefix_line)s[iI](?:llegal|nvalid) user .*? from <HOST>(?: port \d+)?\s*$
ignoreregex =

[Init]
journalmatch = _SYSTEMD_UNIT=sshd.service + _COMM=sshd

Then enable it in jail.local:

[sshd-invaliduser]
enabled = true
maxretry = 1
port    = ssh
logpath = %(sshd_log)s
backend = %(sshd_backend)s

This works with fail2ban 0.9.6-2 on Debian 9.

You can Enhance your security by enable roundcube section
Roundcube does have captcha plugins available which will mitigate this, but users will complain if they have to type in a captcha to login for mail.

Fail2ban provides an easy solution for this.

First up, we need to add roundcube into /etc/fail2ban/jail.conf

[roundcube]

enabled  = false

port     = http,https

filter   = roundcube

action   = iptables-multiport[name=roundcube, port="http,https"]

logpath  = [YOUR PATH TO ROUNDCUBE HERE]/logs/errors

maxretry = 5

findtime = 600

bantime = 3600

Change [YOUR PATH TO ROUNDCUBE HERE] in the above to your actual roundcube folder

eg /home/roundcube/public_html/logs/errors

Next, we need to create a filter.

Add /etc/fail2ban/filter.d/roundcube.conf

[Definition]

failregex = IMAP Error: Login failed for . from <HOST>(\. . in .?/rcube_imap\.php on line \d+ \(\S+ \S+\))?$

ignoreregex =

Now we have the basics in place, we need to test out our filter.
For that, we use fail2ban-regex.

Enjoy


How do I rename a directory via the command line? I have got the directory /home/user/oldname and I want to rename it to /home/user/newname. How can I do this in a terminal?

gvfs-rename will rename directories as well. It will give an error if a directory with the new name already exists. The only limitation is that you can't use a path with the folder name. So

gvfs-rename /home/boo /home/boo-the-dog

will not work, but

cd /home
gvfs-rename boo boo-the-dog

will work. Not as useful as mv -T but I read in the man that it was meant for network operations.


How to copy a bootable NTFS partition from one physical hard drive to another with Ubuntu? I have a USB flash drive with Ubuntu 11.10 installed that I would like to use for the following task:

I have a hard drive with 4 partitions. The second one is formatted with NTFS and contains a fully functional Windows installation. I would like to copy that second partition to another physical hard drive (which is empty).

There's a catch however - I cannot have both hard drives physically connected to the computer at the same time. I have a third external hard drive however that will remain connected throughout the entire operation and has more than double the space of both of the other hard drives.

I realize there are a lot of things to consider here:

The process will obviously involve making some sort of "image" of the second partition, storing it on the external drive, and then copying the image to the new drive.
The partition that I am copying is bootable and should also be bootable when copied to the new drive. I can probably fix the MBR on the partition afterward if need be.
The old and new drives are not identical in make, model, or size. However, there is ample room for the second partition on the new drive.

Any advice on how to proceed or warnings for possible pitfalls would be greatly appreciated. Also, if I missed an important detail, please don't hesitate to ask for it.

(No extra software required, use the tools you have)

dd if=/dev/sda2 of=foo_file.img will create an exact replica of sda to a .img file that you specify.
Save it to an external device and restore it with dd if=foo_file.img of=/dev/sday.
Step by step

Boot from the Ubuntu LiveCD and open the disk management tool (or use sudo fdisk -l from the terminal) to find out which disk you will be copying.

Mount the external device you will save the .img file to, do not mount the disk you want to make the image from!

Use dd if=/dev/sda2 of=foo_file.img, replace /dev/sda2 with the actual partition you want to copy and foo_image.img with a file located on the external disk you previously mounted.

Reboot your PC removing the disk you made the image from and install the new disk in your PC. Boot the computer with the Ubuntu LiveCD.

Mount the external disk that contains the .img file and open the disk tool to make sure about the device where we are going to write it to. (Probably will be using the same device path as the one you just removed). Don't even try to mount the new disk, there should be nothing to mount anyways!

Use dd if=foo_file.img of=/dev/sdax to write the image you created and stored on to the external device to the new disk you just installed. Change sdax for the correct partition.

Run gparted and resize your newly created partitions to accommodate the extra space in your new disk.

Reboot and boot using your new disk.

After this is done you can keep the .img file as a backup till you make sure that everything is running.
I have used this method oh so many times now and not an issue, but you never know. Keep a backup around for some time.

Clonezilla - clonezilla.org

A free software disaster recovery, disk cloning and deployment solution. Allows a user to clone an individual machine or many computers ...


Unable to update my ubuntu server 14.04 using apt-get update I am unable to update my ubuntu server 14.04 using apt-get update.

Outcome is:

W: failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/trusty/inrelease

And another error is:

/usr/local/snort/bin/snort: error while loading shared libraries: libdnet.1 : cannot open shared object

How can I solve this?

I just had this same issue. My company has a firewall that stopped apt-get from getting to the http sources. They still allow ftp traffic, so I was able to work around the firewall by changing all the "http" sites in sources.list to "ftp". For example, in file /etc/apt/sources.list, I changed line:

deb http://us.archive.ubuntu.com/ubuntu/ trusty-security main

to

deb ftp://us.archive.ubuntu.com/ubuntu/ trusty-security main

Now apt-get is able to fetch the files from the repositories.

You should try sudo apt-get upgrade that will run as superuser and upgrade you to 16.04 if you dont want that try sudo apt-get update to run the command as superuser thats what u usually do if your updating your current version there also could be no new updated versions but I bet there are if you want to check you can use sudo apt-get dist-upgrade to upgrade your current verison of ubuntu like 14.04 to 14.14 for expmple though ther might not be a 14.14 version of ubuntu!!! Thank you for the question!


Unable to locate ntpd package I am trying to install ntp for my server. However, on running sudo apt-get install ntpd
i get the response Unable to locate package ntpd. I have run sudo apt-get update and the problem still remains

Install ntp server

Type the following command:

apt-get install ntp

Try the following sequence :

sudo apt-get update

then

sudo apt-get install ntp

will be succeeded...


Ubuntu upgrade to 13.04 won't let me connect to wi-fi (or to Ethernet) After upgrading my Acer Aspire 4810T to Ubuntu to 13.04 32bit connection to any wi-fi (or Ethernet) usually fails. Sometimes, maybe once in five tries, rebooting may resolve the problem. Contrary to some other related posts, the proximity of the wifi station doesn't seem to have an impact on the problem.
The wi-fi application indicator in the notification area at top bar of the screen keeps on entering and exiting and the whole system gets very slow. When I click any application indicator their menus often appear empty. Running any program usually quickly freezes the whole system which makes searching the culprit from logs very challenging.
My network card is: Intel WiFi Link 5100 AGN.
The same laptop worked fine with previous Ubuntu version and at the moment it works fine with Windows Vista. With Virtualbox and Windows Vista as a host and 13.04 as a guest it works ok, though slowly.
dmesg shows a long list of network-manager kills and respawns

[   33.224314] init: network-manager main process (862) killed by ABRT
signal [   33.224361] init: network-manager main process ended,
respawning [   33.709347] init: network-manager main process (1307)
killed by ABRT signal [   33.709393] init: network-manager main
process ended, respawning

apport-unpack shows that the NetworkManager has Crashed (ProcCmdline and ProblemType)
apport-unpack also shows warnings in WiFiSyslog

/sys/devices/virtual/net/lo: couldn't determine device driver;
ignoring.. Trying to remove a non-existant call id.

and hints for a firmware bug

May  1 15:31:49 sauli-Aspire-4810T kernel: [  614.465977] atl1c
0000:01:00.0: vpd r/w failed.  This is likely a firmware bug on this
device.  Contact the card vendor for a firmware update.

Any suggestions, where to start looking for the real problem and how to correct it?

Try to use these commands in a Terminal (Ctrl+Alt+T):

sudo apt-get remove bcmwl-kernel-source
sudo apt-get install bcmwl-kernel-source

Or use purge instead of remove to wipe it, then re-install.

remove network manager and reinstall it using a debian file which you can easily download. and everything will work well. it worked for me on 32 bit.


Remote login onto server and let someone else see your shell? I remember that I was logged in into my server and my friend connected. Some command let him see my shell and see what I am typing.
What command was that ?

Take a look at the screen command, and its multiuser mode.

Ctrl-a :multiuser on    Make the screen session a multi-user session (so other users can attach).
Ctrl-a :acladd USER     Allow the user specified (USER) to connect to a multi-user screen session.

http://wiki.networksecuritytoolkit.org/nstwiki/index.php/HowTo_Share_A_Terminal_Session_Using_Screen

http://www.gnu.org/software/screen/

http://www.gnu.org/software/screen/manual/html_node/Multiuser-Session.html

Maybe the 'ps' command? It will list out what processes are running and can show the processes of other users. I generally run 'ps -ef'


How to install openjdk 7 on ubuntu 18.04 Today I try to install openjdk 7 on my ubuntu 18.04 system. It always install oracle-java8-installer instead openjdk 7. Please help me

apt-get install openjdk-7-jre

Here you got a very good answer with a step-by-step instruction:
Download it here from Oracle.

I have installed OpenJDK 1.7 on Ubuntu 18.04

Step 1. Install OpenJDK 1.7

sudo dpkg -i https://packages.debian.org/sid/libjpeg62-turbo
sudo dpkg -i https://packages.debian.org/experimental/openjdk-7-jre-headless
sudo dpkg -i https://packages.debian.org/experimental/openjdk-7-jre
sudo dpkg -i https://packages.debian.org/experimental/openjdk-7-jdk

Step 2. Switch to OpenJDK 1.7

export PATH=/usr/lib/jvm/java-7-openjdk-amd64/bin:$PATH

Note: If you want to use javac command instead of openjdk 1.7, use below command

sudo update-alternatives --config java


Change default shell when user not in /etc/passwd Any ideas on how can I change the shell to fish?
$ sudo usermod -s /usr/bin/fish jaan
usermod: user 'jaan' does not exist in /etc/passwd
$ getent passwd $USER
jaan:x:15466:94:Jaan A:/home/jaan:/bin/zsh

Related questions: user does not exist in /etc/passwd when trying to change the default shell
Seems like it uses ldap.
$ cat /etc/nsswitch.conf
passwd:         compat ldap
group:          compat ldap
shadow:         compat ldap

# Having the NOTFOUND=return bit was breaking dns resolution on web1 and web2. But we probably
# don't want any of the mdns stuff so let's get rid of it all.
#hosts:          files mdns4_minimal [NOTFOUND=return] dns mdns4
hosts:          files dns

networks:       files

protocols:      db files
services:       db files
ethers:         db files
rpc:            db files

netgroup:       ldap
automount:      ldap

So I installed ldap relevant package.
$ chsh.ldap
LDAP password for jaan:
Enter the new value, or press ENTER for the default
  Login Shell [/bin/zsh]: /usr/bin/fish
Traceback (most recent call last):
  File "/usr/bin/chsh.ldap", line 69, in <module>
    constants.NSLCD_USERMOD_SHELL: shell,
  File "/usr/share/nslcd-utils/nslcd.py", line 128, in usermod
    assert con.get_response() == constants.NSLCD_RESULT_BEGIN
  File "/usr/share/nslcd-utils/nslcd.py", line 103, in get_response
    return self.read_int32()
  File "/usr/share/nslcd-utils/nslcd.py", line 71, in read_int32
    return _int32.unpack(self.read(_int32.size))[0]
struct.error: unpack requires a string argument of length 4
$ which fish
/usr/bin/fish
$ chsh.ldap
LDAP password for jaan:
Enter the new value, or press ENTER for the default
  Login Shell [/bin/zsh]: "/usr/bin/fish"
/usr/bin/chsh.ldap: "/usr/bin/fish" is an invalid shell
$ /usr/bin/fish
(standard_in) 1: syntax error
Welcome to fish, the friendly interactive shell

Here is a hint : /usr/bin/chsh.ldap: "/usr/bin/fish" is an invalid shell.
It seems that you should add /usr/bin/fish to /etc/shells.

To quote ajmitch here,

  You can set fish as your default shell by running
  chsh -s which fish
  Then log out and back in.
  (To set it back to bash, you need to use Fish syntax of course, like this chsh -s (which bash))

Just use chsh -s which fish And make sure to log out and log back in or restart you computer.

By the way this could be a possible duplicate here: How do I set fish as the default shell?