Deleting copied sys and proc folders within a subdirectory in Linux

On my working 16.04.6:

walt@bat:~(0)$ ll -d /proc /sys
dr-xr-xr-x 309 root root 0 Jan  1 23:15 /proc
dr-xr-xr-x  13 root root 0 Jan  1 23:15 /sys

Depending on how you copied them, they MAY have kept the root:root ownership, and probably did preserve the dr-xr-xr-x permissions.

So, to delete the copies, you'll have to:

sudo rm -rfv subdirectory/{proc,sys}


/usr/bin/x86_64-linux-gnu-ld: cannot find -lGL

At first it is very strange that you have Qt in /opt.

The correct way would be to install Qt 5.9.5 and other development packages from repository:

sudo apt-get install qt5-default build-essential checkinstall \
libc6-dev libssl-dev libexpat1-dev libgl1-mesa-dev libqt4-dev \
libavcodec-dev libavutil-dev pkg-config

Then compile your program with

g++ HalloWelt.cpp $(pkg-config --cflags Qt5Widgets) $(pkg-config --libs Qt5Widgets) -fPIC -o HalloWelt

And run with

./HalloWelt

If you want to fix only -lGL error you should install one package:

sudo apt-get install libgl1-mesa-dev


gVIM has too much space between characters

Try another font.

http://vim.wikia.com/wiki/Change_font:

  In gvim, you can change the font using the Edit menu, Select Font. An
  alternative is to enter the command:

:set guifont=*

  Once you have a font you like, you want to make it the default in the
  future. Do

:set guifont?

  and Vim will display something like

guifont=Lucida_Console:h11

  Make a note of this string. Now put a line in your vimrc to set
  guifont to this value, like this:

if has('gui_running')
  set guifont=Lucida_Console:h11
endif

  Note: If there is a space in the text printed, such as

guifont=Monospace 10

  it will be necessary to escape the space

set guifont=Monospace\ 10


reverting from emacs keybindings in chrome

I've documented this in bug 985834.

The heart of the resolution is this:

  This was not, in the end, a chromium-browser problem but a gnome problem. Oddly, gconftool showed the problem fixed when it wasn't. But gnome-tweak-tool showed the key bindings still to be emacs, and changing that back to Default fixed the problem immediately.


I have a problem with firefox-developer. No I can create a firefox-developer.desktop in desktop

Instead of touch, you could use cp of your existing firefox .desktop file and modify it, specifying path to firefox dev binary:

sudo cp /usr/share/applications/firefox.desktop /usr/share/applications/firefox-developer.desktop

sudo vim.tiny /usr/share/applications/firefox-developer.desktop

I've changed the next:

Name=Firefox Web Browser Developer
Exec=/opt/firefox/firefox %u
Exec=/opt/firefox/firefox -new-window
Exec=/opt/firefox/firefox -private-window

Check your /opt/firefox folder for firefox binaries you could use to launch it.


GRUB boot loader install fails after apt upgrade Ubuntu 20

Apologies, I cannot comment yet.
You can try to fix the grub as I explain here.


Unfortunately iTunes does not run very well in Linux. You may be able to run an old version through wine, which you have tried through playonlinux. The other option is to run in virtual machine, you tried it on virtualbox but you could try on VMware player. If I remember correctly, VMware player has support for usb 3.0. VMware player is also free and I have always felt that it was faster than virtualbox too so I recommend you try VMware player.

If that does not work you would probably have to use a windows machine. However If all you want is to transfer some music to an iPod you could use rhythmbox


For venvs you will probably want them in a sub-directory of $HOME to avoid issues with security restrictions in apparmor or containers like docker.

Note the restrictions in this file:

/etc/apparmor.d/abstractions/python

In theory you could put them in /opt but venvs are really user specific and are expected in the users home directory.  Local isn't an option due to other distribution restrictions and the fact that /usr is offically assume to be shared on a network by the LSB.

I personally follow a modified version of the golang structure.

~build/
       +$language/
                +bin/
                |    venv/
                |      |---Python2.7
                |      +---Python3.6
                +pkg
                +src/
                    |
                    +--- my_work/..
                    |          |---repo1
                    |          +---other_project
                    |
                    +-- external-repo.com/..

This makes it easy to find and move content and it is compatible with the restrictions placed by security models, cgroups other restrictions that will become more critical as containers gain popularity.

Remember that venvs were original intended to be contained within the projects directory.  While realities on the core OS dependencies and major version changes have increased their use it is still preferable to keep them as close to the individual package, process, or user as possible.


How can I add an Ubuntu 16.04 desktop to a Windows active directory which is XXXX.local?

In the end I used PBIS:

https://github.com/BeyondTrust/pbis-open

I needed to install SSH, remove avahi-daemon and then follow the PBIS installation instructions.

It has successfully joined the domain even though it is a .local one.

I am now working on getting the domain user login to work!


Errors were encountered while processing: libxau-dev:amd64

Solved in the comments by using the mainserver via

sudo sed -i 's/http:\/\/in\./http:\/\//' /etc/apt/sources.list
sudo apt-get update
sudo apt-get clean
sudo apt-get purge libxau-dev
sudo apt-get install libxau-dev


Remember Ubuntu password but ask for sudo confirmation

No, there is no way to do this. If you enable sudo without a password (How to run sudo command with no password?), then any process you run can execute sudo and run code as root without any confirmation.


Environment variable vs Shell variable, what's the difference?

An environment variable is a globally available, in a program and it child programs. A shell variable is only available in the current shell. To make a shell variable available as an environment variable, use export VARNAME (without dollar $).

Examples for clarification:

$ SOME=VAR # define shell variable $SOME
$ echo $SOME
VAR
$ env | grep SOME # note: no output
$ export SOME # turn $SOME into an environment variable
$ env | grep SOME
SOME=VAR

Another way to define an environment variable:

$ export ANOTHER=VALUE
$ echo $ANOTHER
VALUE
$ env | grep ANOTHER
ANOTHER=VALUE


How to fully cancel changes due to installation of software that require complex procedures?

If you have installed the package from source file you need to manually remove all the files inserted into the system by the package.

For future reference i would suggest you to install packages from official repositories. If for some reason you need to install from source always use checkinstall instead of make install.

make install simply copies file all over the system without any feasible method of tracking down them later, while using checkinstall the files that would be copied into the system is made as a package first by checkinstall. So dpkg can keep keep track of the files as they are under a package then hence while removing just sudo dpkg -r package will be enough to remove the package (and clean the files).

If checkinstall is not installed already, install it by:

sudo apt-get install checkinstall

Now the common installation procedure from source file can take the following form:

./configure
make
sudo checkinstall

Now checkinstall will in turn call make install and will make a package out of the files first.


What's the best way to disconnect USB printer from laptop

Right click on the printer from, then click the Enable toggle to disable the printer.  When you're ready to use it again, right click and put the checkmark back, to toggle it back to enabled.

You can bring up the printer icon though System Settings -> Printers.


Remove an Extra Entry for Windows 7 in BURG or GRUB?

You should definitely try this new application, it's called Grub Organizer. Here's its Launchpad page: https://launchpad.net/grub-customizer .


gdm only starts an xterm; how to get back my desktop?

I fixed it thanks to https://askubuntu.com/a/42954/42522

sudo apt-get install --reinstall gnome-session

Apparently removing Evolution before the upgrade also removed some critical components.


Unity Lens Google Chrome Icon Will Not Go Away

Open System Settings, Choose Privacy (Security and Privacy in 14.04), There you can delete history as well as turn off maintaining history for certain items. In 14.04 this is under the Files and Applications tab


I had the same problem, but GNOME PPP has solved it. It looks like your modem type is CDMA.

What you should do if your modem is CDMA:

Install gnome-ppp from Ubuntu Software Center.
Connect USB Modem.
Open the terminal and type:

sudo gnome-ppp

Open Setup and select Detect button (try it 5-6 times if it cannot detect your modem, if still it can't detect  then reconnect your modem or restart OS).
If your modem is successfully detected, click Close and enter Username, password, dialup number.
If it can't connect, then try 5-6 times, if still it can't connect then reconnect modem or restart OS and go to 2nd point.
If it fails when "Waiting for prompt", then your Username or password or Dial up number is incorrect.

For other GSM modems use Sakis3G.


Not able to use workspaces in ubuntu 20.04. Toogle workspace gnome extention is showing error can anyone help me?

Please note that the workspace extension you mention, and the link you mention for workspaces both come from Ubuntu 11, running Unity.
Things have changed - your running gnome, and Ubuntu 20.04
this link will give you information about how workspaces run in today's systems.
If you use extensions to change the workspaces, please look for extensions compatible with gnome 3.36 or higher


How to disable shutdown/reboot from lightdm in 14.04?

I think I've found the cause: the action seems to have changed to "org.freedesktop.login1.reboot" (and the-like).

Adding the following lines as /etc/polkit-1/localauthority/50-local.d/restrict-login-powermgmt.pkla works:

[Disable lightdm PowerMgmt]
Identity=unix-user:*
Action=org.freedesktop.login1.reboot;org.freedesktop.login1.reboot-multiple-sessions;org.freedesktop.login1.power-off;org.freedesktop.login1.power-off-multiple-sessions;org.freedesktop.login1.suspend;org.freedesktop.login1.suspend-multiple-sessions;org.freedesktop.login1.hibernate;org.freedesktop.login1.hibernate-multiple-sessions
ResultAny=no
ResultInactive=no
ResultActive=no

You still see a confirmation dialog but there are not buttons to confirm. Looks ugly, but works ;)

Unfortunately this applies to all users, not only the lightdm session, so you have to add a second rule to white-list them if desired.

Note that this method block solely reboot/etc commands issued from GUI. To block reboot/etc commands from command line one may use molly-guard - as explained in Disabling shutdown command for all users, even root - consequences?


how to install KDE icon theme in ubuntu? (ROSA Icons)

Different Desktop Environments (Gnome, KDE, XFCE, LXDE, etc.) have different Icon Themes which cannot be used in another DE. It is possible to "migrate" icon themes from one to another but it is a long and winding road which you can of course take and even share the result with other users through sites such as gnome-look.org


RAM size minimum required for Dual booting windows 10 and ubuntu 18.04

With dual-booting, the two OS's are not running at the same time, so RAM is not a factor, as long as you have enough to run one OS at a time. Ubuntu and Windows 10 need 2GB, so you're good to go.

Though if you do want to run both OS's at a time, you could run one inside the other on a virtual machine (e.g. using VirtualBox).


You can easily upgrade over the network with the following procedure.

Launch the update manager.
Click the Check button to check for new updates.
If there are any updates to install, use the Install Updates button to install them,   and press Check again after that is complete.
A message will appear informing you of the availability of the new release.

For 10.04LTS users you need to check the "Release upgrade - Show new distribution releases" drop-down to make sure "Long term support releases only" is selected, and change it if otherwise. See the Trouble-shooting section below for more details. Please see the trouble-shooting section for the special case for LTS users between 12.04 and the release 12.04.1

Click Upgrade.
Follow the on-screen instructions.

See Also:

https://help.ubuntu.com/community/PreciseUpgrades for more information on some alternate methods of upgrading for certain cases.


