Lubuntu 12.10 The add button still not active

Problem fix.. If you want to install it manually download  http://packages.ubuntu.com/search?ke...-kernel-source for bcmwl-kernel-source
and every packages required to install bcmwl-kernel-source  :)
then run the debian file

Sorry if it got off topic :(


At the blinking cursor, just hit ALT + CTRL + F1, and lo and behold, you will get a login prompt. From there you will be able to build a working xorg and get xbmc up and running.

Else,

Try holding down the shift key while booting the machine. Keep holding it down until you get the Grub menu - hopefully. You'll want to edit the first entry. The next to last line usually, that starts with linux /boot/vmlinuz-blah blah blah, and probably ends with quiet splash. what ever the line ends with, insert a space followed by nomodeset

then boot the machine, read instructions at bottom of that page.

Good Luck, hopefully holding down shift key will get you into the grub menu.
the nomodeset option is used for Nvidia graphics, other graphics need variations on the nomodeset switch. Look at the thread above if necessary.


Laptop screen blank after login when external monitor is not connected

To issue X commands from vt1, you need to specify the display.  E.g.:

DISPLAY=:0 xrandr --auto

The monitors.xml config file is what GNOME uses to set up your multihead layout, however it's unlikely to be the source of your trouble.  Theoretically deleting it and rebooting would force GNOME to go back to its defaults, if it was a bug in the GNOME config tool.

/etc/X11/xorg.conf is what X uses to configure itself.  With your Intel HD graphics system you shouldn't need an xorg.conf at all; if there is one present, you can try deleting it and rebooting.  But I don't think that's the source of your trouble either.

I don't think your .dmrc is relevant.  You could test going into a guest session and see if you can reproduce it there; if you can then it's not going to be any of your user config files.

Beyond that, there's a variety of things that can cause this, but without seeing some logs or more test results it's hard to guess what it could be.

With Intel video cards, only two of your outputs can be live at one time.  Especially with these newer systems they have a lot more than two possible outputs (HDMI, DVI, VGA, LVDS, ...) and there are various ways the linux kernel can get confused and hook up to the wrong thing.  Sometimes it's a bit of a race condition what outputs get enabled.  Some of the outputs that the video card is capable of aren't even hooked up to a physical port on your computer.

If the system were in front of me, the things I'd start looking at would be xrandr to see what possible outputs were present and what ones X thinks are connected.  Next I'd enable graphics debugging (sudo xdiagnose, first option), and then reboot and study dmesg from with and without the problem to see how the kernel was picking which outputs to turn on.

Hopefully that gets you on a productive path.  Blank screen bugs can be caused by a lot of different things and it's hard to diagnose it merely based on symptoms, but the above steps should get you far enough into the problem that it'll become diagnosable.


Software updates stuck downloading after 15.04 upgrade

I had the same issue. It seems as there are some problems with the repositories for universe and multiverse. After I removed all of these sources the update runs again without any issue.

Greetings


Partitions will mount at boot if they are specified in the file /etc/fstab and you can also set the mount options here to ensure it will be writable.

The Ubuntu help wiki has a good page about fstab and you can also see the fstab tag wiki

First, make a mount point for your partition in /media, for example,

sudo mkdir /media/storage

Then make a backup of your fstab

sudo cp /etc/fstab /etc/fstab-bak

Then get the UUID of the partition to be mounted. Since you know the partition you want is /dev/sda3 you can grep for it

sudo blkid | grep sda3

The output will look something like:

/dev/sda3: UUID="4ee1bbce-9d64-44b6-821b-511e06a804e0" TYPE="ext4" PARTUUID="482d7ecc-43f2-4c1b-985d-21b42999ed84"

Copy the long string after UUID between "quotes", from your listing, in my case 4ee1bbce-9d64-44b6-821b-511e06a804e0 is what I would copy.

Now open your /etc/fstab for editing in your favourite text editor, using sudo, for example

sudo nano /etc/fstab

at the end of the file, make a new entry using the UUID string you copied, the mount point you made earlier, the filesystem type, mount options and 0 0 at the end, for example:

UUID=4ee1bbce-9d64-44b6-821b-511e06a804e0 /media/storage ext4 defaults 0 0

Everything must be in the right order and separated by spaces. defaults will mount an ext4 partition as writable. If you want to add more mount options, they should be separated by commas and no spaces (see the documentation)


Dualbooting Windows 7 and Ubuntu on 2 hardisks

If your 1 TB drive only has a 200 GB partition on it, skip the rest of this paragraph. If it has one big partition on the entire drive (w/200 GB data on it) it would be best to shrink that partition first using Window's own Disk Management tool. If you cannot shrink it enough, cancel, defrag it to move files down on it, then shrink it. You may need to reboot Windows for it to check the partition shrinkage, that all went well.

That should not lose any files on that drive, but it is best to back up what you definitely do not want to lose, in case you make a mistake or get interrupted (power failure, etc.)

Then you can install Ubuntu on the unallocated part of the 1 TB drive. Make sure that you know which drive is which. While you are booted from Ubuntu live/install you may want to run bootinfo script and look at RESULTS.txt to make sure you know which drive is which and that the Windows mbr is on the SSD. I will assume for the remainder that the SSD is your primary drive (/dev/sda) with Windows mbr, and 1 TB drive is /dev/sdb.

Not sure if automatic partitioning methods allow you to select where to pub grub, but I personally would select Other at the partitioning part of install, partition like I want it, and put grub on /dev/sdb (assuming 1 TB). Afterwards before rebooting, switch your BIOS to boot the 1 TB drive. From grub there you should be able to select whether to boot Linux or Windows.

I do something similar with the drives reversed, where I left Win7 and its mbr on my 1 TB drive /dev/sda, but boot using grub in the mbr of my SSD /dev/sdb (which contains Ubuntu).


Command line dvd creation with chapters and menu

Probably dvdauthor could be used for your task, although it might take some work to get the results you desire. You'd have to use your script to write an XML input file for dvdauthor.

I'd start with a GUI frontend of dvdauthor to create an example input file, which then could be used as a template for the script.


Can't extract .tar.xz archive on 13.10 because permission denied

The tar file seems to have problems, I couldn't figure out why I had to do it in two steps:

I used xz to decompress the file:

xz -d vlc-2.1.0.tar.xz

Now I used tar to unpack the tar file:

tar xf vlc-2.1.0.tar

I can cd to the directory now:

cd vlc-2.1.0

In a nutshell:

wget -c download.videolan.org/pub/videolan/vlc/2.1.0/vlc-2.1.0.tar.xz
xz -d vlc-2.1.0.tar.xz
tar xf vlc-2.1.0.tar
cd vlc-2.1.0

I redownloaded the file and surprise, it worked. Extracting the file with tar Jxf vlc-2.1.0.tar.xz was all I had to do. If for any motive it doesn't work, redownload it.


How to make ffmpeg executable everywhere?

You don't need to edit your PATH or ~/.bashrc

The guide "installs" ffmpeg inside ~/bin so it does not potentially interfere with conflicting repository packages.
There is no need to edit your PATH or ~/.bashrc as shown in the accepted answer. ~/bin is already in the PATH by default (take a look at ~/.profile), but ~/bin is not included when you login if it does not exist (and it did not exist before you compiled), but you can easily "refresh" it as shown below.

All you need to do is this:

hash -r
. ~/.profile

Alternatively you can simply log out then log in.

Now you can run ffmpeg from any directory and it will automatically execute the ffmpeg binary in ~/bin (for the particular user who compiled ffmpeg). All of this is explained in the guide you linked to.

Getting it to work for all users

The above instructions are for the single user who compiled ffmpeg. If you have multiple users you can just move or copy the compiled ffmpeg binary into /usr/local/bin.


How to use the Raring/Saucy netboot installer to install Precise?

Use this netboot installer, it is the Precise Updates installer code + Raring's kernel 3.8:
http://us.archive.ubuntu.com/ubuntu/dists/precise-updates/main/installer-amd64/current/images/raring-netboot/


Because Java bytecode is portable, there isn't much difference between writing a Java app for Windows and writing one for Ubuntu.  You can use either Swing, SWT or JavaFx for your GUI, and Eclipse as an IDE.

You can also write native-looking apps in Java with JGIR.  JGIR will let you use GTK+ 3 to build your application.


E: The repository 'https://download.docker.com/linux/debian focal Release' does not have a Release file

Run
sudo gedit /etc/apt/sources.list.d/docker.list

comment the line, save, voila! Finished, your problem solved!


Cannot login via Unity login screen after upgrade to 12.04

I've changed the display manager from the default LightDM to GDM by installing latter via sudo apt-get install gdm. With GDM set as new display manager (execute sudo dpkg-reconfigure gdm if you couldn't set GDM as display manager during installation), I could log in via the old-school graphical login screen it presented me with after a reboot.

Once logged in, I reset my display manager to LightDM by executing sudo dpkg-reconfigure lightdm. After another reboot, things were back to normal: I can log in via the distribution's standard login UI, now.


How to change terminal theme / behavior?

There are different Terminal emulators (the windows) and different shells (the thing that does the work) and they can be configured or changed. Maybe you'll like the Zsh-shell more than the Bash which is default.
Terminal are made for Text In- and output. i don't think there is a need of a GUI. There are GUI-applications, which can be used as alternative to shell commands
There is possibility for Copy&Paste in Terminal emulators and many shells offer auto-complete with the TAB-key
many shells offer auto-complete with the TAB-key
most commands offer a simple help with command --help. For more information there are manpages: man command
You can open the help section in a different window or look it up on the internet with your browser

I know the shell is hard at the beginning, but there are much more possibilities than with most GUI-applications. If you like to do more with the shell, there are wikis who explain step for step how to use it


Shell does not show typed in commands, "reset" works, but what happened?

When running a shell or most programs in a shell anything you type is echo'd back to the user's terminal by the kernel's tty subsystem. There's other special handling, too, for erase characters, Ctrl+R, Ctrl+Z, and so on.
Certain programs, (editors in particular) that run from a command line don't need or want this. For this reason they signal the kernel with an IOCTL call against the tty (terminal) device that they don't want this behaviour. They don't want special characters to do special things, either. Instead they ask the kernel for a "raw" mode. In particular, editor's like vim turn off various "echo settings". All this applies to real tty terminals on a computer's serial lines, or the virtual terminals at Alt+Ctrl+F4, or the really virtual terminals you get when you run something like gnome-terminal under a GUI.
Such programs are supposed to reset any modes they change on the virtual tty they are using before they quit, either by entering a quit editor command or by taking a signal (from Ctrl+C) for example.
If they fail to do this properly the tty is left in the funny state you have discovered. Since programs can fail to reset the terminal, the reset command was written to allow the user to recover.
I assume the interrupt is messing with the python software you are running. I'd guess that that program isn't getting a chance to reset the terminal, or is simply failing to do so.
In the vim case, when I run your example I get the same behaviour you describe. I also see a message "Vim: Warning: Input is not from a terminal" (It goes away when you reset). This is because vim isn't started normally from the shell. Instead  the 'grep' and 'xargs' commands have been using the standard input, normally occupied by the tty, for purposes of passing the file names from grep tto xargs.
In your posted output from stty -a we can see "-echo", also confirming that this is the problem. If you were to kill vim in such a way that it couldn't handle the signal gracefully you would probably see the same problem.
The problem is described elsewhere at https://stackoverflow.com/questions/3852616/xargs-with-command-that-open-editor-leaves-shell-in-weird-state.
A solution for the vim case is avoid xargs and use instead:
vim $(grep foo * -l)

