Ubuntu 18 Freezing the Whole Computer all the time

Download the 18.04 .iso and load a recently formatted usb drive with the image.  Boot from the usb and select to 'Try Ubuntu without installing'.

You're doing this to check if there is any lag/freezing/etc.  If the problem exists when booted from usb image, we know the issue is being caused by either a hardware issue, or by a default configuration issue shipped with 18.04.  This will likely be harder to diagnose and correct.

If the problem does not happen when booted from usb image, then we know the issue is being caused by a local configuration (software) on your computer.  This should be easier to fix.

If you don't have anything important on your workstation, this would be a convenient time to do a fresh install (format start over).  Likely resolving the problem.  Although, please be aware this will delete any existing files/configurations/etc on your old Ubuntu installation.


jpegoptim

First install jpegoptim via

sudo apt install jpegoptim

Then either try to optimize filesize of your image via

jpegoptim /path/to/image.jpg

or if you need a defined size via

jpegoptim --size=512k /path/to/image.jpg

This will overwrite the image - to make sure you have a backup while testing with jpegoptim.

mogrify (imagemagick)

Resizing

You could as well use mogrify which is part of imagemagick. The following example shrinks the image dimensions to 50% (so resizing - not compressing)

mogrify -resize 50% /path/to/image.jpg

Compressing

The following example shows compressing with mogrify:

mogrify -compress JPEG -quality 50 /path/to/image.jpg

convert (imagemagick)

Compressing

Compressing to 80% using convert works as follows:

convert -quality 80% /path/to/source/image.jpg /path/to/result/image.jpg

Convert somes with a huge set of options, so you could use

convert -strip -interlace Plane -gaussian-blur 0.05 -quality 85% /path/to/source/image.jpg /path/to/result/image.jpg

which should according to this post:

set the quality to 85
progressive (comprobed compression)
a very tiny gausssian blur to optimize the size (0.05 or 0.5 of radius) depends on the quality and size of the picture, this notably optimizes the size of the jpeg.
Strip any comment or exif tag

trimage

I am quoting the project page here

  Trimage is a cross-platform GUI and command-line interface to optimize
  image files for websites, using optipng, pngcrush, advpng and
  jpegoptim, depending on the filetype (currently, PNG and JPG files are
  supported).

You can simply install it via

sudo apt install trimage

After starting via just the application name you might see the UI

If you need more information about trimage either visit the project page or run trimage -h to take a look on the help.

Other tools

There is as well optipng, pngcrush, jpegtran and several other tools in the image-size-optimization-corner .... but i've never used them.

I'll end with some links

OptiPNG - http://optipng.sourceforge.net/
Trimage - https://trimage.org/
PNGCrush - http://pmt.sourceforge.net/pngcrush/


How to set Applications as the default view in GNOME Shell Activities when there are no windows open?

Edit the file /usr/share/gnome-shell/js/ui/viewSelector.js with your favorite text editor. e.g.

gksudo gedit /usr/share/gnome-shell/js/ui/viewSelector.js

Search these lines (Line number = 469) :

_switchDefaultTab: function() {
    if (this._tabs.length > 0)
        this._switchTab(this._tabs[0]);
},

Change them to :

_switchDefaultTab: function() {
    if (this._tabs.length > 0) {
        let appSys = Shell.AppSystem.get_default();
        let allApps = appSys.get_running ();
        if ( allApps.length != 0) {
            this._switchTab(this._tabs[0]);
        } else {
            this._switchTab(this._tabs[1]);
        }
    }
},

And, Save and Restart Gnome-Shell.


mount.cifs -o vers=1.0,sec=ntlm fails with No such file or directory

OK, sorry for the spam, but I've found a solution to my problem.
What happened is that, with this configuration (not allowing guest access), I don't have root shared directory called usbkey, but instead separate shared directories at root-level.
And, ironically, the No such file or directory was, for once, meaningful.
Sadly, I'm used to ignore it, because of all the cases where, because of things like security policies, mount fails with the same error.
I hope that other people hitting my problem nowadays (with SMBv1 deprecated) could benefit from this question.


Where i can download Ubuntu 13.04 ISO torrents?

Direct links to all Ubuntu 13.04 Desktop ISO torrents:

Ubuntu 13.04 Desktop (64-bit)

Ubuntu 13.04 Desktop (32-bit)


try:

from gi.repository import Gtk

and replace gtk by Gtk in your code

or

from gi.repository import Gtk as gtk

see also : Python GTK+ 3 Tutorial : Getting Started


how to automatically add IP address to list of known host when ssh?

The other would automatically add too, but it doesn't because it already has a matching entry with a different key. I usually turn off checking using StrictHostKeyChecking (and deleting known_hosts if I get too annoyed, you may need to manually recreate it if, for some reason, it doesn't get automatically create a new known_hosts):

ssh -o StrictHostKeyChecking=no host

You may need to set CheckHostIP too (-o CheckHostIP=no).


Liberation Mono has wrong height when highlighted or selected

Apparently this is a bug in the fonts-liberation and fonts-liberation2 packages in Ubuntu 18.04.  Installing the bionic-proposed versions of these packages fixed the issue for me.


No. i3lock is minimalist. See the man page http://linux.die.net/man/1/i3lock


strange behavior when i use up arrow key in terminal

Reset your ~/.bashrc .
There is a default version of the .bashrc file in the /etc/skel/ directory in Ubuntu


You can install a ssh server on your computer. and login though ssh using your phone. You need to be on genome for it to work.

Install ssh server on your Computer

sudo apt-get install openssh-server

If you are on gnome you can unlock your screen with this command.

ssh -X user@server "export DISPLAY=:0; gnome-screensaver; gnome-screensaver-command -d;"

i am not a phone person but if you are able to run that command as a short cut using Rom Tool Box it might work. you might want to ask Android Enthusiasts about that.

Remote Lock Screen and Remote Unlock Screen on Linux (Ubuntu)

Unsure if it is what you are looking for but keep in mind Windows, XOS and Linux are completely different operating systems.


GRUB not detecting Legacy BIOS windows 10 installation even with legacy BIOS Ubuntu 16.04LTS installation

Ok, so I solved this problem using EasyBCD from windows 10. One should always prefer using only GNU GRUB2 as default bootloader, this is more like a last resort solution.
NOTE: If anyone's having same problem, first read and try all the things I did (given in question), and also the comments, only do this if nothing works out.
As I said in question comments, I had to override GRUB2 with windows bootloader to boot in windows 10. Once booted, one can install EasyBCD
and run it. Follow this guide to add an entry for Ubuntu in your windows boot menu. On rebooting, boot menu will show both Ubuntu and Windows installations, but there's a catch. On selecting windows, system proceeds to usual windows boot, but when Ubuntu is selected, windows bootloader will first call GRUB2, from wherein you can boot into Ubuntu(AKA "Chainloading").
There's surely a drawback as one has to go through two boot menus to boot into Ubuntu now, hence I'll say again, this is just an ad hoc solution and one should prefer trying other solutions first.


Dual Boot. Broken Windows 7 MBR and Grub

I had same issue. After trying other solutions on the internet, I ran from Ubuntu terminal:

> sudo update-grub

It located the Windows and Ubuntu installations automatically fixing the boot issues.

Hope this helps someone.


I fixed it my Self I uninstilled it. And instead of downloading from steam. Or the ubuntu store I used the terminal.


My laptop is an Core i3.  I have a dual boot - one with 64bit Ubuntu (12.04) and one with a 32bit Ubuntu (11.10).

So, yes - it is a 64bit capable machine.

I'll update the wiki


How USB drives goes after system hard drives

When editing devices in /etc/fstab the suggested method is not to use sd[a-z] naming. Rather, you should use the UUID of the device. This will mean that your mounted devices will not be affected by what device is designated as sda or sdb and so on.

A great guide to learning how to use UUIDs to automatically mount drives in /etc/fstab can be found here: http://www.cyberciti.biz/faq/linux-finding-using-uuids-to-update-fstab/


12.04.3--- Dconf Editor won't show com>canonical>unity option

In Dconf-Editor... go to desktop -> unity

(This is the com.canonical.Unity schema)

Hope this helps.


How can I find my User ID (UID) from terminal?

There are a couple of ways:

Using the id command you can get the real and effective user and group IDs.

id -u <username>

If no username is supplied to id, it will default to the current user.
Using the enviroment variable.

echo $UID


Ubuntu 20.04.1 LTS: laptop keyboard not working after updates

This isn't really an answer, but I just now got the keyboard working. I came here and signed up because I have the same exact problem on an Acer Aspire, I just installed Ubuntu 20.04.1 a couple hours ago.
What I Did:
I upgraded to kernel 5.6, but it still didn't work, at first. I could press caps lock on the laptop keyboard, and the caps-lock light on my usb keyboard would light up, ditto with numlock. I thought that was weird. I then spammed f<#> keys and then recalled reading in one of the release notes (somewhere), that they fixed the Super key or something. So I pressed Super and some other key, and then my window resized (I suppose I hit some hotkey combo at random),  and suddenly the laptop keyboard started working.
I've not actual clue, but I suppose it was pressing the Super Key and something else, perhaps they borked something else when fixing the super key, not uncommon.


The correct way to split hard drives with Ubuntu

There are many ways to partition drives for limited space.

Manual partitioning:
Look in the root partition ( / ) and you will find several directories that can be put on separate partitions for the exact problems you are having (as well as for other reasons).

My new ubuntu install (Bionic) currently uses about 6 GB of space.  On my newest laptop, when looking at the output of du I find that /var uses about (at present) 30% of the 6 GB total.
The users home directory tree ( /home ) often uses a considerable amount of space as well. Om my main computer I have 3 TB allocated to /home and am using more than half.

Both /var and /home can be quite volatile in space demands and when the primary installation partition is limited those two can (and probably should) be placed on another partition to distribute space requirements.
In the early days when disk drives were expensive and space was at a premium it was found necessary (for servers) to place /var on its own partition because mail, software cache, files being served, etc would fill up the space and cause a system crash if no space was remaining for the OS partition. Malicious individuals would deliberately shut down ISPs and others if they were not prepared for such an attack.

LVM:
If you are using LVM to manage your disks, changes can be quite painless.
If you are doing it manually some careful planning and partitioning in advance can easily distribute the data to manage disk space as well. Changes without LVM are painful.

Having both drives (or at least the used 30 GB of drive 1 and all of drive 2 ) as part of an LVM will allow seamless usage of the second drive as space demands.

As a side note:
You did not state what you are using the original 70 GB of the ssd for. If I correctly assume that it is a install of another os then it is probably not movable.  If it is purely data then it could easily be relocated.

Good luck!

BTW,
Some things are accessed frequently and speed becomes a factor. Others are read by the system once or very infrequently and for those speed is really immaterial.


mupen64plus not working; failed to find core library