Is there a command line tool to get the list of content of current kernel used in my Ubuntu?

There is no such universal command. Linux kernel contains very many device drivers.

Generally in-tree device drivers don't have a separate "version". Their version is the kernel version.

You can find all the details about the driver in kernel sources.


. Erase sda1 and sda2, create new sda1 as ext4 primary with mountpoint at /
. sda3 is kept as originally partitioned and formatted with ntfs

This is correct if you will stay with MBR partitioning. Nothing wrong with that in most cases. UEFI installations require an additional, small, EFI partition made as FAT32, and those default to the newer GPT partitioning method,  but you do not need to do that.

GPT can be useful in some cases, since MBR limits you to a maximum of four Primary or Extended partitions; to exceed four, you have to add Logical partitions underneath an Extended partition. GPT does not have such a limit; everything's Primary, no Extended, no Logical.

Do I rename sda3 to sda2 or does Ubuntu also create a loader partition sda2?

Don't worry about the numbering of the partitions, it is all handled automagically.

I think that I have enough ram so I thought that I would forgo the swap partition.

Installation of modern versions of Linux (since Fall of 2017) automagically create a swap file instead of a swap partition. You can manage a swap file far easier than a swap partition, even on the fly without a reboot, and adjust the swappiness to reduce how often swap get touched.

Let the installer make the swap file for you and don't try to run without, as a system crash could ensue if you overrun RAM without a swap file. Swap death is no fun.

Should I someday change my "D: drive" to something besides ntfs?

Eventually, copy the contents of the NTFS partition to a native Linux partition (default is ext4 but there are others), erase, and reuse the space of the NTFS partition, as Linux does not have the best set of tools to deal with NTFS filesystem problems.

However, you left out the most important step: Backup.

Make a backup of your data, then verify the backup copy matches the original (checksums are great for this).  Then, make another backup to a different physical device (or into the cloud) and verify that.

Why? Changing drive partitions, deleting, creating, and formatting, is the easiest way to lose gigabytes of data with one mistake, brownout, blackout, or power spike.


How to Install Ubuntu from iso file using grub1