Here the list of files is constructed by the shell, as it had been by xargs, but the shell is calling vim, which is directly connected to the tty. There is warning message sent to the error output file, and vim sets and resets the tty settings correctly.
An alternative to reset that doesn't clear the screen is stty sane .
More references here, and another interesting one here. Another interesting solution is given in an answer to https://stackoverflow.com/questions/8228831/why-does-locate-filename-xargs-vim-cause-strange-terminal-behaviour.


Selectively exracting files from tar.gz file

List the contents with tar tzf data_backup_202.tar.gz | cat --number.
Use tail to chop the list to include only the members you want to extract:
tar tzf data_backup_202.tar.gz | \
  tail -n 256

Pipe the list of desired member names through xargs which will put as many member names on the generated command line as it can, while avoiding "Line too long" errors:
tar tzf data_backup_202.tar.gz | \
  tail -n 256 | \
  xargs -r tar xvf data_backup_202.tar.gz

Read man xargs tail tar.


Trying to remove libtinfo5 in Ubuntu, but got a unmet dependencies error

libtinfo5 is an important system package that must not be removed unless you really know what you are doing, which is clearly not the case here. You can now reinstall your system.


Unable to login to Ubuntu after creating partition for windows

After reviewing your /etc/fstab, and sudo blkid, and your gparted screenshots, it looks like you overwrote your Ubuntu /home partition /dev/sda1 with a new fresh NTFS partition.

You have to be very careful when working with tools like Window's Disk Management and Ubuntu's gparted.

I don't know of any reliable way to recover. Theoretically it might be possible to delete the current /dev/sda1 NTFS partition, manually recreate a ext4 partition with the exact same partition parameters as original, and maybe recover... theoretically. I can't assist with that.

Next step... delete the /dev/sda1 NTFS partition and reinstall Ubuntu. Hopefully you have good backups and can restore your important data.


I know this is a late response, but I edited /etc/apparmor.d/abstractions/libvirt-qemu and added the following:

/dev/tpm0 rw,

above:

/dev/net/tun rw,
/dev/tap* rw,
/dev/kvm rw,
It was at line 23.


avoid using nvidia card for Xorg with plasma

After discovering the questions and answers here How to configure iGPU for xserver and nvidia GPU for CUDA work,
notably the answer of user890178, and studying the syslog
I finally found that it is not plasma that does anything specific but the problem is the same for gnome and plasma shell when using Xorg. With Xorg the
gpu-manager.service

/lib/systemd/system/gpu-manager.service

is triggered by the display-manager

/etc/systemd/system/display-manager.service.wants/gpu-manager.service

and gpu-manager detects nvidia  and writes the file

/usr/share/X11/xorg.conf.d/11-nvidia-prime.conf

which contains

# DO NOT EDIT. AUTOMATICALLY GENERATED BY gpu-manager

Section "OutputClass"
    Identifier "Nvidia Prime"
    MatchDriver "nvidia-drm"
    Driver "nvidia"
    Option "AllowEmptyInitialConfiguration"
    Option "IgnoreDisplayDevices" "CRT"
    Option "PrimaryGPU" "Yes"
    ModulePath "/x86_64-linux-gnu/nvidia/xorg"
EndSection

This file is not used by Wayland and so the nvidia card is not used, but it is used for gnome-shell on ubuntu and plasma. So in fact both will use the nvidia card for Xorg.

The solution is then a variation of the answer of
Maksym Ganenko in the same question above which means is replacing
/usr/share/X11/xorg.conf.d/11-nvidia-prime.conf by

# DO NOT EDIT. AUTOMATICALLY GENERATED BY gpu-manager

Section "OutputClass"
    Identifier "Nvidia Prime"
    MatchDriver "nvidia-drm"
    Driver "nvidia"
    Option "AllowEmptyInitialConfiguration"
    Option "IgnoreDisplayDevices" "CRT"
    # Option "PrimaryGPU" "Yes"   <<< commented out
    ModulePath "/x86_64-linux-gnu/nvidia/xorg"
EndSection

# added
Section "OutputClass"
    Identifier "intel"
    MatchDriver "i915"
    Driver "modesetting"
    Option "PrimaryGPU" "yes"
EndSection

and additionally to avoid gpu-manager to replace these changes when starting the next session to  follow the advice of Oren in question gpu-manager overwrites xorg.conf to protect the file against changes
by means of running

chattr +i /usr/share/X11/xorg.conf.d/11-nvidia-prime.conf

I seems that the fact that the screen remained black after the adding the two files I mentioned in the question to /etc/X11/xorg.conf.d is due to the fact that with the files in /usr/share/X11/xorg.conf.d that the config file did contain contradicting information.

Given the comment of GabrielaGarcia that astonishingly made the claim that what I ask cannot work on a laptop, I feel the necessity to provide a prove, that what I asked can work, and that the answer I provided is indeed a means to make it work.

Here the output of lspci proving the existence of two graphics cards

(base) m3088: (~) 505> lspci | egrep "VGA|NVIDIA"
00:02.0 VGA compatible controller: Intel Corporation Device 3e9b
01:00.0 3D controller: NVIDIA Corporation GP107M [GeForce GTX 1050 Ti Mobile] (rev a1)

Here the output of ps aux filtering the Xorg, plasma, and anaconda python running a tensorflow session. This shows that all run happily together, while plasma and Xorg do not use the nvidia card as desired (see nvidia-smi below)

(base) m3088: (~) 511> ps aux  | egrep "Xorg|plasmashell|anaconda"
roebel   13139  0.9  5.1 17315584 819236 pts/1 Sl+  00:23   0:10 /data/anasynth/anaconda3/bin/python /data/anasynth/anaconda3/bin/ipython
roebel   16198  0.0  0.0  21540  1068 pts/5    S+   00:42   0:00 grep -E Xorg|plasmashell|anaconda
roebel   18886  1.5  1.3 628292 210572 tty2    Sl+  juil.14  24:22 /usr/lib/xorg/Xorg vt2 -displayfd 3 -auth /run/user/1000/gdm/Xauthority -background none -noreset -keeptty -verbose 3
roebel   19171  2.0  3.4 6576588 561212 ?      Sl   juil.14  33:16 /usr/bin/plasmashell

Here the output of nvidia-smi proving that Xorg is not using nvidia, but the tensorflow session in anaconda python is suing it.

(base) m3088: (~) 506> nvidia-smi
Tue Jul 16 00:34:51 2019
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 430.26       Driver Version: 430.26       CUDA Version: 10.2     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce GTX 105...  Off  | 00000000:01:00.0 Off |                  N/A |
| N/A   47C    P8    N/A /  N/A |    123MiB /  4042MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0     13139      C   /data/anasynth/anaconda3/bin/python          109MiB |
+-----------------------------------------------------------------------------+

I am ready to provide screenshots to show that all this happens on a laptop.


sorting a file using the sort command and overwrite it

Use the -o option of sort instead of using redirection operator, this will edit the file in place.

From man sort:

-o, --output=FILE
              write result to FILE instead of standard output

Here is a test:

$ cat test.txt
A
C
B

$ sort test.txt
A
B
C

$ sort test.txt -o test.txt

$ cat test.txt
A
B
C


Limit terminal command memory usage (previously CPU usage)

taskset, might be the 'magical_command' you are looking for. According to its man page:

"...taskset  is  used  to set or retrieve the CPU affinity of a running process given its pid, or to launch a new command with a given CPU affinity.  CPU affinity is a scheduler  property  that "bonds" a process to a given set of CPUs on the system.
       The Linux scheduler will honor the given CPU affinity and the  process  will  not  run  on  any other CPUs.  "

This would limit mybinary to run on the first two cores:

taskset --cpu-list 0,1 mybinary

Unfortunately, I don't see a parameter in taskset that would also limit what % of the CPU's time you want to allot it to run mybinary.


Can't paste Password into Ubuntu Software Center Log-in Field

I solved this problem by using keepassx instead of keepass.


How do I disable GDM and Graphical User Selection?

In Ubuntu 10.04 you should refer to documentation for Upstart which handles starting of tasks and services during boot, stopping them during shutdown and supervising them while the system is running.

Upstart handle start of gdm, so you should edit /etc/init/gdm.conf

sudo vi /etc/init/gdm.conf    # or use nano if vi is unfamiliar

Default runlevel in ubuntu 10.04 is 2 so you must change this line

stop on runlevel [016]

adding "2" in the runlevel list

stop on runlevel [0126]

Now you can reboot the system.


How do you set up a ubuntu server so that it can recieve and run code remotely

I would suggest openssh. As an SSH server, you can remotely execute commands (including python, java, ruby etc) in the terminal.

You can install it by entering sudo apt-get install openssh-server in the terminal or by clicking the link below:

Setup instructions and documentation can be found on the Ubuntu Help Page.


"Support" is a somewhat strong word here. As you stated, you performed an upgrade, not a fresh install. Python 2 is not installed by default, and has not been for a long time, as it was moved out of the main archive into universe, after 18.04. There however, are still plenty of packages in universe which depend on python2, and therefore it is still in the universe archive.

As you already had the package installed, it would have been upgraded rather than removed.


It will work just fine if you install gnome shell from the official repository. You can choose the desktop in the login screen else you will be automatically logged on to the last selection.

Also during install you can choose between the lightdm and gdm greeters, the first is the default and the second is the gnome one (both should work fine with unity and gnome). the greeter is basically the login screen.


How to change Ubuntu 14.04 logo and BIOS logo?

You can't change what your BIOS does.  For the few seconds between grub and the time X11 takes over, plymouth displays a splash screen.  You can customize it by taking the files in /lib/plymouth/themes/ubuntu-logo/ and copying them to another directory, modifying ubuntu-logo.plymouth to specify another ImageDir and putting your own .png image there, then use update-alternatives to redirect plymouth.default from /lib/plymouth/themes/ubuntu-logo/ubuntu-logo.plymouth to your version.


How do I install graphics.py on Ubuntu 14.04?

Here is a guide:

  Start at Zelle’s Python page at http://mcsp.wartburg.edu/zelle/python/.

  The graphics module is listed as *graphics.py. RIGHT-CLICK on the link and then select >Save Link As

  On a PC save the link in C:\Python31\Lib\site-packages

  On a Mac save the link in

  /Library/Frameworks/Python.framework/Versions/3.1/lib/python3.1/site-packages/

  On Ubuntu save the link in

  /usr/lib/python3/dist-packages


Automatically switch between German and English spell checking