The problem comes from /usr/local/lib/libmupen64plus.so.2 path.
It seems that you have two installation of the application - in /usr/local and in normal paths (as the the result of the installation of deb-package).

Remove such file(s) with

sudo rm /usr/local/lib/libmupen64plus.so.2

Also check the contents of /usr/local/share/man/ path.

If you need to have mupen64plus installed you can reinstall official Ubuntu package with

sudo apt-get install --reinstall mupen64plus-ui-console


There is a way to display boot messages in terminal, without any theme changes:
sudo gedit /etc/default/grub
Find this line

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

And change it to:

GRUB_CMDLINE_LINUX_DEFAULT=""

Or even more boot messages:

GRUB_CMDLINE_LINUX_DEFAULT="no_console_suspend initcall_debug"

To change background add this line: (or install grub theme)

GRUB_BACKGROUND=”/pathtofolder/picture.png”

Then  execute the following command and reboot the system:
sudo update-grub

Note:

  If we want to change the Background of grub menu, the image should be
  PNG, JPG or TGA image. JPG/ JPEG images must be 8-bit (256 color).
  Else you will get errors, so the PNG images are preferable. Images
  should be non-indexed, RGB.

  The GIMP image editor is one application which can edit images to
  conform to the GRUB 2 standards. Use the Image > Mode menu options to
  set the properties to RGB and ensure the mode is not set to Indexed


Xubuntu not automatically suspending after idle anymore

I have the same inhibitor displayed when enabling the "presentation mode" of the power managment widget in my dashboard. You may have activated that.


How to remove a newly created user in Ubuntu 14.04

try

su -
Password: <Enter password of root user>
root@host: sudo deluser sonu

sidenote :
If you write su- for very first time on the terminal then first you have to activate root user by assigning password.

$ sudo passwd root
[sudo] password for <currentuser>:
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully

tips: keyword search of man pages can be then performed using man -k keyword

 man -k user
 man -k password

will gives the list of useful commands with brief info


Problem using "slash character" / key-shortcut

The gui approach: System -> Preferences -> Keyboard, there you can check the second tab. This settings are per user.

You can check the working settings of the user root by doing the following in a terminal
sudo -u root gnome-keyboard-properties

You can open both dialoges at the sametime to get a side by side comparison.


Stuttering animations and videos with Ubuntu 20.04 and nvidia

I've found the solution ! I had installed the gnome extension NVIDIA GPU Stats Tool to test my new video card (a 2060 instead of a 1060), the temperature, the fan speed, etc... By disabling the extension, everything runs smoothly (e.g. the ufos).


How to broadcast a folder in network of class B network?

There is no concept about broadcasting a folder!! What you can do instead is
making a directory shared to others without permissions, so that every one in your network can see, read and write in it.

Install Samba

sudo apt-get update
sudo apt-get install samba

Set a password for your user in Samba

sudo smbpasswd -a <user_name>

Create a directory to be shared

mkdir /home/<user_name>/<folder_name>

Edit the file "/etc/samba/smb.conf"

sudo nano /etc/samba/smb.conf

Once "smb.conf" has loaded, add this to the very end of the file:

[<folder_name>]
path = /home/<user_name>/<folder_name>
available = yes
valid users = <user_name>
read only = no
browseable = yes
public = yes
writable = yes

Restart the samba:

sudo service smbd restart

Now every one in your network can find this shared directory


I was able to solve the problem. Here's the procedure I followed:

I created a bootable live usb and started an install session.
When the installer asked about the installation type I clicked "Something else" which brought me to the partitioning screen.
I then created a 300MB EFI Primary Partition.
After that I aborted the installation process and rebooted.
--> Problem solved.

I then solved my the first problem (assigning more storage to ubuntu) by following this tutorial.


These adapters do not support 802.11n protocol well (at least on linux), but iwlwifi driver tries to use it. You can disable this protocol by running in terminal

sudo tee /etc/modprobe.d/iwlwifi-opt.conf <<< "options iwlwifi 11n_disable=1"

This will be applied after a reboot.


If you use -C option with rsync then it initializes an exclude list which contains .BAK files along with many others.
You can use man rsync and look at what all is excluded by the -C option.

If you want to copy the .BAK files remove the above mentioned option from your command. Although, Note that this will mean that anything which was previously excluded due to this option will also be copied.

Thus your new command would be :

sudo rsync -ravp --delete /home/administrador/ArquivosAL/ /media/administrador/Seagate\ Expansion\ Drive/Backup


Please specify that it is usb modem or general ethernet modem with wired connection.
You can also try from the network manager
Go to Dash and type Network .


What's the advantage of using the Ubuntu web apps browser?

It's a lightweight browser, so is quick to start up:

It takes me 54 seconds for chrome to load, and just 3 for "Ubuntu Web Browser" to load.

It is a desktop link, straight to the page you want. Admittedly, you can do exactly the same thing with Google Chrome (Options -> More Tools -> Application Shortcuts) so that's fairly redundant - although Firefox can't do this as far as I know.

And is it Safari?

Detect my Browser says I'm using Netscape version 5 on Linux.

What Is My Browser says Chromium 35 on Ubuntu

About My Broswer says Safari 537.36 on Ubuntu Touch. Not sure why it thinks those two things - Safari is OSX only, and I'm not on Ubuntu Touch.

What Browser? says Chromium 35 as well.

What's My Browser says Unknown Browser.

What browser am I using? also says Safari.

ThisMachine.info thinks Safari 537.36 on Linux as well.

Finally, What Version is my Browser? says Netscape version 5 on Linux.

This is the Wikipedia article on "Netscape Navigator", but it's quite confusing.

This YouTube video says it is based on the "Oxide browser engine", and a Google search for that gives the Launchpad page, which says:

  Oxide makes it possible for developers to embed a Chromium-powered webview in their application

Essentially, it's a cut-down version of Chromium (or to be more accurate, it's Chromium with a different skin - the box that shows the page is the only part that uses Chromium).

What's the point? Not much for a desktop + mouse user. However, it seems to be built for touch screens (as speculated in this Forum post).

Note that you can access "tabs" and a URL bar - it's a little like Internet Explorer on Touch.

I've recorded a short video - have a look at the YouTube video (1080p). The glitches are (I think) the application's fault.