You can boot the USB from grub prompt if you want. While you are on grub, press C to bring grub command prompt. Then type these commands. (I'm assuming your USB drive is /dev/sdb1).

root=/dev/sdb1
linux /casper/vmlinuz file=/cdrom/preseed/ubuntu.seed boot=casper  quiet splash --
initrd /casper/initrd.lz
boot

After typing the boot, hit Enter to boot from the USB. It should load the Live environment and you should install now.

You can also directly boot from the iso image without even extracting the files. Check this question below:

Install Ubuntu from iso file using grub2


Nvidia drivers on Ubuntu 12.10 don't work on my Mac Mini

Ubuntu 12.10 runs it best on nvidia 313 driver.

Do this commands:

sudo add-apt-repository ppa:xorg-edgers/ppa
sudo apt-get update

Then go to your additional driver page and select the nvidia 313 driver(can be that the page isn't updated, just reboot than).
Wait until the driver is installed and reboot.


Really, the best way to tell is to create a bootable USB stick, run it and see. You can run Ubuntu without installing it, from the USB stick. This will tell you if your graphics card, wifi etc will work, before you install.

Get Ubuntu here : https://www.ubuntu.com/download/desktop

Instructions on the bootable usb here : https://tutorials.ubuntu.com/tutorial/tutorial-create-a-usb-stick-on-ubuntu?_ga=2.77815837.844715256.1509442432-1433623884.1509442432#0

Hope it all goes well for you.


If you still have access to the projector, reconnect it, then sing-in, and from Display Manager you can handle this, otherwise - reboot the machine.


Pandaboard crash on startup or freeze after minutes

I've also experienced the same symptoms but cured with disabling ondemand frequency scaling on my panda ES.

As Xavier replied already to some guy in their October release announcement thread, I did the remedy as followings.

Edit file: /etc/init.d/ondemand
Comment line:

        echo -n ondemand > $CPUFREQ

I've, also, running test with panda board and seems to be no problem with proper cooling.
Without cooling such as fan or heat sink, 11.10 oneiric with TI ppa enhancement also failed some times on this board.

I know omap4460 use lower clock frequency than omap4430 due to chip revision issue in boot code.
This problem should be related to maximum clocks allowed for safe operation, I think.


I have to run command 'sudo dhclient' after every restart or disconnecting from wifi

I had this problem too.  I found guidance from archlinux that suggested creating the file
/etc/NetworkManager/conf.d/dhcp-client.conf with the content
[main]
dhcp=dhclient

Rebooting with this configuration file generates the IPV4 addresses in the Network Manager.


Unable to change password Using chntpw in Ubuntu to reset Windows 7 Password

I've done the same using BackTrack 3 to clear Windows XP 64-bit and Server 2003 passwords. It is pretty straightforward, as long as you don't forget to save, and probably need to lock the account after clearing password to make sure it is enabled.

There are plenty of video tutorials on Youtube, for example: http://www.youtube.com/watch?v=emXP1eE9hUo


Your hardware seems to be outdated (Core2Duo). Ubuntu 16.04 requires 2GB of system memory, try adding some more RAM. Try downloading the ISO from Ubuntu's site to a USB stick. When you proceed to download the ISO, there are recommend system requirements. https://www.ubuntu.com/download


Chainload Windows 10 1909 UEFI on one disk using BIOS grub on other disk

Booting Ubuntu and Windows using grub with UEFI

I gave another try creating a new Ubuntu disk using UEFI and installed it next to the Windows disk. I then ran sudo update grub and now both the Linux disk and the Windows disk now boot from grub.


How to wrap the application to create sh file in Ubuntu Linux

OK, I think there is a misunderstanding as to what a ".sh" file is. This is a shell script, equivalent to a .bat file in DOS (but much more powerful), a piece of text that is read and executed by the program called "shell" (for example, bash). All you need to do is to save a text file and set the permissions to "executable". It might look like this:

#!/bin/bash

echo "Hello world"

Or, it might be a wrapper around a jar file:

#!/bin/bash

java -jar YourJarFile.jar

There are ways to encode a binary file into a shell script such that when the shell script is run, it will create the binary file -- a kind of self-extracting archive. But it is not possible to "convert jar to sh". Also, it is kind of useless.

You can just carry your jar file around. Wrapping it around in a shell script is not really useful, since running it is as simple as writing

java -jar YourJarfile.jar


SSD for OS and Programs, Spanned Multiple HDD's for storage (Home Server)

You need to install ZFS, nothing else you do will compare to its performance. NOTHING. Its also perfect for what you are doing; as I am doing that very same thing and under quite a load.  zfsonlinux.org


AttributeError: /usr/lib/libgdal.so.1: undefined symbol: OGR_F_GetFieldAsInteger64

Try adding ubuntugis-unstable
sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable

sudo apt-get update

and install packages from it:
sudo apt-get install libgdal-dev

As ppa:nextgis/dev caused me a some trouble when installing sp package here and seem to also cause there


sort a file based on the field 3 of the file contents

Using sort and awk

Suppose your date format is the following

08/03/2015 –> Day, month, year

using the command below.

It's one command (note the \ at the end of the lines)
Replace your_input_file with your file name.

The command

awk '{for (i=1;i<=NF;i++) {if (i==3) {printf "%s/%s/%s\t",substr($3,7,4),substr($3,4,2),substr($3,1,2)} else {printf "%s\t",$i}} printf "\n"}' your_input_file |\
sort -k3 -k4 |\
awk '{for (i=1;i<=NF;i++) {if (i==3) {printf "%s/%s/%s\t",substr($3,9,2),substr($3,6,2),substr($3,1,4)} else {printf "%s\t",$i}} printf "\n"}'

Breakdown

The first awk command corrects the date from day/month/year

08/03/2015

to year/month/day

2015/03/08

The sort command sorts the new structure
The second awk makes changes to the first awk undo

If your date format isn't day/month/year, you have to change the part

substr($3,7,4),substr($3,4,2),substr($3,1,2)

and
substr($3,9,2),substr($3,6,2),substr($3,1,4)

Explanation

substr(field,start_position,length)

field

do not change, it's the third column
start_position, length

return a substring from start_position with a length of length

Example

The input file foo

cat foo

090100010000481074      1       08/03/2015 09:35:17.934 LA150803000AJSX00000    LA150803000AJSX CRBP    Buy     ELF     100     1980000 119     3       2       1890000 119     100     2040000 119     100     1980000 119     1000   #Q  2
090100010000481074      1       07/03/2015 09:35:15.934 LA150803000AJSX00000    LA150803000AJSX CRBP    Buy     ELF     100     1980000 119     3       2       1890000 119     100     2040000 119     100     1980000 119     1000   #Q  2
090100010000481074      1       07/03/2015 09:35:17.934 LA150803000AJSX00000    LA150803000AJSX CRBP    Buy     ELF     100     1980000 119     3       2       1890000 119     100     2040000 119     100     1980000 119     1000   #Q  2
090100010000481074      1       08/03/2015 09:35:15.934 LA150803000AJSX00000    LA150803000AJSX CRBP    Buy     ELF     100     1980000 119     3       2       1890000 119     100     2040000 119     100     1980000 119     1000   #Q  2
090100010000481074      1       08/03/2016 09:35:17.934 LA150803000AJSX00000    LA150803000AJSX CRBP    Buy     ELF     100     1980000 119     3       2       1890000 119     100     2040000 119     100     1980000 119     1000   #Q  2
090100010000481074      1       03/07/2016 09:35:15.934 LA150803000AJSX00000    LA150803000AJSX CRBP    Buy     ELF     100     1980000 119     3       2       1890000 119     100     2040000 119     100     1980000 119     1000   #Q  2
090100010000481074      1       07/03/2016 09:35:17.934 LA150803000AJSX00000    LA150803000AJSX CRBP    Buy     ELF     100     1980000 119     3       2       1890000 119     100     2040000 119     100     1980000 119     1000   #Q  2
090100010000481074      1       08/03/2015 09:35:15.934 LA150803000AJSX00000    LA150803000AJSX CRBP    Buy     ELF     100     1980000 119     3       2       1890000 119     100     2040000 119     100     1980000 119     1000   #Q  2

The output of

awk '{for (i=1;i<=NF;i++) {if (i==3) {printf "%s/%s/%s\t",substr($3,7,4),substr($3,4,2),substr($3,1,2)} else {printf "%s\t",$i}} printf "\n"}' foo | sort -k3 -k4 | awk '{for (i=1;i<=NF;i++) {if (i==3) {printf "%s/%s/%s\t",substr($3,9,2),substr($3,6,2),substr($3,1,4)} else {printf "%s\t",$i}} printf "\n"}'

090100010000481074  1   07/03/2015  09:35:15.934    LA150803000AJSX00000    LA150803000AJSX CRBP    Buy ELF 100 1980000 119 3   2   1890000 119 100 2040000 119 100 1980000 119 1000    #Q  2
090100010000481074  1   07/03/2015  09:35:17.934    LA150803000AJSX00000    LA150803000AJSX CRBP    Buy ELF 100 1980000 119 3   2   1890000 119 100 2040000 119 100 1980000 119 1000    #Q  2
090100010000481074  1   08/03/2015  09:35:15.934    LA150803000AJSX00000    LA150803000AJSX CRBP    Buy ELF 100 1980000 119 3   2   1890000 119 100 2040000 119 100 1980000 119 1000    #Q  2
090100010000481074  1   08/03/2015  09:35:15.934    LA150803000AJSX00000    LA150803000AJSX CRBP    Buy ELF 100 1980000 119 3   2   1890000 119 100 2040000 119 100 1980000 119 1000    #Q  2
090100010000481074  1   08/03/2015  09:35:17.934    LA150803000AJSX00000    LA150803000AJSX CRBP    Buy ELF 100 1980000 119 3   2   1890000 119 100 2040000 119 100 1980000 119 1000    #Q  2
090100010000481074  1   07/03/2016  09:35:17.934    LA150803000AJSX00000    LA150803000AJSX CRBP    Buy ELF 100 1980000 119 3   2   1890000 119 100 2040000 119 100 1980000 119 1000    #Q  2
090100010000481074  1   08/03/2016  09:35:17.934    LA150803000AJSX00000    LA150803000AJSX CRBP    Buy ELF 100 1980000 119 3   2   1890000 119 100 2040000 119 100 1980000 119 1000    #Q  2
090100010000481074  1   03/07/2016  09:35:15.934    LA150803000AJSX00000    LA150803000AJSX CRBP    Buy ELF 100 1980000 119 3   2   1890000 119 100 2040000 119 100 1980000 119 1000    #Q


It's working fine after deleting ~/.config/evolution/sources


Is there a way to start the screensaver by clicking on something?

Turn screen off

The display can be turned off by a command:

xset dpms force off

About the command - man xset:

DESCRIPTION
       This program is used to set various user preference options of the display.

       -dpms   The -dpms option disables DPMS (Energy Star) features.

       +dpms   The +dpms option enables DPMS (Energy Star) features.

       dpms flags...
               The dpms option allows the DPMS (Energy Star) parameters to be set.  The option can take  up  to
               three  numerical values, or the `force' flag followed by a DPMS state.  The `force' flags forces
               the server to immediately switch to the DPMS state specified.  The DPMS  state  can  be  one  of
               `standby',  `suspend', `off', or `on'.  When numerical values are given, they set the inactivity
               period (in units of seconds) before the three modes are activated.  The first value given is for
               the  `standby'  mode, the second is for the `suspend' mode, and the third is for the `off' mode.
               Setting these values implicitly enables the DPMS features.  A value of zero disables a  particu‐
               lar mode.

Turn the screen saver/locker on

The KDE screen saver/locker can be turned on by command:

qdbus org.kde.ksmserver /ScreenSaver SetActive true

The command will launch the screen saver or locking depending the user settings. KDE System Settings > Display and Monitor > Screen Locker.

About the qdbus - man qdbus:

NAME
       qdbus - a communication-interface for qt-based applications

SYNOPSIS
       qdbus [--system] [--literal] [servicename] [path] [method] [args]

DESCRIPTION
       qdbus provides an interface to Qt-based applications communicating over D-Bus.  See http://www.freedesk‐
       top.org/software/dbus/ for more information about the big picture.

       By default qdbus will list all service names of services that are running and you can manipulate at  the
       moment.  You can also manipulate and run several types of methods for each dbus-enabled application.

More: https://techbase.kde.org/Development/Tutorials/D-Bus/Introduction

Command to button

The KDE has the menu editor: https://docs.kde.org/stable/en/kde-workspace/kmenuedit/

After the command has a launch button the button can be transfered from the KDE menu to the desktop or to the panel.

Alternative is to add a plasma widget - On/Off Switch: http://kde-apps.org/content/show.php/On/Off%20Switch?content=116323

and add the plasma widget to the desktop/panel.

Binaries from the Ubuntu PPA: https://launchpad.net/ubuntu/+ppas?name_filter=plasma-widget-on-off-switch


Need help rescuing Kubuntu 19.10 from graphics snafu

After beating my head against this problem for a day, I stumbled across my own solution. I had uninstalled and reinstalled the nouveau and nVidia drivers available (390, 430, 435) in the repositories multiple times in various combinations without success.

Then, searching on the nVidia site I came across the latest driver; 440 as a manual install .run file. I downloaded it to my 19.10 installation using a live USB and installed it from my the command line. It complained a couple of times, but I finally got it installed and KDE came back to life.

An interesting side effect of this is that, during the install, it asked if I wanted to install 32-bit libraries (yes), and now Steam, which I could never get working in 19.10, works just fine.


How to install the gedit markdown-preview plugin on 14.04?

This plugin is written for Python 2, but since gedit 3.8, only Python 3 plugins are supported. So some small changes are required.

Modify the installer (gedit-markdown.sh) to install the python3 markdown module:

This is a patch that you can apply on the existing file (or you can just copy the full modified version available here):

--- gedit-markdown_ori.sh   2014-05-14 16:14:58.386700310 +0200
+++ gedit-markdown.sh   2014-05-14 15:42:21.038783248 +0200
@@ -263,7 +263,9 @@

 # Note: sous Archlinux, «/usr/bin/python» correspond à Python 3. On teste donc les
 # chemins pour Python 2 en premier.
-if type -p python2.7 > /dev/null; then
+if type -p python3 > /dev/null; then
+   binPython=$(type -p python3)
+elif type -p python2.7 > /dev/null; then
    binPython=$(type -p python2.7)
 elif type -p python2.6 > /dev/null; then
    binPython=$(type -p python2.6)
@@ -287,15 +289,15 @@
            cheminPythonMarkdown=python-markdown/python2
            cheminPythonSitePackages=$("$binPython" -m site --user-site)
        fi
-#  elif [[ ${versionPython:0:1} == 3 ]]; then
-#      compareVersions "$versionPython" "3.1"
-#
-#      if [[ $? == 2 ]]; then
-#          bonneVersionPython=false
-#      else
-#          cheminPythonMarkdown=python-markdown/python3
-#          cheminPythonSitePackages=$("$binPython" -m site --user-site)
-#      fi
+   elif [[ ${versionPython:0:1} == 3 ]]; then
+       compareVersions "$versionPython" "3.1"
+
+       if [[ $? == 2 ]]; then
+           bonneVersionPython=false
+       else
+           cheminPythonMarkdown=python-markdown/python3
+           cheminPythonSitePackages=$("$binPython" -m site --user-site)
+       fi
    else
        bonneVersionPython=false
    fi

Run ./gedit-markdown.sh install

You should see python 3.4 instead of 2.7:

############################################################
##
## Installation of gedit-markdown
##
############################################################

## First step: check dependencies

- gedit: 3.10.4
- Python: 3.4

[...]

Change the plugin loader to python3

Replace /home/aarold/.local/share/gedit/plugins/markdown-preview.plugin with:

[Plugin]
Loader=python3
Module=markdown-preview
IAge=3
Name=Markdown Preview
Name[fr]=Aperçu Markdown
Description=Show the HTML version of the Markdown text you're editing
Description[fr]=Affiche l'aperçu en HTML du document Markdown en cours d'édition
Authors=Michele Campeotto <micampe@micampe.it>\nJean-Philippe Fleury <contact@jpfleury.net>
Copyright=Copyright © 2005, 2006 Michele Campeotto\nCopyright © 2009, 2011-2012 Jean-Philippe Fleury
Website=http://www.jpfleury.net/logiciels/gedit-markdown.php

Convert /home/aarold/.local/share/gedit/plugins/markdown-preview/__init__.py to python3:

Run:

2to3 -w /home/aarold/.local/share/gedit/plugins/markdown-preview/__init__.py

Finally open this file and edit line 86 (remove the binary mode, "wb" -> "w"):

with open(confFile, "w") as confFile:

Activate the plugin in Gedit as you did.


Is there anything like Unity's "lenses" in GNOME 3?

I think it is not possible to install lenses in gnome3. But I have a solution for you.
It is possible to install more then one desktop interface. As you know, Ubuntu has been using gnome3 since version 17.10, but it is possible to install unity next to gnome3.

https://linuxconfig.org/how-to-install-unity-desktop-on-ubuntu-18-04-bionic-beaver-linux

Regards.


Same problem encountered. fixed !by turn off 3D Acceleration in vmware.
Go to "Virtual Machine Settings" , click "Display",then Uncheck "Accelerate 3D graphics"
enjoy!


No internet connection on Dell Mini 9 after upgrade

According to the  Ubuntu Certification Page Ubuntu is compatible with 10.04 LTS (with notes) those notes say:

  Proprietary drivers required
  Installation of a proprietary driver is required for wireless network (WiFi) functionality.

You will need to download and install these drivers for the wireless network connections to work. I know that's not possible on this machine to "download" anything - however there are plenty of questions which outline How to install packages offline. The package you will need for this to work is bcmwl-kernel-source.


ctrl+r-shift and ctrl+l-shift to toggle direction

There is an Extension for Chrome and Firefox to switch the direction:

Switch Direction for Chrome and Chromium

Switch Direction for Firefox

After Installing the extension:

Go to the settings and turn on Enable Switch Direction with Ctrl+Shift+X
Restart the browser.

Now you can switch direction by pressing ctrl + shift + x


Add this to the /etc/init.d/postgresql-9.6:

### BEGIN INIT INFO
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
### END INIT INFO

and run sudo systemctl enable postgresql-9.6 again.


Installing Ubuntu on (c. 2012) Macbook Pro

Below is the sequence of steps needed to finish installing Ubuntu on a Mac. I assume you installed Ubuntu to use EFI booting.

Boot to Ubuntu live.
From the Desktop, press the control+option+T keys to open a Terminal window.
Enter the command shown below.

sudo  fdisk  -l  /dev/sda

Below is the output I saw from entering this command.

  Note: For a better view, click on the image or open the image in a new window.

From the output of the sudo fdisk -l /dev/sda command, determine the device for the EFI System partition. For me, this was /dev/sda1. If you determine a different device, make the appropriate substitutions.
Enter the commands given below to make Ubuntu appear in the Startup Manager.

sudo  bash
mkdir  efi
mount  /dev/sda1  efi
cd  efi/EFI
mkdir  BOOT
cp  ubuntu/grubx64.efi  BOOT/bootx64.efi
cd  ~
umount  efi
rmdir  efi
exit
exit

Shutdown Ubuntu live.
Startup the Mac and immediately hold down the option key until the Startup Manager icons appear.
Click on the hard disk icon labeled "EFI Boot". Next, while holding down the control key, click on the circular arrow below this icon.

You are finished. Your Mac will now automatically boot to Ubuntu on startup and restart.


NO ,you will not have to download drivers(sound,wireless.LAN) for Lenovo G570 to run ubuntu.But You must need to download and install graphics drivers.


How do I install Red5 using apt-get? Getting sub-process error

Installing a server has nothing to do with luck. Either it works or not. Software isn't magic. For this reason, first force to finish the installation, because with a broken package system you can't install other needed packages, if they are needed.

After that, you can solve the server start problem.

In a fresh Ubuntu 15.10 Wily (VM) installation is nothing more to do than

sudo apt-get install red5-server

All needed dependencies will be installed correctly. If you do not trust me, then I install Ubuntu again and give you the full output of the installation. ;)

However, if problems occur in an installation script, in your case in

/var/lib/dpkg/info/red5-server.postinst

then it is always a good idea to take a look at the script. If there is this line

set -e

replace with

# set -e

and run

sudo apt-get install -f

or find, where the server will be started, something like

invoke-rc.d red5-server start

and comment out the start procedure. And run

sudo apt-get install -f

Then you'll need to find out why the server fails to start, but the installation can be completed.


How do I get fsck to fix the errors it is reporting?

What additional switches are required to get fsck to correct these errors?

I don't know what you expect with -f and -E, but fsck do not fix but report if you don't ask him to fix. There are two options to fix the file system:

-a: This will fix errors found automatically.

Automatically repair the filesystem without any questions (use this option with caution).  Note that  e2fsck(8) supports -a for backward compatibility only.  This option is mapped to e2fsck's -p option which is safe to use, unlike the -a option that some filesystem checkers support.

-r: This will ask before fixing errors.

Interactively  repair the filesystem (ask for confirmations).  Note: It is generally a bad idea to use this option if multiple fsck's are being run  in  parallel.   Also  note  that  this  is e2fsck's default behavior; it supports this option for backward compatibility reasons only.

There's also -y but is not recommended:

For  some filesystem-specific checkers, the -y option will cause the fs-specific fsck to always attempt to fix any detected filesystem corruption automatically.  Sometimes an  expert  may  be able  to  do  better driving the fsck manually.  Note that not all filesystem-specific checkers implement this option.  In particular fsck.minix(8) and fsck.cramfs(8) do not  support  the  -y option as of this writing.

What exactly does this error mean (I am looking for something more informative than it was expecting one number but found another)?

Is there any documentation that describes this specific error message?

Actually,  fsck is simply a front-end for the various filesystem checkers (fsck.fstype) available under Linux.  The filesystem-specific checker is searched for in /sbin  first,  then  in  /etc/fs  and /etc, and finally in the directories listed in the PATH environment variable.  Please see the filesystem-specific checker manual pages for further details. So, for us to know, you have to tell us what filesystem are you checking.


Is there a way that I can make people have to input an administrators password to change the desktop background?

I don't know what your are doing and why they change your desktop background but you could let the other users only use the 'guest session' (a default feature -> the login screen shows a guest session login button) or create a separate user account for them (System Settings -> User Accounts).
Another solution but more a dirty hack:
You could set the background using a cronjob every ~5 min:
gsettings set org.gnome.desktop.background picture-uri "file:///usr/share/backgrounds/warty-final-ubuntu.png"


How to add extra memory space to "usr" partition in ubuntu 16.04?

Make a backup of your important data first. Then follow these instructions very carefully:

Boot the system from a Live disk or USB.
Use Gparted to create an extra EXT4-formatted partition from the unallocated 11Gb space after /dev/sda17. Let's say it is called /dev/sda18.
Create three temporary mount points, say /mnt/root, /mnt/usr/ and /mnt/usrlib.
Mount the existing root partition, /dev/sda9, on /mnt/root (this is necessary to modify /etc/fstab later on.)
Mount the existing partition containing /usr, that is /dev/sda13, on /mnt/usr/.
Mount the new empty partition /dev/sda18 on /mnt/usrlib.
Copy the whole of /mnt/usr/lib over to /mnt/usrlib. Make absolutely sure you have an exact copy (preferably, use rsync repeatedly until nothing is transferred).
Enter an extra line in /mnt/root/etc/fstab to mount /dev/sda18 on mount point /usr/lib.
Reboot.

If everything works, and you can verify that /usr/lib is mounted on /dev/sda18, you have two copies of /usr/lib. To remove the one that you no longer need, in order to free up space, do the following:

Reboot from a live disk.
Mount /dev/sda13 on a temporary mount point, say /mnt/usr.
Delete the contents of /mnt/usr/lib, but keep the empty directory, which will serve as the mount point.
Reboot.

Other Askubuntu users are encouraged to review this procedure and point out errors and omissions.


Shortcut for switching to previous and next window in Ubuntu?

If you want to switch between differents windows then you have to use
:

Alt+Tab: Switch between running applications

If you want to switch between differents workspaces, then use:

Ctrl+Alt+arrow: Move between workspaces

In case none works, I would suggest you to get a look at your default keyboard shortcuts, you may see and change them in Settings->Devices->Keyboard.


By default you get the session name (see marked area on the left side) as soon as you add another session  (you might have to wait for some time or refresh the status line with F5.

Also:

F8: Rename the current window.
Ctrl+F8: Rename the current session.


With Snap and Apt both existing, how do I backup all my apps so that I can restore it on a new machine

For snaps I think a Snapshot is the way to go.

For normal apt(.deb) software packages installed on your machine I think you could try these options:

Check your apt archive directory(/var/cache/apt/archives) to see if this contains any .deb file. Those .deb are the software package from the applications you have in your system. If so, copy these .deb file to a USB stick from example, restore them on the new machine and once these files are on the new machine install them using sudo dpkg -i *.deb
A second option if the previous step doesn't find anything would be to create the .deb for your current system, on console type:

sudo apt-get install dpkg-repack
mkdir repack
cd repack
dpkg-repack `dpkg --get-selections | grep install | cut -f1`

The above commands will create the .deb files from your current installed system in the repack directory, from there you could copy these file to an USB stick, then restore them on the new machine, and again, perform an sudo dpkg -i *.deb on the new machine to install these deb applications in there


What is the 'popularity-contest' package for?

It sends information about installed packages (but this is disabled by default, you can enable it using sudo dpkg-reconfigure popularity-contest) for package popularity/usage statistics.

https://help.ubuntu.com/community/UbuntuPopularityContest

http://popcon.ubuntu.com/

Package description:

The popularity-contest package sets up a cron job that will periodically
 anonymously submit to the Ubuntu developers statistics about the most used
 Ubuntu packages on this system.

 This information helps us making decisions such as which packages should go on
 the first CD. It also lets us improve future versions of Ubuntu so that the
 most popular packages are the ones which are installed automatically for new
 users.


Downgrade Ubuntu 18.04.3 kernel to original kernel

Ubuntu 18.04 was shipped with the 4.15 kernel.

Ubuntu 18.04 starting with .2 point release are shipped with HWE kernels.

HWE kernel versions are "rolling". Now it is 5.3. Kernel 5.0 is not supported any more on Ubuntu. If you did a normal upgrade on 18.04.3, you woild have the 5.3.

You can easily install the original 4.15 kernel by installing linux-generic meta package.

You an also install the current HWE kernel by installing linux-generic-hwe-18.04.

Beware that grub will always boot with the highest kernel version unless you select another one.

So if you want to use the current Ubuntu kernel, run

sudo apt install linux-generic-hwe-18.04

if you removed it previously. Then remove your mainline kernel.


Can not change DNS settings in Ubuntu 20 desktop

Don't know about the UI, but your netplan file should have something like this:
network:
  version: 2
  ethernets:
    ens50:
      dhcp4: true
      nameservers:
        addresses: [8.8.8.8]

See my answer for more details on working with netplan, and of course, the documentation.


Here is another tool called Safe Eyes for the same purpose:
sudo apt install safeeyes

Alternatively, you can install it from the PPA:
sudo add-apt-repository ppa:slgobinath/safeeyes
sudo apt-get update
sudo apt-get install safeeyes

Features:

Short breaks with eye exercises
Long breaks to change physical position and to warm up
Strict break for those who are addicted to computer
Do not disturb when working with fullscreen applications( Eg: Watching movies)
Disable the keyboard during break
Notifications before every break
Support multiple displays
Pause automatically if the system is idle
Optional audible alert at the end of breaks
Multi-language support

For more details: https://github.com/slgobinath/SafeEyes


What should I do to compare those decimals with a BC -l?

bc uses > and < for numeric comparisons.

Also keep in mind that bc outputs the truth value:

$ echo "2 > 1" | bc
1
$ echo "2 > 3" | bc
0

You have to do this:

if [[ $(echo "$promedio < 3.0" | bc -l) == "1" ]]; then
    echo Studen is low
elif [[ $(echo "3.0 <= $promedio && $promedio < 3.5" | bc) == "1" ]]; then
    ...

Or you can use bash's arithmetic conditional, which handles "0" as "false" and non-zero as "true":

if (( $(echo "$promedio < 3.0" | bc -l) )); then
    echo Studen is low
elif (( $(echo "3.0 <= $promedio && $promedio < 3.5" | bc) )); then
    ...


Upgrading Tex Live from 2015 to 2016 on Ubuntu 16.04 LTS

If you are happy to upgrade your system version of TeX Live you can install the very latest from a PPA. Add the PPA and install TeX Live from a Terminal as follows:

sudo add-apt-repository ppa:jonathonf/texlive-2016
sudo apt-get update
sudo apt-get install texlive

This installed with no issues on my own Xenial system:

andrew@athens:~$ tex --version
TeX 3.14159265 (TeX Live 2016/Debian)
kpathsea version 6.2.2
Copyright 2016 D.E. Knuth.
There is NO warranty.  Redistribution of this software is
covered by the terms of both the TeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the TeX source.
Primary author of TeX: D.E. Knuth.
andrew@athens:~$

And hopefully will install with no issues on your system as well :)

References:

PPA TeX Live 2016: Backport of TeX Live 2016 packages for LTS releases


Use additional uid and/or gid options, modify number according to your user id:

(..)
#removable  -fstype=ext2        :/dev/hddA
P -fstype=vfat :/dev/sdi1 uid=1000,gid=1000

See more options for fstab here:

https://help.ubuntu.com/community/Fstab

See more automount options here:

http://linuxconfig.org/automatically-mount-usb-external-drive-with-autofs


Your rsync command line was almost correct.

There should be no space after the commas in the exclude list,

sudo rsync -aAEHSXxv --progress --delete --exclude={/home/sterlingbutters/Butters-Ubuntu-Backup/*,/home/*/.cache/*,/home/*/.local/share/Trash/*,/dev/*,/proc/*,/sys/*,/tmp/*,/mnt/*,/media/*,/lost+found} / /home/sterlingbutters/Butters-Ubuntu-Backup


problem in eclipse installation in Ubuntu 12.04

Please follow following steps:

Install JDK 1.6 by following steps mentioned at http://www.devsniper.com/ubuntu-12-04-install-sun-jdk-6-7/
Download an eclipse IDE for 64 bit linux and extract it.

Hope this will help.

Thank you,
Praveen


Reinstall grub2:

  sudo apt-get purge grub grub-pc
  grub-common

  sudo apt-get install grub-common
  grub-pc

  sudo update-grub


By default enigmail will decrypt - see http://www.rainydayz.org/node/108 for guidance. If it doesn't, check the OpenPGP → Automatically Decrypt/Verify Messages option is checked.


Charging limits depend upon your vendor.But if you would like to save power and prevent overheating problems,you could install a panel app called CPUfreq.

sudo apt-get install indicator-cpufreq

Now,all you have to do is type

indicator-cpufreq

in the terminal to launch it for the first time.Once started,choose the powersave option.


Can't connect second monitor with HP Pavilion g6 over Ubuntu 12.04

You're probably not using the most appropriate graphics driver.

open your terminal and write in the following command:

lspci -v | less

this will list some of your hardware, including your graphics card, you should have an entry like:

00:05.0 VGA compatible controller: ATI Technologies Inc Rage XL (rev 27)

Next go to your fabricant webpage and search for the appropriate driver for your graphics card and OS.


For minimalist systems, how important is updating regularly?

Updates are intended to FIX issues and not to create new problems.
Security updates FIX security issues and are not to create new security holes.

All in all: updating when there is a security patch is better than not updating. For all the normal updates you can always not install them if you are not affected by what the update is intended to fix. But they will (/are intended to) make your system more stable.


You're not missing anything. These icons are not the new default, but a new third party theme, the Faenza icon theme. You can grab them from GNOME-Look or the Equinox PPA.

sudo add-apt-repository ppa:tiheum/equinox

sudo apt-get update && sudo apt-get install faenza-icon-theme


Did you install the proprietary Nvidia drivers?

In theory, shortly after installation, Ubuntu should notify you that "restricted drivers are available".

Otherwise, go to System settings -> Additional drivers. It should show you Nvidia drivers available for download. Select it, agree to the terms if necessary, install them and restart.

How do I install additional drivers?

Ubuntu is not allowed to distribute these drivers; therefore, they have to be installed explicitly by the user.


Speed up apt-get update by removing known ignored Translation-en

I fixed this problem by adding the fallowing line:

Acquire::Languages "none";

at the end of /etc/apt/apt.conf.d/00aptitude (use sudo -H gedit /etc/apt/apt.conf.d/00aptitude in a terminal to edit this file).

After I did this, sudo apt-get update is running faster.


Why can't I browse windows shares although I can connect to them?

None of the computers in your network is configured to use lan manager announcement.

This is where one computer on the network enumerates all available shares and then broadcasts them for other Samba clients to read.

It is fine to have more than one computer do it but if none of them are configured to do it you can't browse shares.

There's an article here that describes Samba options:

http://www.onlamp.com/pub/a/onlamp/excerpt/samba_chap7/index2.html?page=3

Alternatively, you can configure the Windows Share protocol on one of your Windows computers to enable Lan Manager protocol.


How to freeze a list of installed packages and craft an apt-upgrade script to target the same at any time after?

apt list --installed | sed s/Listing...// | awk -F "/" '{print $1}' >  $(date +aptlist-%m.%d.%Y-%H.%M.%S.txt)

Creates the file which lists all of the installed packages.
xargs -a ThatFileCratedAbove.txt sudo apt-get install

Will install them from the list
....I would test the file first with apt-get -s install to simulate installation, just to make sure the list is not going to cause any problems.. (though that might take a long time)
.
.
.
UPDATE FOR  VERSION REQUIREMENT...
If you wanted to capture the version and be able to install those versions later, then your apt list snapshot would need to be created like this instead of above:
apt list --installed | sed s/Listing...// | awk -F"[[:blank:]/]" '{ if( $1 ne '' ) print $1"="$3}' >  $(date +aptlist-%m.%d.%Y-%H.%M.%S.txt)


How to remove duplicate application in /usr/share/applications folder?

Remove the second Google Chrome in the Internet menu of Main Menu

:

You may also have to remove the second one in the Other Category as well...


Edit your ~/.bashrc file and create aliases.

It's quite simple, just add lines such as:

alias lstart="sudo /opt/lampp/lampp start"

Be careful when creating your aliases because you may create an alias which is name the same as something that already exists. Also, do not delete anything else in that file or your may find things breaking.


How do I get 1366x768 resolution with dual graphics card ATI Madison Radeon HD 5000M Series and Intel Integrated Graphics Controller

Open your systems settings from top panel right corner wheel.

in your system settings look at monitor settings . there you can  set your monitor resolution from available resolutions .


using a byobu and disconnected session how to see message on screen

Just run

byobu

again and it will re-attach to the current session in the background (for the current user). If there is no, it will create a new session.

In case a lot of output has been produced and you'd like to scroll up, use the Copy mode by pressing F7. It will "disconnect" the cursor and allows you to scroll up and search. Use the arrow keys (↑ ↓ → ←) or PageUp / PageDown keys to move around, and Esc to get control back on the shell.

See also: Can Mouse Wheel Scrolling be enabled in Byobu?


Ubuntu Gnome 14.04: Everytime software is updated PC reboots and Linux gets broken

Install the correct nvidia drivers from the official package management system instead of using the downloaded compiled version or install dkms and recompile the nvidia drivers so that you won't have this problem after every update.

For now, you should be able to boot up using one of the older kernels. Select advanced options from the grub menu and then select one of the older kernels and do not select the newest kernel.

Next, search for software sources or open the ubuntu-software-center, select edit and then select software sources.

Then, select the additional drivers tab and then select the recommended nvidia proprietary driver that is marked "tested". Apply your selection and when you are done, reboot.

Alternatively, if you insist on using the downloaded version of the nvidia driver, install dkms so that you won't break your system after an update:

sudo apt-get update
sudo apt-get install dkms

Click here for more info.


What I did to rescue my computer: I used synaptic package admin and set the fglrx to re-install. Then I added this line to my grub:

GRUB_CMDLINE_LINUX="acpi_enforce_resources=lax"

I rebooted and nothing happened. Then I executed

update-grub

And THEN it worked! :)

Thanks for adding your ideas!


The default key combination to toggle the menu bar for digikam 6.4.0 is Ctrl + M.


The idea is process the result from grep and append it explicitly to the output file. This way you can use the console to write debug messages.

#/bin/bash

# Save output to this file
outputFile='./xmldocs/1.txt'
rm -f $outputFile

# List only *.xml files and iterate
for i in `ls *.xml`
do
    # Echo which file is being processed (only printed to console )
    echo 'Processing :'$i
    # Grep, remove trailing newline and append to $outputFile
    grep "Document ID:" -s $i | tr -d '\n'  >> $outputFile
    # Add char to separate
    printf "~" >> $outputFile
    # Grep, remove trailing newline and append to $outputFile
    grep 'CI[^"]' -s $i | tr -d '\n' >> $outputFile
    # Print newline to separate results
    printf "\n" >> $outputFile
done

echo '!! done'

If this don't work please post the other line that you want to grep to test it.


It is possible you did not install the nvidia driver, the stock Nouveau driver lacks power management, most GPUs will run at full power as a result.
You can get the latest stable gpu drivers from the xswat ppa
https://launchpad.net/~ubuntu-x-swat/+archive/x-updates

It is possible a kernel upgrade may fix it see this question:
How do I add the mainline kernel PPA?
I would not hold my breath.

Ubuntu might boot without changing the bios if you use the signed linux image

sudo apt-get install linux-signed-generic linux-signed-image-generic

You should be able to find more info using google, that has been asked many time, I never bothered to read it, I don't use windows anymore, if I ever wanted to there is virtualbox
I would rater not have a binary blob from MS in my kernel, which is what the signed kernels have, but you gotta do what you gotta do


Where can I download the latest DVD ISO which contains everything?

http://www.ubuntu.com/download/desktop

This link has both the stable release (12.04) and most recent newer release (13.04) and is too big to fit on a CD.  You'll need a DVD or USB stick to burn.

Choose your flavor, and architecture, and you're good to go!


Netbook Edition is optimized for small screens (and using already Unity, that is coming in 11.04 Desktop Edition) and easy use for portability. I would use Desktop Edition for screen sizes larger than 12".


Folders and files in desktop show their full path

I had the same problem after I played with Nautilus (The file manager application) settings.

Just open Nautilus and go to Edit --> Preferences. From the Display tab, select None instead of Location from the Icon Captions section. Go to the desktop and hit F5.


How to access more storage from Ubuntu USB

The Desktop or "Live" runs on a read only file system and has limited space. You can not save your settings between booting and you will have limited space for saving your work.

You can, however, save data to your hard drive or a second flash drive.

You can also condifure your usb drive. You can add a second partition or boot the live CD with persistance.

Depending on what you are wanting and the size of your flash drive, perhaps you can simply install Ubuntu onto the usb drive.


apt-mirror: can't create /media/usb/apt-mirror/mirror directory at /usr/bin/apt-mirror line 342 - onto USB drive

Hopefully not the best and final one, but I found a way to get it working.

I added the NTFS USB drive via /etc/fstab, recycling the options from a smb mount. The line looked like this

in /etc/fstab add
 /dev/sdc1  /media/usbdrive  ntfs defaults,credentials=/home/user/.smbcredentials,uid=1000,gid=1000,iocharset=utf8  0   0

With this, apt-mirror did start without complaining. Maybe all the options are not really required (I did not further testing) but it did work.


Unable to log in to to Cinnamon without snapd 18.10

sudo apt install --reinstall gsettings-desktop-schemas
solved it for me. Seems typing out your question makes it easier to actually google it.


Is it bad to have /home/ on an NTFS partition?

Will running home from NTFS be a problem, or perhaps a performance killer?

Yes, NTFS does not understand Linux permissions. If you're using Gnome, then you won't even be able to log in due to permission issues.
dot files on NTFS are not considered hidden files and due to the lack of permissions -anyone- can change those files without having to worry about passwords.
Also read this: http://en.wikipedia.org/wiki/NTFS#Linux

  Due to the complexity of internal NTFS structures, both the built-in 2.6.14 kernel driver and the FUSE drivers disallow changes to the volume that are considered unsafe, to avoid corruption.

If you want to do it like this you are better of with FAT. But WHY break the security of a Linux system? Why?

A better way is to put /home on ext3 or ext4 and mount the directories from the Windows partition (in that case you can use NTFS though I still advice against it). This will not break the security model but you can still share all your personal files.

  Can I convert the HDD from NTFS to ext3 (or ext4?!) without losing all the files, and how?

GParted can do this. But it is probably quicker to move all the files elsewhere and then format the disc and copy the files back.


Command fails in crontab but works in terminal

htop needs the TERM variable set to e.g. xterm to output any data, so just set this variable for xterm in your cron line, e.g.:

@hourly echo q|TERM=xterm htop|aha --black --line-fix >/tmp/htop.html

If you want to test whether a command really doesn’t depend on any environment variables – which often lead to problems with cron, see the question you linked –, use env -i to “start with an empty environment”:

$ env -i htop
Error opening terminal: unknown.

Combined with the diff of cron’s and your terminal’s environment that’s a nice way to test which variables a command needs. htop in fact only needs TERM:

env -i TERM=xterm htop


Can't change current resolution (NVIDIA)

In my case I had the latest Linux kernel installed (5.4.2) and Nvidia driver 440 doesn't work well with it, I had to downgrade to kernel 5.0. Bleeding edge on Linux is a mistake.

Card GTX 1060, Ubuntu 18.04.


have a look at the below question as well its answer.

please click here to find your answer


Can't do anything after moved launcher to bottom

The solution is mentioned right on that page:

rm ~/.compiz-1/plugins/libunityshell.so

To run this, log in to safe mode (from GRUB), and remove the file from your ~/.compiz-1 folder.

Since you will be logging in as root when using safe mode, you will have to navigate to /home/yourusername/.compiz-1/plugins/ manually and delete the file from there.

After this, restart and when you log in things will be back to normal.

P.S. don't use autologin!


Disable External Storage (Thumb Drive) on Particular USB Ports

Try the command below:

#echo "blacklist usb_storage" >> /etc/modprobe.d/blacklist.conf


What's the difference in content between the Ubuntu and Lubuntu Software Centers? Why aren't winners of the app showdown available in the latter?

Both distributions use the same repositories. So, software that can be installed on ubuntu can also be installed on Lubuntu ,which means that they have the same software center.


Unable to connect to wireless networks after 12.04 automatic update

You can use this command to unblock all wireless devices:

sudo rfkill unblock all


Terminal: Open multiple profiles in tabs

You could install konsole. It can give you a random colour for each tab or you can have a different profile in each tab. It has a few more features than gnome-terminal but it can easily duplicate the latters functionality.


You may use Disks in Ubuntu to restore disk image to USB.
In the top-right menu of 'Disks' there is an option to restore disk image(.iso files)


Changing brightness under Unity completely hangs the system

Apparently this is a known kernel bug . A workaround to your problem is explained in comment #71.

Open the file /etc/defult/grub as root: sudo gedit /etc/default/grub
Change the value of GRUB_CMDLINE_LINUX_DEFAULT to "quiet splash pcie_aspm=force acpi_backlight=vendor"
Update the grub sudo update-grub
And reboot sudo reboot


For example, when I go to the top most directory and list the files, this is what I get in Ubuntu:

That is the root of the system. Equivalent in Windows: c:

Linux is a multi-user system and is set up as such. Windows used to be a single user system and was/is also set up like that. Main difference: each user has its own place in Linux where files are stored: /home/$USER/ and within that are personal directories. In Windows it is something like c:\Users\%USER%\.

To get to the current users Documents you can use:

cd /home/$USER/Documents/

But there is a shorthand version: ~ points to your home, so

cd ~/Documents

also works. There are more: $USER for instance will replace with the current user but also $HOME for the home dir or $SHELL for the shell used (echo can be used to show the content: echo $USER will show the current username).

  When I go into "usr" on Ubuntu, it doesn't display the expected filed as "Users" in Windows. Help please?

/usr is not what you believe it to be. It now is short for "Unix System Resources" so not related to a user ;) /home/$USER is where you find personal files.

Mind though that since you are using root ~ will point to the home of "root" and that is /root. I would advice to not use root on command line as Ubuntu is made to be used with a sudo account user and limited exposed elevated privileges.

Using a root sessions allows you to delete anything from that system without any restrictions. Using a sudo account would prevent deleting if you accidentally would try to and did not add sudo to the command.


How to make VLC File Picker style using default system file picker style?

According to my knowledge, VLC GUI still uses GTK2. So the VLC file picker is GTK2 style, while system file picker is GTK3 style. I'm afraid not much can be done about it.


Files (Nautilus) icons not appearing with Numix Square icon theme on Ubuntu 18.04 LTS with Unity desktop

I did not have any icon themes installed with folder and file icons so it fell back to the default empty file icon from the GNOME system theme.

Both Numix Square and Numix Circle do not have built-in system icons or file/folder icons but instead require the Numix icon theme to be installed. This fixed my particular problem!


Firefox default download directory on Xubuntu

That should be in your home with the name Downloads unless otherwise changed by yourself or another user using your account.

That is a direct reference to Ubuntu default folders and can be changed by editing the file ~/.config/user-dirs.dirs with a text editor, using for example leafpad:

  leafpad ~/.config/user-dirs.dirs

# This file is written by xdg-user-dirs-update
# If you want to change or add directories, just edit the line you're
# interested in. All local changes will be retained on the next run
# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped
# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an
# absolute path. No other format is supported.
#
XDG_DESKTOP_DIR="$HOME/Desktop"
XDG_DOWNLOAD_DIR="$HOME/Downloads"
XDG_TEMPLATES_DIR="$HOME/Templates"
XDG_PUBLICSHARE_DIR="$HOME/Public"
XDG_DOCUMENTS_DIR="$HOME/Documents"
XDG_MUSIC_DIR="$HOME/Music"
XDG_PICTURES_DIR="$HOME/Pictures"
XDG_VIDEOS_DIR="$HOME/Videos"

This functionality is provided by the package xdg-user-dirs installed by default in any Ubuntu flavor.


Installing new hard drive on dual boot system: is boot loader only on hard drive?

When the computer boots, special code in the read-only memory (BIOS or EFI) reads a boot loader from one of several possible locations (hard disk, USB flash drive, optical drive, network) and gives it control.

If you replace the hard disk with a new one, the new disk won't have any boot loader on it; you will need to install an operating system, or else restore a full-system backup. You can use for example Clonezilla to make a full backup of the old hard disk.
If you add a hard disk, the old disk still has the boot loader.

P.S. Please read the comment of user waltinator and follow the suggested instructions.


It's my guess that this occurs when you resize/scale the image.  If you want to stop automatic resizing, right-click on your desktop, select Desktop Settings and change the resizing method to Centered.  This actually disables resizing and just centers the image.

If you do that though and your wallpaper is larger than the screen size, you will have to resize it using an app, like gimp for example.


Unmet dependencies installing SWI-Prolog

Answering my question....  I had to make a fresh installation of Ubuntu.  Now on 20.04.


Try installing legacy drivers with nvidia settings

sudo apt-get install nvidia-304 nvidia-settings

That's what worked for me


A patch has been proposed https://bugs.launchpad.net/ubuntu/+source/gnome-disk-utility/+bug/571038


When trying to upgrade Kerberos development libraries, why do I get an "unmet dependencies" error?

A security update for Kerberos packages was issued on July 31, 2012, to fix a security vulnerability. This bumped the Ubuntu version numbers from ubuntu0.2 to ubuntu0.3.

It's possible (but rare) that for a while, the libkrb5-dev/krb5-multidev packages were not updated, and thus had the old dependencies of ubuntu0.2 which was causing your problem.

In any case, it appears this has now been fixed:

$ apt-cache show libkrb5-dev | grep Depends
Depends: krb5-multidev (= 1.10+dfsg~beta1-2ubuntu0.3)
$ apt-cache show krb5-multidev | grep Depends
Depends: libkrb5-3 (= 1.10+dfsg~beta1-2ubuntu0.3), libk5crypto3 (= 1.10+dfsg~beta1-2ubuntu0.3), libgssapi-krb5-2 (= 1.10+dfsg~beta1-2ubuntu0.3), libgssrpc4 (= 1.10+dfsg~beta1-2ubuntu0.3), libkadm5srv-mit8 (= 1.10+dfsg~beta1-2ubuntu0.3), libkadm5clnt-mit8 (= 1.10+dfsg~beta1-2ubuntu0.3), comerr-dev

Please try a sudo apt-get update && sudo apt-get -f install to try to fix this. If it it doesn't, just remove the libkrb5-dev package. From a simulated removal on my dev system, it appears that the CUPS and QT dev packages may also be removed (libqt3-mt-dev, libcups2-dev). And then install libkrb5-dev again.


How do I show apt-get package management history via command line?

All actions with apt (apt-get) are logged. These files are available in /var/log/apt/. To view the most recent history log, execute:

less /var/log/apt/history.log

These logs gets rotated (every month I guess), old files will be suffixed with a number and compressed. So to view the next history log, use:

zless /var/log/apt/history.log.1.gz

To view the logs available:

ls -la /var/log/apt/


your tc command is correct, the problem is most likely caused by the network adapter.

mqprio to work requires a network adapter supporting multiple hardware queues
you may list network queues by issuing the command

ls /sys/class/net/<adapter name>/queues

additionally if your NIC support multiple queues, you can usually adjust the number of RX queues (also called RX channels), by using ethtool, see https://blog.packagecloud.io/eng/2016/06/22/monitoring-tuning-linux-networking-stack-receiving-data/#check-the-number-of-rx-queues-being-used


Where is pypy for python 3.5 on bionic (18.04 LTS)?

Results of snap find pypy3 :
Name   Version  Publisher    Notes    Summary
pypy3  5.8.0    pypyproject  classic  PyPy is a fast, compliant alternative implementation of the Python language

Installing the native pypy3 snap package with sudo snap install pypy3 --classic is the most secure way to install PyPy3.5 in Ubuntu, and it also is updated automatically or can be updated manually with sudo snap refresh pypy3. The current version of the pypy3 snap package is 5.10.1.
Version 6.0 of the pypy3 snap package is not yet available, but it will be available as a snap package eventually. Meanwhile the native pypy3 snap package (PyPy3.5 v5.8 v5.10.1) is able to run pandas.

Download PyPy3.5 v6.0 from the official PyPy website here.
Installation instructions
All binary versions are packaged in a tar.bz2 or zip file. When uncompressed, they run in-place. For now you can uncompress them either somewhere in your home directory or, say, in /opt, and if you want, put a symlink from somewhere like /usr/local/bin/pypy to /path/to/pypy_expanded/bin/pypy. Do not move or copy the executable pypy outside the tree – put a symlink to it, otherwise it will not find its libraries.


The \r issue suggests you have edited the script file on a Windows machine. Windows uses \r\n as the line terminator while Linux (and most other operating systems) use \n alone. When you edit a file in Windows, Windows will add \r to the end of the lines and that will break your scripts.

So, first remove the \r:

sed -i 's/\r//g' script.sh

The next issue is that your script isn't doing what you think it is. Or what I imagine you think it is, since you didn't actually say. I am guessing that you think that hd='pwd' sets the variable $hd to the value returned by the command pwd. That isn't what's happening. You are simply setting the variable to the string pwd:

$ hd='pwd'
$ echo "$hd"
pwd

To use the output of a command as the value for a variable, you need to use var=$(command) or var=`command`:

$ hd=$(pwd)
$ echo $hd
/home/terdon

So your script should be:

#!/bin/bash
hd=$(pwd)
cd "$hd"

In this case, however, you don't even need that. The current directory is already in a variable:

$ echo "$PWD"
/home/terdon

So you could also have done hd=$PWD. Or simply cd "$PWD".


Cannot install build-essential/gcc/g++ after upgrade to 17.04

So I was able to install build-essential again by following these steps:

$ sudo apt install build-essential
...
The following packages have unmet dependencies:
 build-essential : Depends: gcc (>= 4:5.2) but it is not going to be installed
                   Depends: g++ (>= 4:5.2) but it is not going to be installed

A gcc version greater 5.2 is required, so lets try to install gcc.

$ sudo apt install gcc
...
The following packages have unmet dependencies:
gcc : Depends: cpp (>= 4:6.3.0-2ubuntu1) but it is not going to be installed
      Depends: gcc-6 (>= 6.3.0-9~) but it is not going to be installed

Okay. Something else is missing. Let’s try installing that.

$ sudo apt install cpp
...
The following packages have unmet dependencies:
 cpp : Depends: cpp-6 (>= 6.3.0-9~) but it is not going to be installed

Still nothing. Trying again.

$ sudo apt install cpp-6
...
The following packages have unmet dependencies:
 cpp-6 : Depends: gcc-6-base (= 6.3.0-12ubuntu2) but 6.3.0-18ubuntu2~16.04 is to be installed

Once again.

$ sudo apt install gcc-6-base
...
gcc-6-base is already the newest version (6.3.0-18ubuntu2~16.04).

So here I don’t know what exactly went wrong. It should be noted that there is a 16.04 string at the end of that version number. That seemed odd. I removed that package.

$ sudo apt remove gcc-6-base

Now I was able to install build-essential again. This will also reinstall gcc-6-base.

$ sudo apt install build-essential

Remaining problem:

$ sudo apt upgrade
...
The following packages have been kept back:
  cpp g++ gcc

Root of the problem is similar as above, gcc-7-base is faulty but I can’t simply remove it, since I get this:

The following packages have unmet dependencies:
 libgcc1 : Depends: gcc-7-base (= 7.1.0-5ubuntu2~16.04) but it is not going to be installed
 va-driver-all : Depends: mesa-va-drivers but it is not going to be installed or
                          vdpau-va-driver but it is not going to be installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.

Danger Zone:

I managed to resolve this issue with the following steps:

$ sudo apt install aptitude
$ sudo dpkg --force-all -P gcc-7-base
$ sudo dpkg --force-all -P gcc-7-base:i386
$ sudo aptitude install gcc-7-base

This is super dangerous and might break your installation. Executing dpkg --force-all -P will remove a package forcefully, ignoring any dependencies on this package. Following this by a regular apt upgrade might remove almost all relevant software from your installation.

I was only able to recover from there by usind aptitude which resolved every dependency issue I had.


Suspend/Hibernate broken on Macbook Pro 10.1 retina with Ubuntu 13.10

Upgrading to kernel  3.13.0-031300rc6-generic seems to have fixed the issue. It also installed the Intel® Ivybridge Mobile driver which may be related to the fix. There are a few minor graphics artifacts but other than that everything works fine.


The answer is outdated, now the GTX9xx series works fine with the drivers in Ubuntu's repositories.

Anyway, if you want the latest drivers you could try this PPA instead: https://launchpad.net/~graphics-drivers/+archive/ubuntu/ppa

Finally solved using this ppa instead of xorg-edger's one:

https://launchpad.net/~mamarley/+archive/ubuntu/nvidia

and installing:

sudo apt-get install --install-recommends nvidia-346 bumblebee-nvidia nvidia-prime nvidia-346-uvm


Ubuntu Auto Software Installation Script

automated apt install

You can use -y Option like

sudo apt install -y <package>

to automatically answer with Yes

Writing the file

The file edit you could do by

sudo echo 'a line' > <file>

For begin a new file and

sudo echo 'another line' >> <file>

To append lines to that file

Unattended mySQL installation

For the password prompt while mySQL installation refer to this answer

Unattended phpmyadmin installation

For the prompts for phpmyadmin installation refer to this side I didn't test it but it might still work.

Note: Don't forget to restart apache2 after installing phpmyadmin

sudo service apache2 restart


Fonts not displayed properly in Adobe Acrobat in Ubuntu

I assume you're using Acrobat Reader 9.x for Linux, which is still available on Adobe's FTP server.
The problem is Arial and Times New Roman are being replaced with the generic font Adobe Sans. Fonts have to be copied directly to the Acrobat font folder because it doesn't use the system fonts.

Install Microsoft Core Fonts for the Web.
sudo apt install ttf-mscorefonts-installer

You may have to reinstall if a previous install was unsuccessful.
sudo apt reinstall ttf-mscorefonts-installer

Copy the fonts to the Acrobat font folder.
sudo cp /usr/share/fonts/truetype/msttcorefonts/* /opt/Adobe/Reader9/Resource/Font/


What is difference between the options "autoclean", "autoremove" and "clean"?

From the apt-get man page:

clean:   clean clears out the local repository of retrieved package files.
It removes everything but the lock file from
/var/cache/apt/archives/ and /var/cache/apt/archives/partial/. When
APT is used as a dselect(1) method, clean is run automatically.
Those who do not use dselect will likely want to run apt-get clean
from time to time to free up disk space.

autoclean: Like clean, autoclean clears out the local repository of retrieved
package files. The difference is that it only removes package files
that can no longer be downloaded, and are largely useless. This
allows a cache to be maintained over a long period without it
growing out of control. The configuration option
APT::Clean-Installed will prevent installed packages from being
erased if it is set to off.

autoremove: is used to remove packages that were automatically
installed to satisfy dependencies for some package and that are no
longer needed.

Every command has a manual page, if you want to know what their parameters are or what each of them do, just type in the shell `man `  Ex. `man apt-get`

manpage for the apt-get command


Latest CMake on Ubuntu 16.04 without removing other packages

Instead of installing cmake from source, why don't you try adding CMake deb repository:
https://apt.kitware.com/
In this way you will install the latest version of cmake in the proper way.


SSH to Ubuntu machine doesn't work when I get out of home

This is not an answer, but I have more to say than fits in a comment. The beast you're trying to tame can be tamed, but it's way bigger than you're thinking, as you stand with your hand on the end of its tail. I don't know how to get you on its back, but I can describe its butt, which you haven't yet laid hands on.

First things. That address you got, 127.0.0.1, that's not your address. Try this command, similar but less noise: ip -f inet a. You'll see probably two short groups. Ignore the group that says LOOPBACK 127.0.0.1. Look in the other, for a line with any other set of numbers. Look for a line that reads something like "inet 192.168.100.1/24". That's your address. Not the /24 part.

Time for a pause. Who else has that address? Everybody has that address. Walk out on your balcony, put your hand on your brow, squint, count. How many other balconies do you see? Behind every single one of them is another computer with that same address. Every single apartment. Except that guy on the bottom floor, polishing his Harley on his patio. He has that address and two others.

Like most folks, you probably have a WiFi router that sets up a little internet fiefdom for your private amusement. It's from there that your inet address comes from, and it works only within your private fiefdom. Just like Harley and everybody else. The whole internet is broken up into cells this way.

What you want, you want a global presence so you, and anybody in Latvia, can find your home server from anywhere in the world. That takes more work than plugging in a WiFi router. There are several approaches. A service like managed DNS is probably your most attractive option. No-ip for example offer a free service geared toward home users. That's not your next step.

I hesitate to recommend a service, but there it is. I hesitate, because you're about to get kicked, reaching for the butt. Kicked hard. The 'net is lousy with bad guys who are always probing for fresh new virgin computers to stand up and peek outside their little fiefdoms, ready for a good beating. You opened up port 22 to the world. That's the red neon light port. Put your computer on the global net that way, and you will be probed and discovered.

I had the neatest experience back in the '90s. For a time there, there was a known exploit that allowed Windows XP to be hijacked without doing anything at all. You didn't have to run a program or browse a website. Just jack your box in to the net. The funny thing was, base XP was vulnerable, but SP3 was not, if I recall correctly. But the CD was base, and you installed SP3 from the 'net. Yeah. I installed base XP, jacked in to upgrade to SP3, and in minutes I was infected. Fantastic.

It's usually not that bad, and Linux is safer than that, for all we know. But you opened port 22 to the world. No one ever does that. Do you have a good, strong, user password? A really good, strong password? Do you have a root account? Have you disabled root login over SSH? Have you disabled ssh password authentication altogether, opting for public key login? What services do you have running? Have you cut them back to a minimal set? Do you have active SELinux/AppArmor profiles for them?

Honestly you're probably still safe enough, because your WiFi router surely has a firewall that prevents SSH attempts from outside, and just protected you from yourself. Don't disable that just yet. I'm not expert on this stuff by any means. This is just the basics. Stricter Defaults on help.ubuntu.com might be a good introduction to this topic, but you'll want to read and understand more than that, before contacting No-ip.


Strange icon in Unity top menu bar after installing KDE

This is the icon that Ubuntu displays when he's not able to find the correct one defined for this particular service.


Instead of removing and loading modules. Create
  /etc/modprobe.d/iwlwifi.conf with the content: options iwlwifi
  11n_disable=1 then reboot (you may need to run # update-initramfs -u)

This solution by user "Arch user" worked
I didnt need to run update-initramfs -u


How to fully remove MySQL and phpMyAdmin

You can fully remove MySQL and phpMyAdmin by doing the following:

Open your terminal (CTRL+ALT+T) and log in as root:

sudo su
Stop all MySql services that may still be running:

service mysql stop
Remove mysql and all its folders and files:

apt-get remove --purge mysql*

apt-get remove --purge mysql-server mysql-client mysql-common -y

apt-get autoremove -y

apt-get remove dbconfig-mysql

rm -rf /etc/mysql /var/lib/mysql

find / -iname 'mysql*' -exec rm -rf {} \;
Remove PhpMyAdmin:

apt-get purge phpmyadmin*
Autoremove and clean all dependencies:

apt-get autoremove && apt-get autoclean


GRUB menu not showing up on boot after replacing battery

The output of efibootmgr -v revealed that the boot-entry for Ubuntu is broken, so I recommended to make use of boot-repair which fixed the issue.


List of blogs to learn more about Ubuntu


my win10 crashed so i want to install ubuntu instead and running into several problems

If you want to fix your windows 10 OS, follow This Answer.
Also, you can do this above, and repair the partition. after that, open the Command prompt and type powercfg -h off. it will delete the hiberfile.sys and won't hibernate.
probably it can't be fixed, because it's hibernated.
Edit: i already tried this answer on my broken WIndows 7 OS (UNMOUTABLE_BOOT_VOLUME) and it fixed it. i don't know how it will work if the OS is hibernated.


Can I change my Bcache settings on the fly?

You can change both replacement policy and cache mode via the /sys interfaces while the system is running.
Just echo the appropriate setting word to the file and it changes the setting.
The control file contents show the available options and current setting when you read them - for example:
# cat /sys/fs/bcache/[you cache id]/cache0/cache_replacement_policy
[lru] fifo random

and
# cat /sys/block/[your bcache device]/bcache/cache_mode
writethrough writeback [writearound] none


sensors-applet will do the trick for you. You can install it with:

sudo apt-get install lm-sensors sensors-applet

You should then do sudo sensors-detect so that lm-sensors is configured (it will scan sensors in your hardware).

Then simply add "Hardware Sensors Monitor" to the panel. Then, within the context menu, you will be able to configure which sensors will be shown, units, update interval....


I'm trying to understand these partitions

/dev/sda1  *       2048    1050623    1048576  512M  b W95 FAT32

/dev/sda2       1052670 1953523711 1952471042  931G  5 Extended

/dev/sda5       1052672 1953523711 1952471040  931G 83 Linux

This is typical for an UEFI installation of Ubuntu in MBR ("msdos").
sda1 -> ESP (EFI System Partition); required (as FAT32) and not exclusively "Windows", it's for all installed OSes. Please read the UEFI guide in order to understand what it entails, all computers now (and form a decade ago) are UEFI, not BIOS; users must understand UEFI going forward.
sda2 -> Extended partition that the Ubuntu installer usually creates whenever it detects "msdos" partitioning type.
sda5 -> Logical partition inside sda2, that's why they "overlap" (not really, one is a logical partition inside a primary partition) and despite the label is probably your root file system (if you have no other drives it certainly is; removing it will remove your Ubuntu installation.
Additional considerations:
It would have been better to create an entirely new GPT partition table instead of keeping the old MBR ("msdos"). It can be easily done in a live session, before installing Ubuntu, with GParted, Devices menu > Create new partition table, select "GPT". This blanks the drive completely. Then the Ubuntu installer, using the default settings would only (re-)create the ESP and the root (/) file system since currently there's no need for a separated swap partition.


Atheros AR9485 behaviour is broken after update to 15.10

You have a wrong kernel for Ubuntu 15.10. Are you usre yiu have 15.10, not 15.04? If you are sure, install kernel 4.2 by running:

sudo apt-get install linux-generic


Lego Mindstorms EV3 software cannot find brick via WiFi

It is a firewall that blocks connections from the brick. The easiest way to fix the problem is to disable firewall by sudo service ufw stop, but it's a bad idea in general. Instead, you could setup rules to allow.

I guess, Lego Mindstorm sends a broadcast request, and waits for incoming connections from anyone (from the brick in our case). That means, you need to allow incoming connections either:

from an interface
using a subnet
from a specific IP
to a specific port
using a specific protocol (i.e. http, https, ssh)
any combination of above.

So, one rule you could use is sudo ufw allow from 192.168.0.6, since it's the address of your brick. But I don't know how the address is assigned to the brick, whether it is dynamic, and would you want to use it with another one (with different IP), so probably better way would be to find the port in use, and setup a rule for that. First, temporary disable firewall (sudo service ufw stop), execute in terminal sudo tcpdump -nni any src 192.168.0.6 and dst 192.168.0.6, and connect the app to the brick. You would see an info about packets going between your host and brick, the port is written right after IP of your PC, like …192.168.0.6.52382 > 192.168.0.1.80… Then you can use:

sudo ufw allow PortNumberYouGot # e.g. sudo ufw allow 21

or better yet is to allow only a specific subnet:

sudo ufw allow from 192.168.0.0/16 to any port PortNumberYouGot


Programmatically move window to viewport in compiz

It is also possible to use the Place Windows plugin in the CompizConfig Settings Manager to have programs always open on a certain viewport. The Place Windows plugin can be found under the Window Management category.
Once inside the Place Windows plugin go to the Fixed Window Placement tab at the top. At the bottom you will see the Windows with fixed viewport. Click the New button to add a new program. Next click the green plus to configure what windows should be positioned. Use a Type of Window Class. Use the Grab button to get the information from an open window of the type you want to position when started. You will also need to set the horizontal and vertical viewport location where you want the program positioned on startup.
This information is from a webupd8.org article titled "Make Applications Always Open On A Given Workspace (Viewport) Using Compiz". There is also a link to a screencast on Youtube that goes through these steps on that page.


Nothing weird about that if you are using NVIDIA's priopriatary driver... Perhaps it got updated and now shows that logo or maybe this time it just worked a little slower and showed itself for a while longer. I have NVIDIA drivers on two machines and one time logo shows and other is just too fast to notice or display does not react to screen mode change that fast...


"Disk I/O error:" Can not write anything to mounted partitions

Boot a live usb/cd, anything with gparted on it, use it to check the partition, the partition must be unmounted

if it fails your drive may be shot, there are some things you can try if it is a ssd (firmware upgrade/use AHCI mode/ trim)


You can mount the USB drive on boot via an init.d script. To begin, check for what your USB drive is recognized as with the lsblk command:

sda       8:0    0 465.8G  0 disk
└─sda1    8:1    0 465.8G  0 part
sdb       8:16   0 931.5G  0 disk
├─sdb1    8:17   0   499M  0 part
├─sdb2    8:18   0    99M  0 part
├─sdb3    8:19   0     1M  0 part
├─sdb4    8:20   0    15M  0 part
├─sdb5    8:21   0 442.1G  0 part
├─sdb6    8:22   0 442.6G  0 part
├─sdb7    8:23   0     1G  0 part
└─sdb8    8:24   0     3G  0 part

Let's say that my sdb8 is the USB partition I want to mount at startup.

Make a script in the /etc/init.d directory (in this case, I will be using gedit)

sudo gedit /etc/init.d/usb-mount

usb-mount should contain the following contents:

#!/bin/bash

mkdir /media/your_username/usb_name
sudo mount /dev/sdb8/ /media/your_username/usb_name/

Make sure to replace your_username with your username, usb_name with your usb name, and sdb8 with the partition you want to mount.

After saving the script, you want to chmod it:

chmod +x /etc/init.d/usb-mount

After a reboot, the USB drive should be mounted. Hope this helps!


Live-Build lb build "chroot: failed to run command ‘/usr/bin/env’: No such file or directory"

I had the same thing happen to me and I think it's because my working directory is mounted from my host OS (mac osx) via vagrant.

P: If the following stage fails, the most likely cause of the problem is with your mirror configuration or a caching proxy.
P: Running debootstrap...
mknod: ‘/vagrant/tutorial1/chroot/test-dev-null’: Operation not permitted
E: Cannot install into target '/vagrant/tutorial1/chroot' mounted with noexec or nodev
P: Begin unmounting filesystems...
P: Saving caches...
chroot: failed to run command ‘/usr/bin/env’: No such file or directory

The '/usr/bin/env': No such file or directory error is because debootstrap failed, and I'd bet the command being run is something along the lines of: chroot /vagrant/tutorial1/chroot /usr/bin/env FOO=bar baz, and chroot is failing to find /usr/bin/env

I moved outside of the /vagrant path on my machine and it seems to be working.

Try looking at earlier messages in the output for clues. Feel free to paste more of the output in here if you are still not certain!


You should not have entries in /etc/fstab for removable media; remove them.

The file fstab contains descriptive information about the various file systems. fstab is only read by programs, and not written; it is the duty of the system administrator to properly create and maintain this file.


It is possible. Install Tweak Tool - either via Ubuntu Software Center or:

sudo apt-get install gnome-tweak-tool

After installing open it. In Tweak Tool's Shell section options choose Hibernate at Power button action.


You probably did not follow the correct procedure. For one: nowhere does it state you need to rename the file to an extension that claims it is a compressed archive. This is one method that works:

Re-download Cisco Packet Tracer 6.0 for Ubuntu.
Open up Downloads folder, rename to CiscoPacketTracer6.0.
Open terminal (Ctrl+Alt+t).
Type in:

sudo su

And type in your password and press Enter.
Then type:

cd Downloads
ls
chmod +x CiscoPacketTracer6.0
./CiscoPacketTracer6.0

Next, click the space bar to go to the bottom (You'll see a % at the bottom left of terminal) of the EULA and press the y button to accept the terms and conditions.
After that, sit back and wait until it's done.
Next, click on Ubuntu symbol and search "Packet" on your computer. You should see the Cisco Packet Tracer 6.0 icon. Right mouse click on that and packet tracer should open.

If this does not work please edit your answer and PM me.

The installer puts its files into:

/usr/local/PacketTracer6/

The executable is:

/usr/local/PacketTracer6/bin/PacketTracer6

So you can also create a link in /usr/local/bin to be able to run from the command-line:

sudo ln -s /usr/local/PacketTracer6/bin/PacketTracer6 /usr/local/bin/

Finally, for reference, to find the path and arguments used when a program was run from the gui, you can use: ps auxfwww | less.


How to Prevent this Translate-Popup in Chromium of Ubuntu 16.04?

Do (here)

  Click menu icon and go to Settings.
  Click Show advanced settings.
  Under Language section, uncheck Offer to translate pages that aren't in a language you read.

I added my target language to the list and had then the unchecked option. Solves the case.


So, I switched distros (for others reasons) and I found the problem, in case some one needs it.
I use zsh as my main shell and it uses .zprofile instead of .profile, witch is used by bash. So the solution is either use the .zprofile file or use bash just to use .profile and then, after it gets sourced, you can change the shell to zsh (or ksh, dash, fish, etc), you just need to add export SHELL=/bin/zsh on your .profile
you can easily change shell with chsh -s $(which bash), considering you have which command installed.


You need a LiveCD, which is just a bootable Linux CD. Once you boot into that, mount the hard drive somewhere, then view the logs in the mounted folder.

Load gparted from the LiveCD to find the device name of the boot partition. Let's say it's /dev/sda1.

Then open a console, and create a folder for mounting:

mkdir /mnt/boot

Then mount the boot partition:

sudo mount /dev/sda1 /mnt/boot

Change to the log folder:

cd /mnt/boot/var/log

Display the logs in date order:

ls -ltr

Now check any recently-modified log, such as syslog:

less syslog


Laptop fails to boot, multiple kernels in GRUB

I observed the same when upgrading from 4.15.0-39 to 4.15.0-42 on my Ubuntu 18.04.1 NAS (x86_64):

Failed to execute /init (error -2) second line: Kernel panic - not syncing: no working init found.

So apparently the init is broken.
My solution was to remove 4.15.0-42

sudo apt remove linux-image-4.15.0-42
sudo apt autoremove

and, thus, automatically go back to 4.15.0-39 which works fine.
The autoremove removed amd64-microcode, intel-microcode iucode-tool and thermald which appear to be needed by -42 only.

(In order to be able to do the above, boot from a live CD/DVD/USB and chroot to the Ubuntu installation)


Bridging is for adding/combining segments to a network. When you bridge two network interfaces, what you are doing is allowing network broadcasts to reach all of the nodes. Bridging would not apply to what you are trying to do.

For the router to function, here is a basic reference:

check ip forwarding status for routing:
   sysctl net.ipv4.ip_forward

set (enable) ip forwarding status for routing:
   echo 1 > /proc/sys/net/ipv4/ip_forward

unset (disable) ip forwarding status for routing:
   echo 0 > /proc/sys/net/ipv4/ip_forward

After you have verified that ip forwarding is enabled, you can use iptables on the public interface, the network interface with the physical internet connection, as a NAT interface.

I won't attempt a comprehensive explanation of NAT here, but this is a basic example:
echo 1 > /proc/sys/net/ipv4/ip_forward
/sbin/iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE
/sbin/iptables -A FORWARD -i eth1 -o eth2 -m state --state   RELATED,ESTABLISHED -j ACCEPT
/sbin/iptables -A FORWARD -i eth2 -o eth1 -j ACCEPT

you can see the nat like so:
   sudo iptables -L -t nat


Ubuntu 12.04 (Lubuntu), Manage Networks, Panel Icon, Incoming Traffic. Why?

There can be various reasons why there may be network traffic even though you're not actively browsing the Internet.

Depending on your update settings, the update manager might fetch the new package lists automatically but only informs you about available updates, which means that the real, package update process has not been run yet, but the package list update has.
Some programs submit performance data and crash reports.
Having an NFS mounted and accessing it might also cause traffic.

You can use EtherApe to find out where the traffic comes from (run it as root).

If you want to make absolutely sure that there will be no network activity over eth0 (or eth1 or wlan or whatever you are using), you can shut it down using ifconfig (you might need root privileges for this):

$ ifconfig eth0 down

Use up instead of down to bring it back up.