There is a Firefox plugin that does the job:
https://addons.mozilla.org/en-US/firefox/addon/automatic-spelling-language/?src=search
I guess you'll need to have both German and English dictionaries installed, of course!


Installation Steps of Oralce Client 11.2

The library libpq is required by Perl DBI.

sudo apt-get install libpq5

Next time you can use this command t find the missing package:

% apt-file search libpq.so.5
libpq5: /usr/lib/x86_64-linux-gnu/libpq.so.5
libpq5: /usr/lib/x86_64-linux-gnu/libpq.so.5.7


Need a service to monitor network traffic for every processes

According to your comments you need no logs saved on drive and wish to run the network monitor as system service enabled at system start. Let's do it.

Install nethogs utility:

sudo apt install nethogs

Create bash script inside your home directory (your can replace it with other directory) assuming your username is bob:

touch /home/bob/nethogs.sh

Make the created script executable:

chmod +x /home/bob/nethogs.sh

Open script in text editor and copy and paste its code:

#!/bin/bash
pipe=/tmp/nethogs_pipe

trap "rm -f $pipe" EXIT

if [[ ! -p $pipe ]]; then
    mkfifo $pipe
fi
exec 3<>$pipe
nethogs -t -a >&3 2>&1

exit 0

Save changes and close text editor. Next create another script to read named pipe created by nethogs.sh script:

touch /home/bob/netmon.sh

Make the script executable:

chmod +x /home/bob/netmon.sh

Copy and paste to netmon.sh the code:

#!/bin/bash

pipe="/tmp/nethogs_pipe"

while true
do
    if read line; then
        echo $line
    fi
done <"$pipe"

exit 0

At next step we have to convert the nethogs.sh bash script to system service. Create/open the file in editor:

sudo nano /etc/systemd/system/nethogs.service

and copy/paste the code (replace bob in ExecStart with your username):

[Unit]
After=network.target

[Service]
ExecStart=/home/bob/nethogs.sh

[Install]
WantedBy=default.target

Save changes and close the file. Make the created service enabled at system start:

sudo systemctl enable nethogs.service

Start the nethogs service:

sudo systemctl start nethogs.service

and check its status:

sudo systemctl status nethogs.service

Finally cd to your home directory where netmon.sh script resides and execute the script:

./netmon.sh

To quit monitoring press CTRL+C. That's all.

If you want to save monitoring data to drive, replace content of the nethogs.sh script with the code:

#!/bin/bash
log="/var/log/nethogs.log"
err="/var/log/nethog.err"
nethogs -t -a > $log 2> $err

exit 0

and restart service:

sudo systemctl restart nethogs.service

Live monitor through named pipe will be disabled and output of the script will be saved to /var/log/nethogs.log file - just open it with less or tail, for example:

tail -f /var/log/nethogs.log

All of errors will be saved to /var/log/nethogs.log file. The /var/log/nethogs.log will be cleaned up everytime computer rebooted/service restarted, to disable files cleanup  and to enable output appending replace content of the nethogs.sh script with another code:

#!/bin/bash
log="/var/log/nethogs.log"
err="/var/log/nethog.err"
nethogs -t -a >> $log 2>> $err

exit 0

Remark. In nethogs command options -t and -a inside scripts can be replaced according to your version installed. In Ubuntu 18.04 nethogs version option -t means tracemode and option -ais listen all interfaces.


How do I enable the AppArmor profile for Firefox?

Simply run this instead of using cat:

sudo apparmor_parser /etc/apparmor.d/usr.bin.firefox

-a or add is the default operation apparmor_parser performs.

  Why? the command as you tried it will work if you are logged in as root or you recently used sudo; the sudo password entry is causing the problem you experienced. In general, for pipes use this syntax:  sudo sh -c "command1 | command2"

  Note: the /usr/bin/firefox AppArmor profile is disabled by default in Ubuntu. As long as the version of Firefox you download installs in /usr/bin (e.g. not your home directory), the default AppArmore profile can be enabled and will work.


Why are there some packages in the Software application but not in apt?

You have just discovered "snap" packages, they are deployed by "snappy" package management system built by Canonical Ltd. (the Ubuntu company).

  Snaps are containerised software packages that are simple to create and install. They auto-update and are safe to run.

Read more here: https://docs.snapcraft.io/getting-started/3876

The Software application also contains snaps, in fact

  Some applications are available in both formats. In such a case in Ubuntu Software the snap will be listed first. (source)


Can't block YouTube using host file in Ubuntu 16.04

Correct hosts line should look like this:

 127.0.0.1  www.youtube.com

Then your ping www.youtube.com should look like this:

64 bytes from sayantani-Aspire-ES1-512 (127.0.0.1): icmp_seq=1 ttl=64 time=0.036 ms
64 bytes from sayantani-Aspire-ES1-512 (127.0.0.1): icmp_seq=2 ttl=64 time=0.102 ms
64 bytes from sayantani-Aspire-ES1-512 (127.0.0.1): icmp_seq=3 ttl=64 time=0.104 ms

Explanation: The hosts file does not block the connection, it replaces the destination www.youtube.com with your localhost (sayantani-Aspire-ES1-512).

If you want to block the destination then you need to use iptables with -drop -dest and IP address...

By using hosts file you get reply not from youtube.com, but from your host defined in the hosts file, which is correct.

With following commands you can drop the packets to a 12.34.56.78 destination (replace it with your target IP address):

iptables -I OUTPUT 1 -d 12.34.56.78 -j DROP
iptables -I FORWARD 1 -d 12.34.56.78 -j DROP
iptables-save

But using iptables command requires a deeper knowledge of iptables and the rules you have on your system now.


I'm not terribly sure about multitouch, but tablet and touchscreen can be config'd under Settings > Mouse and Touchpad, and then by selecting your touch device from the drop down menu. In mine, I can select "Serial Wacom Tablet touch" and then select the "Tablet" tab below, which allows me to configure the tracking and rotation.


Why I can only see a few folders in Windows disk?

First of all, have the Windows drive checked using the Windows drive checking tools to repair any inconsistency it may have. Then head the following general advise.
Background
Files on an MS Window partition are stored on a file system that is formatted as ntfs, the file system of Windows. Ubuntu supports this file system for reading and writing, and also has basic file system repair tools.
When you access a Windows file system in Linux, you need to make sure that the file system is clean. That means that Windows should have fully closed the file system before you access it with another file system.
Windows, with the feature "faststart" enabled, does not fully close the file system, as part of the strategy to boot faster. While that is fine for a file system only used by Windows, it is not if you have another OS that needs to access to the drive.
Practical advice to keep the partition healthy
Ensure that the ntfs volume is properly closed and healthy ("clean") before you use it with Ubuntu.

Disable the option "Fast start" of Windows, so Windows fully shuts down, closing all file systems whenever you turn it off.
Effectively Shut down Windows before switching to Ubuntu. No hibernate!
Have the drive regularly checked using the Windows drive checking tools.

If you head that advice, you will be able to seamlessly access the volume on Ubuntu. On Ubuntu, the same rule applies: fully shut it down before starting Windows.


Why does "p" in "aptitude search" mean not installed at all?

p is for : the package and all its configuration files were removed, or the package was never installed. According to aptitude documentation

[ http://algebraicthunk.net/~dburrows/projects/aptitude/doc/en/ch02s02s02.html ].

And p is for "purged" so it is absent from the system. I guess that is the meaning :)


How to forcefully remove MySQL and MariaDB with unmet dependencies, when apt-get and dpkg do not help?

You have confused the packaging system. "Finally, I also manually deleted all files in the directory tree, which contained anything in the name from MySQL or MariaDB". DON'T DO THAT!

The only stable packaging system state that might be available to you now is with NONE of the packages mentioned installed, then begin again, more carefully.

To get to the "NONE" state, remove and purge each package:

PKGS="mysql-server mariadb-client mariadb-server-10.0 mariadb-common mysql-community-server"
sudo apt-get check
sudo apt remove $PKGS
sudo apt purge $PKGS
sudo apt autoremove
sudo apt-get install --reinstall mysql-server

You may get warnings from these commands, probably due to the mess you made. Try to ignore them.


Canon CanoScan LiDE 25 Ubuntu 14.04 lts Failed to Scan

I use Canon CanoScan LiDE 25 and recently tried to scan again using Simple Scan. While the scanner always works for 32-bit system, it had failed work at all for 64-bit system. I have confirmed these results while running Xubuntu 14.04.

Proof of failed attempts

In the following attempts, I connect the scanner to USB 3.0 and 2.0 ports in turns and run lsusb and dmesg | tail commands in Terminal to confirm it is being detected. The output lines have been trimmed to show the relevant ones only.

Attempt 1. Use USB 3.0 port to connect the scanner (Detect: YES, Scan: FAILED)

  $  lsusb

  Bus 001 Device 011: ID 04a9:2220 Canon, Inc. CanoScan LIDE 25

  $  dmesg | tail

  [  719.578197] usb 1-1: new full-speed USB device number 11 using xhci_hcd

  [  719.596841] usb 1-1: New USB device found, idVendor=04a9, idProduct=2220

  [  719.596863] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0

  [  719.596878] usb 1-1: Product: CanoScan

  [  719.596890] usb 1-1: Manufacturer: Canon

  [  719.669064] WARNING! power/level is deprecated; use power/control instead

Attempt 2. Use USB 2.0 port to connect the scanner (Detect: YES, Scan: FAILED)

  $  lsusb

  Bus 001 Device 012: ID 04a9:2220 Canon, Inc. CanoScan LIDE 25

  $  dmesg | tail

  [  719.669064] WARNING! power/level is deprecated; use power/control instead

  [  898.267099] usb 1-1: USB disconnect, device number 11

  [  905.255202] usb 1-4.3: new full-speed USB device number 12 using xhci_hcd

  [  905.273163] usb 1-4.3: New USB device found, idVendor=04a9, idProduct=2220

  [  905.273186] usb 1-4.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0

  [  905.273201] usb 1-4.3: Product: CanoScan

  [  905.273214] usb 1-4.3: Manufacturer: Canon

Why did not work

I read somewhere that the presence of USB 3.0/XHCI may interfere the use of scanner. This didn't make much sense to me, so I just tried changing the ports without disabling any USB settings in BIOS/UEFI menu. In both attempts, Simple Scan failed with error as shown in screenshot below.

I estimate 64-bit driver support is still lacking to this answered date. Or, 32-bit device driver must be used to make the scanner work properly. That being said, I even tried to install Simple Scan for 32-bit system on Xubuntu 14.04 64-bit system but failed miserably.

Now it works (2016-07-06)

I tested again Canon CanoScan LiDE 25 against Xubuntu 16.04 64-bit live system. I repeated the attempts above and it worked from both USB 2.0 and USB 3.0 ports. No further configuration is required; the scanner works out of box in 16.04 releases.

Above all, I didn't manage to figure out why it didn't work in 14.04 64-bit and why now it works for 16.04 64-bit. These LTS releases are already quite different in terms of kernel release, package version, program version, and others.