In case you can't tell, you drag up  from the bottom to open the bar, then you can navigate the "tab" history with Back and Forward. This browser doesn't support Mouse buttons that go Back and Forward (because it's for touch screens I guess).

To access the tabs, click Activity - you will see your recent pages, currently open tabs (I can't see how to close them).

Finally, you can hover over the "Activity" header to click "Bookmarks".

My pronouns are He / Him


Are there examples of custom installation scripts?

Depending on which installer you are using, MAAS provides different mechanisms to customize an installation. This answer assumes you are using the curtin installer (also known as fast-path installer) which became the default in MAAS 1.7.

MAAS uses cloud-init as part of its installation process. There are multiple ways to customize cloud-init behaviour, the easiest being simply providing a User-Data Script, which cloud-init executes during first boot, after the operating system installation is complete.

In MAAS, this can be accomplished by providing the user_data argument to the node start CLI command. The format of that command is:

maas <user> node start <node uuid> user_data=<script> distro_series=<name>

where <script> is actually a base64-encoded string. For a concrete example, assuming you would like to run a script called addkey.sh which prints some output to the installation console, imports an SSH key from Launchpad for the user ubuntu, and logs the results to a logfile:

#!/bin/sh
(
echo ======== Hi World ======================
echo ============== $(date) =================
ssh-import-id user
) | tee /my.log

you could issue the following commands:

$ script=$(base64 addkey.sh)
$ maas myuser node start node-79b67e82-d25c-11e4-a333-00163eca91de \
  user_data=$script distro_series=trusty

which if successful should return (after a while) output in the following format:

Success.
Machine-readable output follows:
{
    "status": 6,
    "macaddress_set": [
        {
...

Now this runs that script after deployment of one specific node. If you'd like to have commands set up so they run on any node which is installed through MAAS,  you can add the commands to be run as part of the late_commands stanza in the /etc/maas/preseeds/curtin_userdata file. For a more complex example which uses this mechanism to set up two VLANs on a network interface, see http://astokes.org/customizing-fastpath-curtin-installations/.

Note that Curtin is currently mostly undocumented; there is however an overview file that describes some of the detail of its operation.

Keep in mind this mechanism is not to be confused with a comissioning script, run during the commissioning phase, and which in the MAAS node life-cycle comes before installation. Commissioning is generally used for administrative tasks that are meant to not directly affect installation; examples would be:

firmware updating
sanity testing of key hardware components
burn-in


Piix4_SMBus: 000:00:07.3: Host SMBus controller bus not enabled

First, add this line in your vmx file to increase the boot time to 50s

bios.bootDelay = "50000"

Start the VM, hold the left shift key down, then hit Enter.

In the grub menu, choose Advanced options for Ubuntu -> Recovery mode.  Once the system boots, choose 'Root' to drop into a root shell.

In the root shell, enter the following commands

mount -o remount,rw /
nano /etc/modprobe.d/blacklist.conf

go down a few lines (almost anywhere) and enter the line

blacklist i2c-piix4

Then press ctrl+o to save the file, and ctrl+x

Finally, enter the command

reboot


Have you tried running ibus-daemon? Or maybe setting QT_IM_MODULE=xim... I don't know which one is better.
There is a discussion in Telegram's github:
https://github.com/telegramdesktop/tdesktop/issues/1041


Ubuntu deeply hangs every time I open 30 chrome tabs and web-development software

Chrome actually eats so much amount of ram (about 1.5 Gb in my machine), check you ram usage in system monitor and check for which process keep using more of your ram...

I recommend you to close all unused tabs and do use firefox more. Also you need to change in swap sysctl vm.swappiness=10.

I hope your system will no more / less have hanging issues. If still there is problem then you need to update ram, minimum 6gb for smooth running...


After hours of pulling my hair out I finally got it up & running again. I rebooted earlier this morning and there was still no change, I came up with no further possible solution so decided to chance another reboot and voila it worked


Installing IBM Lotus Symphony Dictionaries

According to the IBM Lotus Symphony Installation Guide they offer a .deb package for installation on Ubuntu, that can be easily installed graphically (GUI) or Terminal, the problem is that the package is designed for Ubuntu 10.04, but if you really want to install it, follow this instructions:

Graphically

Download the package;
Double click it and follow the steps.

From the Terminal

Use the cd to access the download directory.
At the download directory type the following command and replace the "[package_name.deb]" with the package name with its extension:

sudo dpkg -i [package_name.deb]

If the installation failed because of unmet dependencies look at this question for information on how to fix this type of problem.


Since you've enabled the Universe repository, and it still does not work, that suggests that APT has not been updated to use the new configuration. (This can cause the problem you're experiencing even if it has been updated to use the new configuration, but has not been updated since other changes were made.)

I noticed you didn't mention running sudo apt-get update. It's a good idea to run that before installing software on the command line. If you haven't run that very recently, try that, and then see if you can install the software.

If that does not work, then the problem is usually caused by a misconfiguration of your software sources. You could have only parts of the necessary sources enabled, or you could be configured to use software sources that are broken on the server (some mirrors might malfunction or go down), or software sources for the wrong Ubuntu release or for some other operating system altogether.

So, if running sudo apt-get update doesn't fix the problem, take a look at the contents of /etc/apt/sources.list. One way to view the contents of that file is to run:

cat /etc/apt/sources.list

If that doesn't clarify the cause of the problem, or you want help interpreting its contents or checking if they are correct, then please edit your question to include the ful output of that command (and also of lsb_release -a).


How to rerrange the context menu of Nautilus?

You’ll need to change the application source code and rebuild it from scratch. GTK applications compiled from source code to machine language like Nautilus rarely provide a mechanism to change menu layouts on the fly.


More KDE-esque audio control in Ubuntu/GNOME menu bar? or PulseAudio-cum-Gnome integration?

You can use a GNOME shell extension called 'Volume Mixer'.

  Shell Volume Mixer is an extension for GNOME Shell allowing separate configuration of PulseAudio devices and output switches. It features a profile switcher to quickly switch between pinned profiles and devices.


I'm not a Java programmer, so I don't know the correct value for CLASSPATH. But, you seem to. You can add it to ~/.bashrc like so:

CLASSPATH=/path/to/1:/path/to/2:/etc

The change will take effect globally the next time you log in. However, it will take effect immediately in new shells.

Additionally, if you want to set it for just one particular command, do this:

CLASSPATH=/something command-here arg1 arg2

A third way would be to create a wrapper script, which would be appropriate if you needed to set multiple variables or if you needed to determine appropriate values programmatically:

#!/bin/bash
export CLASSPATH=/something
export ANOTHER_ENV_Variable=foo

exec your_fancy_program "$@"


GIMP: auto resize canvas size to image size

Copy the layer then use shift + ctrl + v to create a new image from the copied layer.


The cache needs be removed as well after removing the software. It's here:

sudo rm -r ~/.cache/software-center

Then reinstall. It worked.


can you still use windows 8 and have ubuntu as the desktop?

i did not get actually what you want. but if you want to use windows programs you can use wine and about windows 8 in your ubuntu box you can prefer for VMWare...


Assigned variable for pipeline is not working

The syntax var=$(command) will run command and assign its output to the variable $var. This means that this line in your script:

killProcess=$(sudo netstat -nlpt | grep 2020 | awk '{print $7}' |
              sed 's/.\{5\}$//' | sort -u |  xargs -t kill -9)

will always run this pipeline which ends with the kill command, and assign its output to $killprocess. Since the kill command has no output, this line later will never do anything:

$killProcess

What you want to do is killProcess="sudo netstat ... | xargs -t kill -9. But there are other issues with your command as well. First of all, it will match any lines containing 2020, but you only want cases where 2020 is the port. What if it is the PID instead?

Here is a working version of your function with a few changes:

checkPort(){
  ## Get the target port. If none is given, default to 2020
  targetPort=${1:-2020}

  ## Collect the PID(s) that are listening on the port in the
  # array 'pids'.
  pids=( $(sudo netstat -nlpt | awk "\$4~/:$targetPort\$/{print \$7}" |
           sed 's|/.*||'))
  ## If no processes were listening, move on
  if [[ -z ${pids[0]} ]];
  then
    echo "No process listening on port $targetPort"
  ## If any processes were listening, kill them.
  else
    echo "killing process(es) listening on port $targetPort"
    ## First, try to kill the process gracefully
    kill "${pids[@]}"
    ## Check if any are still running
    for pid in "${pids[@]}"; do
      ## If it is still running
      if kill -0 "$pid"; then
        ## Kill it with fire
        kill -9 "$pid"
      fi
    done
  fi
}

This can now take a parameter, so run it as checkport to check port 2020, and checkport 22 will check port 22. It also first tries to kill gracefully (ou should always avoid kill -9 unless absolutely necessary) and only uses kill -9 if that fails.


Unzip a .zip file to all directories that contain a .php file that contains the text “house” inside?

You could use xargs sh -c '...' together with $(dirname "$1"):

grep -rlZ --include='index.php' house /directory/path/of_the_index_file* \
| xargs -0 -I{} sh -c 'unzip /directory2/path/file.zip -d "$(dirname "$1")"' xargs-sh {}

Or easier, use GNU parallel, which has dirname feature included using {//}:

grep -rlZ --include='index.php' house /directory/path/of_the_index_file* \
| parallel -0 -n1 unzip /directory2/path/file.zip -d {//}

Avoid parallelization if you want by adding -j1 to parallel.

If parallel is not installed, install it using:

sudo apt install parallel

You might consider running unzip once in the beginning to a temporary directory and use cp or ln inside xargs or parallel.

Note: For both solutions, I use grep -Z together with xargs/parallel -0 to avoid problems with newlines somewhere in the path. Even if it does not affect you, it's a good habit to take care of it.


You should be able to remap it with CCSM. See this answer for how to install CCSM. Then look under the Scale module of the Window management section. The key command is set in the Bindings tab.


It sounds like you have installed the OS and THEN made the boot partition. You can take 2 routes to fix this problem, as far as I know.
a) Repair the install
This is the harder route, and needs you to:
1) Boot into the install CD/DVD
2) Mount the partition with / somewhere (let's say /mnt) and rename the /mnt/boot folder to something else, like boot.old (modify accordingly if not using /mnt)
3) Create a blank /mnt/boot folder and mount the new separate /boot partition into there
4) Copy all files from the old /boot folder into the new /boot partition (files inside /mnt/boot.old into /mnt/boot, but be careful to keep the directory layout)
5) Adjust the /mnt/etc/fstab to include the new /boot partition
6) Bind mount (sudo mount --bind  ) the /dev, /proc, /sys into /mnt/
7) Chroot into the /mnt folder (sudo chroot /mnt) and run the grub-install command you ran earlier. Also run update-grub.
8) Exit out of the chroot, unmout everything you've mounted and try to reboot.
b) Reinstall
Obviously the easy route. You would need to:
1) Start the Ubuntu installation from the CD/DVD
2) Continue as you did, but:
3) Choose something else at the partitioning scheme, choose the Ubuntu partition and select / for the mount point, then choose your fat32 /boot partition and choose /boot as the mountpoint.
4) Continue with the install.

To answer your question, no, copying grub.cfg is not enough.


The stuck was maybe due to the nvidia graphics card.
if you installed nvidia propiertary driver.i think there will be no chance of getting stuck in bootmenu , also please remove nouveau.modeset=0 from grub entry if you have already installed nvidia drivers .

The one i am using has i5-9th gen and 1050 4GB graphics card
There is no issue at all


Arrow keys in Terminal shortcut don't work

First install rlwrap tool (in Ubuntu is not installed by default) by running next command in terminal:

sudo apt-get install rlwrap

Now set up your custom keyboard shortcut using next command:

gnome-terminal --disable-factory -x bash -c 'rlwrap -a /home/anmol/Desktop/c++/dictionary'


Error installing Oracle 11gR2 on Ubuntu 14.04 32 bits

Are you running this on a server without x server? The installer tries to initialize a SWT Window for a GUI.

Try running the install command with ./runInstaller -mode=console, maybe this will help - some oracle installers have this option, hopefully this one as well.


If you have an internet connection, you can safely comment out the line starting with deb cdrom: .... in the file /etc/apt/sources.list. You can edit this file with the command:

sudo gedit /etc/apt/sources.list

and simply prepend this line with the #-sign so that it looks something like this:

# deb cdrom:[Ubuntu 12.10 _Quantal Quetzal_ - Release amd64 (20121017.5)]/ quantal main restricted

Save the file and don't forget to run

sudo apt-get update


After updating to latest AMD driver can't login Ubuntu 16.04.3 LTS

There was an advisory on the AMD site stating AMDGPU-PRO 17.30 was not compatible with 16.04.3 with the new HWE stack (kernel and Xorg).  As far as I can tell, since yesterday the advisory has disappeared from the AMD site and there is possibly a new 17.30 build that supports 16.04.3.  I am yet to try it.


I Installed Ubuntu and now my Windows 7 is gone

It seems you have erased your Windows. Check how to install Ubuntu to learn more about dual-boot installing, and the answers given to this question to try to recover your data.

In order to run Windows programs, you would have to install Wine and then install the applications there.


Chrome showing white screen and opens in small window and keyboard is not working in chrome

Can you try these steps and tell if it worked:
rm -rf ~/.config/google-chrome

Though let me tell you that this will reset all your bookmarks, history. This is kinda like reinstalling chrome. If you had backedup your history into your email id then you can back it up easily after doing this command.
Clear the cache:
rm ~/.cache/google-chrome


Photoshop alternatives are :-

Krita is a raster graphics editor based on Qt 5 and the KDE Frameworks 5. Krita is designed to be a digital painting application. It has been influenced to some extent by software like Corel Painter and SAI. Krita packs with some key features different from most of its kind, including the ability to work with both bitmap and vector illustration.
MyPaint is a free and open-source raster graphics editor for digital painters with a focus on painting rather than image manipulation or post processing. MyPaint is available for Microsoft Windows, OS X, and Linux. It is in some ways similar to Corel Painter.
Pinta is a free, open source program for drawing and image editing. Its goal is to provide users with a simple yet powerful way to draw and manipulate images on Linux, Mac, Windows, and *BSD.
Inkscape is a professional vector graphics editor for Windows, Mac OS X and Linux. It's free and open source.
Polarr Photo Editor is an ideal photo editor for photographers. It offers advanced auto-enhance tools and sophisticated filters to edit every detail of your photo.

For coding part, I recommend :-

Sublime Text is a proprietary cross-platform source code editor with a Python application programming interface (API). It natively supports many programming languages and markup languages, and its functionality can be extended by users with plugins, typically community-built and maintained under free-software licenses.
It is recommended if you want a very fast code editor.
Visual Studio Code is a free and open-source code editor developed by Microsoft for Windows, Linux and macOS. It includes support for debugging, embedded Git control, syntax highlighting, intelligent code completion, snippets, and code refactoring.
It is based on Electron (formerly known as Atom Shell), a framework that enables cross-platform desktop applications using Chromium and Node.js. It is great for Javascript development.
Atom is a free and open-source text and source code editor for OS X, Linux, and Windows with support for plug-ins written in Node.js, and embedded Git Control, developed by GitHub. Atom is a desktop application built using web technologies. Atom, like Visual Studio Code, is based on Electron . It is written in CoffeeScript and Less. It can also be used as an integrated development environment (IDE). Its developers call it A hackable text editor for the 21st Century.
Brackets is an open-source editor written in HTML, CSS, and JavaScript with a primary focus on Web Development. It was created by Adobe Systems, licensed under the MIT License, and is currently maintained on GitHub. Brackets is available for cross-platform download on Mac, Windows, and Linux.
Geany is a text editor using the GTK+ toolkit with basic features of an integrated development environment. It was developed to provide a small and fast IDE, which has only a few dependencies from other packages. It supports many filetypes and has some nice features. It is recommended if you want a small and fast IDE that has built-in support for major languages so that you don't have to customise it to fit your needs.

