intel-virtual-output command for Saucy 13.10 with dual monitor setup and hybrid graphic

Hope this helps:

Intel-virtual-output tool

First, you will need latest xf86-video-intel driver installed (2.99). Ubuntu 13.10 comes with it, so you don’t need to update driver in that case. However, what made all of this possible is the latest release of intel-virtual-output tool, which comes bundled with xf86-video-intel driver source. But, ubuntu’s package does not bundle it, and we need to compile it from source. One MAJOR thing to note here is: DO NOT compile it from ubuntu’s deb-src package. That package is old, and current release has some major fixes for the tool that we will actually need in order to have everything working properly. So lets do it:

sudo apt-get install xorg-dev git git
clone git://anongit.freedesktop.org/xorg/driver/xf86-video-intel
cd xf86-video-intel
./autogen.sh
cd tools
make
sudo cp intel-virtual-output /usr/bin/
sudo chmod +x /usr/bin/intel-virtual-output

Taken from here: http://www.unixreich.com/blog/2013/linux-nvidia-optimus-on-thinkpad-w520w530-with-external-monitor-finally-solved/


What made "smbd" stop running on boot-up?

Be careful, if you have several network cards, samba may not even try to start (no trace of smbd in sys.log) because it waits for the wrong network interface to be up.

check ifconfig to find which interface you want to use.
Then check in /etc/samba/smb.conf that samba is using the correct interface
Then check in /etc/config/smbd.conf that the correct interface is waited to be up  before launching samba. For instance, the line below will only start smbd if the eth0 interface is up:

start on (local-filesystems and net-device-up IFACE=eth0 and started udev-finish)


How can I tell Ubuntu fix my RAM disk as non-pageable?

There are two types of filesystem commonly used for RAM-disks in Linux, ramfs and tmpfs.

tmpfs is the more modern on the two, and will put unneeded files in swap. As far as I am aware, there is no option to disable this.

ramfs is older and more primitive, and cannot use swap. Be warned, however, that unlike tmpfs a ramfs filesystem will continue to grow until you are out of RAM, at which point your system will hard-freeze. Therefore, if you use ramfs, you must be vigilant of its size at all times.


Every time I open the terminal, several commands are already executed

Check the .bashrc file in your home directory for a source command.
This file is read every time your terminal emulator starts and if it contains a source it runs those commands.
You can check this by running:
cat .bashrc | grep source


ISO file is special file format called ISO 9660. Here is quote from wikipedia

  Since ISO 9660 is by design a read-only, pre-mastered file system, all
  the data has to be written in one go or "session" to the medium.

So as a file system is read-only, you cannot mount it with write access.

But you can recreate ISO file, if you want.

You should mount your *.iso file somewhere
Then copy it to some temp folder
Using mkisofs util create new ISO file.

Here is a little example:

sudo mount -o loop folder/isoImage.iso anotherFolder/
mkdir new_copy_of_iso
cp -R anotherFolder/* new_copy_of_iso/
umount anotherFolder
mkisofs -R -o name_new.iso new_copy_of_iso


You can clone the sd card with DD.

Make sure the target card is at least as big as the source card.

A command to watch the progress of the copy is:

$ dd if=[source drive or image] of=[destination drive or image] bs=4M status=progress

The source or destination drive or image can be replaced with one of the following examples:

/dev/sda
/dev/sda1
/dev/sdb
/dev/sdb1
/home/user/disk.img

The above are examples.  To backup the whole disk if source drive were /dev/sdb and the destination drive were /dev/sdc the command would be:

$ dd if=/dev/sdb of=/dev/sdc bs=4M status=progress

If you backed up to an image, you could use the image as a permanent backup and eventually make multiple clones from the image.

$ dd if=/home/user/disk.img of=/dev/sdc bs=4M status=progress

The number after in the device is the partition, in case you are only concern with cloning a partition rather than the whole drive.

It's very important to be careful with this low level command... especially the of (output part).  Without checking it'll start to write to the destination device which could corrupt your system if you output to the wrong device, your main OS or Data drive for example.

What I do in an effort to be careful is create a script for the process.  Then run the script when I have spent a lot of time studying it to be sure I'm accessing the correct devices.

Hitting cntrl-C will drop out of the command, but it will not stop the process.  You have to specifically kill the dd task.

After the clone, if there is a discrepancy in size (for instance the destination disk or partition is bigger, you can fix this with gparted by resizing the partition on the new drive.


After running dconf reset -f/ under 16.04 LTS how can I correct my environment for RDC?

After reading this article I was able to find a solution by purchasing a headless ghost, display emulator . I am now able to connect via RDC and SSH.


I can't install or uninstall through Ubuntu software center

The software center has always been bad.  I have no idea why they removed Synaptic

sudo apt install synaptic

However, to install Chrome, you are best to use gdebi

sudo apt install gdebi

Right-click on the deb file and choose "open with"  gdebi.
All should be well .. make sure no other software managers are running at the same time.  Only one can install at a time.

Good Luck.


Transmission is a good Torrent client, it is installed by default .


Landscape - email notifications not working

You can instruct Postfix to use a different smtp server (i.e to act as a 'relay'), rather than send mail natively as itself instead to mail addresses.

This post on Linode's documentation on things should be able to help you configure postfix to send smtp through a remote SMTP server (such as Google Mail, etc.).

This is how my landscape server is configured to send email notifications, although until I can replace my hypervisor machine my landscape server has been shut off in favor of a much more needed gitlab instance.

You did mention if you could use ssmtp instead.  Unfortunately, to my knowledge, the packages that install Landscape have a dependency on the postfix package - removing ssmtp will likely remove postfix, and that will probably remove Landscape.


Adding unread message count to terminal command prompt

Open gedit ~/.bashrc file and add this script at the end of that (don't forget you have to add this script at the END of file):
NewMail(){
    NEWMAIL=$(mailx &)
    UNREAD=$(echo $NEWMAIL |grep -o 'messages.*new' | cut -f2 -d" ")
}
NewMail # call NewMail function

if [ -n "$UNREAD" ]; then
    PS1="[Hi, alex. you have $UNREAD new mail(s)] $PS1"
fi

We wrote a function whose name is NewMail.
Explanation of function:
The result of first line(NEWMAIL=$(mailx)) according to you information in body of question are:
"/var/mail/alex": 2 messages 2 new [...]    # if you have a new unread mail

OR
No mail for alex                            # if you don't have a new mail

That I stored the above result in a NEWMAIL variable there.
I passed the result into next command in second line with this command echo $NEWMAIL.
Then with this command grep -o 'messages.*new' I get the result just between "message" word and "new" word, which is: messages 2 new.

-o - Print only the matched (non-empty) parts of a matching line, with each such part on a separate output line.

Now we have this messages 2 new result. Then I pass this result to next command cut -f2 -d" ", to getting just number of messages:

-f flag used for fields and -f2 select only second field from "messages 2 new"
-d" " with one space here is used for field delimiter.

Then after running second line, we have the number of new unread mail and that is: 2 here.
In this NewMail # call NewMail function line, we call the NewMail function.
With this if condition, I check if you have new mail. Then the command prompt will change and shows: "[Hi, alex. you have # new mail(s)]" before the prompt. If you have not got any new mail then the command prompt will not change.
if [ -n "$UNREAD" ]; then
    PS1="[Hi, alex. you have $UNREAD new mail(s)] $PS1"
fi

-n flag with [ -n "$UNREAD" ] checks if the length of UNREAD is Not zero.
PS1 is defines your command prompt that configure into .bashrc file in your home directory. This is what we open/edit this file. Then I edit that to include unread message count before your command prompt. See:
PS1="[Hi, alex. you have $UNREAD new mail(s)] $PS1"

Here's the screenshot if I have new mails:

And if I have not got any new mail:

That's it. Just copy and paste the script at the end of your ~/.bashrc file.


Problem with GRUB resolution - Ubuntu 18.04

Edit the file /etc/default/grub and find the line:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

Then change it to:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash video=hyperv_fb:1920x1080"

See that this will sort out your problem. Also note the advice at the beginning of the file:

  If you change this file, run 'update-grub' afterwards to update /boot/grub/grub.cfg.


Will my epson stylustx121 printer work in ubuntu?

Well, I am also using the same Printer Epson Stylus TX121. It works out of the box with Ubuntu. You have to download drivers from here. Those drivers are free to download and use. You need to download separate packages for Printer and scanners to work.

Visit this Blog to Get started


How do I completely re-install my PC with only Ubuntu

Install a partition manager. Gparted is one option in Ubuntu (sudo apt-get install gparted if not already installed; or check Ubuntu software center).
Open Gparted and delete the partition(s) marked as "Windows". If you have a C: and D: on W7 there will be 2 partitions.

Mind you: you might have a recovery partition. It would be best to leave that alone just in case.
Format the partitions you deleted as ext4 and give them a mountpoint. These partitions will then automatically show up as empty disks in Nautilus (or your Desktop if set as showing them there).
You will need to chown the disks to your user with sudo chown $USER:$USER {/mountpoint}.


"cannot create /etc/apt/sources.list.d/getdeb.list: Directory nonexistent" while upgrading getdeb-repository package

It seems that /etc/apt/sources.list.d folder doesn't exist in the system.

Check if folder is present with:

   ls /etc/apt/sources.list.d

and if it is missing, try:

  sudo mkdir /etc/apt/sources.list.d

and redo apt-get command.


cannot boot 5.x: Couldn't get UEFI db list

I began getting similar errors only after upgrading the kernel.

The errors seem to be related to an attempt to import UEFI keys for Secure Boot.
I do not have Secure Boot enabled in my BIOS but do only boot in UEFI.
I was able to stop the errors simply by changing a setting in the BIOS from [Customized] to [Standard] for Secure Boot Mode.

The Customized setting allows you to modify the secure boot keys manually. The Standard just sets the default keys.

Note: This fixed my error even though I previously had Secure Boot [Disabled] in BIOS settings.

Security -> Secure Boot -> Secure Boot Mode -> [Standard]

Hope this can possibly help you and others.


So first of all i fixed my own problem ( a lenovo ideapad y580 ) by formatting the disk ( for information see the hdd information image in the question) and then doing a full erase with a seatools for dos bootable cd. Then i set the sata controller in the bios from "ahci" to "compatible" and reinstalled ubuntu 14.04 lts from the live cd. Now it mostly boots up fine, but i sometimes need to go into standby with the power button of the laptop after logging in, because the screen then sometimes still goes black. But after reactivating the laptop from standyby, ubuntu does work :)
Hope that helps somebody too, but these solution might only be possible with the same hardware specs and as you can tell, it isnt the best solution at all...


How does sudo handle $HOME differently since 19.10?

For years, Ubuntu has shipped a patched version of sudo that preserves $HOME by default. Besides Ubuntu and its derivatives, very few other operating systems (perhaps no others) do this. It has been decided that this causes more problems than it solves, and starting in Ubuntu 19.10, $HOME is no longer one of the few environment variables sudo preserves.

In terms of what the change is and how it affects users, the key points are:

As of Ubuntu 19.10, sudo command does what sudo -H command does in previous releases. It can indeed be used in cases that would have previously advised sudo -H, including to run GUI applications as root or another user. Running graphical programs as root at all remains controversial. But in 19.10 you can run sudo gedit with the exact same effect as sudo -H gedit. In 19.10, commands like sudo gedit no longer create annoying file ownership problems in your home directory.
This applies even on systems upgraded to 19.10 from an earlier release, even when the upgrade doesn't change your /etc/sudoers file. The change is in the source code of the sudo program itself, not in its default configuration files. (It can be overridden in a sudoers file, but you'd probably know if you did this.)
It doesn't--and won't--apply to releases prior to 19.10. Before 19.10, sudo preserves $HOME by default, and future updates to sudo won't change that. For example, 18.04 LTS will always have the old behavior, even in future point releases.
sudo -H command still works fine. If you're in the habit of using that, no problem. You just don't have to, on a 19.10 system.
Most commands you run with sudo won't behave differently. In the overwhelming majority of situations where you would not have passed -H, you could have. Some users do rely on or otherwise prefer the old behavior of preserving $HOME. But that often had unintended effects. So if you were relying on this, you still might not want to override the change in a sudoers file.

See also WinEunuuchs2Unix's answer to Why should users never use normal sudo to start graphical applications?

Why The Change

As the changelog puts it (under "sudo (1.8.27-1ubuntu2) eoan"):

  This restores sudo handling of $HOME to what everyone else does

"Everyone else" refers to the upstream sudo project (hosted here) and also seemingly all other operating systems that contain sudo, except those that derive from Ubuntu.

There's more to it, though. This is also considered to fix a security bug, as described in Ubuntu patch to add HOME to env_keep makes custom commands vulnerable by default. The history was concisely summarized in this comment there by Steve Langasek (whom you may have heard of), which I quote in full:

  This change was originally introduced in response to bug #760140.

  The upstream change in sudo was never accompanied by a CVE, and the behavior change was never applied to previous releases of Ubuntu, so it didn't seem security sensitive at the time.

  I am not opposed to changing this to behave the way Simon describes, but I defer to the Security Team here.

Todd C. Miller, who maintains the upstream sudo project (very actively, and for many years now), was also asked for input on the issue. He explained the reason sudo resets (i.e., does not preserve) $HOME:

  On Thu, 16 May 2019 07:48:40 -0400, Dan Streetman wrote:

    I've cc'ed sudo-users, so the question to the upstream sudo list can
    be summarized as:
    How likely would it be for upstream sudo to add HOME to env_keep by default?

  Extremely unlikely.  Prior to sudo 1.7.4 the HOME and MAIL environment
  variables were preserved in the environment by default.  This can
  lead to programs using config files the original user's home
  directory, which has security implications, so the default was
  changed in 1.7.4.

  In the old days, sudo did little more than change the uid.  These
  days sudo tries to run the command in an environment that closely
  matches what you would get by logging in as that user.  This has
  proven to be safer as it more closely matches the assumptions other
  programs make.

    We ask because Ubuntu carries a patch that adds HOME to env_keep,
    unlike the default upstream, or any other Linux/Unix.  We are
    considering removing that patch, to match upstream defaults, of not
    including HOME in env_keep.

  I would be supportive of that.  I believe that resetting HOME is
  the safer default.

  - todd

(I have altered the formatting from the original message to display properly in this medium.)

As of 19.10, the downstream sudo in Ubuntu behaves as the upstream sudo (and sudo in other operating systems, including Debian) have behaved for many years. For more detailed information on the history of this change and the developments that preceded it, including numerous links for further reading, see the "sudo and $HOME: The Last 20 Years" section below.

Huh? a.k.a. Why it (sometimes) matters what sudo does with $HOME

Programs you run that need the location of your home directory often examine the value of the $HOME environment variable. One important case is when a program tries to store and access configuration files in the home directory of the user running it. Programs typically go by the value of $HOME. Sometimes when you run a program as a substitute user--for example, as the root account--it is appealing to have that program use your settings. But this can also get messy, in two ways:

Usually when you run a command as another user, you want it to work mostly the same way as if that user had run it. But if it is a command whose behavior can be radically altered by the fact that you ran it--which happens if its behavior is heavily customized by data read from files found inside the directory named in $HOME--then this goal is not achieved.

When you're permitted to perform any action you choose as any user including root (which in Ubuntu is conferred by membership in the sudo group), the issue is mostly one of accident. However, if you are a limited user and you have been permitted to run only specific commands with sudo, then being able to manipulate what those commands do has serious security implications. The bug report that led to the change in 19.10 was specifically motivated by that problem (and includes a compelling example of it).
If you run a command as another user and the command makes changes to its configuration in the directory named in $HOME, an attempt is made to write the changes to files in that location. When the substitute user is not root, as in sudo -u username command, this typically fails and produces error messages, which is mildly annoying but not serious.

But in the common case that the substitute user is root, as in sudo command, this succeeds, but if any new files are created, they are owned by root, and your user account no longer has full access to all its own configuration files. This can be fixed by chowning the files back, so the problem is most severe in the case of graphical applications, whose complexity can make it so more files, in more places, are involved (and where it has been reported to sometimes make login difficult, though usually the problem is less severe than that).

What changed, and why all 19.10 systems have the change

A short whitelist of environment variables that are not reset by default is hard-coded in sudo itself. In Ubuntu releases prior to 19.10, an Ubuntu-specific patch adds $HOME to this whitelist. It is compiled into a binary file used by sudo, so upgrading to a version of sudo that does not have the patch removes it from the whitelist.

The patch was removed in 19.10. So upgrading to 19.10 or higher will always apply the change, even when no configuration files associated with sudo are modified.

It is still possible to configure any version of sudo to preserve $HOME (see below). In the extremely unusual case that you did this before 19.10--when such a configuration would have made no difference--and kept that configuration across an upgrade, $HOME would still be preserved. But you would presumably remember having done this strange thing.

If your upgrade to 19.10 (or later) failed and gave you an only partially upgraded system with a version of sudo from before 19.10, then sudo on that system still preserves $HOME by default. This is almost the only case where sudo would preserve $HOME in 19.10 (or later) without you knowing about it--though you would still have been informed, during the release upgrade, that not all packages could be upgraded.

The easiest way to see directly that the patch is gone in the source code of sudo in Ubuntu 19.10 is to compare https://git.launchpad.net/ubuntu/+source/sudo/tree/debian/patches?h=ubuntu/disco-security to https://git.launchpad.net/ubuntu/+source/sudo/tree/debian/patches?h=ubuntu/eoan.

Still, if you are not sure how your system is configured, you can run sudo printenv HOME to find out.

Resetting $HOME in Ubuntu 19.04 and earlier

Although updates to sudo in Ubuntu 19.04 and earlier may include changes to the documentation to explain the situation, the way sudo treats $HOME in those releases has not been and will not be changed by any updates. Most users will not want to bother manually changing how sudo works on systems where they are already using it without problems. However, if you like, you can make sudo reset $HOME on those systems, even without upgrading them.

Any particular time you run sudo, you can use the -H/--set-home option to reset $HOME:

sudo -H command

Or you can use -i. This does more than reset $HOME. sudo -i command behaves as if you logged in as root, ran command, and logged out; sudo -i by itself behaves as if you logged in as root and places you in an interactive root shell. This differs from sudo -s, which starts an interactive shell that is not a login shell. Before Ubuntu 19.10, sudo -s preserves $HOME; that is, regardless of version, the -s option does not carry any behavior that affects how $HOME is treated. It is meaningful to use -H and -s together. You can also use any of -H, -i, and -s with -u user to become user rather than root. Finally, using sudo via the graphical frontends gksu or gksudo (still available in 16.04 LTS, though you may need to install the gksu package) resets $HOME.

If you want to reconfigure sudo so that it always resets $HOME, you can enable the always_set_home option in a sudoers file:

Defaults    always_set_home

You would add that line to /etc/sudoers or, better, to a new file in /etc/sudoers.d/. Either way, you should use visudo to edit the file, so you get the benefit of syntax checking. (A syntax error in any sudoers file causes sudo to refuse to work at all. This is a hassle, though it can be fixed.)

For example, on some of my pre-19.10 systems, I created and edited /etc/sudoers.d/always_set_home by running:

sudo visudo -f /etc/sudoers.d/always_set_home

In the file, I wrote the above Defaults line. The filename need not be always_set_home--it can be whatever you like, so long as it contains no . or ~ character. The word on the Defaults line does, of course, need to be exactly always_set_home.

(One reason to prefer making a new file in /etc/sudoers.d/ to modifying the existing /etc/sudoers file is that, if a future update ever does change the default /etc/sudoers file, you can accept the new file without losing your customizations. Another reason is that it is immediately clear that you have changed the configuration, and where your changes may be found.)

If you do this and later wish to run an individual sudo command that preserves $HOME, you can do that the same way you would do it in 19.10 (see below).

Preserving $HOME in Ubuntu 19.10 and later

The way sudo treats $HOME has been changed for a reason. (See the above sections, as well as the detailed history section below.) But if you really want to make sudo continue to preserve $HOME, even in 19.10 and later, you can configure this behavior in a sudoers file.

Any particular time you run sudo, you can tell it to preserve $HOME with --preserve-env=HOME:

sudo --preserve-env=HOME command

This is the form of --preserve-env that is documented as --preserve-env=list in the sudo manpage. It is also possible to use --preserve-env with no list operand, which is the same as -E; that preserves all environment variables. But there's rarely a good reason to do that, especially if your goal is just to preserve $HOME. If you don't like typing --preserve-env=HOME, you could define a shell alias or shell function or write a script that lets you run a shorter command to do it. Even better would be to seldom preserve $HOME (see the section below on alternatives to doing so).

More generally, you can make sudo preserve any particular environment variable varname with --preserve-env=varname. (You may also see code that effectively preserves $HOME by setting it explicitly in the command sudo runs, such as with sudo HOME="$HOME" command. This also works. It is quite different from HOME="$HOME" sudo command, which would not keep sudo from resetting $HOME.)

Or if you really want to make sudo always preserve $HOME, you can do this by adding $HOME to env_keep in a sudoers file:

Defaults    env_keep += "HOME"

That can go in /etc/sudoers or a file in /etc/sudoers.d/. Although I stress I don't recommend doing this at all, if you decide to do it then I'd suggest creating and editing /etc/sudoers.d/keep-home (call the file what you like, so long as the name doesn't contain . or ~) by running:

sudo visudo -f /etc/sudoers.d/keep-home

Then you can put that Defaults line in the file.

The reason to use += instead of merely = is that there are a handful of other environment variables, hard-coded into sudo itself, that are preserved by default, and that you probably want preserved. If you used =, then only the environment variables you listed explicitly in the file would be preserved. In this case, that would be just $HOME. More information about the grammar of sudoers files is available in sudoers(5).

As for why I suggest making a file in /etc/sudoers.d/ instead of editing /etc/sudoers--and why you should definitely use visudo either way--see my comments in the "Resetting $HOME in Ubuntu 19.04 and earlier" section above.

Alternatives to Preserving $HOME

Most of the time you use sudo, the best alternative to preserving $HOME is to do nothing. Most sudo commands have the same effect (and some work slightly better) without $HOME preserved. However, I am aware of two popular use cases for preserving $HOME.

Using your text editor configuration and/or plugins to edit files owned by root or another user. sudoedit, or equivalently sudo -e, is an ideal alternative for this. It runs the editor as you, you edit a temporary copy of the file, and the file is updated when you quit the editor. Since the editor runs as you, it uses your configuration and plugins automatically, and does so without any risk of failing in opaque and unexpected ways with permission denied errors or making files in your home directory inaccessible to you. To edit file:

sudoedit file

To edit file with editor instead of the default editor:

SUDO_EDITOR=editor sudoedit file

For example, SUDO_EDITOR=vim sudoedit /etc/apt/sources.list edits /etc/apt/sources.list with vim.

To decide what editor to use, sudoedit consults the environment variable $SUDO_EDITOR; if that's unset, it consults $VISUAL; if that's unset, it consults $EDITOR; if that's unset, it tries editor commands from a hard-coded list, which in practice in Ubuntu means it uses editor. Typically that resolves to /usr/bin/editor, which is a symlink. If you want to change the default editor systemwide then you can change what /usr/bin/editor points to by running sudo update-alternatives --config editor. You can also set one of those three environment variables, which is a good way to change what sudoedit edits with for just one user.

Making programs you only run as root use specific configuration files. If a program you run as root looks in $HOME for its configuration, then you can just put that configuration in (or move that configuration to) root's home directory, /root.

Resetting $HOME when you don't know what release you're using

You may sometimes write a command and not know what release of Ubuntu (or what operating systems besides Ubuntu) it will run on. For example, you may be writing a script that you will run on multiple machines.

sudo continues to accept the -H option, with the same effect it always had. It just happens that, starting on 19.10, sudo without -H does the same thing (unless you have configured it to do otherwise) as sudo -H.

To write portable sudo commands that reset $HOME, you can continue using:

sudo -H command

(Also as before, if all the actions performed in your script need to be done as root, it's probably better not to use sudo in your script and just run the script as root with sudo.)

sudo and $HOME: The Last 20 Years

Around the turn of the century, the upstream sudo project introduced the env_reset option, which makes sudo reset most environment variables. This option is enabled unless disabled explicitly in a sudoers file. (It is possible to enable it explicitly, which Defaults env_reset in Debian and Ubuntu's /etc/sudoers file does, but this is not actually necessary.) Before sudo had env_reset, all environment variables were preserved unchanged. With env_reset, only a handful of variables were preserved. This included $HOME.

In July of 2010, $HOME was removed from that small whitelist and thus no longer preserved by default.

In September of 2010, a bug report about documenting that in the sudo package in Debian was filed. As far as I can tell, there was no controversy about, or objection to, the change itself, from Debian developers. (But see below.)

In February of 2011, the change had come further downstream from Debian to Ubuntu and Ubuntu developers discussed whether or not it was desirable.

In April of 2011, the change was reported as a bug, referencing that discussion. (Some behavior resulting from the change had been reported as a bug the day before that.) At least at the time, this was considered to be a regression ("the Debian maintainer already tried to fix this once but it appears the fix was incomplete"). I haven't found any such Debian bug report, but that doesn't mean there wasn't one; furthermore, a change could have been made without one. I suspect, though, that it may have been an erroneous reference to that documentation bug.

The next day, the development release of Ubuntu was updated with a downstream, Ubuntu-only patch, to re-add $HOME to the list of environment variables sudo preserved by default. I believe this was done quickly so as to make it into the release of Ubuntu 11.04. The effect was that sudo in 11.04, as in previous Ubuntu releases, preserved $HOME by default.

In November of 2011, a bug was reported about how the documentation for sudo in Ubuntu said $HOME was reset. That is, the manpage in Ubuntu correctly described the behavior of upstream sudo but not the patched behavior in Ubuntu.

In September of 2014, a bug was reported pointing out some of the problems with having sudo preserve $HOME by default and arguing that the problem with running graphical programs with normal sudo is not that it's inherently dangerous (often cited to this wiki page) but that sudo's unusual handling of $HOME in Ubuntu makes it dangerous and should be considered a bug. It appears there was significant interest in this bug report, including from Ubuntu developers, even though it would be some time before it would be fixed.

In March of 2016, the bug that would later become the main reference for the problems with sudo preserving $HOME was reported. Initially, this bug report focused specifically on the security problem that users who are not administrators (i.e., cannot run arbitrary commands as root), but who have been permitted to run specific commands with sudo, can maliciously alter the behavior of some programs, and in some cases even gain full control of the system. It recommended a narrow change that would attempt to address that case specifically, while still having $HOME preserved when members of the sudo group run commands as root or another user.

In April of 2019, a bug was reported objecting to the behavior of sudo preserving $HOME by default, even when sudo -s is used.

Later that month, discussion resumed on the March 2016 bug, toward the possible resolution of removing the Ubuntu-specific patch altogether. This broadened the focus of that bug report beyond the specific security vulnerability it described. The goal of making sudo in Ubuntu treat $HOME the same way upstream sudo (and sudo in other operating systems) treats it, starting in Ubuntu 19.10, was articulated.

In May of 2019, a bug was reported about how programs (including non-graphical programs) that use launchpadlib suffer configuration file ownership problems because sudo preserves $HOME.

A week later, another mailing list discussion on "how sudo handles $HOME" took place (see also this archive page), showcasing a range of views on how sudo ought to treat $HOME. One preference that was uncontroversial was that if a change were to be made, it should only be to 19.10 and later, and not be made in any updates for previous releases. The question arose of whether upstream sudo would continue resetting $HOME in future versions.

The upstream sudo maintainer, when consulted about this, made clear that no such upstream change is planned and supported the view that the downstream version of sudo in Ubuntu should also reset $HOME by default. That message, posted originally on the sudo-users mailing list, was quoted in a comment on the March 2016 bug report.

In June 2019, Ubuntu developers made plans to remove the patch that makes sudo in Ubuntu preserve $HOME.

About a week later, the change was made in Ubuntu's repositories. This change applies starting in 19.10. The only change that will be made to sudo in earlier releases is to update the documentation so it clearly and correctly describes the behavior of sudo in those releases.

Acknowledgements

Zanna helped me figure out what this should cover and how to cover it, and she gave feedback on multiple fragments and drafts of it as I wrote them (see conversation back then, more recently starting here, then here, here, there, and finally here and there).
Seth and DK Bose encouraged me to write this (see conversation around here and there).
WinEunuuchs2Unix wrote that excellent answer and expanded it to cover how sudo changed in 19.10, which preceded this Q&A and (as far as I know) was the first information about the change posted to Ask Ubuntu.


How to set a file size limit for a directory?

Usual filesystem quota on ext4 is per-user/group, not per-directory. ZFS can sort-of set a directory quota, by creating a filesystem of a fixed size off a ZFS volume.  A simple trick, though, is to create a 2GB file, create a filesystem on it, and mount it at the desired folder:

$ touch 2gbarea
$ truncate -s 2G 2gbarea
$ mke2fs -t ext4 -F 2gbarea
mke2fs 1.43.3 (04-Sep-2016)
Discarding device blocks: done
Creating filesystem with 524288 4k blocks and 131072 inodes
Filesystem UUID: bf1b2ee8-a7df-4a57-9d05-a8b60323e2bf
Superblock backups stored on blocks:
    32768, 98304, 163840, 229376, 294912

Allocating group tables: done
Writing inode tables: done
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information: done

$ sudo mount 2gbarea up
$ df -h up
Filesystem      Size  Used Avail Use% Mounted on
/dev/loop0      2.0G  6.0M  1.8G   1% /home/muru/up

In any case, filesystem quotas (or methods like this) aren't as user friendly as you want. This method is one-way flexible, in that you can increase the size online, but decreasing it would be hard.

The commands:

touch: touch 2gbarea creates an empty file named 2gbarea.
truncate: truncate is used to resize files (in this case, I resize the currently empty 2gbarea file to 2 GB using -s 2G).
mke2fs: mke2fs creates ext2/3/4 filesystems (in this case, ext4).
mount mounts the filesystem on the given directory.
df is used to list filesystem usage.


You can install pcscd either in the Ubuntu Software Center or in the terminal. Open the terminal and type:

sudo apt-get install pcscd
cd ~/Desktop/ && sudo dpkg -i pcsc-omnikey_3-3ubuntu1_amd64.deb


Ubuntu 12.04 brightness control not working on HP 255

Try this:

Open a terminal (Ctrl + Alt + T).
Then type sudo nano /etc/default/grub. It will ask for your password. Type it in.
Around the 11th line, there will be something like: GRUB_CMDLINE_LINUX_DEFAULT="quiet splash". Change it to GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_backlight=vendor"
Save the file by Ctrl+O followed by Ctrl+X. Then run sudo update-grub in the terminal.
Reboot and see if backlight adjustment works. If not, undo the changes you did above, by invoking the text editor as in steps 1 and 2.

Hope it helps.

Works for Acer Aspire v3-571,Acer Aspire v3 571g,Hewlett Packard Bell EasyNote TS,Acer Aspire 4755G,Acer Aspire 5750-6866, Acer Aspire 5739, Lenovo T540p


Ubuntu 15.10 connect to VPN server on port 443 without certificate

When you connect to OpenVPN from Windows you must have profile/configuration file somewhere with .ovpn extension, quite sure it can be found from C:\Program Files\OpenVPN\. When you open-up your configuration file at Windows you will see where certificates are located at your computer.

You can copy-paste your configuration from Windows to Linux (aswell certificates) but make sure you edit certificates locations.

After that, connect from command line at linux with your config file.

openvpn --config ~/workvpn.ovpn


Can't start Goldendict to system tray on Kubuntu

I got this problem as well. If you dig into it deeper you'd notice goldendict starts (the same wrong way) even being removed from autostart! The only way to stop it from start on login is

remove from autostart
kill (not just close into tray, but kill like pkill goldendict)
relog/reboot

Why? Because the default (before you ever touch the setting) KDE start behavior is "restore previous session" (at least in 18.04)! And when it "restores" previouly running apps it supplies "-session XXXXXXXXXXXXXXXXXXX_XXXX_XXXXX" argument to those. Try running goldendict -session hello and you'll see it will start not into systray and with "hello" word in the search field. Here is how it did start for me on login and here is what I saw in pstree.

Now to the fix. Go System settings/Startup and Shutdown and set On Login=Start with an empty session.

DONT SET IT TO "RESTORE MANUALLY SAVED SESSION"!!

I tried it and on relog there only was a black screen (probably because I left with Ctrl+Alt+Bksp). To fix that I Ctrl+Alt+F2 to a virtual console and changed loginMode to default in ~/.config/ksmserverrc (it says "default" but the meaning is "empty session").

Thanks for posting your question so I didn't feel lonely dealing with it!


Difference between Intel i915_bpo and i915

Phoronix has reported some issues with Skylake CPUs and Ubuntu.
There are also workarounds available.
Nevertheless, The simplest solution for the time being the author has found (and you are probably not going to like this) was to run Fedora instead. At least for the time being...

Regarding i915 vs i915_bpo, I think "bpo" stands for "backported". It contains some fixes found in newer versions of i915 that get backported to ubuntu kernel to fix known issues/add new hardware support.


How do I remove RocketTab ads from Google Chrome in Ubuntu?

I finally found the issue. It was one of Google Chrome extension named Facebook video downloader. Beware of this extension. It shows ads by RocketTab and Not Set Ads.


Is it possible to make Ejecter working on Ubuntu 14.04 LTS, 16.04 LTS or 18.04 LTS?

Other methods (but out-the-box)

Disk Mounter applet

As @DKBose has noted, on Ubuntu MATE you can use other method.
All current versions have Disk Mounter applet (from mate-applets package):

it is very compact on the MATE Panel  and
allows to mount, unmount and eject media:

Note: Disk Mounter applet does not spin-off (spin-down) USB HDDs.

Caja

Standard MATE file-manager (Caja) allows to Eject, Unmount, and (for some devices) to Safely Remove Drive from Devices section

and from drop-down menu:

and from desktop:

Here Safely Remove Drive removes power from USB-flash (switches LED off) and spin-downs USB-HDD.

GNOME Disks

If other methods fail, then you can install gnome-disk-utility package and use GNOME Disks (gnome-disks executable) application to mount, unmount and power off the drive:

Ejecter (original problem)

Yes, it is possible. But we need to get some packages from 12.04 LTS repositories manually:

mkdir ~/Downloads/ejecter
cd ~/Downloads/ejecter
wget http://archive.ubuntu.com/ubuntu/pool/main/u/udev/libudev0_175-0ubuntu9.10_amd64.deb
wget http://archive.ubuntu.com/ubuntu/pool/main/p/parted/libparted0debian1_2.3-19ubuntu1_amd64.deb
wget http://mirrors.kernel.org/ubuntu/pool/universe/u/udisks/udisks_1.0.5-1_amd64.deb
wget http://archive.ubuntu.com/ubuntu/pool/main/g/gnome-disk-utility/libgdu0_3.0.2-2ubuntu7_amd64.deb
wget http://archive.ubuntu.com/ubuntu/pool/universe/e/ejecter/ejecter_0.4.4-0ubuntu2_amd64.deb

then for 14.04 LTS use

sudo dpkg -i --force-all *.deb
sudo apt-get install -f

or for 16.04 LTS and 18.04 LTS

sudo apt-get install ./*.deb

Then log-out and log-in again.

Connect USB-flash or HDD and you will get Ejecter icon in the notification area.

To eject the device click on the Ejecter icon, then on appropriate device name and it will be safely removed from the system.

Notes:
1. Ejecter does not spin-down external USB hard disks. Use GNOME Disks (gnome-disks or from Applications→Accessories→Disks) for this purpose.
2. This solution was tested on Ubuntu 14.04 LTS (MATE, Unity and GNOME FlashBack) Ubuntu 16.04 LTS (MATE, Unity and GNOME FlashBack), Ubuntu 18.04 LTS (MATE, Unity, GNOME FlashBack, GNOME sHell).


How to install Openshot 2.0 side by side with 1.4.3?

As of recently (since the time of posting the question) Openshot 2.0.x can now be installed (via the libopenshot ppa) side by side with 1.4.x.


How can I check a compressed file for reliability?

You can use the -d command. Quoting from man tar:

-d, --diff, --compare
   find differences between archive and file system

This might be very time-consuming, though.

Example in action:

$ tar -Jcf bin.tar.xz bin
$ echo foo >> bin/login.sh
$ tar -Jdf bin.tar.xz
bin/login.sh: Mod time differs
bin/login.sh: Size differs

  Or, is there something which will give me more details about the compression? ... As in something that might say: Your 5GB folder will 761MB using this compression type.

In general, the only way to know what size some data will compress to is to actually compress it.

xz is usually good at compression, and if most of your 5 GB was text, it could have compressed well (as opposed to, say PDF files or media files).


How do I install the QtWebKit 3.0 module for Qt Creator?

In default 12.10 it seems to be provided by libqtwebkit4. But that package is from Qt4, so I suppose you are using qt5-edgers ppa to provide Qt5. There you have two packages that can solve your problem:

sudo apt-get install libqt5webkit5-qmlwebkitplugin libqt5webkit5

So if you are using that PPA install those two packages and see if it solves your problem. If not you can use apt-cache to try to find the right package:

apt-cache search libqt*webkit*

If you can't find anything, you can try to use the Qt4 package I stated above, but I doubt it would help anything.

Hope it helps.


Answer prompts automatically in a shell script during an installation

You need to have newlines between the strings:

printf '%s\n%s\n%s\n%s\n%s\n%s\n' o 3 N Enter U N | ./$new_upgrd


For issues such as these, it is worth experimenting with one or more of the common boot options such as "nomodeset" and "xforcevesa".

To do this, press the Escape key when you see the Ubuntu logo.

This will display a similar screen as per this AU answer.

Either select one of the options by pressing F6 or type the text, for example, "nomodeset" as per the example in the link.

Use the option "try without installing".  If you see the Ubuntu desktop then double click the icon on the desktop to continue the installation.

Once installed, you will need to "fix" the boot option you chose when booting the live CD.

See this AU answer on how to do this.


Zotero update permission denied in Ubuntu 20.04

Posting my above comment as an answer as apparently, this comes up for others, too:
The Snap package should disable updating from within the app -- as per its documentation, in-app update isn't supported (see snapcraft.io/zotero-snap) and handle updates itself. Given that it's also not up to date with Zotero, I'd recommend using the deb/aptitude package here, which is very reliable.
Alternatively, you can directly download the tarball from Zotero, unpack it to a convenient location such as ~/.local/bin (make sure you have write access to the location with your regular user account -- otherwise, you'll run into the same issue again) and just run Zotero from the terminal.
Since the deb package basically does the same thing and handles dependencies and creates the launcher, I'd go for that in almost all cases.


I fixed it by upgrading to the latest Kernel version (5.8).


I had the same problem as you and I solved it by changing the ~/.Xmodmap file to the one provided by dfacto. It is not perfect (the alt and super keys are switched by default, and it changes the trackpad to "natural" scrolling) but at least you have a super key. I guess that by understanding how Xmodmap works, this can be solved.


Ubuntu on Samsung Chromebook 2 boots to Chrome OS

We are running Chromium + Ubuntu 13.10 on a Samsung 11.6" Chromebook, model 500C12-K01.  To switch I press Ctrl+Alt+Shift+forward.  By "forward" I mean the key labelled F2 on most computers.

I set up the Chromebook following Ben Schoon's article  at http://itechtriad.com/articles/2014/7/21/how-to-install-minecraft-on-a-chromebook. He says you use Ctrl+Alt+forward to switch, which is different that works on my install.  I figured out the correct commands on my system by carefully readings the output messages that flash by during the installation.


In my case I found that the NVidia card was not actually turned off, and the only thing I actually needed to do to run CUDA code was:

export LD_LIBRARY_PATH=/usr/lib/nvidia-352

in the shell where I want to run it (I am assuming that globally changing the alternatives setting would break compiz, etc, etc...)

To get to this point (on a Dell Optiplex 7010, with Ubuntu 14.04, CUDA 7.5, and a GTX 980) I believe the steps were:

Use the PRIME Profiles tab to select Intel
Reboot, and select Intel as the default in the BIOS
Shut down the computer
Plug the monitors into the onboard video :)

Everything seems to be working fine so far (nvidia-smi sees the card, cuda samples run, theano uses the card, etc...)


How can I upload to Ubuntu Wallpaper Contest?

This is the Trusty Tahr Wallpaper Submission Group.


VirtualBox Ubuntu Stuck, Black Screen with White Spinner

Your ISO is faulty.
Errors can be experienced (it tells you that).
Did you verify your ISO ? https://tutorials.ubuntu.com/tutorial/tutorial-how-to-verify-ubuntu#0
It doesn't matter which files, most of your files as squashed into a HUGE squashfs, so ~98% of files are contained in that one file. Most of the other files are what boots your system, verifies & then opens the squashfs
For more details, I'd suggest looking up https://bugs.launchpad.net/ubuntu/+bug/1874662
If you filed a bug in your case, it's almost certain your report would be marked a duplicate of that (the other alternative would just be invalid due squashfs errors).


Searching for the driver for the NVIDIA GeForce GTX 970 graphics card at the official NVIDIA website returns the following results.

The latest driver available at the official NVIDIA website is the recommended driver for this graphics card. The best choice of drivers for this graphics cards from the Ubuntu repositories is the nvidia-331 graphics card driver which is the latest tested NVIDIA proprietary graphics card driver in Ubuntu 14.04. nvidia-331-updates is a more recent graphics driver in Ubuntu 14.04, but it is not called tested in the Additional Drivers utility.

To be sure that this is the correct driver for the NVIDIA GeForce GTX 970 graphics card, open the terminal and type:

ubuntu-drivers devices

The results of this command will show a list of drivers and the NVIDIA driver with Recommended appearing after it is the correct driver to install. The Recommended NVIDIA graphics driver from the Ubuntu Software Center is the best driver to install because it is the most stable and reliable driver available from anywhere, and the small incremental performance enhancements that may be possible to achieve from bumping up to the latest graphics driver are not worth the risk of making Ubuntu less stable.

  Is the 290 easier to deal with?

If you want to get a specific answer to this question, you need to provide the full name and model number of the graphics card, because AMD also makes a graphics card called AMD Radeon R9 290 and I need to know the full name and model number of the graphics card to search for the correct driver. NVIDIA usually releases graphics card driver updates faster than AMD, but since both cards were launched about one year ago I don't think this would make any difference in Ubuntu 14.04.


Mysql lampp not running in ubuntu desktop

you can try following these steps: (ofcourse remove anything you have installed earlier)

  sudo apt-get update
  sudo apt-get install apache2
  sudo apt-get install php mysql-server php-mysql
  sudo apt-get install phpmyadmin


is there any way to split a number into an array of ranges?


How to find commands for autostarting applications?

Put the below commands on the command field for thunderbird and empathy while adding it to startup applications,

/usr/bin/thunderbird
/usr/bin/empathy


Can I set different backgrounds for different workspaces (tags) in Awesome WM?

You can add some code in your ~/.config/awesome/rc.lua file that will change the desktop wallpaper whenever you change tags.  Technically, it will set the wallpaper to the tag you most recently selected (in awesome, you can have multiple tags selected at the same time).

If you don't have that file already, then copy the system-wide awesome config file into that location:

$ mkdir -p ~/.config/awesome
$ cp /etc/xdg/awesome/rc.lua ~/.config/awesome

In my rc.lua in Ubuntu 11.10, there is a section where the tags get created that is labeled like this:

-- {{{ Tags
-- {{{ Define a tag table which hold all screen tags.
[... code that creates default tags ...]
-- }}}

After that section, I added the following code:

-- {{{ Tag Wallpapers
for s = 1, screen.count() do
    for t = 1, 9 do
        tags[s][t]:add_signal("property::selected", function (tag)
            if not tag.selected then return end
            wallpaper_cmd = "awsetbg /home/user/Pictures/wallpaper" .. t .. ".png"
            awful.util.spawn(wallpaper_cmd)
        end)
    end
end
-- }}}

Replace "/home/user/Pictures" with the location you want to store your wallpapers.  It will use the file "wallpaper1.png" for the 1st tag, "wallpaper2.png" for the 2nd, etc.  Note that this assumes that you have 9 tags.  If you have a different number, adjust the inner for loop.

awsetbg requires that you have some program installed capable of changing the wallpaper.  For example, the 'feh' or 'imagemagick' packages.  You can find a list of the supported programs in the awsetbg script (/usr/bin/awsetbg):

wpsetters="${wpsetters:=Esetroot habak feh hsetroot chbg fvwm-root imlibsetroot display qiv xv xsri xli xsetbg wmsetbg xsetroot}"

The only one my Ubuntu had installed by default was xsetroot, but I believe that program only supports bitmap images.  I have imagemagick installed (provides the 'display' command), so that can handle most any format you can imagine.  ;)

If you are using a gnome/awesome hybrid desktop (using gnome with awesome as the window manager) and haven't disabled nautilus's desktop management, you may have to use the gnome method of setting the wallpaper instead of awsetbg.  This is because nautilus manages the desktop and may override your settings.  For 11.10, you would change the awsetbg command to:

gsettings set org.gnome.desktop.background picture-uri file:///home/user/Pictures/wallpaper1.png

gsettings is the new way, for older Ubuntu versions (not sure exactly how long ago it changed), you should use gconftool-2:

gconftool-2 --set /desktop/gnome/background/picture_filename --type string file:///home/user/Pictures/wallpaper1.png


The AMD fglrx driver doesn't see GPU cores in AMD APU A8-7600

I'm answering my own question - in case anybody needs the same configuration. After many retries I was able to achieve what I wanted - to have a machine with hybrid CPU/GPU processor, which is not involved into graphical output.

Step 1. I've found a motherboard BIOS parameter, which I needed to enable. On my motherboard (ASUS A88X-PRO) this parameter is on the path:

Advanced -> NB Configuration -> IGFX Multi-Monitor

Step 2. I've installed all the necessary prerequisites for the AMD Driver. On my machine they were:

sudo apt-get install dh-modaliases execstack debhelper devscripts xserver-xorg-dev libglu1-mesa-dev libqtgui4 lib32gcc1 dkms

Step 3. I've installed AMD Driver Ver 15.302. The driver archive has been unpacked into the fglrx-15.302 directory, and the *.run script from this directory was run manually. The script has created four *.deb files, which have been installed by the following command:

sudo dpkg -i *.deb

IMPORTANT: If you do the same, the script will ask you to run the aticonfig command. Don't do that!!! This command will configure the driver to use the GPU for graphical output - that's NOT what we want. Reboot after this step.

Step 4. I've installed the AMD SDK Ver 3.0 (release 130.136) in my local directory in order not to change anything in system directories. The clinfo command reports both CPU and GPU cores now:

$AMDAPPSDKROOT/bin/x86_64/clinfo|grep 'Device Type'
  Device Type:                   CL_DEVICE_TYPE_GPU
  Device Type:                   CL_DEVICE_TYPE_CPU

And now it's time to play with samples from the SDK...


It is simply available with actual Qt5 dependency in the universe pocket for focal. Install with:

sudo add-apt-repository universe
sudo apt-get install antimicro


APT vs. dpkg - Removing packages with a dependency problem (telepathy)

Thanks to @user535733 for the useful comment: "Use dpkg to uninstall the offending (conflicting) package, then use apt to clean up the dependencies"

Here's how I removed the conflicting packages:

$ sudo dpkg --remove kde-telepathy
(Reading database ... 1330002 files and directories currently installed.)
Removing kde-telepathy (15.04.20ubuntu1) ...

$ sudo dpkg --remove kde-telepathy-minimal
(Reading database ... 1329999 files and directories currently installed.)
Removing kde-telepathy-minimal (15.04.20ubuntu1) ...

Afterwards I cleaned up with

sudo apt autoremove


How to install LAN Messenger in Ubuntu 16.04 and higher?

Instructions for installing LAN Messenger--a serverless text chat application--on Ubuntu/Mint 18.x.

Notes: If anyone would like to install this app on a 19.x O/S release, note that the procedure is somewhat different and it requires a bit of "hacking". I'll update this post with that procedure when I'm able... The LAN Messenger software has only been built for install on 64-bit Linux. If you require a 32-bit version, you'll need to build the app from the source code which is available at the web address shown below... Be aware that I've only tested the app's basic features, i.e. chatting and sending files between two computers and these functions appear to work quite well.

For what it's worth, here's a review of LAN Messenger from 2013:
https://www.makeuseof.com/tag/instant-message-anyone-on-your-home-network-with-lan-messenger/

As the first step in the process, boot into a live instance of the chosen Ubuntu/Mint 18.x distro. In my case, I had a live USB copy of Linux Mint 18.1 to work with. I recommend this step be done because it allows you to investigate LAN Messenger without altering anything in your computer's installed O/S.

Having booted into the live session, download the LAN Messenger .deb file from the app's website (https://lanmessenger.github.io/) and install it using GDebi by right-clicking on the .deb file and choosing "Open with GDebi Package Installer".

Once installed, try to run the app ("lmc") in the terminal. You'll likely get the following error:

  mint@mint ~ $ lmc /usr/lib/lmc/lan-messenger: error while loading
  shared libraries: libQt5Multimedia.so.5: cannot open shared object
  file: No such file or directory
  mint@mint ~ $

If so, then from the terminal update the package cache and then install the libqt5multimedia5 package:

sudo apt-get update
sudo apt-get install libqt5multimedia5

Again, try running the app in the terminal. If there are no fatal errors reported and the software's icon now exists in the system tray, left-click on it to access its menu options. Before continuing you may want to first "exit" the app in the system tray and confirm that it can be restarted from the system menu.

If everything works as expected, you can repeat the above process on a second computer on your home network (booting from a second live USB or DVD) and test the communication between both systems. When you first run the app on the second computer, you should be greeted with a notification message saying that the user on the first computer is available for chat...

Welcome to using LAN Messenger!


Ubuntu 14.04 system messed up after kernel update

Solved it by chrooting to the system from Ubuntu live DVD.
I had to reinstall the kernel because they were not correctly installed and missing some important files.

This is an awesome howto and should be pinned https://askubuntu.com/a/166010/252296


Try this:
Download these packages:
https://launchpad.net/~michael-gruz/+archive/ubuntu/canon-trunk/+files/cnijfilter-common-64_3.90-76~ubuntu14.10.1_amd64.deb
https://launchpad.net/~michael-gruz/+archive/ubuntu/canon-trunk/+files/cnijfilter-common-32_3.90-76~ubuntu14.10.1_amd64.deb
https://launchpad.net/~michael-gruz/+archive/ubuntu/canon-trunk/+files/cnijfilter-ip1900series-32_3.90-76~ubuntu14.10.1_amd64.deb
Assuming they are downloaded at ~/Downloads
To install they, run in a terminal:
cd ~/downloads
sudo dpkg -i *.deb
sudo apt -f install


Thanks to WinEunuuchs2Unix for your comment. Boot-repair seems to have done the trick.

https://help.ubuntu.com/community/Boot-Repair


how to give _apt user permission to /var/lib/apt/lists?

The moment you symlink things, you have to do permissions analysis on the location that the symlink points to.
If you moved /var/... into /root then anything accessing /var/... needs to be able to read /root - which only root can do.  Any chmodding you do on the symlink will do nothing.
You should move back your /var/... with the original permissions it had back to where it should be and not symlink it.  This will break many potential things since by default only root can read /root.
You may want to consider expanding the /var partition rather than 'symlinking' stuff around, it's going to break the way you're doing things.


Screen resolution stuck at 640x480 after upgrade

I've struggled with the problem and found a very simple solution.

I have  ubuntu 14.04.2 LTS running on my machine.

The solution is:

Xdiagnose

Use Xdiagnose from the Dashboard.
   (Xdiagnose is an analysis tool for troubleshooting X.org problems, and this is what you are experiencing.

Enable options under debug

Search for and launch Xdiagnose, then enable all the options under the Debug section. Click the Apply button, then close the window and restart the system.

the solution is also detailed here:  linuxbsdos.com.


How to set up iptables to access my apache2 server from public IP

You seem to be mixing and matching between using raw iptables, and ufw (which is a front-end to iptables)
I think the first thing to do is delete all ufw rules, and flush iptables. then pick one (either raw iptables, or a front-end). then just use that. Mixing and matching between the two is going to cause all sorts of issues


Ubuntu 17.10 and rhythmbox google music plugin

For Ubuntu 14.xx or Later Users
Canonical's repos package Rhythmbox 3 beginning with Ubuntu 14.04 Trusty Tahr. If you are running Ubuntu 14 or later, you will need to add the Saucy repos to your sources, and downgrade to Rhythmbox 2.99 to use this plugin.

Have you downgraded your Rhythmbox?


When Gparted tried to resize the Windows partition (I understood that it is the partition you talk about) probably it gone in some trouble and the NTFS is now on a "broken" state that needs you to restart it using Windows to correct the situation.

On that scenario, mount is not going to work until you start the partition with Windows to correct it, as a NTFS Linux-mount could damage more the file system there.


New computer, best way to add new ssh keys

Depending on your OS, you can try:

ssh-copy-id username@host

To specify the key file use:

ssh-copy-id -i ~/.ssh/id_rsa.pub username@host

You may have to copy your public key to a computer that already has SSH access to the three machines, otherwise these commands won't work without asking for a password.

I find this is much easier than using my old method:

cat ~/.ssh/id_rsa.pub | ssh username@host 'cat >> .ssh/authorized_keys'


How do I disable 'Warning: Unsafe Paste' pop-up?

Open up the terminal, click on edit, click on preferences, and untick the box.

That should do it.


HTTP redirects to main domain, but not HTTPS

That's not a correct Vhost for SSL.

You have to actually turn on SSL on the VHost (SSLEngine on), specify a certificate and so on. Here is a reasonable starting point.

<VirtualHost *:443>
   DocumentRoot /var/www/forum/html/
   ErrorLog "logs/error_log"
   CustomLog "logs/access_log" common
   ServerName forum.domain.com
   ServerAlias www.forum.domain.com
   SSLEngine on
   SSLProtocol all -SSLv3 -SSLv2
   SSLCipherSuite HIGH:!aNULL
   SSLCertificateFile /etc/letsencrypt/live/forum.domain.com/cert.pem
   SSLCertificateKeyFile /etc/letsencrypt/live/forum.domain.com/privkey.pem
   SSLCertificateChainFile /etc/letsencrypt/live/forum.domain.com/chain.pem
   CustomLog /var/log/apache2/ssllog %t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
</VirtualHost>

To achieve a redirect, you can use the following for your regular vhost:

<VirtualHost *:80>
        ServerName forum.domain.com
        Redirect permanent / https://forum.domain.com/
</VirtualHost>


It seems that Update Manager got an error while extracting some files. Probably there was some problem while downloading the updates and some downloaded files may be corrupted.

To remove those files execute this on a terminal

sudo apt-get clean
sudo apt-get update

This should delete all downloaded files. After that, run again Update Manager to redownload and install the updates.


Why do I've two entries per server in known_hosts file?

You have two entries because one is by domain and the other by IP address, so your example:

|1|wwwwwwwwwwwwwww=|wwwwwwwwww= ecdsa-sha2-nistp256 AAAAAAAAAA+AAAAA=
|1|vvvvvvvvvvvvvvv=|vvvvvvvvvv= ecdsa-sha2-nistp256 AAAAAAAAAA+AAAAA=

might in effect read:

[example.com] ecdsa-sha2-nistp256 AAAAAAAAAA+AAAAA=
[192.168.6.8] ecdsa-sha2-nistp256 AAAAAAAAAA+AAAAA=

If you disable known host hashing (add HashKnownHosts no to your ~/.ssh/config file) then you can see what is happening, but on a non-hashed known_host file, both the domain and IP address can appear on the same line, so they'd look like this:

[example.com],[192.168.6.8] ecdsa-sha2-nistp256 AAAAAAAAAA+AAAAA=

There's a bit more of a discussion of the known_hosts file format here.


Why do some of my MP3's have album cover icons and some not in Nautilus?

Cover art in mp3 files is handled through the use of ID3 tags. It often depends on the source you got your .mp3 files from as to whether they will have cover art embedded within.

In regards to downloading cover art there are a number of programs designed to do this, some good examples are discussed in the related question: Need a MP3 ID3 tagger, and cover fetcher


MongoDB installation failed on Ubuntu 16.04

TL;DR;

Try running this command,

sudo apt-get install libcurl3 openssl

and then

sudo apt-get install mongodb-org

Logs:

So I've followed official instructions on Mongo 4.0 here and got this after running sudo apt-get install mongodb-org

The following packages have unmet dependencies:
 mongodb-org : Depends: mongodb-org-server but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

Then I manually added mongodb-org-server to installation command:

sudo apt-get install mongodb-org mongo-db-server

but then I got

mongodb-org-server : Depends: libcurl3 (>= 7.16.2) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

After manually installing these:

sudo apt-get install libcurl3 openssl

I got it working with single:

sudo apt-get install mongodb-org

command.


Wake on Lan doesn't work on Asrock Q1900DC-itx

Check your BIOS and make sure ACPI, PCI Devices Power On is enabled.


Is there a way to regain preview workspace functionality in unity?

This is currently not possible in 11.04.


How to change the default position of ~/.ssh/authorized_keys

http://www.openssh.com/txt/release-5.9
* sshd_config(5)'s AuthorizedKeysFile now accepts multiple paths,
   separated by whitespace. The undocumented AuthorizedKeysFile2
   option is deprecated (though the default for AuthorizedKeysFile
   includes .ssh/authorized_keys2)

e.g.
AuthorizedKeysFile <path1> <path2> <pathN>


Ubuntu error message after GRUB " pci 0000:00:14:0: PCI INT A no GSI "

I had the same trouble, with the same computer... To solve it you juste need to upgrade your BIOS to v1.37 (Check Acer Website)


How do I find the folder/directory that a file is in (without using find)?

You can use the command locate in Terminal or if you need to search for a file on the computer, there is an easy and built-in way to do it.

Launch the Search for Files program from the Places menu. By default, this will only search your files (your home directory), but you can tell it to search in other folders with the Look in folder dropdown. This will only search on file names. If you want to search inside file, see the Beagle application.


I can't use the terminal while gedit command is running

Short Answer
In the unresponsive terminal:

Hit Ctrl+Z.
Type bg and enter.
Type disown and enter.

Long Answer
In the unresponsive terminal, hit Ctrl+Z, this will "pause" the process (or "job") and return the console control to you. However, you'll notice that gedit becomes unresponsive and you can't use it.

Extra: if you want to, you can execute the command jobs, you'll notice that it'll read Stopped for the gedit command, that's why you can't use it.

To make the job successfully run in the background (i.e. to make gedit responsive again), execute the command bg (meaning background). You'll now be able to use gedit, and at the same time have the prompt to yourself.

Extra: now, if you  execute jobs, you'll notice that it'll read Running.

You can overcome all of this from the very beginning. When you're launching gedit from the terminal, add an & to the end of the command, so something like this gedit /path/to/file &. This will launch gedit in the background from the first place (you might need to hit Enter a couple of times to get the console control back).

Extra: if you were following these extra notes, you might have noticed that the second time you did jobs, you could see that bash added a & to the end of the gedit command.

Once you get used to this system, you might notice that if you close the terminal, gedit will also terminate, without even a confirmation dialog. To prevent this from happening, run disown, which will detach the gedit process from the terminal, removing it from the list returned by jobs.


In which directory should I permanently mount a drive?

I mounted my HDD on /mnt, created some folders and stored some files. After rebooting the laptop all was gone, nothing was shown under /mnt/myHDD. I thought I had lost everything but no. The data was still there, but for some reason the OS was not showing it.
After unmounting the HDD and mounting it on the root (as /myHDD) all went back to normal.
I suspect this is because of the nature of /mnt. The Filesystem Hierarchy Standar says this about /mnt:

/mnt : Mount point for a temporarily mounted filesystem
Purpose
This directory is provided so that the system administrator may temporarily mount a filesystem as needed. The content of this directory is a local issue and should not affect the manner in which any program is run.
This directory must not be used by installation programs: a suitable temporary directory not in use by the system must be used instead.

So it makes sense it 'dissapears' after rebooting the machine even if it was added to /etc/fstab which was true in my case.
The other option might be mounting the HDD under /media but the Filesystem Hierarchy Standar says this about /media:

/media : Mount point for removeable media
Purpose
This directory contains subdirectories which are used as mount points for removeable media such as floppy disks, cdroms and zip disks.

It doesn't make sense to use it to mount an HDD either. What to do then?
Well, mounting the HDD anywhere else, like in the root folder /hdd.
Hope that helps!


Application Crash cleared the content of the Folder

As it turned out that the application itself while downloading the files from DC Network uses a temporary directory to stores files. While I was browsing through the filesystem I just stumbled upon this temporary folder (For LinuxDC++ it under /home//.dc++/FileLists) while looking through it I found most of my files.


How can I switch from server kernel to desktop kernel?

All you need to do is:

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

And after reboot, check your kernel version with:

uname -a


Remount the filesystem as read/write

mount -o remount,rw /

and run those chown/chmod again.


How to link with a WebDAV application in Unity?

Start Nautilus, in the menue go to: File-> Connect to server


my laptop Is AMD hybrid-graphics card, is it supported by Ubuntu 16.04 driver?

Using the OS radeon driver make sure you pass nomodeset to the kernel boot parameters.

(see https://wiki.ubuntu.com/Kernel/KernelBootParameters)


Touchpad not working and does not appear in dconf-Editor

I went to Settings-System(Geräte)-Mouse and Touchpad (Maus und Tastfeld) and enabled the Touchpad there. It is now working again.


adding a payload file to a bootable USB drive created by mkusb-plug

Running Ubuntu I can use sudo -H gparted to increase the size of the original FAT partition of FD12LITE to 127 MiB, which creates 96 MiB free space.

A more complicated alternative is to use sudo -H gparted to create a second partition with for example

size 512 MiB and
FAT 16 file system.

I checked that FreeDOS will recognize such a file system at boot as D: and FreeDOS could create and read a file in it.


You can re-install Ubuntu the same way, you installed it the first time. Format or delete the partitions assigned to the previous installation, to make sure, it's gone and doesn't mess with the new installation. You can use the partition manager built-in to the installation assistant with the Something else option.

You can keep using Windows, while Ubuntu is installed, if you don't find it reliable enough (yet). Alternatively, you can choose to “Try Ubuntu” without installation to check out hardware compatibility (see next point).
Hardware compatibility is a big issue on Linux unfortunately for various reasons. If a piece of hardware isn't brand new¹ or exotic, there are actually good chances, that it runs out of the box or with a few simple touches.

In many cases though, drivers need to be installed manually or even compiled from source. Often you'll find a relevant question here.

In all other cases you can ask your own question and people will try to help you, if they know how (which usually comes down to searching online for suitable descriptions and instructions and adapting them to the specifics of Ubuntu). To speed things up, it helps if you follow the advice on asking hardware compatibility questions:

I have a hardware detection problem, what logs do I need to look into?
My wireless/WiFi connection does not work. What information is needed to diagnose the issue?

If you hardware is very old and/or underpowered (e. g. in the case of netbooks), take a look at How do I find out which version and derivative of Ubuntu is right for my hardware in terms of minimal system requirements?.

¹ compared to the kernel used by a particular Ubuntu release


It seems to be the Mainboard wiping the data, because there was still a part of the GPT formatting left.
Details are explained here: https://unix.stackexchange.com/a/484532
Running sgdisk --zap /dev/sda and sgdisk --zap /dev/sdb solved the issue.


Problem mounting my internal hard drive...any suggestions?

You can try and install ``ntfsprogs".

$ sudo apt-get install ntfsprogs

Then, try and run "ntfsck" and/or "ntfsfix" on the Windows NTFS partition.

$ ntfsck /dev/sda1    #If your partition is /dev/sda1

If you're not sure of the Windows partition/device, you can try ``fdisk" command on the Terminal.

$ sudo fdisk -l

Look for the "Device" with "System" as NTFS. Example:

Device     Boot      Start         End      Blocks   Id  System
/dev/sda5        348483584   373188607    12352512    7  NTFS

You can also refer to the following: How do you repair an "input/output error" in an NTFS partition?


No, it's not a bug. If you have a look at the /usr/bin/cal file, you'll see that it's a symlink:

$ ls -l /usr/bin/cal
lrwxrwxrwx 1 root root 4 Jan 17  2018 /usr/bin/cal -> ncal

cal points to ncal. The binary modifies it's behavior based on which name it is called under. The hint is that the two first lines of cal -h lists cal, whilst the next lines lists ncal.

ncal -h disables hi-lighting of the current day.

The reason it's implemented this way is to provide a better cal without breaking the old format. This is also noted in man cal:

  History

  A cal command appeared in Version 5 AT&T UNIX.  The ncal command appeared in FreeBSD 2.2.6.  The output of the cal command is supposed to be bit for bit compatible to the original Unix cal command, because its output is processed by other programs like CGI scripts, that should not be broken. Therefore it will always output 8 lines, even if only 7 contain data. This extra blank line also appears with the original cal command, at least on Solaris 8


May a Linux kernel package have config files that remain in storage after removing the package?

No linux-{image,image-extra,header}-<version>-generic package adds anything to /etc. You can confirm this using a quick check of currently installed kernel packages:

grep /etc /var/lib/dpkg/info/linux-{image,headers}*.list

The output will be nothing. This is also reinforced by the lack of .conffiles for these packages in /var/lib/dpkg/info/. As such, you don't need to purge these packages; removing and purging are effectively the same for kernel packages.

What does remain after you remove these packages is information that dpkg itself stores (in /var/lib/dpkg/info): the postrm package maintainer script, list of files, etc. The last step in purging is running postrm and deleting postrm itself (and any other information dpkg might have, such as file lists) - which is not usually done for normal removal. You might see a bunch of linux-image*.postrm files in /var/lib/dpkg/info/.


How do I access the SSH client side from the SSH server side?

As @terdon said you can use the following command to execute something on the remote server through SSH and save (redirect) the output to the local instance:

UserA@HostA:~$  ssh UserB@HostB ls ~ > /home/UserA/ls-of-home-UserB.txt

Also you can use the following command to execute something on the local instance and pipe the output to the remote server and save it by the command tee:

UserA@HostA:~$  ls ~ | ssh UserB@HostB tee /home/UserB/ls-of-home-UserA.txt

I'm agree with @Sebastian Stark you are probably asking how to create revers tunnel with SSH port forwarding. The SSH connection allows to bind  port on the remote server to port on the local by using the option -R. And vice versa you can bind local port to remote port by -L.

In your case should be applied the first scenario by using the option -R:

UserA@HostA:~$  ssh UserB@HostB -R 2222:localhost:22

This command will establish connection from HostA to HostB as usual and will bind port 2222 on HostB to port 22 on the loopback interface on HostA. That means when you request something on port 2222 on HostB the request will be handled by the service that listen on port 22 on HostA, usually this is the SSH server. At this point you could be able to use some of the following commands to connect back from HostB to HostA:

UserB@HostB:~$  ssh UserA@HostB -p 2222
UserB@HostB:~$  ssh UserA@localhost -p 2222

Or you can use the above commands, for example:

UserB@HostB:~$  ls ~ | ssh UserA@localhost -p 2222 tee /home/UserA/ls-of-home-UserB.txt

Note you should have installed SSH server on HostA!

One interesting usage is that you can bind remote port on HostB to port on other instance in the local network of HostA:

UserA@HostA:~$  ssh UserB@HostB -fTN -R 3389:192.168.100.115:3389

Where 192.168.100.115 is the IP address on any Windows computer in the LAN of HostA, let's call it HostC. The options -fTN will push the ssh connection into the background and you will have just a tunnel from HostB:3389 through HostA to HostC:3389.

I'm using this by combination with autossh to keep the connection alive. For example I have the next line in my crontab:

@reboot sleep 15 && autossh remote-server-with-public-ip -fTN

Where remote-server-with-public-ip is a Host defined in my ~/.ssh/config file on HostA:

Host remote-server-with-public-ip
    HostName hostB
    IdentityFile ~/.ssh/hostB/id_rsa
    User userB
    Port 22
    RemoteForward 2223 127.0.0.1:22
    RemoteForward 8080 127.0.0.1:80
    RemoteForward 6900 127.0.0.1:5900
    RemoteForward 3389 192.168.100.115:3389

The ports 2223, 6900, 3389 on HostB are not public and I can access them only through another SSH connection - for example from HostD that is somewhere on Internet. But to access 8080 I'm using Apache with reverse proxy on HostB :-) and the virtual host's configuration file looks as this:

<VirtualHost _default_:443>

    ServerName forward.example.com
    # Other configuration directives

    SSLEngine on
    # SSL certificate files

    ProxyRequests Off
    <Proxy *>
        Order deny,allow
        Allow from all
    </Proxy>

    ProxyPass "/"  "http://localhost:8080/"
    ProxyPassReverse "/"  "http://localhost:8080/"

    <Location />
        Order allow,deny
        Allow from all
    </Location>

</VirtualHost>

The Apache's modules proxy and proxy_http are required.

Further reading:

Access remote multiple servers behind NAT
Making a .sh script to check if SSH connection exists and if not then connect
Use Outgoing SSH to receive incoming SSH


Magic file does not produces wanted results

file uses its pre-compiled magic database by default - you need to tell it to use your custom file using the -m option.

Ex.

$ file testFile
testFile: ASCII text

but

$ file -m myMagic testFile
testFile: ThisIsTestType
$


Problems accessing LAMP installation or phpMyAdmin?

The error message rather indicates the server being unable to reach. Are you sure you configured it to listen on port 8080? Check the following things:

check your /etc/apache2/ports.conf what ports you have configured Apache to listen on. It's shown in the line starting with "Listen", and by default points to port 80
run netstat -a -t -n to check for listening services. The column "State" should show "LISTEN" here, and the column "Local Address" has your local services. In this column, the port in use is printed after a colon, so e.g. "*:8080" would indicate there is something listening on port 8080
check your Apache error log file for details. If not configured otherwise, you should find it in /var/log/apache2/error.log

The most likely cause is you set up Apache to listen on port 80 (which is the default), and now try to follow some tutorial which assumes otherwise. It might also involve configuring a virtual host, and you skipped this step (or didn't succeed here).

If, on the other hand, your configuration is to have Apache listen on port 8080, and it is listed by above netstat command properly, it could be some permission problem -- though that normally should be indicated by a different error. Just to make sure you can rule this out:

check what user Apache is running under. This usually is www-data:www-data (i.e. user and group is www-data). Using the command ps -aeo "%p %U %G %x %c" |grep apache you should see all Apache processes, having the user and group in the second and third column.
check directory and file permissions. Either user or group should have at least read and execute on the directories, and read on the files. Having your DOCUMENT_ROOT in /var/www, for example, and accessing an index.html there, the file must be at least readable to Apache's user or group, and /var as well as /var/www should have read and execute permissions given.


File system went read only after adding ssh key

You must setup root password:

sudo passwd

Then restart the ssh service:

sudo service ssh reload

Note: permitting root access especially without password is quite dangerous it makes your system highly vulnerable to external threats.


QoS (quality of service) criteria in router for Ubuntu One

This doesn't directly answer your question, it's a workaround. You can limit the up & download rate from the U1 app like this:

This requires that you remember to switch this on and off for big files, but it should work.


Error mounting ntfs partition at start-up Ubuntu 11.10 - can only be mounted and accessed as root

You can fix this problem by installing ntfs-3g

In terminal, you type:

sudo apt-get install ntfs-3g

then reboot.


Adding an external hard-drive to www folder

The most logical answer to your question: I would consider to create a mountpoint /var/ pointing that disc. That way your whole /var/ will be on that disc. That is not adding it to the current /var/www/ though. If the current disc has lots of content in /var/ your new disc if filled with that content already. You could do that following this answer.

The 2nd option would be to create a symlink in /var/ to point to the new disc. That way you add the new disc to the current content. But it might spell trouble in the future: not everything seems to understand or to correctly interpret symlinks. Plus you are spreading out your /var/ over 2 discs. So if 1 of the discs breaks the other becomes useless...

To offer a possible better option since you asked "how should I do this": Apache2 (assuming you use this) works with virtualhosts. That kills the need to store web content in /var/ and you can store it anywhere you want by including a documentroot in any of the virtualhosts. The default one will point to /var/www/ . So you can mount your disc with a name you like (ie. /user27374/) and put your website content into that directory (./var/www/ on that disc). You can keep the current /var/, copy it all over to the new disc (ie /user27374/var/www/), create a 2nd virtualhost that points to this webroot and test your setup while the current one stays active.

Any of these can be used but the last one I consider the easiest with the least maintenance. But feel free to consider any of the options (or if someone else posts a different one their method :) ).

Mind though that an external disc is not the quickest when loading data and you will need to have it mounted always if you want to use the webserver.


Booting to Windows Boot Manager removes Ubuntu option from BIOS

1- First download boot repair disk from here: Boot Repair Disk

2- Then burn it into a USB or a CD-DVD

3- Boot your computer from that device

4- Choose your language

5- Choose "Recommended Repair"

6- Reboot your computer.

It will fix your grub (I hope)...


Can older wallpapers be used in newer releases?

Yes, download the wallpaper from google pictures and add it to your pictures map. From appearances you can add it as a wallpaper.

13.10

Default wallpaper.

18 wallpapers that won the contest.

And in case anyone wonders:

13.04

Default wallpaper
13 wallpapers that won the contest

12.04

Default wallpaper
15 wallpapers that won the contest

In case the links disappear you can also download all of the from the package page.


Shortcuts like Ctrl + T and Ctrl+Shift+T no longer work in applications like Terminal, firefox, etc

I had a similar problem. While this doesn't necessarily fix your problem, this comment does not fit into the comment section and might be helpful anyway.
Running xev and pressing Ctrl-T showed this:
KeyPress event, serial 40, synthetic NO, window 0x9e00001,
    root 0x160, subw 0x0, time 3445511468, (-677,97), root:(1251,126),
    state 0x0, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

FocusOut event, serial 40, synthetic NO, window 0x9e00001,
    mode NotifyGrab, detail NotifyAncestor

FocusIn event, serial 40, synthetic NO, window 0x9e00001,
    mode NotifyUngrab, detail NotifyAncestor

KeymapNotify event, serial 40, synthetic NO, window 0x0,
    keys:  2   0   0   0   32  0   0   0   0   0   0   0   0   0   0   0
           0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0

KeyRelease event, serial 40, synthetic NO, window 0x9e00001,
    root 0x160, subw 0x0, time 3445521451, (-677,97), root:(1251,126),
    state 0x4, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False

Instead of FocusOut, it should have shown just another KeyPress event.
In my case, I had just installed and run qstardict, which apparently uses Ctrl-T for something. Quitting the app fixed Ctrl-T in all apps.
Now, just for the sake of completion, here's one blunt way to proceed if you suspect a different process might be handling the Ctrl-T:
Quit as many applications running as possible. There are other options, but you could use perf to get a list of all running background processes. (Use sudo apt-get install linux-perf to install.) Run sudo perf record -e context-switches -a sleep 2 and press Ctrl-T within 2 seconds. Then you could do sudo perf script  | awk '{print $1}' | sort -n | uniq > running_bg_processes_1. Then do another perf record without pressing Ctrl-T and another perf script piping to a different file. Then look at the differences between the file. You may have to do this multiple times. If you see a difference each time, that process could just be your candidate. If you don't see any consistent differences, it seems likely that at least one of the processes listed is the culprit, so you could narrow it further down from there. E.g. you could strace all the remaining processes and see if there's activity exactly right after you press Ctrl-T.


Dedicated menu bar inside a window in Ubuntu 15.04 with Unity

Try this:

Install the following packages and restart your apps:

sudo apt-get autoremove appmenu-gtk appmenu-gtk3 appmenu-qt

NOTE: In Firefox, you have to disable "Global Menu Bar integration" extension as well.

Source and full documentation:

How to Disable Ubuntu's Annoying Global Menu Bar


It's for KDE and there is no way to make it run on Ubuntu.


For the benefit of anyone running into this thread.  The machine was so cheap that I got it anyway reasoning that if I could not make it work with Ubuntu I could always install Windows.  In the event though this was not required - the Ubuntu version is 12.04 and it appears to have been tailored for the machine by HP.  Upon firing it up it walked me through a few configuration steps and I now have an Ubuntu laptop that works well and looks good.


How to send a mail between 2 Ubuntu virtual machines in VirtualBox?

I assume, this is sort of test environment, without a real DNS/MX/etc settings?
I think you should take a look at https://linux.die.net/man/5/transport. These postfix settings allows you to force the recipient/destination host for some emails. Just setup the destination host for your needs.


How to give permissions to specific command?

Using sudoers file

The correct way is to add a line into your /etc/sudoers file similar to:

username     ALL = NOPASSWD: /bin/path/to/fastboot

which means this specific 'username' is able to run fastboot command using sudo without providing any password as anyone.

Now when you run it using sudo fastboot it won't ask you for password and is a little bit faster to work with.

Then simply add a simple alias to your .bashrc:

alias fastboot='sudo fastboot'

Using SUID bit

I highly recommend the above solution over this one;

If your fastboot program is a binary file you can do as follow:

sudo chown root:$(id -gn) /path/to/fastboot
sudo chmod 4750 /path/to/fastboot

First we make sure that root is the owner of this file and also it belongs to your primary group, then we make it possible for the owner and group to run this file while adding the SUID bit (4) which means file will be run with the owner's rights (root).

Now it should work without sudo, however only root and you are able to run it.


Howto enable boot messages in ubuntu 12.04?

Yes. the link is still valid. You can use both methods(editing the GRUB file, and editing the command-line during boot).


Which graphics driver in the Additional Drivers list should I choose?

Let the built-in ubuntu-drivers program decide automatically which graphics driver to install. Open the terminal and type:

sudo ubuntu-drivers autoinstall
sudo reboot

The autoinstall command of ubuntu-drivers installs drivers that are appropriate for automatic installation including their dependencies.


How to make mail indicator show a number

Have you considered using email client supporting such feature?

AFAIR it is supported by

kmail
thunderbird / icedove with FireTray plugin


Avoiding requirement to type sudo ifdown br0 && sudo ifup br0

Remove auto eth0 from your  /etc/network/interfaces file.

Here's an example of a Proxmox VE host I have with bridged interfaces:

auto lo
iface lo inet loopback

iface eth0 inet manual

auto vmbr0
iface vmbr0 inet static
        address 123.123.123.123
        netmask 255.255.255.0
        gateway 123.123.123.1
        dns-nameservers 8.8.8.8 8.8.4.4
        bridge_ports eth0
        bridge_stp off
        bridge_fd 0

Here vmbr0 is bridging eth0. eth0 is set to manual and doesn't start automatically, but vmbr0 does.

Yours then should look like:

auto lo
iface lo inet loopback

iface eth0 inet manual

auto br0
iface br0 inet dhcp

bridge_ports eth0
bridge_stop off
bridge_maxwait 5


evolution does not retrieve mails from my gmail account

You can set it up correctly by following the instructions on https://help.ubuntu.com/community/UsingGmailWithEvolution


Could not find a kernel image on LiveCD 14.04 LTS

According to this wikipedia page your E-300 APU is AMD64 (x86_64) architecture.

Try downloading the ubuntu-14.04-desktop-AMD64.iso image and use it to install.


Steam not detecting the right AMD Radeon drivers on Wine

Why not use the native Steam client and native counter striker for Linux instead of running the windows version on wine.


In order to copy and paste in the terminal, you need to include the SHIFT key. For example:

Ctrl+Shift+C = Copy
Ctrl+Shift+V = Paste

Regular Ctrl+C won't work because the terminal interprets this as cancelling/interrupting an operation.


Boot problem - installed ubuntu 16.04 and restarted. But ubuntu is not coming.

Hi there is already a topic about this with some detailed information off what might go wrong. please check this topic. The steps given in the solution are the following:

Before installation goto BIOS-Settings, make sure to have this:

Security: set supervisor password;
Boot - BootMode: UEFI;
Boot - SecureBoot: enabled;

After installation again go to BIOS-Settings

Security - Select an UEFI file as trusted for executing Enter;
HDD0 appears Enter;
EFI appears Enter;
goto  Enter;
choose the first entry with .efi ("shimx64.efi" at my device) Enter;
give it a name Enter;
save changes on exit BIOS;
restart


Server locks up while streaming video suspect hardware failure

There seems to be some type of resource threshold.  that your browser will reach.  I just did a top to get the Process ID for your browser and renice it to -1.  Once I did that it stopped locking.  If your PID was 18737 type

sudo renice -n -1 -p 18737

I haven't had time to figure out how to modify user thresholds, but I am sure it is an easy setting somewhere.  else you have to do this every time you reboot.


time of bringing up or down an interface

One can access interface related logs using the dmesg from terminal. But the logs are not available anymore after you reboot your system. I am giving you a script that would store the interface up/down log in ~/interface_up_down.log. You need to use this before you reboot or shutdown your system. Save the following script as save_interface_log.sh

#!/bin/bash

dmesg -T | grep "link becomes ready" | grep $1 | awk -F "]" '{print $1}' | awk '{print $4}'| while read var1;
do
    echo -e "[$(date +%d-%m-%y)/$var1]\t$1\tUP" >> ~/interface_up_down.log
done
dmesg -T | grep "Link is down" | grep $1 | awk -F "]" '{print $1}' | awk '{print $4}'| while read var2;
do
    echo -e "[$(date +%d-%m-%y)/$var2]\t$1\tDOWN" >> ~/interface_up_down.log
done

Give the script executable permission from terminal using

chmod +x /path/to/save_interface_log.sh

To run the script for eth0

/path/to/save_interface_log.sh eth0

When you run the script it will save interface up/down info to the file in your desired format as below. I used eth0 you can modify any other interface.

[14-12-13/19:08:15]    eth0    DOWN
[14-12-13/19:08:28]    eth0    UP


How do I make DOSBox show in full screen mode?

First, press ctrl + F10 to lock mouse to dosbox and then try alt + Enter.


no permission to modify boot file rc.local

First you'll need a text editor. Ubuntu comes with gedit by default. To run gedit with sudo privileges type sudo gedit filepath . Then you'll be asked for your sudo password, enter it and gedit window will open allowing you to edit and save the file.

If you know how to use vi/vim (even knowing how to insert/save and quit is enough) you can do the same by sudo vi filepath This opens the file in your terminal.

Seems that i'm pretty wrong here.

Courtesy of @steeldriver Why should users never use normal sudo to start graphical applications?

@GTRONICK says >   For gtk applications you should use gksudo .


After the upgrade from 14.04 LTS to 16.04 LTS in gwenview plugins missing

As stated in this Gentoo Forum thread

Problem

  So, I just installed kipi-plugins-5.0.0, so I could finally update gwenview to a KF5 version, but it seems that all plugins except import/export have just disappeared. Am I doing something wrong, or is it just one more case of the developers telling us "you think you want it, but you don't"?

Reason

  Anyway, kipi-plugins is not maintained by 'the KDE guys' but by 'the digikam guy' and he decided to move these plugins into digikam in the process of porting to KF5/Qt5 and become platform independent (read: MacOS, Windows).

Solution

There is not really one except using another tool to do the job.


Firefox asks to install flash, then plugin finder says "no suitable plugins were found."

It seems that flash is not working properly with Firefox. First of all I suggest you to install flash with:

sudo apt-get install flashplugin-installer

Then if it's not OK, try to reset your Firefox.
You have to go to

Firefox --> Troubleshooting Information --> Reset Firefox...


baobab:
If you want to use baobab, this is possible by mounting the root filesystem in another place and analysing that. This way, other filesystems will not be mounted in the new root mount and any files hidden by mounts under / will be uncovered and counted in your analysis.

Assuming your root filesystem is on sda1 (df will tell you which device it is):

mkdir root-rebound
sudo mount /dev/sda1 root-rebound
baobab root-rebound

and then tidy up when you're done:

sudo umount root-rebound
rmdir root-rebound

Alternatively you could unmount said file systems manually. You can also scan just your home folder, because it will most likely contain the source of the excessive disk space usage.

du has two options which are able to prevent counting other filesystems:

 -x, --one-file-system
         skip directories on different file systems
     --exclude=PATTERN
         exclude files that match PATTERN

Thus,

du -hx

would ignore all other mounted filesystems or

du -h --exclude /media

would ignore all files in /media where most filesystems are mounted.

If you're using du, sorting so that the biggest things appear at the bottom of the list can help decipher the output. eg:

du -hx | sort -h


Welcome to Ubuntu!

One thing to realize is that your hard drive can be logically split up into smaller pieces. These pieces are called partitions. There are many advantages and disadvantages to partitioning, but that is a topic for another time. Just realize that this means that installing and removing apps will not affect the boot volume (most of the time).

Based on what you've said, you have your a separate partition which your computer uses to start up from called the "boot volume". You may have residual kernels and other files on there that are taking too much space. As long as you have a normal Ubuntu installation, these commands can be pretty safely run:

While booted into that computer, run this command:
dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | xargs sudo apt-get -y purge.

This will clear out the unused kernels and initrd's that you are not using.

(Adapted from this question that is similar)