TL;DR For 64-bit system, the easiest solution is to use the current release (16.04). Else, the scanner works in 32-bit system of any release that is supported to this date.


Dual boot: Automatically mount NTFS disk at 18.04 startup with all permissions

Please make sure you have disabled Fast Boot in your BIOS/Firmware setup, and also disabled Hibernation and Fast Startup in Windows, as they can cause this issue.   As cl-netbox wrote in How to disable hibernation and fastboot from windows so dual boot works in Ubuntu 14.04 (with specific keystrokes and commands added here for ease of use), you must boot into Windows, disable hibernation and Fast Boot. How?

Open command prompt as administrator and execute:

powercfg /h off

Open the "old" version of Windows Control Panel with Win+R.
Go to the Power Settings and uncheck Fast Startup.
If you don't see Fast Startup, enable Show Hidden Settings.

Shutdown the machine completely, do NOT reboot, by tapping Win then click on the power icon at far lower left; hold down Shift and click Shut down.

Boot into your BIOS/Firmware settings (they key for which which varies on different PCs) and select Ubuntu as default system.
Now you can select the OS to boot from GRUB menu.

https://unix.stackexchange.com/questions/477733/is-it-necessary-to-disable-fast-boot-in-windows-to-dual-boot-with-linuxefistub/477740#477740 also provides useful detail.


Does high definition videos play smoothly on Samsung N150 Plus?

I found this question somewhat funny, since your computer has only 1024x600 display.

Nevertheless, Samsung N-150 has an Intel Atom N455 1.66 GHz and GMS 3150 graphics card, which is simply not enough to flawlessly play high definition movies. Perhaps it could handle some 720p movies depending on the used coded, but definitely not 1080p. Changing OS will not help, since it's the hardware that is not powerful enough.

There was a discussion about this CPU and HD movies, here.
And another link related to what Atom CPU's could handle particular HD content, here.


Photo print extremely dark and yellow. Profiling failed. What now?

I wonder if this page may help you:
Canon printer color printing too dark

I have a similar problem. I recently installed Ubuntu Mate 16.04. My memory is that colours on my Epson were fine. However I have been travelling and using friends' printers. With both an HP Deskjet 3050A and a Canon MG6800 (using CUPS+Gutenprint driver), the cyan and magenta were correct but the yellow was too dark and mustardy, making the red, green and blue too dark.


Is there an application/way to fix or confine bad sectors with Ubuntu?

No doubt this is a duplicate, but the answer needs to be put up front:

Replace that hard disk NOW!! Bad sectors cannot be fixed. A small number can be worked around, but this is done automatically by the firmware in the hard disk; you should never see any sign that they actually exist unless you run a SMART test on the disk. When you start seeing bad sectors, it means that the disk is failing. The disk may continue to be usable (in a limited way) for anywhere from no time at all to months, but the problem is that these failures can and often do escalate very rapidly and without further warning -- the bad sectors are the warning. Thus, you should go to a store today, buy a new disk, and copy your data off the bad disk today. Don't mail-order a new disk to save $10, because the extra time for delivery of the disk could be the time in which you go from 1,880 bad sectors to 1,880,000 bad sectors.


in installing Ubuntu facing problem with following message "serious errors were found while checking the disk drive for /"

My guess is that GRUB is looking for your / partition in the wrong place, or failed to install at all. In order to diagnose your problem, you will want to use boot-repair. Since you have an Ubuntu LiveCD/LiveUSB, it is most convenient to run the utility from there. Instructions on doing so can be found at the Ubuntu Community Wiki, but a brief synopsis can be found below.

Boot into your LiveCD/LiveUSB
Choose "Try Ubuntu"
Establish an Internet connection. Note that this is different from a network connection in that you need to be able to connect to a website as well.
Open the Terminal application from your Dash. If you are having trouble finding your Dash, try typing just Ctrl + Alt + T.
Enter the command, sudo add-apt-repository ppa:yannubuntu/boot-repair && sudo apt-get update. Be sure to follow this with a carriage return (Enter) so it can execute.
Enter the command, sudo apt-get install -y boot-repair && (boot-repair &) after it finishes executing, and be sure to execute this one as well.
Select "Recommended Repair".
When the repair is finished, copy down the URL you are provided with. If your repair does not work, this will be necessary for further troubleshooting.
Reboot your computer normally (i.e. not to your installation media).
Now, you should be able to boot to Ubuntu. If that is not the case, please update your question with the URL you copied down earlier.


How can I do a cdromupgrade if 12.10 does not have an alternate iso?

Correction:

Apparently you can't.  I've just burned a 12.10 DVD and booted off it to have a look, but it is not offering and upgrade option, only 'use all of the disk' 'install alongside' and 'something else'.  It seems they have indeed removed the CD upgrade option.

Even holding down Space to get to the utility menu does not yield an upgrade.

I think there were some problems with the CD upgrade in past versions but I thought it was one of the better ideas I've seen regarding upgrades.  Let's hope it comes back in future releases.


How come I cannot make this file executable (chmod permissions)?

Following worked for me:

First, save the old copy of /etc/fstab to say $HOME/fstab.old

Now run

$mount

to get the device type (eg, /dev/sda3), look for where the drive is mounted,

Example:

/dev/sda3 on /some/path type fuseblk (rw,nosuid,nodev,allow_other,default_permissions,blksize=4096)

(NOTE: In your case the device type and the directory where it's mounted will be different).

Find the UUID of the disk by running:

$blkid

On my system this returned:

/dev/sda3: UUID="90FEDFC7FEDFA3AE" TYPE="ntfs"

Copy/paste the following entry in your /etc/fstab file:  (run gksudo gedit /etc/fstab to edit)

UUID=90FEDFC7FEDFA3AE /media/Software ntfs rw,noauto,users,exec,nls=utf8,umask=003,gid=46,uid=1000    0   0

(NOTE: WRITE THE UUID OF YOUR DISK. Also provide any path that is convinient to you).

Restart your computer.
Now you should be able to execute any file.


The command could not be located because '/usr/bin' is not included in the PATH environment variable

Your PATH variable has been messed up.  Unless you are trying to run a restricted user with rbash, you should have /usr/bin in $PATH.  For a terminal session you can fix this by running:

export PATH="/usr/bin:$PATH"

As @SylvainPineau mentioned, this answer covers how to permanently fix your path by editing the /etc/environment file.


Stuck at boot after updating Nvidia drivers

I managed to find a solution.

I had to uninstall the nouveau drivers through recovery boot and install the proper nvidia drivers, the whole procedure is explained very well on this page : http://www.allaboutlinux.eu/remove-nouveau-and-install-nvidia-driver-in-ubuntu-15-04/ (You can skip the second page).

The only twist I had to use was to obtain the drivers (since I had no access to the desktop) using the command "sudo apt-get install nvidia-XXX", XXX being your driver's version (you can find the info on the Nvidia website).

Note that this command line may or may not work out of the box (I went through a lot of trial and error to make it work).My guess is that it would also be possible to download the drivers elsewhere and mount them through the recovery, and then to follow the instructions in the guide.

Everything worked fine afterwards.


how to update dolphin file manager in real time

The way in order to refresh Dolphin is to press F5. However, this would be manual.

In order to continuously refresh, an automatic solution, create a bash script that runs on boot. This bash script should press F5 every five seconds if Dolphin is open. Create a file named dolphin-update in /usr/local/bin with the following contents:

#!/bin/bash
while true; do
    PID=$(pgrep "dolphin")
    if [ "$?" -ne "0" ]; then
        xdotool key 'F5'
    fi
    sleep 5
done

You may need to first create it as root and then change the owner to your user:

sudo chown username:username /usr/local/bin/dolphin-update

Ensure that it has executable permissions:

chmod +x /usr/local/bin/dolphin-update

Now we need that to run on boot. To do that run sudo crontab -e and add the following line to the end of the file:

@reboot /usr/local/bin/dolphin-update

This script will run on boot.

You should now have a continuously refreshing Dolphin!

There are some caveats to this script.

If you open Dolphin, go to another application where F5 triggers something, (eg Chromium refreshes the page), the script will still run and be a constant annoyance. Solution: Close Dolphin when not actively using it.
As a cron job is used, if your computer crashes, the script will not run on boot. However this is a problem with cron not the script.

What the script means, line by line:

#!/bin/bash - shebang to run with bash
while true; do - run continuously
PID=$(pgrep "dolphin") - find the process ID of a dolphin instance. This is purely there to check whether there is even a instance of Dolphin running.
if [ "$?" -ne "0" ]; then - check the result of whether there is a Dolphin instance running. If there is, then ...
xdotool key 'F5' - press F5
fi - end the if block
sleep 5 - wait 5 seconds before repeating the process
done - end the while block


I can't access my samba shares. Ubuntu Server 20.04

Just so I understand the question: You are trying to access Ubuntu Server 20.04 from another Linux client? If that is so it won't work by default.

You have three choices:

[1] Enable SMB1 on the server:

Edit /etc/samba/smb.conf and under the workgroup = WORKGROUP line add this one - NT1 is samba speak for SMB1:

server min protocol = NT1

Then restart smbd:

sudo service smbd restart

[2] Keep smb.conf as it is but have the client ask for the server and share explicitly either through Connect to Server or in the Location bar as

smb://server-name.local/share-name

The .local part requires you add the avahi-daemon package to your server. You can try it without the .local and just use the host name but that can be problematic. Or you can use the server's IP address.

[3] Use a CIFS mount from the client. For example:

sudo mount -t cifs //server-name.local/share-name /mountpoint -o guest,uid=1000

After some syntax changes you can set this up as a systemd automount in fstab so the user doesn't have to use the terminal.


What developer text editors are available for Ubuntu?

Geany
Geany is a lightweight IDE that supports python.
Some features that I have found particularly useful include:

Syntax highlighting
Automatic indenting - especially useful for python
Code folding, allowing you to hide parts of your code
Inbuilt syntax checking and execution
Symbol browser
Embedded terminal
Find and replace with regexp support


Warning: fsck not present, so skipping root file system

I had the same problem and the solution described here worked perfectly for me.
umiddelb wrote:

You need to add the relevant executables:
echo \
'#!/bin/sh
. /usr/share/initramfs-tools/hook-functions
copy_exec /sbin/e2fsck /sbin
copy_exec /sbin/fsck /sbin
copy_exec /sbin/fsck.ext2 /sbin
copy_exec /sbin/fsck.ext4 /sbin
copy_exec /sbin/logsave /sbin' \
  | sudo dd of=/etc/initramfs-tools/hooks/e2fsck.sh
sudo chmod +x /etc/initramfs-tools/hooks/e2fsck.sh

before building the initrd
sudo update-initramfs -c -k ${kver}

After that, reboot and checkout the results.


Create a symbolic link

sudo ln -s /usr/lib/i386-linux-gnu/libgnome-keyring.so.0 /usr/lib/libgnome-keyring.so.0

sudo ln -s /usr/lib/i386-linux-gnu/libgnome-keyring.so.0.2.0 /usr/lib/libgnome-keyring.so.0.2.0


T530 unable to boot Linux after latest Windows 10 update, no external devices

My suspicion is that you're correct that the Windows updates included a firmware update that wreaked havoc. Unfortunately, sometimes firmware updates on EFI systems wipe out boot entries. Windows is usually unaffected by this because it installs a copy of its boot loader in the fallback position (EFI/BOOT/bootx64.efi) and many EFIs recognize the Windows boot loader in its normal position (EFI/Microsoft/Boot/bootmgfw.efi) as a fallback filename. Ubuntu and Fedora aren't so lucky, though; if their entries get wiped, they most likely won't boot.

In general, the solution is to be prepared with an emergency boot disk. This could be an Ubuntu installer that you can use to run Boot Repair, a copy of my rEFInd boot manager on a USB flash drive or CD-R, an EFI shell on a USB flash drive or CD-R, or knowledge of how to use your firmware to launch an arbitrary boot loader and where the boot loader for your OS lives (but note that many EFIs lack this feature). Depending on your solution, you may then need to manually re-create boot entries. Sometimes this is most easily done by re-installing your boot loader, but that's overkill; one or two efibootmgr commands will normally do the trick.

Of course, in your case you had the added complication that your firmware stopped showing you options to boot from removable media. That could be a matter of firmware configuration settings that you could tweak -- sometimes these options are hidden by "fast boot" or "minimal USB initialization" settings. This is getting into territory where model-to-model differences are extremely important, so it's hard to say what's normal or common.


The package dhelp hasn't been available since Trusty: You could:

Try to install the Precise version, but I don't have Trusty in order to test that, sorry ;)

wget http://mirrors.kernel.org/ubuntu/pool/universe/d/dhelp/dhelp_0.6.20ubuntu1_all.deb
sudo dpkg -i dhelp_0.6.20ubuntu1_all.deb

Try to install dwww without installing apache2: It's possible to force the installation of dwww without the dependencies, but it's something else I'm not willing to test on my system neither, sorry!

apt-get download dwww
sudo dpkg -i --force-all dwww_1.12.1_amd64.deb

So better take a system backup before you try any of the above workarounds...  ;-)