NOTE: Visual Studio Code, Atom & Brackets are good code editors but they aren't as fast as Sublime Text till now. But one great advantage of them over Sublime Text is that they are open-source.


Can I delete my home folder to start fresh?

Yes you can. All you need to is backup any files you may need, then run the following:

rm -rf ~/*

If you still have files in your home folder, you can run Nautilus as root:

gksu nautilus

then navigate to your home folder, unhide all hidden files (ctrl+H) and select and delete them.

After this, log out and log back in, or restart your computer.


Here's sample /etc/dhcpd.conf from https://help.ubuntu.com/community/dhcp3-server

# Sample /etc/dhcpd.conf
# (add your comments here)
default-lease-time 600;
max-lease-time 7200;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.1.255;
option routers 192.168.1.254;
option domain-name-servers 192.168.1.1, 192.168.1.2;
option domain-name "mydomain.example";

subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.10 192.168.1.100;
range 192.168.1.150 192.168.1.200;
}

Notice the line option domain-name-servers 192.168.1.1, 192.168.1.2; You could add there dns servers outside your domain that you want


This image comes as a feature to the Wallch program as well. As mentioned here: http://wall-changer.sourceforge.net/screenshots.php Wallch uses a third-party image hoster so as to provide this image, for protection of static.die.net's bandwidth.

So, if you want this image as your background you can go and download Wallch (it is at the Ubuntu Software Center).

By the way, the image is updated every 30 minutes, not every 10.


A Temporary solution I usually rely on is "Super Grub2 Disk"

Download the first "Recommended download".
Burn the ISO on a CD (I think Brasero Disc Burner comes default with Ubuntu).
Boot the PC off it (Like you did with Ubuntu CD during the installation).
Choose "Everything", then choose your windows installation.

If this works, and the windows is OK, you can try to make that windows drive your default boot drive, but that's out of the scope of my temporary answer.

I'm assuming here that you didn't actually wipe out your windows installation during Ubuntu's, but rather choose to install it side by side on a separate drive (This you can easily check from Ubuntu using "Files" application to search for a drive (Under "Devices") that looks like your windows drive).


That error is because Deja Dup is trying to write to the external backup disk, but can't.  Can you manually create a file on the backup disk in the file manager?


keyboard layout returning to default when using kvm

Instead of your current command (or possibly in addition to it) you may want to try:

gsettings set org.gnome.desktop.input-sources sources "[('xkb', 'gb')]"


How to create cube slide transition in Libreoffice Impress?

In Impress, choose the menu options SlideShow -> Slide Transitions.  Way down the list you will find Outside turning cube and Inside turning cube.  These are the slide transitions that I believe you want.


Keyboard Navigation isn't working in Application Dashboard

The extension Start Overlay in Application view does not appear to be updated anymore. Thus, it may not function correctly in your version of Gnome Shell.
A more up to date extension that does the same is Show Applications instead of Workspaces. Try that: chances are that this will not exhibit the issue.
Another up to date extension that might suit you is Activities icons. It changes the "Activities" button in two icons, one for the overview, and one for the application overview.
Note: This is a general drawback of Gnome Shell, the desktop environment used by Ubuntu, and its "Extensions" system. Extensions are maintained by individual developers, that have to accommodate for an ever changing Gnome Shell. Extensions that are not continuously maintained tend to break in newer Gnome Shell versions. Therefore, prefer to use extensions that are tested against your version of Gnome Shell, and preferably extensions that are well maintained. It is a good sign if, on the Gnome Extensions site, many versions of Gnome Shell are listed under the "Versions" drop down.


Tunneled TLS WI-FI connection on Ubuntu 15.04 does not work

I have just solved by changing the Authentication into Protected EAP (PEAP). (On Ubuntu 14.04 I used this connection by Tunneled TLS)


Installing Ubuntu OpenStack AutoPilot on VMware Workstation - network config

I am doing the same and similarly struggled as I am also not a network person.  But here is what I did.  I have an ESXi Server..and created the network as follows:VMware Network  See the VMware network pic.

I implemented a router.  There is a fresco-043.ova that I downloaded and installed.  Make sure to disable DHCP on the router.  Note network attachments in the pic.
In addition to the default "VM Network" I created "VM Network2" with no vmnic attached (therefore an internal network).
Ignore the VM Network-Internal it is not used for this example.
When configuring your MAAS be sure to use the MAAS IP as your DNS when running the autopilot-config script.

This seemed to all work - nodes got commissioned and ready. But I I did get stuck in landscape so I am not yet sure my configuration is 100% correct.

Hope this helps.


It looks as though USBView installs the desktop file for Ubuntu 17.10 running Wayland as it tries to run a command sudo-to-root that is not compatible with Ubuntu 16.04.

Try installing gksu for GTK sudo.

sudo apt install gksu

Then copy and paste the following line to update the Desktop File:

sudo bash -c 'sed -i "s/sudo-to-root -X -c/gksudo/" /usr/share/applications/usbview.desktop'

Hope this helps!


What does this mean "You don't have permissions for /dev/ttyACM1 device!"?

This means that your user don't have permissions to access to /dev (devices).

Try: sudo wammu

to gain permissions to access to devices

Another thing you can do is to put your user in bluetooth group system


Btrfs reports "ERROR: minimum size for each btrfs device is 131072000", but my drives are much larger

I've tested using loop devices:

Create images:

dd if=/dev/zero of=test1 bs=1 count=1 seek=4294967295
dd if=/dev/zero of=test2 bs=1 count=1 seek=4294969343

Add them as loop devices:

losetup -f test1
losetup -f test2

Check for the loop devices used:

losetup | grep test
/dev/loop8    0      0     1  0 /home/davod/test1     0     512
/dev/loop9    0      0     1  0 /home/davod/test2     0     512

Then, create the BTRFS pool:

mkfs.btrfs -f /dev/loop8 /dev/loop9

It worked for me.

If you don't have important data on the disks, just use ZFS, using the entries devices, and use a separated device (a SSD) for boot (EFI partition if the machine has it, and ext4 for GRUB), and empty partitions for L2ARC and ZIL).


How to edit /etc/apt/sources.list using putty in a VPS setup

Umm, pretty simple, eh?
Open putty and establish your connection to the VPS.
You gotta use a text editor such as nano to edit sources.list. Run this command:

sudo nano /etc/apt/sources.list

Then navigate to the end the file (a new line maybe) and keep Putty window open of course.

Simply copy the repository addresses you want to add to sources.list file to your clipboard.

Then right-click inside the Putty window and repository addresses will be added to the end of the file (if that didn't happen you can write the addresses by hand).

Press CTRL+O and then Enter to save the file.

That should be it.


Removed libgcrypto and some other essential packages, how do I reinstall them?

Be sure to get connected to the net using wire cable then please open a pseudo-tty by pressing ctrl+alt+F1 made login with your user and password if requested by the system, then type

sudo apt-get update
sudo apt-get install ubuntu-desktop

give your user password when requested, you will not get any screen chars on screen when you type your password so type it, then press enter.


I accidentally killed all of my pulseaudio, now I have no sound.

Reinstalling the pulseaudio package will solve your problem of disappeared volume icon on the top panel.

sudo apt-get install --reinstall pulseaudio


First off, there doesn't seem to be a problem as the command finishes without error. However, you ought to have /proc/mounts and /proc/swaps. Maybe your /proc didn't get mounted or got unmounted.

Check that your /etc/fstab has a line proc /proc proc nodev,noexec,nosuid 0 0. Then try sudo mount /proc and see if the files are back.


Cursor ghostly jumps with touchscreen in 11.10

Did you use xinput to set a Coordinate Transformation Matrix for X? If yes, follow this bug:
https://bugs.freedesktop.org/show_bug.cgi?id=50664

In any case, your problem might be related to the fact that X autoconfigures itself to share the mouse pointer between all pointing devices. This way, the touchscreen/tablets interfere with the mouse and vice-versa.
A possible solution may be found here:
http://www.harbaum.org/till/cnc/cx-t100/index.shtml


Set centralised user home folders in LDAP Ubuntu

Let's suppose that the directory of LDAP users is /home/ldap:
On the server:
1-Create the /home/ldap folder
2-Share it with NFS (edit /etc/exports and add something like this):

/home/ldap   *(rw,no_root_squash,no_subtree_check,no_wdelay,sync)

3-Restart or reload NFS service
In the clients:
1-Create the /home/ldap folder
2-Get it mounted automatically (edit /etc/fstab and add something like this):

192.168.1.10:/home/ldap   /home/ldap   nfs    _netdev,auto,hard,intr  0  4


how to edit a .pdf file in kubuntu 13.04?

I can recommend of two programs (both available in software center):

libreoffice-pdfimport - a libreoffice plugin that enable editing of PDF files. work better for editing text. it doesn't add itself to open with menu, and you have to open libreoffice-draw to open pdf documents with it.
xournal - can't edit text inside PDF documents, but has nice features for editing the pdf as an image.


How do I set a custom thumbnailer for audio/x-vorbis+org?

You have to replace characters like "/" and "+" with "@". This is working fine here on a freshly installed 11.04 VM:

Open the gconf-editor and go to /desktop/gnome/thumbnailers.
There should already be an entry for audio@x-vorbis@ogg.
Just paste the path to your thumbnailer for command, e.g.

/home/YOUR_USER/bin/my-ogg-thumbnailer -s %s %u %o

and set enable to true.

This will work for .ogg files, for .oga files do the same for the audio@ogg thumbnailer entry.

If you've messed up too much with thumbnailers and want a fresh start (will undo all thumbnailer customization):

rm -rf ~/.gconf/desktop/gnome/thumbnailers
gconftool-2 --recursive-unset /desktop/gnome/thumbnailers


No wifi network on Ubuntu. But working well on Windows on same laptop

Hello guys I simply install new copy of Ubuntu and it worked


Ubuntu wont boot (only blank screen) after upgrading to 14.04

I had the same problem, too, so I downloaded and burned the Ubuntu 14.04 on DVD and booted from it. I selected "install Ubuntu" and the option which installs Ubuntu without formatting or losing data. It does ask for a default user - just use the same user than before, so it will be mapped to the original home directory.

I had to re-install all my applications, but as the configuration files were not erased, a lot of things reverted to as they were before.

The other users were manually and I had to do some "chown" to ensure that they matched the old one, as the owner of the home directory user1 was user2, etc...

I am sure that there is other method, but as you mentioned, I wanted to get back on my feet very fast.  It took me 30 minutes to get a working computer.  I am sure that I have missed some applications but when I will need them I will re-install them.


"Module nvidia is in use" but there are no processes running on the GPU

On Ubuntu 20.04, I've been able to fully unload and reload the NVIDIA modules with the following commands (performed via SSH or a text-only tty).
sudo service gdm3 stop

sudo rmmod nvidia_uvm
sudo rmmod nvidia_drm
sudo rmmod nvidia_modeset
sudo rmmod nvidia

# Then, reload them if desired:
sudo modprobe nvidia
sudo modprobe nvidia_modeset
sudo modprobe nvidia_drm
sudo modprobe nvidia_uvm

This came in handy e.g. when upgrading the NVIDIA driver without rebooting (which could happen unexpectedly via unattended apt upgrades).

As @Thomas pointed out in a comment, if there's still something preventing one of the modules from being unloaded, it's usually possible to figure out what with:
lsmod | grep nvidia
lsof | grep nvidia


How would I install Ubuntu with two hard drives

A lot of the desktop applications in Ubuntu offer by default to save things in subdirectories of your home directory, such as Documents, Photos, Videos, etc.
You could do your install so that /home is mounted on your HDD with everything else on SSD. That way you don't need to think about how things are laid out.
Alternatively, you can do a simple install entirely to the SSD and then afterwards mount the HDD somewhere like /srv, and just remember to save your stuff in there.
There are pros and cons to each method. I would probably go with the second because I'd want things in my home directory to perform well and could use my own judgement about where large files get stored.
So assuming you will go that way, do your install and get the desktop up and running how you like. Then open the "Disks" application and see what device name corresponds to your HDD. It will probably be either /dev/sda or /dev/sdb.
Now you know what device you want to mount, follow the community instructions on installing a new hard drive. Just mount it somewhere like /srv/media or /srv/documents or whatever. Don't forget that after mounting the filesystem you will have to change its ownership to your own user so that you can write to it without having to become root.


GImP Plugin: unable to access GimpDrawble or Gimpimage resolution

There is gimp-drawable-get-image

http://developer.gimp.org/api/2.0/libgimp/libgimp-gimpdrawable.html#gimp-drawable-get-image

That's not really a question for Ask Ubuntu, though - more likely Stack Overflow.


How can I find where the vim executable is located when my PATH is broken?

It seems like your PATH environment variable was corrupted.

You can find vim in /usr/bin/vim

$ which vim
/usr/bin/vim

In /usr/bin you should find also vi and gedit

nano can be found in /bin

$ which nano
/bin/nano

sudo can be found in /usr/bin

$ which sudo
/usr/bin/sudo

Notes:

As mentioned by @SorenA and @PatrickMevzek search for a location of a file can also be done using whereis

As mentioned by @Terrance - whereis vim finds all names with like vim in the name, Note that most of the results aren't the vim executable.

  man which - locate a command - It does this by searching the PATH
  for executable files matching the names of the  arguments.

  man whereis - whereis  then  attempts  to  locate  the desired
  program in the standard Linux places, and in the places speci‐fied by
  $PATH and $MANPATH.


xfce4-terminal "Open Link" feature stopped working on XUbuntu 14.04

This is caused by the removal of the -remote command-line switch in Firefox 36.  If you have Mozilla Firefox selected as your preferred browser in the Preferred Applications settings, the terminal (or, rather, exo-open) is still trying to use that obsolete switch, which confuses Firefox.

See this bug report (bug #1429284) for more details.

In any case, there's a very simple work-around:

Open the Preferred Applications setting (found under Settings in the Xfce menu, or by running exo-preferred-applications from the command line).
Click the Web Browser selection menu, and select "Other..."
Simply type firefox (or, equivalently, firefox "%s"), in all lower case, into the dialog that opens:

You should now have "firefox" (as opposed to "Mozilla Firefox") selected as your preferred browser.  Now just close the Preferred Applications settings, and try opening a link from your terminal — it should work normally again.


Keep getting error message on k3b when trying to burn a dvd video of a movie

I have this error each time I use K3b. To overcome this I find I need to go into the preferences where it asks for the path to the "tmp" folder. When clicking OK, it asks for permission to create the folder. I also find that I need to redo the file permissions to my CD/DVD writer as well.

It then works well. The only thing is to remmeber to do these two things each time I use it.


Ubuntu Server 12.04 - Create a non-Root user with own Userdir

To enable apaches's userdir module run: sudo a2enmod userdir. You have to do this as a user able to sudo. Don't forget to restart apache: sudo service apache2 restart.

Then dev's public_html directory will be available at http://192.168.1.100/~dev.


Configuring mouse speed after Ubuntu 20.04.1 desktop installation

The easiest way is via "Settings". Here's how you do it:

Press Super and type "settings" (or some part thereof):

Open "Settings"

Click on "Mouse & Touchpad" on the left-column:

Move the "Mouse Speed" slider to a value that works better for you

That's all there is to it. The change takes effect immediately.


How to install left for dead 2 in Ubuntu?

Left for Dead 2 plays natively on Ubuntu with the Steam client.
I'm unsure why you would need Wine unless you have a physical disk for Windows. Left for Dead 2 is a source based game, which is known to have bad performance in Wine.


Your question is a little unclear. But if you have Windows installed and running now, then yes you can install Ubuntu on another drive. When you install, you need to select the disk with Windows installed as the location for the boot files. Ubuntu will detect your Windows installation and then Ubuntu will install GRUB with a menu that allows you to select Ubuntu or Windows every time you boot.

If you haven't installed anything or want a clean install of Windows, then I would recommend you swap the locations of the drives so the SSD is the first one and the HDD is second. Then install Windows on the SSD like normal, then install Ubuntu and select the second drive for the OS /home partition but select /dev/sda as the location for the boot files. The rest will be like above with a menu.


Setup passwordless sudo for ubuntu user in Ubuntu 16.04

Add the user to

/etc/sudoers

with

sudo visudo

and add

{user} ALL=NOPASSWD: ALL

where {user} is the user your want this for. Mind that you can break your system if you do this wrong so make sure to always has a 2nd account logged into "root" (so with a prompt #, not $)

  Also what are the security implications of having this enabled?

Serious.

You should be using ssh keys anyways regardless of this. Besides that anyone with access to the system can destroy it. 1 rule of cloud instances: you make backups. Always. Every time. Instances are volatile so they can get deleted at any time without warning. So you make backups. Always. Every time. That helps recovering when you yourself makes mistakes but always when others mess your system up.


Connected to wifi, but no internet [16.04]

Just because you've joined the Wi-Fi access point doesn't mean you're really connected to the overall network. It's basically just the wireless equivalent of "plugging in."

The IP router info and DNS settings is what "connecting to the Internet" requires. And your Ubuntu 16.04 computer doesn't seem to be getting it.

127.0.1.1, for example, is a loopback to your own computer, not a real DNS server.

Normally on Wi-Fi, once you join the SSID, there is a DHCP server that is reachable on the broadcast domain. So DHCP clients will broadly ask on that local part of the network (which is all it can reach at that point, since it doesn't know how to get out), "Are you a DHCP server? Can you give me an IP?" The DHCP server replies to the query with an address that your laptop can use to join the wider IP network, and usually also provides router/gateway, DNS server IP, and sometimes more if there's DHCP options.

Since your other laptop can connect to the network, we know the DHCP server exists exists. And since your Ubuntu 16.04 laptop can use DHCP on other networks (assuming you haven't changed the interface configuration), we know your laptop's DHCP client can theoretically work. It's unlikely to be a software bug. So the question is why that specific DHCP server does not want to talk to your laptop's DHCP client, or why your DHCP client isn't talking to the network.

Could it be that you're actually using a manual IP, and it's the wrong one for this network, but your settings work on others?

Manual IP, gateway, and DNS assignment is not the answer. In fact, if you do that with an IP the network admin didn't give you, it can create an IP conflict on the network, and neither you nor the other guy will be able to connect.

Pinging the gateway won't get you name servers, either. All it does is add the gateway to the ARP cache.

Get the output to:

sudo cat /etc/network/interfaces

It's possible to accidentally combine DHCP (to retrieve the DNS/gateway settings) with manually assigned IP addresses, since it's a valid use although most people don't do it, and it can cause problems like this. Let's see if your DHCP config is truly all DHCP, and valid for this network. What I'm expecting to see for a working config is simple:

auto wlp3s0
iface wlp3s0 inet dhcp

Note: No "address 10.12.152.1", no netmask, no gateway, no "dns-search uoguelph.ca". That needs to be empty, or your computer won't grab it from the DHCP server.

Network configuration https://help.ubuntu.com/lts/serverguide/network-configuration.html
Automatic IP Address Assignment: How DHCP Works https://www.youtube.com/watch?v=RUZohsAxPxQ


Ubuntu doesn't look like sending power to an usb port used by a device that uses 2 usb ports to function

You might try the tlp package for Thinkpad power management, it provides some USB options:

http://linrunner.de/en/tlp/docs/tlp-configuration.html#usb

Read the install instructions carefully, it is incompatible with laptop-mode-tools (uninstall first).

# tlp stat| grep -i USB

shows the info about USB device manamement then.


Ubuntu Hard Disk Filled up one day, empty the next day

Don't worry it should be just a case.
The possible causes can be:

the use of a SysRq special key combination.
an Hard Disk problem (if you enabled the S.M.A.R.T. support in your BIOS and you have the proper S.M.A.R.T. support software installed).
a Kernel Panic or a "freeze".
a support system fault (if the current goes away for a moment and you don't have a charged support group active).
a bug/special feature in a kernel modules.

Anyway, if there is no data loss you can ignore the problem, because it's caused for sure by the partition set as unmounted for the reasons on top (a partition usually gets unmounted automatically to prevent data loss, it's a good thing).
The boot script can remount an unmounted partition.
If you experience the problems another time, please let us know.
Have a nice experience.


Your best bet may be the --reinstall option.

Force a reinstallation with:

sudo apt-get --reinstall install ttf-mscorefonts-installer

which will force the preinst and postinst scipts that actually install the fonts to be re-run.


When using sfdisk I had typed sudo sfdisk /dev/sde1 << EOF. sde1 was just the partition which is why it was failing. I had to type sudo sfdisk /dev/**sde** << EOF.


PDF-viewer in TeXstudio, ctrl+left mouse does not work

The following worked in TeXStudio 2.11.2 on Ubuntu 17.04:

In the viewer, choose Window > Show > Toolbar. On the toolbar, you can toggle the zoom button or the hand button. Either way disables the click=nextpage behavior, restoring the desired ctrl-click behavior.

I don't know how you could restore the click=nextpage behavior if you wanted to, but I assume you don't.


Can't use ftp to transfer a file - permission denied

One clue--filezilla is frequently running in root privileged (sp?) mode. If you set it to run that way, and transfer works, I would use filezilla myself. Then it will not matter about the perms on the file. I do not know how to script this, have used filezilla routinely.

maybe you could try ftp as root by using sudo? Looking at the script again, try logging into the server with the admin id of isola.

ok, you are connecting into FTP server now? You can't be logging in anonymously then. you need to log into server with the ID that has root privileges on FTP server.


Install multiple elasticsearch versions on 12.04

[Edit 2019-12-11]: Docker is obviously the way to go now!

Answering to myself, I ended with simple installation scripts like that:

#!/bin/bash
sudo apt-get remove elasticsearch
sudo dpkg -i elasticsearch-0.90.5.deb
sudo rm -rf /usr/share/elasticsearch/plugins
sudo cp -R plugins /usr/share/elasticsearch
sudo cp elasticsearch.yml.0.90.5 /etc/elasticsearch/elasticsearch.yml
sudo /etc/init.d/elasticsearch restart
sleep 2;
sudo /etc/init.d/elasticsearch status

Note that in the elasticsearch.yml file, the cluster name must be different to avoid conflicts:

0.9.5:

cluster.name: cluster_v0

1.7.6:

cluster.name: cluster_v1

And so on.


Best ubuntu/linux distro for latitude d620 ( school, light browsing)

Every linux distro works because they can be customized to fit your needs. You might want to take a more lightweight distro your laptop, I would suggest trying Xubuntu or Lubuntu.


In my case, the answer is found on
https://www.unixmen.com/how-to-format-usb-drive-in-the-terminal/
Thank you


IPv6 differs from IPv4 not only in longer addresses, but also in address scopes for these addresses.

This means that every IPv6 address has a so-called scope. The scope is the part of a network in which the associated address is recognized as valid and routed.

You have 2 global scope and one link scope.


Installing Xubuntu on a 4 GB storage device (Eee PC 701)

Instead of using the xubuntu, or indeed any if the standard  live or alternate *buntu iso's try a minimal cd.
https://help.ubuntu.com/community/Installation/MinimalCD
Make sure you are connected to the internet and then get the packages you want.
You can make it as minimal as you want to.
Boot with the livecd, once you have got past the start screen you will get options for language, location and keyboard layouts.

The installer will then detect hardware and ask for network configurations.
Choose a mirror and select and appropriate archive for your locale.
After more configuration you will be able to add users and passwords, enable encryption if required.

Next setup your partitions as required

The installer now installs the base system, you will then be shown a software selection screen - I picked manual package selection, but then quit from aptitude when it was available. Wishing to install my packages later. You can if you wish select your packages here if you wish.

The installer will complete the install including grub install.
Once finished, reboot when asked removing the install medium.
You will boot into a command line at this stage.

Login and enter your password.
Here I installed the packages I wanted
sudo apt-get install xorg xterm lightdm firefox menu gksu synaptic --no-install-recommends

once installed those have installed, start the gui with startx and you will boot into the xfce system. You can then complete the installation with the apps you want to use.
This install used 1.2Gb.

More information on installing with a minimal cd can be found here
http://www.psychocats.net/ubuntu/minimal


Dell XPS 13 Qualcomm Device 1101 (a501) wifi issue

UNTESTED:
According to https://bugzilla.kernel.org/show_bug.cgi?id=211569#c3, while the driver is being developed and may work in parts if you have the latest kernel (5.11 or ubuntu's oem kernel), you can also try this second solution, that is:
Update BIOS to version 1.1.4 or newer
UPDATE:
tested and it works :)


You can specify the Python interpreter to use with the -p option:

virtualenv -p python3 ...

This will use the default Python 3 interpreter currently installed on your system.


Chromium doesn't show up to be selected as default browser

I had the same problem on linux mint. I wanted Google's chrome to be my default browser, but for some reason it did not listen to me. So I did this once and somehow everything got sorted:

Right click on a html file
Select Open with Chromium
Next Close the browser again
Repeat 1 and 2 but this time click on other options and select  Make Chromium as default browser


Ok, so after I was guided in the right direction by the user muru (thanks again!) I managed to identify the culprit:

My .vimrc file used the following setting

au FocusGained *: silent! !

which is commonly used for rereading/redrawing the file when an external change has been made and vim regains focus. I don't yet understand why this line caused the issue, all I know is that excluding it from my .vimrc solves my issue.


mpirun -np N, what if N is larger than my core number?

9 will run simultaneously.
There is no confusion for the remaining 1 process; mpirun schedules in round-robin order by default, so the 1st core/node will be assigned that process.
You can certainly increase np beyond the number of available physical cores/nodes. The tradeoff is that the overhead increases with a larger number of processes than cores/nodes. If your code is not tightly CPU-bound (e.g. requires significant IO wait time), you should do this. Ultimately, you don't know if it will be faster until you try.
MPI does the initial scheduling, but for more than one process per node, or just in general (since there are a number of other processes running in the background too), the Linux kernel scheduler takes over.

See this man page for much more information.


I accidentally removed myself from sudoers, how can I fix this?

No need to reset root password (well, technically, Ubuntu's root does not even have a password). Do this:

Reboot your PC

In Grub's OS selection screen, choose "Ubuntu xxxx - recovery mode"

Now you have a console with root privileges. Add your user back to sudo group:
  usermod -a -G sudo youruser

The shell might reply that it cannot do it because the file system in mounted in read-only. To remount your fs in read-write: mount -o remount,rw /

That will be enough for sudo. But its suggested you also re-add yourself to other default administrative groups. You can reboot, logon normally and use GUI:

Menu > Administration > Users and Groups > Advanced Settings > User Privileges or Account Type (Change...) > Administrative

Or use this command:
  sudo usermod -a -G adm,cdrom,plugdev,lpadmin,sambashare youruser

Notes:

The sudo group used to be the admin group prior to Ubuntu 12.04. If you're on anything older, replace the group sudo with the group admin in the above commands.
Starting from Ubuntu 20.04, the fuse group does not exist anymore. It allowed regular users to access /dev/fuse using fusemount, i.e., to mount FUSE filesystems. But since Debian 8 /dev/fuse is already world-writeable by default.

Important Note:
The default set of groups for what is considered an "Administrator" role
changes over time, as some groups become obsolete or irrelevant (such as tape or floppy), are removed, renamed or re-organized, or are created in your system only when related packages are installed (sambashare, virtualbox, www_data). So in a few years adm, cdrom or lpadmin might not exist (that is, if they still do!).
Besides, some features that currently use groups for filesystem-based permissions might change to another access permission mechanism, such as udev, PAM, AppArmor, SELinux, etc.
So the only way to get an updated list of groups is... to check your current system! Create a new temporary Administrator user using the GUI, or do a fresh install in a VM, and see which groups the user is assigned to by default.


How to see the directories etc, bin, boot in the file system?

The directories you are looking for are in /

cd  /
ls  -l

This is a screenshot with the tree:

You don't need to use sudo for reading them (you would need it for writing in some of them)

I've posted 2 commands; I had a problem with end of line


You can use this function; it will move everything inside the directory passed as an argument one level above, hence taking care of multiple files / folders in the target directory:

function delete_dir() {
    [ -d "$1" ] || return;
    for x in "$1"/*; do
        mv -i "$x" "$1"/..
    done
    rmdir "$1"
}

Add it at the end of ~/.bashrc and run . ~/.bashrc in the running Bash instances (if any) to apply the changes immediately.

$ tree
.
└── foo
    └── bar
        ├── 1
        ├── 2
        └── 3

2 directories, 3 files
$ delete_dir foo/bar
$ tree
.
└── foo
    ├── 1
    ├── 2
    └── 3

1 directory, 3 files


How to scan Terminal output for a string?

command-name | grep 'STRING'

If STRING starts with '-' or '--', it's necessary to utilize one of the following formats:

command-name | grep \\'STRING'
command-name | grep -e 'STRING'
command-name | grep -- 'STRING'


How to completely separate desktop enviroments?

You can do it the «hard way».

1.- Open your DE. For instance, Cinnamon.

2.- Check every installed application in the menu and write down those you don't want to appear.

3.- Open your File Manager (Nautilus or Nemo)

4.- Go to /usr/share/applications (also check .local/share/applications in your home folder) and identify the file name of the applications you don't want to appear under your present DE

5.- Open a terminal and type

cd /usr/share/applications

6.- For each application, type

sudo nano [nameoftheprogram].desktop

For instance:

sudo nano yelp.desktop

7.- Find this line

OnlyShowIn=

and delete the DE you don't want. If there isn't this line, add it and add also the DE.

8.- Repeat steps 6, 7 and 8 for each program.

N.B. This how-to will only help you with the mixing of programs in the menu.


What mount point should I use for data/free space

First, you need to understand Linux/Unix mount points a bit better. I wrote this article on the topic a while back, so you might consult it for background information. I'm sure there are other tutorials on this topic you might consult, but I don't have any other URLs handy.

Once you've got a better understanding of mount points, you should realize that your disk sizes are a bit awkward. A complete Ubuntu installation takes about 5-8GiB, although it's common to create a root (/) filesystem in the 10-30GiB range to give some space for growth and temporary files, plus a separate /home partition (as thom suggested) for your user files. (/home is not used in a default Ubuntu installation, but IMHO it should be.) A separate swap partition as large as your RAM or a bit larger is also common. If you add up the needs of root (/) and swap, it's almost certain to be well under half the size of your smaller disk. If you mount your 320GB drive at /home, that means you'll have either a ridiculously oversized root (/) or you'll have unused space on the 160GB disk and no convenient place to mount it.

Some people deal with this issue by using some of the storage space as a partition that will be auto-mounted somewhere under /media by Ubuntu. This is awkward, though, since your user files normally reside in /home, so you'll have to decide what goes where, and if you make bad decisions, you'll run out of space and have to spend time juggling files around to deal with it.

A more sophisticated way to handle the problem is to use Logical Volume Management (LVM), which enables you to group together several partitions (physical volumes in LVM-speak) into a volume group, which you can then carve up into logical volumes that can be any size -- even larger than any given physical volume. Using LVM will therefore enable you to set up a /home partition that spans both your disks -- perhaps 400-450GB in size. The trouble with LVM is that Ubuntu's desktop editions provide poor support for it, so you'll need to jump through extra hoops to use it. (FWIW, Fedora provides much better out-of-box LVM support than Ubuntu.)

I recommend you read a bit about LVM (at the link in the previous paragraph) before making any decision. You might decide that it's more hassle than it's worth, and just deal with your awkwardly-sized disks in some other way; or you might decide to take the plunge and set up an LVM for your computer. The point is to make an informed decision.


Can't set the native resolution for an external VGA 1080p monitor with xrandr or settings

You have not given a make/model of the monitor or said how you attempted to use xrandr to set the resolution so I would suggest you edit your question with those details.
You need to use cvt to generate a "modeline" for example:
cvt 1920 1080
or with a refresh rate depending what your graphics/monitor can handle:
cvt 1920 1080 60
(Also, for some hardware you may have to use reduced timing mode: cvt -r 1920 1080)
Then you need to pass the generated modeline to xrandr for example:
xrandr --newmode "1920x1080_60.00"  173.00  1920 2048 2248 2576  1080 1083 1088 1120 -hsync +vsync
Here is a good reference for xrandr


Downloading and installing Flex and Bison for use in closed environment (can not use apt-get)

On a system with internet connectivity, download the flex and bison packages:

apt-get download flex bison

Bring those deb files (flex_2.6.0-11_amd64.deb and bison_2%3a3.0.4.dfsg-1_amd64.deb) to your closed system.
Install them from a terminal, whose current directory is the location of the deb files:

sudo dpkg -i flex_2.6.0-11_amd64.deb
sudo dpkg -i bison_2%3a3.0.4.dfsg-1_amd64.deb

If you had tried to use Nautilus to install the package, the "Open with Software Install" R. click menu choice does require a network connection.


Mount and external hard drive on an Amazon ec2 Ubuntu server

There's nothing build into SSH that can do that as far as I know. You can however setup a SSH server on your computer, port-forward and then use sshfs to connect your computer's storage as a file system on the Amazon server.


Ubuntu not booting from USB on laptop (no optical drive)

If you have access to a Windows box, try using LiLi. I've always had more success with that than with Unetbootin.


Not getting sound for notifications in Firefox after switch to GNOME

This issue may be occurring because there are no packages available to decode the MP3 sound file. They may have been present on your previous installation but lost during the upgrade.

Check to see if you have a package to perform the decoding (such as ubuntu-restricted-extras).

Source: https://stackoverflow.com/a/32663653/5217088


How to install Visual Studio Code on armhf

The following script installs and runs github.com/cdr/code-server to run VSCode through the browser. Tested through UserLAnd on Android 8.1.0 running Ubuntu 18.04 on an armv7l processor. The project recommends installing it this way for processors that don't have a pre-built binary.
#!/usr/bin/env bash

# Dependencies for install script, building project.
apt-get update
sudo apt-get install -y curl build-essential pkg-config libx11-dev libxkbfile-dev libsecret-1-dev libatomic1 python

# Install nvm to install node
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
export NVM_DIR="$HOME/.nvm"; [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"; [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"

# Currently installs node v12.18.0; code-server requires v12+.
nvm install lts/*
npm i -g npm

# Finally, install code-server
npm i -g code-server

# Once it eventually builds, start it running on 127.0.0.1:8080 without password authentication.
code-server --auth none

There are some caveats mentioned in the code-server FAQ that would be worth reading, like "Differences compared to VSCode?" and "How do I make my keyboard shortcuts work?".


Ubuntu freezes constantly when propietary Nvidia drivers are installed

These freezes happened to me too. It looks like the Nvidia driver from Ubuntu repository does not handle relatively new adapters well.

But also it can be overheat. This also should be considered. I would start with upgrading the driver and kernel this way.

sudo apt-get install linux-generic-lts-vivid

reboot

sudo add-apt-repository ppa:xorg-edgers/ppa
sudo apt-get update
sudo apt-get install nvidia-346 nvidia-settings nvidia-prime
sudo add-apt-repository -r ppa:xorg-edgers/ppa

reboot.


An answer was found on the USB ModeSwitch forum.


why doesnt this bash script get all the files?

Handling filenames containing spaces or other funny characters is easily done, using find and xargs. Read man find xargs and do something like
find . -mindepth 1 -type f -iname '*.pdf' -print0 | \
    xargs -0 -r echo mv -t $PWD

to verify commands, and when they correspond to expectations...
remove the "echo" to actually execute the commands.


File a bug with the translator team.

Excerpt from /usr/share/locale-langpack/tr/LC_MESSAGES/gnome-screenshot.mo:

msgid "Screenshot from %s.%s"
msgstr "%s.%s Ekran görüntüsü"

should be:

msgid "Screenshot from %s.%s"
msgstr "%s ekran görüntüsü.%s"

Extension png goes into the second %s.


Lenovo provides a document that describes troubleshooting options based on various beep patterns and related symptoms.

Your problem might not be related to Ubuntu, even though you might have downloaded the firmware update via an Ubuntu tool.

If you turn your laptop back on, carefully note the symptoms and match them with Lenovo's guide:

"Beep and no beep symptoms - ThinkPad General"
https://support.lenovo.com/us/en/solutions/ht035729


What happens internally when we type a command in the terminal?

Assuming you are using bash as a shell, it will search all the directories set via the PATH environment variable.

Note that aliases and functions take precedence to scripts/binaries.
You can use echo "$PATH" to list the directories (colon used as separator).


Is there anything to check after your computer locks up or freezes?

Yes. Look at /var/log/kern.log, and check the lines before the reboot (lines with kernel: [    0.000000] were logged 0.000000 seconds after the reboot, so look at the lines preceding that one.


Unable to convert partial VLAN from systemd to netplan

Yes, netplan should support addresses both on the ethernet interface and on a vlan attached to that interface.


Does Ubuntu for phones support the AMR-WB codec, aka HD Voice?

I just searched the entire source repository for Ubuntu Touch for "AMR" and there is nothing in there that suggests AMR-WB is used, so the simple answer to your question is: No.

Sorry to be the harbinger of bad news…


The problem is that when you use sudo, it creates a new environment with no X settings.

There are two options: first, you can use sudo -E gparted to try preserving the environment, try it, if this works it's probably the safest option.

If not, you'd need to configure your server's root account to allow logging in through ssh, so that you can ssh root@server, which should set the appropriate forwarding and environment.

First, on the server, in /etc/ssh/sshd_config, ensure it has:

X11Forwarding yes
PermitRootLogin without-password

Next, add the ssh public key from your client to the root account on the server. If you can already ssh to the server without password with your normal user, then use sudo -i to start an interactive root session. Then:

ssh localhost. This is just so that an initial .ssh directory is created.
Copy the authorized_keys file from the normal user: cp /home/normaluser/.ssh/authorized_keys ~/.ssh

Now from the remote system try ssh -v root@server. You should be able to log in with no password. Check that the output shows X forwarding has been enabled. Then you should be able to run gparted remotely.

Also, it goes without saying, but mucking around with a remote system's partitions is risky; ensure you have a backup of important data in case a disaster happens :)


It removes the Ubuntu (or other flavour) that you installed using wubi.exe and it removes the registry entries, boot entry and folders/files that were placed on your computer.

In other words it reverses what running wubi.exe did.

Since Wubi doesn't interfere with how Windows boots, it cannot stop it booting either. So you can safely install and uninstall without affecting Windows.

Finally, in your situation, you installed Windows 8 over Windows 7. This means that the boot entry and the registry entries are all gone. All you have left is the C:\ubuntu folder. So, running wubi-uninstall.exe won't work. For you to install fresh, you just have to delete that folder and then run wubi.exe again.


If you google the PCI ID 1043:82be, the results is an Asus-manufactured nVidia 9400 GT, which is what Ubuntu identifies it as. 10de:0641 shows up as a 9400 as well...

Are you 100% certain that this is wrong, and that the card is in fact a GTS 450?


From what I can see, /var/www is owned by someone else (probably root).
To resolve this :
 Using Alt+F2 or the terminal, run gksudo nautilus. Ubuntu then shall ask you for your password. Nautilus will now open as root.

Navigate to the /var directory.

Right click on the folder "www" and select properties.

Browse to the "Permissions" tab.

Make this dialog box look like the screen shot below :

Here, "vibhav" (which is my user name) will be replaced by the user name through which you want to share the directory.

Click on "Apply Permissions to Enclosed Files"

Click on "Close"

Now , as a normal user, launch the File Browser.

Navigate to /var/www/site and right-click.

Select share this folder.

Enter sharename wwwsite and a comment.

Click button "Create Share

This shall share the folder over your network.


I tried a bunch of different things, but in the end my solution is just adding:

killall gnome-keyring-daemon
gnome-keyring-daemon --replace

To /etc/rc.local

Now Chrome asks for a password the first time it opens, as I would expect.


Hostapd does not deal with IP addresses, but you can restrict your station id's.

# Station MAC address -based authentication
# Please note that this kind of access control requires a driver that uses
# hostapd to take care of management frame processing and as such, this can be
# used with driver=hostap or driver=nl80211, but not with driver=madwifi.
# 0 = accept unless in deny list
# 1 = deny unless in accept list
# 2 = use external RADIUS server (accept/deny lists are searched first)
macaddr_acl=1

# Accept/deny lists are read from separate files (containing list of
# MAC addresses, one per line). Use absolute path name to make sure that the
# files can be read on SIGHUP configuration reloads.
accept_mac_file=/etc/hostapd/hostapd.accept
# deny_mac_file=/etc/hostapd/hostapd.deny

Usually hostapd.accept is sufficient to restrict access.


Here's a great site that will give you a listing of the defaults based upon your country and version in use:

http://repogen.simplylinux.ch/


beleive it or not, I typed sudo rm -r * in / by mistake! anyway to undo

The highest priority should be to save the content of your [most important] personal files. For this purpose I think you should avoid writing anything to your drive.

My way to do it is to shutdown the computer and reboot from another drive (typically an Ubuntu live drive or a linux rescue system), and if you have valuable data in the drive, to clone it with ddrescue to a third drive, and after that do recovery work on the cloned copy. This way you can afford mistakes (and in that case clone the drive again and try again to recover data from the cloned copy). The tools Testdisk and PhotoRec from http://cgsecurity.org might be useful.

This is described in some details in the following links,

Repair the partition table and file system of a pendrive - scroll down to 'Advanced repair of a partition table, file system and/or recovery of files',
Accidentally did dd /dev/sda - Not exactly your problem, but the method might work for you too.


No keyboard or mouse when first starting Ubuntu installation, stuck at screen with keyboard = man in circle

(https://www.dell.com) Go to the PC manufacturer and get the windows drivers.Your new OS will install the windows installer for the correct driver. After the system does it's thing . Restart the computer.


Lubuntu 18.04 can't SSH to Cisco Router: no matching key exchange method found. Their offer: diffie-hellman-group1-sha1

The problem is the Cisco router. Ubuntu's ssh client proposes a default set of modern and secure encryptions and the router proposes another set (with legacy algorithms) and they have none in common.

You can force ssh to add the weak legacy algorithms to its list of proposals:

From the command line:

ssh -oKexAlgorithms=+diffie-hellman-group1-sha1 192.168.1.1

or adding the option to ~/.ssh/config

Host 192.168.1.1
  KexAlgorithms +diffie-hellman-group1-sha1

As explained here (you have other solutions there), that might be not be enough and you might have to enable ssh-dss too.

ssh -oHostKeyAlgorithms=+ssh-dss 192.168.1.1

or adding the option to ~/.ssh/config

Host 192.168.1.1
  HostKeyAlgorithms +ssh-dss


Cmake error: -- Configuring incomplete, errors occurred!

The Qt4 packages are available from third party PPA. You have to add it with:
sudo add-apt-repository ppa:rock-core/qt4
sudo apt-get update

and then install necessary development package
sudo apt-get install libqt4-dev qt4-qmake qt4-dev-tools


Problem with usb printer ports in Ubuntu 16.04

You may use udevrules, as @Henning said.

First find out some unique information for the printers by executing

$ sudo udevadm info -a /dev/usb/lp0
calling: info
.
.
    SUBSYSTEMS=="usb"
.
.
    ATTRS{idProduct}=="1763"
    ATTRS{idVendor}=="04a9"
    ATTRS{serial}=="8025E2"

(and equivalent for lp1)

This is just an example, but usually Vendor, Productand serialare sufficient. Now you can create a simple udev-rule to let udev create a unique name (link) for this printer when it is added. Create a file in /etc/udev/rules.d e.g. with sudo nano /etc/udev/rules.d/99-myprinters.rules to hold two lines like:

ACTION=="add", SUBSYSTEMS=="usb", KERNEL=="lp[0-9]*", ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1763", ATTRS{serial}=="8025E2", SYMLINK+="printer1"

Of course you have to replace the ids and serial by what udevadmreported. This means:

When a device is added (ACTION=ADD) that is an usb printer (SUBSYSTEMS=="usb", KERNEL=="lp[0-9]*") which matches vendor, product and serial number, add a symbolic link in /dev with the name printer1 (well, you may name the printer as you want, maybe something more intuitive).

Important: The name of the rules file has to end in .rules, otherwise it will be ignored. And you should respect the naming conventions for udev rules.

Sometimes printer drivers installation creates their own udev rules in /etc/udev/rules.d; just look at them for examples.

You can test this with sudo udevadm test <devicepath>, where <devicepath>has to be the full path reported by udevadm info, e.g. /devices/pci0000:00/0000:00:13.2/usb2/2-3/2-3.2/2-3.2:1.1/usbmisc/lp0.


I have a broken package that will not allow me to perform updates or any changes to my computer. How do I fix it?

E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?

For this problem , reason is simple . you must be root while doing this & to be a root , place sudo before the command you are typing . for example to update

sudo apt-get update

while coming to your first issue . open your terminal and type this

sudo apt-get install -f

hope that helps .


Get Logitech G402 software for Ubuntu 20.04 (Not Hyperion its just G402)

Install piper. It should support your G402.
Piper is a GUI frontend to libratbag, a driver for various gaming mice on Linux. Alternatively you can use ratbagctl from the command line, which is installed along with piper if you follow the instructions.


brightness not working for Dell inspiron 3542

It happened with me 2 times when brightness was not working what I did, I installed nothing and only cleaned it via its recovery mode. After it I directly resumed to Ubuntu and checked everything was working. Moreover, when mouse or touch-pad does not work or error comes while starting Ubuntu I do the same. I have stopped automatic updates and now I update it manually. Apart from this, after every installation of update I clean it from its recovery mode which is in grub's advance options.


After upgrading to 13.04 clicking on trash gives "Malformed URL trash://"

Dolphin has a problem with handling paths pointing to 'Trash'.
When launching the Trash by clicking on the trash can, the dolphin windows is launched with URL: trash:// which is not what it is expecting. Instead, according to dolphin, it is expecting the correct path to be trash:/
You may have (unintentionally) made dolphin the default file manager for opening windows.
Undo that by following the steps below:

Install exo-utils

sudo apt-get install exo-utils

Run it

exo-preferred-applications

In the Utilities tab, under File Manager, select Nautilus back and select close.

After that, try to open trash again, it will open correctly in Nautilus, not in dolphin.

Reference: https://help.ubuntu.com/community/DefaultFileManager


Can you run apache2 on windows's wsl feature?

From the WSL FAQ:

Can I run ALL Linux apps in WSL?
No! WSL is a tool aimed at enabling users who need them to run Bash and core Linux command-line tools on Windows.
WSL does not aim to support GUI desktops or applications (e.g. Gnome,
KDE, etc.)
Also, even though you will be able to run many popular server
applications (e.g. Redis), we do not recommend WSL for hosting
production services – Microsoft offers a variety of solutions for
running production Linux workloads in Azure, Hyper-V, and Docker.

Although you might be able get Apache working with some research and elbow grease, I think MS's advice is solid.  You might not want to run a web server from a Windows Store app on your Windows desktop.  WSL is just not the right tool for the task.


No headphone output sound in ubuntu 14.04 - was logitech, now lync

I can only imagine that your headset is a Logitech H390. I've had a couple of those decide to change themselves into a "Lync Audio Device". When this happens, Logitech advises sending them back for a replacement or purchase a new headset.

If you have a Windows installation available to you, you should be able to fix the headset yourself: https://robertianhawdon.me.uk/2018/04/28/repairing-a-logitech-h390-headset/

Hope this helps,

Cheers


Finding out what package a command came from

Open a terminal and try the following commands:

dpkg -S 'command name'

eg:  dpkg -S /bin/ls

Sample output:

coreutils: /bin/ls

You can also obtain detailed status information about coreutils package, enter:

 dpkg -s coreutils

Sample output:

Package: coreutils
Essential: yes
Status: install ok installed
Priority: required
Section: utils
Installed-Size: 9040
Maintainer: Ubuntu Core Developers
Architecture: i386
Version: 5.97-5.3ubuntu3
Replaces: textutils, shellutils, fileutils, stat, debianutils (<= 2.3.1), dpkg (<< 1.13.2)
Provides: textutils, shellutils, fileutils
Pre-Depends: libacl1 (>= 2.2.11-1), libc6 (>= 2.6-1), libselinux1 (>= 2.0.15)
Conflicts: stat
Description: The GNU core utilities
 This package contains the essential basic system utilities.
 .
 Specifically, this package includes:
 basename cat chgrp chmod chown chroot cksum comm cp csplit cut date dd df dir
 dircolors dirname du echo env expand expr factor false fmt fold groups head
 hostid id install join link ln logname ls md5sum mkdir mkfifo mknod mv nice nl
 nohup od paste pathchk pinky pr printenv printf ptx pwd readlink rm rmdir
 sha1sum seq shred sleep sort split stat stty sum sync tac tail tee test touch
 tr true tsort tty uname unexpand uniq unlink users vdir wc who whoami yes
Original-Maintainer: Michael Stone


Wine: fixme :font: get_name_record_codepage encoding encoding 29 and 20 not handled, platform 1. Ubuntu 20.10

I had the same issue with my GNU/Linux Debian 10 and it happened after a MESA update. I suspect you are facing the same problem. You need to downgrade to a previous version of MESA. Apparently MESA 21 seems to have some issue with WINE. Good luck.


Command line web browser using SSH, is there any way i can use

You could use SSH as a proxy and then use a local browser to use that proxy.

ssh -ND 8080 user@server.example.com

That sets a SOCKS proxy. Just edit your browser's proxy settings to IP: localhost Port: 8080 and your traffic is going out over SSH.

Just remember that all your browser's traffic is going through the proxy until you disable it so don't do anything against network policy while you're logged in. I might suggest using a private instance of Chrome, for example.

Note: This probably won't work for domain lookups so you'll need the local (to the SSH host) IP of the router.


You could use a for loop e.g.

for i in {0..3}; do ifconfig eth${i} up; done


I figured it out

notify-send "$(amixer -D pulse get Master | awk '$2== "Left:" {print $5}')"

Thanks!


Install following ppa: https://launchpad.net/~vala-team/+archive/ubuntu/ppa

using:

sudo add-apt-repository ppa:vala-team/ppa

then perform an update and upgrade

sudo apt-get update
sudo apt-get upgrade

after that, just install geary (from the daily ppa)

sudo apt-get install geary


Fresh Install 14.04 Server Networking Not Working

Are you sure you have the network cable plugged in?

The UBUNTU base install assigns IPaddresses with DHCP.
Unless during the install the $USER assigned a static IPaddress.

From the original post.

output lshw -C network

*-network:1
logical name: eth1

output ethtool eth1:

Settings for eth1:

Link detected: no

Check the network cable.
From shell prompt, enter the command ifconfig

"Post that output". IPaddress, NETWORK, SUBNETMASK, GATEWAY, BROADCAST, DNS,

From shell prompt, enter the command hostname -I

"Post that output".

Login to the router/modem/bridge and obtain the IPaddress, NETWORK, SUBNETMASK, GATEWAY of the router(s), assuming you have only one router?

"Post  the private IPaddress, NETWORK, SUBNETMASK, GATEWAY" of the router.

NOTE: "REMOVE" the routers public IP address: X.X.X.X it can be found at What is my IP Address page. (from another computer connected to your local area network LAN)

For example, if you have multiple computers within your home you may want to the private IP addresses of each computer within your home.

Your router gets the public IP address, and each of the computers, tablets and smartphones connected to your router (via wired or wifi) get a private IP address from your router or server via DHCP protocol or Statically assigned. That is beyond the scope of the question


To configure PulseAudio we have two options:

1) Set channels for the daemon
To set the default channels (5.1.) for the pulseaudio daemon we can edit /etc/pulse/daemon.conf as root and edit the following lines to
default-sample-channels = 6
enable-lfe-remixing = yes

Note: Pulseaudio may not run properly if not a valid channel number is given.

2) Set a default card profile
Alternatively we may also define a default sound card profile in /etc/pulse/default.pa (or if defined for a user session only in ~/.pulse/default.pa).
set-card-profile <index> <name>

where we need to give the <index> of the sound card (e.g. 0) and the <name>(e.g. "Digital Surround 5.1 (HDMI)") of the profile we want as default. Possible values are listed with the following command
pacmd list-sinks

Note: for changes to settings files to take effect we need to restart the pulseaudio daemon by
pulseaudio -k


How can I open the command line in Firefox Quantum?

As far I could see while testing, this is still on Shift+F2.

I suggest backing up your bookmarks and so on (Firefox-Sync) and start over on a fresh profile.

This you can do easily by closing Firefox and deleting ~/.mozilla and ~/.cache/mozilla via terminal:

rm -r ~/.mozilla ~/.cache/mozilla

or you can start up Firefox with the profile manager via terminal by:

firefox -P