Is linux binary universal to all kinds of distributions?

This is two questions:

Is a Linux binary universal to all distributions?

It depends:

If the program is using nothing outside the Linux kernel, it will be universal except for the 32- or 64-bit question. A Linux "hello world" (a minimalistic program that just prints "hello world" to a terminal window) could probably be independent of the distribution.
If the program is using any non-kernel library or service (which is most of Linux, the kernel is fairly small), there are differences in which libraries are included, which versions these libraries are and where they are located. So in this (most common) case distributions are not equal.

Why do many commercial programs say that they only work on one or a few distributions?

Because there is a very large number of Linux distributions, and nobody wants to test their program on all of them.

A commercial vendor will normally say that they support only the distributions they have tested their software on. It may or may not work on other distributions, from the vendor's perspective the point is just that you can't complain if it does not work on a distribution they don't support.

Which distributions are selected for testing depends on what the vendor expects their customers to be using. Commercial/professional programs commonly pick enterprise distributions, possibly through a reasoning similar to "people who paid for their OS are more likely to pay for our software", possibly simply by counting the distributions used by their existing customers.

See also Mark Shuttleworth (the guy that is the reason we have an Ubuntu in the first place) on binary compatibility between Ubuntu and Debian - Debian is the closest distribution relative of Ubuntu.


php scripts dont work when called from php tags in html

Open the file /etc/php5/fpm/pool.d/www.conf:

sudo nano /etc/php5/fpm/pool.d/www.conf

and add .html at the end of the following line:

security.limit_extensions = .php .php3 .php4 .php5 .html


Everytime I turn my computer on its in something called grub?

Reinstall Your Windows Boot Loader From the Windows DVD / USB.

Use repair your computer option from windows installer then reboot.

http://www.howtogeek.com/howto/33433/restore-the-windows-boot-loader-after-an-ubuntu-update/


Installing icons via gnome-tweaks crashed my system

I solved it, in case you stumble upon the same problem, just run:
dconf reset -f /org/gnome/

if you don't have dconf installed, then run:
sudo apt install dconf-editor


Instead of sshpass -p "passwordhere" ssh -o StrictHostKeyChecking=no user@host, make it

if $(sshpass -p "passwordhere" ssh -o StrictHostKeyChecking=no user@host); then echo "Success!"; else echo "Bother.  Didn't work."; fi


How do I check the battery's status via the terminal?

The below command outputs a lot status and statistical information about the battery. The /org/... path can be found with the command upower -e (--enumerate).

upower -i /org/freedesktop/UPower/devices/battery_BAT0

Example output:

  native-path:          /sys/devices/LNXSYSTM:00/device:00/PNP0C0A:00/power_supply/BAT0
  vendor:               NOTEBOOK
  model:                BAT
  serial:               0001
  power supply:         yes
  updated:              Thu Feb  9 18:42:15 2012 (1 seconds ago)
  has history:          yes
  has statistics:       yes
  battery
    present:             yes
    rechargeable:        yes
    state:               charging
    energy:              22.3998 Wh
    energy-empty:        0 Wh
    energy-full:         52.6473 Wh
    energy-full-design:  62.16 Wh
    energy-rate:         31.6905 W
    voltage:             12.191 V
    time to full:        57.3 minutes
    percentage:          42.5469%
    capacity:            84.6964%
    technology:          lithium-ion
  History (charge):
    1328809335  42.547  charging
    1328809305  42.020  charging
    1328809275  41.472  charging
    1328809245  41.008  charging
  History (rate):
    1328809335  31.691  charging
    1328809305  32.323  charging
    1328809275  33.133  charging

You could use tools like grep to get just the information you want from all that output.

One simple way: piping the above command into

grep -E "state|to\ full|percentage"

outputs:

state:               charging
time to full:        57.3 minutes
percentage:          42.5469%

If you would often like to run that command, then you could make a Bash alias for the whole command. Example:

alias bat='upower -i /org/freedesktop/UPower/devices/battery_BAT0| grep -E "state|to\ full|percentage"'

Add that to the end of your .bashrc file, and you can type 'bat' any time, in the terminal.

There is also a upower -d (--dump) command that shows information for all available power resources such as laptop batteries, external mice, etc.


Software Center seems to freeze system when installing, syslog has "blocked for more than 120 seconds" errors

I got something similar, install with mini.iso on CD, so I hit Esc and the startup screen change to text mode, so I can see what happen, so I found 1/120 seconds value searching for IP, the file in my computer is url_helper.py, so try push the Esc key when you got the ubuntu logo on the screen and read what cause this 120 delay

Any way I try to change these value to, and looks like an Ubuntu cloud issue on the start up, hope this help you, I still searching for how to edit the 120 second value in the url_help.py routine, removed the IP searching or some kind of code that ignore this, if not network it's available.


Which VCS to use for Ubuntu development?

As is often the case, the answer is "it depends." It depends on exactly what kinds of contributions you are hoping to make. Ubuntu is a vast project made of many different software packages.

Some, like Unity or Software Center, are developed as part of the Ubuntu project. The "upstream" code lives in bazaar repositories, and the best way to contribute to those projects will be by proposing merges on Launchpad. Their development models are closely tied to this process with continuous integration tests run on each commit before it lands into trunk.

For most other software packages, Ubuntu is simply the "downstream." This software is either packages by Ubuntu developers or comes by way of Debian. The upstream development of these thousands of packages is of course done in many different VCSs, from CVS to git. For example, GNOME projects all live in git.  In order to work on these packages in a unified way using a DVCS, Ubuntu needed to make a choice. The choice of bazaar makes sense for us for a number of reasons. The fact that Canonical is the corporate sponsor of both Ubuntu and Bazaar was obviously a main factor. Ubuntu benefits from this greatly as Bazaar upstream resources are often used to specifically work on integrating with Ubuntu and pain points Ubuntu developers identify. Bazaar and Launchpad are already tied closely together. As Ubuntu already used Launchpad for bug tracking, it makes sense to keep development centralized there.

So, if you are planning of contributing to one of the projects that
Ubuntu is the "upstream" for, Bazaar is certainly the way to go.
If you are developing your own software that you hope to include in
Ubuntu, you can use any VCS you want.
If you want contribute to packaging software and making fixes to packages in Ubuntu,  the packages are all imported into Bazaar repositories, but you do not need to use those if you aren't comfortable with it. This is done to give people that want it the power of a DVCS, but you can still contribute by so-called "traditional packaging methods" for lack of a better word. Before Bazaar was adopted for Ubuntu development, these were the typical methods for contributing to Ubuntu.

As to the question of in what ways is Bazaar better than Git, that seems to be a bit of a different question.


How can I rename or alias an lpr CUPS queue name?

Well I could not see the wood for the trees. I deleted the auto-set-up queue and created a new one with the name I wanted.


I suggest reinstalling package called "plymouth-theme-ubuntu-logo". it's the default plymouth theme used in ubuntu.

sudo apt-get install --reinstall plymouth-theme-ubuntu-logo

Then make sure you are choosing it.

sudo update-alternatives --config default.plymouth

Then you will choose one of the installed themes (choose ubuntu-logo):

There are 4 choices for the alternative default.plymouth (providing /lib/plymouth/themes/default.plymouth).

  Selection    Path                                                           Priority   Status
------------------------------------------------------------
  0            /lib/plymouth/themes/numix/numix.plymouth                       100       auto mode
  1            /lib/plymouth/themes/numix/numix.plymouth                       100       manual mode
* 2            /lib/plymouth/themes/solar/solar.plymouth                       10        manual mode
  3            /lib/plymouth/themes/ubuntu-logo/ubuntu-logo-scale-2.plymouth   99        manual mode
  4            /lib/plymouth/themes/ubuntu-logo/ubuntu-logo.plymouth           100       manual mode

Press enter to keep the current choice[*], or type selection number:

Then save changes

sudo update-initramfs -u

Reboot, and check if it was solved


How to configure ufw on Ubuntu and still retain internet connection?

To check your current settings:
sudo ufw status verbose

To add basic firewall rules:

sudo ufw deny 5353/udp
sudo ufw deny 5900/tcp
sudo ufw deny 22
sudo ufw deny 25/tcp
sudo ufw deny 135,139,445/tcp
sudo ufw deny 137,138/udp
sudo ufw deny 110
sudo ufw deny 2049
sudo ufw deny 143
sudo ufw deny 21/tcp
sudo ufw deny ssh

To block Outgoing Ports Except Those Needed (This configuration will allow the following outbound ports: 20-21, 53, 80, 123, 443 which is all that is required for many users):

sudo ufw deny out 1:19/tcp
sudo ufw deny out 1:19/udp
sudo ufw deny out 22:52/tcp
sudo ufw deny out 22:52/udp
sudo ufw deny out 54:79/tcp
sudo ufw deny out 54:79/udp
sudo ufw deny out 81:122/tcp
sudo ufw deny out 81:122/udp
sudo ufw deny out 124:442/tcp
sudo ufw deny out 124:442/udp
sudo ufw deny out 444:65535/tcp
sudo ufw deny out 444:65535/udp

Re-check your changes:

sudo ufw status verbose

Re-check enable (required):

sudo ufw enable


Execute command on remote machine using telnet in one line

Instead of repeatedly invoking the ssh command, you could run ssh to repeatedly execute the command on the remote system and then parse and use the output locally.  Then you wouldn't have to keep running the ssh connection and putting up with the initial lag.

For example:

ssh remotehost "while [ "1" ] ; do iwconfig wlan0 ; sleep 1 ; done"

Or, you could use netcat to send the output on the remote system back to your machine.  For example, run this on the local machine:

nc -l 9999

Then on the remote machine:

while [ "1" ] ; do iwconfig wlan0 ; sleep 1 | nc localmachine 9999

Replace localmachine here with the host or ip of the machine that will be doing the "monitoring".

You could even pipe the output from nc reading that port into another command.

Closer to your actual question, you could do this on the remote system to act as a telnet "server":

while [ "1" ] ; do iwconfig wlan0 | nc -l 9999 ; done

Then you could do this to get the outupt:

telnet remotehost 9999


That's because you download from eclipse website and extract .tar file to Specified directory so if you want to remove eclipse :

Go to this directory and remove eclipse folder on my laptop /opt/eclipse.
Run this command whereis eclipse and remove output directories.
If you create specific Launcher icon go to /usr/share/applications or directory you create in and remove it (it will need permission so open your file manager as a root).


Problem installing Ubuntu 12.04.3 with flash drive on a Windows 7 laptop

Don't choose install alongside with windows option.Choose something else option.
Then format the partition you want to install ubuntu into ext4 filesystem.
After that install ubuntu on the formatted ext4 partition.


How to create VM image of Windows 10 on external drive using KVM?

First thing you need to know is the disk for a VM is stored as a file. There is no way it will occupy the whole disk, so it really doesn't matter whether you are storing it in an internal or external HDD. All you need is the free space to create the 'disk' file.

I would assume that you're using Desktop Environment. First, you need to mount the external HDD. You can do it via Disk Utility if you haven't done it.

Then, check out this article:
https://www.google.com/amp/s/www.linuxtechi.com/install-configure-kvm-ubuntu-18-04-server/amp/

Follow Step 2 and make sure you have installed everything mentioned. Probably you have already installed most of it, just double check if virt-manager has been installed as well.

If you can get to Step 5, then you simply need to create the disk on the external HDD mount point and continue to finish it.


I just answered the same question.

Dont worry just enter your terminal and enter : sudo apt-get install firmware-b43-installer

It should work again :)

Tell me if it doesn't


The problem I think I was hitting was that the Nvidia x-server would load my preferred resolution (1280x1024), but then the settings manager would load its preferred option, which by default was 1024x768.

How I ended up solving this - in terminal:

sudo leafpad /etc/X11/xorg.conf

Scroll down, likely near or at the bottom, to where it says something like:

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "Stereo" "0"
    Option         "nvidiaXineramaInfoOrder" "CRT-1"
    Option         "metamodes" "1280x1024_75 +0+0; nvidia-auto-select +0+0"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

The third option ("metamodes") is the resolution option. In that line, I removed the ; nvidia-auto-select +0+0. The line now looked like this:

Option         "metamodes" "1280x1024_75 +0+0"

This disallowed the settings manager to select the resolution it wanted and override xorg.conf, thus forcing the computer to use 1280x1024 by default.


Why does `reboot` and `poweroff` work without super user privileges in Ubuntu 16.04?

For me, both poweroff nor reboot needs a password on Ubuntu 16.04 .

However, for this to occur, I had to create a user account called "foo", for example, and then ssh to localhost as either that user or as myself.  When I do this, I do need to authenticate myself.  It seems to recognize another user is logged in.

For example, I get this message:

User foo is logged in on sshd.
Please retry operation after closing inhibitors and logging out other users.
Alternatively, ignore inhibitors and users with 'systemctl reboot -i'.

Presumably, it's "smart" enough to realize when there is in fact another user logged in.

(I agree with you that it would be nice to always authenticate as root.  Sometimes, no other user is logged in, but an important process is running in background performing some kind of calculation.)

Edit:  Just tried myself.  If I'm logged in as foo, I need to authenticate myself (who is in the sudo group).  If I reboot as myself with foo still logged in, I have to type systemctl reboot -i without a password.  I presume the difference is that the system knows I'm in the sudo group.

Edit 2:  As noted by Severus Tux, systemctl suspend -i behaved similar to systemctl reboot -i from the previous edit.


Which version of Ubuntu can I install on these specs?

What counts most here is not the "version" (e.g.Precise 12.04 instead of Oneiric 11.10), but the desktop environment that comes on top of the Ubuntu OS (Xfce/Xubuntu vs Unity vs KDE/Kubuntu). Beyond all these, there is one operating system.

Sorry to disagree with people here, but I do not think that 1 GB of RAM is sufficient to run in full comfort (that is smoothly, especially in using the Internet) the Ubuntu desktop which in fact is Unity. It is true that official sources state that Ubuntu/Unity will be installed and will run with 512 RAM etc but a question like the above does not refer to pure technical facts but to the practical and personal experience of the user in these circumstances.

I myself have a 1GB RAM computer and had to migrate from Windows to Ubuntu because decisive software like the latest versions of Firefox and Chrome would not run as good as before due to the new standards and demands of the Internet environment. As going from XP to Win7 would not have improved things for me, I installed Xubuntu. Everything changed instantly, my computer rejuvenated. But at the same time I installed Gnome and Unity, and there my computer was dead sluggish. So, I understood that Unity (and also KDE/Kubuntu) is for users that come to Ubuntu for other reasons than for trying to put to work older computers. From my point of view I would not use Unity on a computer that would not be able to run Win7 as well.

To continue my little story, in my 1GB RAM computer Xubuntu runs like XP would have in the era of Firefox 3.5. But here I am now up to date with all main programs. But  I have succeeded even more with the same computer, a better experience than I ever had in Windows (even when this PC was up to date). I was able to get more speed, snappy response, and also stylish appearance by employing the 1GB RAM PC into the LXDE/Lubuntu enviromnment. Which, along with Xubuntu/Xfce, I recommend for similar specs. For KDE and Unity, get 2GB RAM.

To really understand how the computer copes with the different desktop environments, one can install all the other desktop environments: Unity, Gnome, KDE, Xfce and LXDE (to have the specific dependencies use lubuntu-desktop instead of LXDE and so forth) although, in order to avoid risks of conflicts with the main installation, a usb-live testing is the best.

I think that the illustrative pictures that people see on the Internet for Xubuntu and Lubuntu desktops are misleadingly simplistic compared to Unity, and so people tend to chose the later no matter their specs. But to make the former ones look stylish is easy. Here is a Xubuntu desktop:

And Lubuntu/LXDE:


Cinnamon is a Gnome-Shell desktop fork.  It is not strictly a Gnome-2 interface, although the developers aims are laudable - to produce a simpler more traditional desktop interface.

Development seems to be rapid.  It is usable and certainly fun to play with with a growing number of extensions to install to extend the base installation.

How to install

for 13.04 & 13.10, 14.10 & later

Cinnamon is now available in the Universe repository

cinnamon

Alternatively - from the command-line:

sudo apt-get install cinnamon-desktop-environment

Since it is in this repository, it is community maintained and thus it is up to the community to update  the packages as and when new releases and bug-fixes are released.

For Ubuntu 14.04, there is currently no cinnamon packages in the Universe repository.

Via PPA for 11.10 and later

EDIT: 22/05/2014 - the PPA ppa:gwendal-lebihan-dev/cinnamon-stable has been removed or hidden from public view.  I contacted the maintainer and the following is their reply:

  The stable PPA is indeed no longer being maintained.

  The nightly PPA is being kept for development purposes and should not
  be used on any sort of production machine (it can and will break at
  any time).

  To be honest, I don't have an alternative to offer Ubuntu users at the
  moment, apart from switching to a distribution that does support
  Cinnamon. There are many such distributions out there, and I'm only
  hoping for someone to (finally) step up on Ubuntu's side to provide
  proper packages to its users.

EDIT: 25/04/14 - Two alternative PPA's have now been created - both claiming to enable the stable version of Cinnamon for Ubuntu users.  I cannot vouch for the veracity of these PPAs

Option 1: 12.04 & 14.04 users only:

sudo add-apt-repository ppa:tsvetko.tsvetkov/cinnamon
sudo apt-get update
sudo apt-get install cinnamon

Option 2: 14.04 users only:

sudo add-apt-repository ppa:lestcape/cinnamon
sudo apt-get update
sudo apt-get install cinnamon

As an alternative you may wish to consider the unstable nightly automatic builds - please note Gwendal's warning above:

sudo add-apt-repository ppa:gwendal-lebihan-dev/cinnamon-nightly
sudo apt-get update
sudo apt-get install cinnamon

Option 3: In addition, you can also install cinnamon 2.2 in Ubuntu 14.04 LTS and derivatives by adding Linux Mint 17 Qiana  repository in your system.

Open file /etc/apt/sources.list with nano command:

sudo nano /etc/apt/sources.list

Add the following line at the end of file /etc/apt/sources.list

deb http://packages.linuxmint.com/ qiana main upstream import

Update the repository then install the authentication key

sudo apt-get update
sudo apt-get install linuxmint-keyring

Update the repository again and install Cinnamon 2.2:

sudo apt-get update
sudo apt-get install cinnamon

After installation

Logout and select the Cinnamon session:

Enter you password and you'll see the Cinnamon desktop

... showing the traditional start type menu and applet design from Gnome-2

Extensions/Applets

The Cinnamon desktop uses the same philosophy as Gnome-Shell - functionality can be added to by installing Extensions & Applets.

Cinnamon uses its own Settings tool.

Cinnamon Settings

Cinnamon Applets

Similar to gnome-shell extensions - you can install applets from a dedicated Mint website.


Unable to locate package python-gnomedesktop

You wrongly written the package name.It's not python-gnomedesktop it's python-gnome2-desktop.So try the below commands to install that,

sudo apt-get install python-gnome2-desktop
sudo apt-get install python-rsvg
sudo apt-get install ipython

OR

sudo apt-get install python-gnome2-desktop python-rsvg ipython


Is there anyway to make Ubuntu remember my ssh key passphrase?

The core problem is that you have a password-protected SSH key.  What this means is that the private key is actually encrypted, and needs to be decrypted for use, hence the need for a passphrase.  (This same logic applies to PGP key actions such as signing, where you need to use the private key to generate a signature).  There should be an SSH authentication agent, or at least an agent working with gnome-keyring (14.04) which would be handling the 'prompts' and the 'gnome-keyring', however consider that this is not always the case when working in a CLI environment.

Seahorse should present your SSH keys under "Secure Shell" and nothing else, which may be causing one problem.  But the main issue is that the SSH key's private key half is encrypted and password protected, and the password is needed to initiate the 'secure' negotiation section with the key.  However, it isn't actually seahorse which controls the authentication, it's actually part of gnome-keyring which has to memorize things.  While it should be able to remember your password, it's apparently not able to operate in the way it needs to to provide you a GUI prompt to put in the password and then store the password in the keyring.

The only true way to remove the password prompt there on all cases is to remove the password from the SSH key.  While SSH keys should ideally have passwords as an additional layer of protection, ideally you will only store the password for the private key for the duration of the session, or the duration of the GUI session until you log off or reboot, or even ideally for the short time that you are doing the SSH key authentication.  This is done for security purposes, but in some cases it's not feasible or necessary.

If you wish to remove the password from your SSH key, then you will need to follow these steps: (source)

Remove the passphrase.

openssl rsa -in ~/.ssh/id_rsa -out ~/.ssh/id_rsa_new
Backup and replace your private SSH key.

mv ~/.ssh/id_rsa ~/.ssh/id_rsa.backup
mv ~/.ssh/id_rsa_new ~/.ssh/id_rsa
Set key permissions, as private keys are owner-readable only (this is OpenSSH enforced)

chmod 400 ~/.ssh/id_rsa
Test the connection via SSH, and there should be no password prompt.


How can I get back the data of my USB on Ubuntu 16.04.1 LTS?

Overview

The data are important. This means that you should not mount this drive (only connect it). Then you should clone it to a drive of at least the same size, and do the recovery work on the cloned copy. This method will reduce the risk (that the recovery attempts will destroy data, than are possible to recover).

There are several helpful pages and several tools available via the internet. I wrote the following short page with tips and links to tools, that have worked for me.

Repair the partition table and file system of a pendrive

Details about cloning

Clone a drive to another drive of at least the same size. The drives are represented as block devices.

1. According to example 1 in 'info ddrescue'

Boot from a 'third' drive, for example the internal drive or another USB boot drive with linux.

Install ddrescue

sudo apt-get install gddrescue

It is a two-step procedure, where the second step is only necessary when there are 'difficult' or bad blocks on the source device (the USB drive)

sudo ddrescue -f -n source-device target-device log-file
sudo ddrescue -d -f -r3 source-device target-device log-file

for example

sudo ddrescue -f -n /dev/sdd /dev/sde log-file
sudo ddrescue -d -f -r3 /dev/sdd /dev/sde log-file

but check very carefully and modify the device letters to your particular case.

2. mkusb

If you find this too difficult or risky, we can hope that there are no bad blocks in the source device. Then it is possible to do this with mkusb. It will help you select the target device in order to avoid writing to the wrong one and overwrite valuable data.

Install mkusb:

If you run standard Ubuntu, you need an extra instruction to get the repository Universe. (Kubuntu, Lubuntu ... Xubuntu have the repository Universe activated automatically.)

sudo add-apt-repository universe  # only for standard Ubuntu

sudo add-apt-repository ppa:mkusb/ppa  # and press Enter
sudo apt-get update
sudo apt-get install mkusb mkusb-nox usb-pack-efi

Run mkusb like this:

sudo -H mkusb source-device

To match the example above we assume

sudo -H mkusb /dev/sdd

and mkusb will display information about all devices and later the possible target devices to let you select it via a menu, where additional data is displayed.

mkusb will filter the devices, and only show what are suitable target devices with numbers to help you select the correct one, in this example a Sandisk Extreme pendrive at /dev/sde

Check in the terminal window, that the whole device was read and all data written (cloned)!

...
99
100
1962864+0 records in
1962864+0 records out
8039890944 bytes (8,0 GB, 7,5 GiB) copied, 440,371 s, 18,3 MB/s
Done
do_n_show: Work done
---------------------------------------------------------------------------
Syncing the device ...
Done :-)
Cleanup after mkusb finished :-)
---------------------------------------------------------------------------
Total time used [by mkusb] = 886 s; 00:14:46

(In this case there was extra total time because I made screenshots.)


How to add Silverlight to Chrome in 12.04?

I recommend installing Piperlight. In my ubuntu 13.10  and folowing the steps here
http://www.webupd8.org/2013/08/pipelight-use-silverlight-in-your-linux.html
it works smoth


Should I just contact the developer?

Yes. If it is closed source, or you don't know java...


Wow, how is the documentation for this so terrible? At the time of writing, the documentation on the official site literally says:

5.3. Configuring, building, and installing
WRITEME :-P (PKG_CONFIG_PATH, ./configure, make, make install, /etc/ld.so.conf, LD_LIBRARY_PATH, PATH, yadda yadda)

Here's how I installed it (on Ubuntu 18.04 LTS) after lots of trial and error. Keep in mind that gphoto2 is simply the CLI for libgphoto2. Simply installing gphoto2 won't do much for you.

Easy method

Use apt (or apt-get)

$ sudo apt install gphoto2
$ sudo apt install libgphoto2-6

You may be wondering why it's libgphoto2-6 and not just libgphoto2. When you're typing sudo apt install libgphoto2 press tab and see what it completes. You can also view what the latest packages are for each ubuntu build. Launchpad and packages.ubuntu.com.

After that you should be able to use gphoto2 in Terminal.

$ gphoto2 -v

should show you something meaningful.

Advanced build

If you go to the gphoto2 website, you'll notice that they've released updates to libgphoto2 since Ubuntu 18.04's latest package (2.5.16). Specifically, I want to have support for Sony Alpha A9, which requires libgphoto2 v2.5.22. You can download it from the source, but now what?

cd to the tar.bz2 file.

unzip it: autocomplete the file name by pressing tab

$ tar -xjf libgphoto2-2.5.22.tar.bz2

configure, make, make install Go into the directory. Each of these commands will take time, so enter one line at a time.

$ cd libgphoto2-2.5.22

$ autoreconf -is
$ sudo ./configure
$ sudo make
$ sudo make install

If at any point it says it looks like something went wrong, it's likely you're missing a package. I had to install: libtool, libpopt-dev, libsub-dev, libexif-dev, libjpeg-dev, autoconf, autopoint, libcdk5-dev

The github repo has an additional step of

autoreconf -is

which for me, required apt installing the autoconf and autopoint packages.

This updates libgphoto2. To update gphoto2, which I needed to do in order to use libgphoto2-2.5.22, you have to go through the same steps. Read the README.md. I had to install libpopt-dev. Running ./configure alerted me to this problem.

You may need to restart Terminal or your machine to see changes.

After that, check your version using gphoto2 -v.


What is the process to install Microsoft edge with Wine?

Every one of those "fixme" statements is a syscall that Wine cannot handle. Each statement represents a stub -- unwritten code, not broken code.
Your approach simply won't work unless you're on a team with a Wine developer who can write those missing syscalls.
Wine is a great, ambitious project with a lot of amazing people. Please keep in mind that it's a volunteer-led project, not a commercial software product. Wine has never promised complete compatibility with all Windows applications. Wine developers do not have access to the Windows source code. Updates to any of the many moving parts (Windows, the application, Wine, or Ubuntu) sometimes improve compatibility...but also sometimes break it.


We've been working on a transition plan for a while now. The desktop team put together a list of applications that are affected by the transition and people have started to post design recommendations, filing bugs, and fixing applications. Any help talking to application developers of your favorite applications is always welcome!

KDE applications all work (application indicators are based on the same KSNI technology) and everything we ship on the CD is ported. Many applications are also just porting to the technology on their own. Application Indicators specifically have a fallback mechanism in place so that application authors can use them without having to break on systems that use the old notification area.

In Unity when I use an application that doesn't use application indicators remember that the icon for the application is sitting in the launcher too, so it's not like it totally disappears from your view, it's just not sitting in the top right of the panel.

For 11.04 there is a whitelist for applications that need to use the area. Users can modify this list to add legacy apps if they require it.

(Omar has information on what will happen to other apps.)


Wiped 12.04 LTS and installed 13.04 over it, and I am loving it. Nice and speedy compared to my previous installation, and almost none of the glitches. That also solved this problem so I am answering my own and marking as such to close the question.


Is the port 443 in your router redirected to the host you have the server running on? If not, that could be the problem.

Try to connect to your server using the port directly:

https://yourpublicipaddress:443

If it doesn't work, you'll need to forward all the connections to the 443 port in the router to the local IP where the server is.


How to add a script as an icon in topbar

You would have to create an indicator app.

A quick example that you can work with is:

#!/usr/bin/python

# This code is an example for a tutorial on Ubuntu Unity/Gnome AppIndicators:
# http://candidtim.github.io/appindicator/2014/09/13/ubuntu-appindicator-step-by-step.html
# https://gist.github.com/candidtim/7290a1ad6e465d680b68

import os
import signal
import json
import subprocess

from urllib2 import Request, urlopen # URLError

from gi.repository import Gtk as gtk
from gi.repository import AppIndicator3 as appindicator
from gi.repository import Notify as notify

APPINDICATOR_ID = 'myappindicator'

def main():
    indicator = appindicator.Indicator.new(APPINDICATOR_ID, os.path.abspath('sample_icon.svg'), appindicator.IndicatorCategory.SYSTEM_SERVICES)
    indicator.set_status(appindicator.IndicatorStatus.ACTIVE)
    indicator.set_menu(build_menu())
    notify.init(APPINDICATOR_ID)
    gtk.main()

def build_menu():
    menu = gtk.Menu()

    item_myapp = gtk.MenuItem('MyApp')
    item_myapp.connect('activate', myapp)
    menu.append(item_myapp)

    item_quit1 = gtk.MenuItem('Quit')
    item_quit1.connect('activate', quit1)
    menu.append(item_quit1)

    menu.show_all()
    return menu

def fetch_joke():
    request = Request('http://api.icndb.com/jokes/random?limitTo=[nerdy]')
    response = urlopen(request)
    joke = json.loads(response.read())['value']['joke']
    return joke

def myapp(_):
    subprocess.call("myapp.sh", shell=True)
    return myapp

def quit1(_):
    notify.uninit()
    gtk.main_quit()

if __name__ == "__main__":
    signal.signal(signal.SIGINT, signal.SIG_DFL)
    main()

In the example above just change the myapp.sh to a full pathname of your script and it will run.  When you run the script it will place the item in the indicator to the menubar.

Details can be found at:
http://candidtim.github.io/appindicator/2014/09/13/ubuntu-appindicator-step-by-step.html
and
https://wiki.ubuntu.com/DesktopExperienceTeam/ApplicationIndicators


How do I know the password for my encrypted home directory?

It looks as if you are trying to install java, which (I presume it wants root access) needs an administrator's logon password, not the encryption key. Just give it the password you use to log on to Ubuntu. In fact, it is using sudo(or some GUI spinoff, like kdesudo, or gksudo) which uses the admin logon password to get rights to do anything under the system under the root account.

Reference: http://linux.die.net/man/8/sudo

Edit: Also, if it actually needs the encryption key, feel free to run:

ecryptfs-unwrap-passphrase

upon the terminal to get the long hex string you need.


Not able to see the sound indicator in system notifications

I believe that you are referring to the sound indicator in Panel 0 (usually at the top)?  If so, see Ubuntu launchpad bug #1208204

This has been observed by several users.  There is a patch in message #5 that I can confirm as working for me.  I suggest that you try the patch and reboot.  Does that bring the indicator item for audio control back into operations?

Note that the indicator-sound package containing the file needing the patch was just re-released yesterday without the patch (scheduling issue, probably).  I had to re-apply the patch.  So, keep an eye on your system updates.


Can I simulate a button press on a web page from terminal

You can use lynx:

lynx http://tokira.net/unicode/index.php

By default lynx is not installed in Ubuntu, but you can install it with:

sudo apt-get install lynx


How can I run Ubuntu 16.04 from a USB stick?

If you want to save changes to a Live Ubuntu install, the install needs to be Persistent.

You can save up to 4GB of changes if you use UNetbootin to install Ubuntu to a USB stick.

You can save unlimited changes to a persistent install made with mkusb.

Startup Disk Creator that comes with Ubuntu no longer makes persistent installs.

It is also possible to do a Full install to USB, the same as to an internal HDD.
It is recommended that you disable the internal drive before proceeding with this so as not to mess up the internal drive or install the boot loader in the wrong place. It also ensures a clean grub menu on the USB drive.


Considering that you have equal number of columns in all the rows, this should work for you:

awk -F' ' '{print NF; exit}' <filename>

awk is a patter scanning language

-F is the field separator; ' ' tells awk that columns are space separated. This will work even if there is more than one space between two columns.

print NF; exit prints the number of fields and exits

Caveat: This will report the number of columns in the first line only.

Refer to awk manual for more options.

Source: Similar question on SO


It looks like you have installed Ubuntu under Windows instead of or as well as as a separate partition. This means that when you load Ubuntu (the windows Ubuntu) you only have a very limited amount of space, but your hard drive shows a massive Ubuntu partition with a ton of space which isn't being used.

From your image here you can see in (1) where the ntfs partition (which is windows) is mounted as the host. Where as the Ubuntu partition (2) isn't mounted at all as anything. Also the new Ubuntu partition you've made (3) is where I think you've resized the Ubuntu partition (2) and created a new space, which is also not being used or mounted.

To solve this mess you need to back up all your files, delete the new partition and resize the Ubuntu partition back to 300GB. Then go into windows and uninstall Ubuntu from windows. Then see if it will boot into Ubuntu, if it will then job done. If it won't then you need a new install and you need to use the Ubuntu Live CD from boot (not from windows) in order to install it directly and not using a wubi install.

Comment here if you're having issues or need someone to talk you through it.


How to broadcast a wifi network with no internet?

Check if your laptop's wireless devices supports AP mode:

iw list

Under 'Supported interface modes' look for 'AP'.

If it is there, and you are using gnome you can just go to the Gnome Settings Manager -> Wifi -> Settings menu -> Turn on Wi-Fi Hotspot...

By default it will attempt to create a Wi-Fi network with the same name as the current hostname of your laptop.

Any environment with NetworkManager should be simple enough to enable this functionality on, though the GUI interface may vary, or may require command line invocations.


gromit / gromit-mpx doesn't work on Ubuntu 20.04

gromit uses the Pause key to control it. When you run gromit from command line or from its desktop icon, it starts and waits in the background.

To activate it you need to press the Pause key. Pressing Pause once more will make gromit wait in the background again. So, this key acts as a way to toggle painting.
Use the Shift+Pause key to clear whatever you have drawn.
Use Ctrl+Pause to toggle the view of whatever you have drawn.
Use Alt+Pause to stop and quit gromit.

Note: Most notebook keyboards will not have a separate Pause key. On my keyboard the Pause key is reached using the Fn+PgUp key. So, to quit gromit for example on my notebook, I have to use Fn+Alt+PgUp on my keyboard.
See the man page on how to change the Pause key to something more easy accessible.

gromit itself is not very useful, since it starts drawing from the left-top corner of your screen and connects with straight lines the area where you have released your mouse and then pressed the mouse key again. So, it is better to use gromit-mpx which allows you "to make multi-pointer annotations on your screen". gromit-mpx uses the F9 key instead of the Pause key, so:

Press F9 key to toggle painting.
Use the Shift+F9 key to clear whatever you have drawn.
Use Ctrl+F9 to toggle the view of whatever you have drawn.
Use Alt+F9 to stop and quit gromit-mpx.

The F9 key can be changed to something else. See its man page.


The problem was that my computer was sleeping during the times that the script was scheduled to run. :-)


Connecting to vnc of kvm guest without setting up Xserver on Ubuntu server

OK, finally I can get it worked so I post the answer here just in case someone needs it.

In short, I don't need to install both the vncserver and desktop environment on Ubuntu server in order to use vnc with KVM guest. The KVM does come with the built-in vncserver and hence it has different configuration. I had a big mistake when trying to install and config the vncserver for the host Ubuntu server since it's totally useless in my case.

To enable vnc for KVM, just enabling the following 2 options in /etc/libvirt/qemu.conf

vnc_listen = "0.0.0.0"
vnc_password = your-password

My 2nd mistake was not to set the password for vnc so the vncviewer always failed to connect, even in the case the password was set to empty.

After that, enabling the following option in /etc/libvirt/libvirtd.conf

listen_tcp = 1

And of course restarting the libvirt service again

service libvirtd restart

Now the KVM guest can be installed via the command line similar to:

virt-install [...] --graphics vnc,port=5900,listen=0.0.0.0

From the client PC that you want to connect with Ubuntu server, make sure to forward the port of vnc similar to:

ssh -v -L 5900:127.0.0.1:5900 -N -f 192.168.1.100

The address 127.0.0.1:5900 is the default localhost address for vnc on the Ubuntu server. I don't enable the firewall so it's not necessary for me to add the port 5900 to the firewall.

Finally, open the vncviewer on client PC and connect to vnc://127.0.0.1:5900, then provide the password and enjoy your machine.


I'm installing Ubuntu 14.04 on a Dell C521 keep getting error 8000

It seems that you have an issue with the hard disk itself. Try using the livecd, opening the disks application and checking the SMART status of the disk, and see if there are any bad sectors


Execute the same command with sudo

sudo apt-get install proxychains


How to create system restore point on Ubuntu 18.04.1 LTS?

The closest thing to a Windows-like restore point is by using Timeshift. I use it to save snapshots to an external USB hard drive. Although it can, it's normally not used for backing up your /home directory, just system-level changes. Use Backups (Déjà Dup) for backing up /home files.

  Timeshift is a system restore utility which takes snapshots
      of the system at regular intervals. These snapshots can be restored
      at a later date to undo system changes. Creates incremental snapshots
      using rsync or BTRFS snapshots using BTRFS tools.

More information at https://github.com/teejee2008/timeshift

Add the PPA and install with:

sudo add-apt-repository -y ppa:teejee2008/ppa

sudo apt update

sudo apt install timeshift


Most likely you have python3 as your default python version while the python library you installed is for python2
You can verify this by running:
python --version
if you don't have python2:
 apt-get install python2.7
then explicitly start python2.7 and run  import pygame from there


Why does compiling the Linux kernel cause Ubuntu to freeze?

I have the same issue when compiling the kernel for zynq.
This is what I used:
make -j ARCH=arm UIMAGE_LOADADDR=0x8000 uImage

Now I change it into:
make ARCH=arm

and it compiles and creates the Image and zImage in the \arch\arm\boot\

Goodluck


ubuntu 12.04 archive.ubuntu.com fails to connect during update

There is a 7 step Package Manager Troubleshooting Procedure available at Ubuntu Documentation  Have a look at it, and let me know if it works.


Ubuntu 20.04 - Google Chromium is slow after wake from sleep

Same problem for me (ubuntu 20.04 + Chrome 85.0.4183.102). I solved it by simple disabling the Use hardware acceleration when available in Chrome Settings. There you go for a pretty long explanation of the reasons.


It is very easy to install the Gujarati Language and use it using the below step-by-step guide:

First open Settings
Click on Language Support
In the Language Support window that appears click on Install/Remove languages
Search for Gujarati and tick on the box right to it.
Click on Apply
Close the settings screen and search for iok and open iok -Indic Onscreen Keyboard
In the bottom right, you can select Gujarati language
Open any text editor and press Super+space to switch between language and start typing and enjoy...


Can We enable Notifications About Oracle Java Update In Linux?

As far as I can tell (and have experienced), oracle-java8-installer will update your Java version for you.

Whenever a new version comes out, the installer is updated with the new information. The next time you run sudo apt update, this new installer version will be reflected. Running sudo apt upgrade will install the new installer, which will then (in turn) install the new version of Java.

Note that this will only work if you've installed Java through the package. If you used the raw tarball, this will not work nearly as well (or at all).

It is important to note, however, that this will not increase your "major" version (so Java 8 will never upgrade to Java 9, unless you install Java 9's installer).

This method of Java installation offers no notification, so you just need to run the apt updater. Depending on your system configuration, Ubuntu may offer a general update notification. See the Software and Updates app for this setting.

Generally speaking, very few packages installed through Apt will have their own update notification system (though some, especially launcher-only packages usually will). Instead, apt will take care of things and bundle it with all the other updates. To some, this centralized package system is one of the biggest benefits of Linux over other operating systems.


Zoom installation hosed in update from 5.4 to 5.8 kernel in 20.04 Kubuntu

Thank you for the replies, Archisman and guiverc.
I updated via apt-get update and apt-get dist-upgrade.  I'm not an experienced Ubuntu user, so may have done something I shouldn't have to make it pull in the 5.8 kernel.
I wanted to keep my openSUSE Tumbleweed bootloader, so installed Ubuntu in the new partition with ubiquity --no-bootloader.  That makes it difficult (at least for me) to choose some options in the grub menu, as openSUSE is still managing things.  However, I was able to click 'e' at the boot-to-Ubuntu option, and edit in:
linux /boot/vmlinuz-5.4.0-65-generic root=/dev/sda2
initrd /boot/initrid.img-5.4.0-65-generic

... and that got it to boot with kernel 5.4, and a working Zoom.
I might experiment with the tool 'Mainline' -- https://ubuntuhandbook.org/index.php/2020/08/mainline-install-latest-kernel-ubuntu-linux-mint/ -- to choose my Ubuntu kernels in the future.


Looks like you're missing libssl-dev package installed.

If what you're trying to compile is among the packages available for Ubuntu but say, you want a newer version, you might want to install all build prerequisites with:

sudo apt-get build-dep john

to satisfy build dependencies for the "john" package.

Otherwise you need to check for build dependencies manually. Often the './configure' command gives you enough information.


Crackling and delayed sound after upgrading to 18.04

I had the same issue and killing pulseaudio fixed it for me. I'm not sure why it would get into a bad state, but restarting pulseaudio might be something to try.

Try

killall pulseaudio