How do I set the policy for users to modify the network state and connections? How can I set the permissions for users to make changes to the network connections and state? For instance, how can I allow/disallow users to connect to new wireless networks? How can I allow/disallow users to turn off networking?

You can create a local policy for one or more users.

Create the document where the settings will live...

touch /var/lib/polkit-1/localauthority/50-local.d/10-network-manager.pkla

Add one or more policies...

[Let foo modify system settings for network]
Identity=unix-user:foo
Action=org.freedesktop.NetworkManager.settings.modify.system
ResultAny=no
ResultInactive=no
ResultActive=yes

[Do not allow foo to enable/disable networking]
Identity=unix-user:foo
Action=org.freedesktop.NetworkManager.settings.enable-disable-network
ResultAny=no
ResultInactive=no
ResultActive=no

The key is the ResultActive element which can be set to yes, no, auth_admin, or auth_admin_keep where the latter two will require the password of another user with sudo privileges.

The Action element defines what action will be allowed/disallowed or require authentication with a password. There are options like org.freedesktop.NetworkManager.enable-disable-network for toggling network as enabled/disabled. You can see more options in the /usr/share/polkit-1/actions/org.freedesktop.NetworkManager.policy file, just look for something like <action id="org.freedesktop.NetworkManager.enable-disable-network"> and read it's description.

You can also set all values with the * wildcard...

[Prevent foo from modifying all network states and settings except with admin password]
Identity=unix-user:foo
Action=org.freedesktop.NetworkManager.*
ResultAny=no
ResultInactive=no
ResultActive=auth_admin_keep

This will require a password to make ANY change to network settings or state.

You can do this in a single command that could be included in a script...

sudo su -c 'printf "[Prevent foo from modifying all network states and settings]\nIdentity=unix-user:foo\nAction=org.freedesktop.NetworkManager.*\nResultAny=no\nResultInactive=no\nResultActive=auth_admin" >  /var/lib/polkit-1/localauthority/50-local.d/10-network-manager.pkla'

References:

http://manpages.ubuntu.com/manpages/trusty/en/man8/polkit.8.html
http://manpages.ubuntu.com/manpages/trusty/en/man8/pklocalauthority.8.html

Linux os is secure, it’s most likely asking for authentication before entering a WiFi login key, I’ve had issues with it too,
All you need to do is when the message appears enter the user password and then you’ll be prompted to enter network key.
There’s no need to go into etc/ or /use or modify any file isn’t the actual file system creating yet another problem.
It’s a security steps, if someone get a hold of your computer once they log out they’ll need your password to access the browser.
If you don’t have the password to get into network then you shouldn’t use that computer.


How can I fix a 404 Error when using a PPA or updating my package lists? PPA seems to be constantly offline. Whenever I use sudo apt-get update, this error is shown:

W: Failed to fetch http://ppa.launchpad.net/ 404  Not Found

How do I fix these errors?

Automated removal
skip to the bottom of this answer for a scripted way to remove offending software-sources for all ubuntu versions prior to Ubuntu 15.04
What are 404 errors

The 404 or Not Found error message is a HTTP standard response code
indicating that the client was able to communicate with the server,
but the server could not find what was requested.
The web site hosting server will typically generate "404 - Page Not
Found" web page, when users attempts to follow a broken or dead link.

What are the causes of these errors in update-manager
Typically, three main areas cause these errors in update-manager

A user has just upgraded and has re-enabled a PPA software-source that no longer exists

A user has manually typed in a new software source incorrectly

A PPA was added, but the maintainer has subsequently deleted some/all of the PPA

where are these software-sources
PPAs typically are saved in one of two locations

/etc/apt/sources.list
in an appropriately named file with a .list file-extension in /etc/apt/sources.list.d/ for example webupd8team-jupiter-natty.list

This list file typically contains:
deb http://ppa.launchpad.net/webupd8team/jupiter/ubuntu oneiric main
# deb-src http://ppa.launchpad.net/webupd8team/jupiter/ubuntu oneiric main

Note a # at the front of a line of text means that it is commented out and is not checked by the package manager.
How to eliminate these errors
Typically, if you run sudo apt-get update from a terminal or click the details button in Update Manager after hitting the refresh button you will see errors such as:

If the error is due to a PPA - usually unticking the similarly named PPA with the URL shown in the error message will resolve this.

If the 404 error was due to an additional repository that has been added to /etc/apt/sources.list then its easier to add # character to the start of the line to comment out the offending repository i.e.
gksu gedit /etc/apt/sources.list

More info
Here is a bug report on the update manager to solve this problem:

https://bugs.launchpad.net/ubuntu/+source/update-manager/+bug/1049046

If you are getting these problems without PPAs, check out this question:

How can I fix a 404 Error using the Ubuntu archives?
Repositories/Ubuntu - Community Ubuntu Documentation - Removing & Disabling Repositories

> You sources are messed up/or corrupted, but we can make a new fresh list.

  Open a terminal and type

sudo rm /etc/apt/sources.list

  Then, Type :

sudo rm /etc/apt/sources.list.d/ppaname-ppa-$(lsb_release -sc).list*

  Then open software sources :

sudo software-properties-gtk

  You will see 5 check boxes tick them all and underneath change the
  server to the nearest on to you, for example if you live in the United
  States you would put the United States server, apply the options and
  close the window.

  Then go to your terminal and type :

sudo apt-get update && upgrade

  Which updates your system.


Install Ubuntu GNOME 17.04 on X230 grub error When I try to install Ubuntu GNOME 17.04 on my Thinkpad x230 it returns with this error:  can't install GRUB on /dev/mmcblk0

For some strange reasons Ubuntu isntaller tried to install the bootloader on the USB and not on the hard drive.
Go to manual resize and partition creator install and select your hard drive for the bootloader /dev/sda

I installed Ubuntu 17.04 on an old IBM Think Pad T60. Near the end I got a similar error. There are a lot of solutions posted around, some using a boot-repair program, others involving post-install repair with the live (off the DVD) Linux. Here is what worked for me after some experimentation:

Using 17.04 32 bit i-386 ISO image, burned to DVD, I cold booted, and used the following options on the Ubuntu install. These choices are approximate, but you'll recognize them in the actual installation choices

Full install with delete

LVM

install updates now

load extras like fonts and graphics

I am guessing either the grub with the updates is fixed, or using LVM (no tweaking, just took what it gave me) fixed the boot record bug.


how to disable nautilus-dropbox in KDE? On Ubuntu 12.10 64bit I additionally installed kubuntu-desktop. I installed dropbox in Unity to use it there with nautilus. In Kde this is not the wanted behavior so I installed the dropboxd - Daemon and enabled it to autostart in KDE. But the nautilus-dropbox applet is always started in addition to the daemon.

How can I make sure that there is ONLY the dropboxd running and NOT the nautilus-dropbox when I use KDE and When using Gnome I llike to use nautilus-dropbox?

plz note that there is no setting for nautilus-dropbox in KDE autostart applications!

Maybe there is a way to install two versions and make sure only the right one is started with each desktop environment?

This is from a quick Google search and is a bit old, but http://ubuntu-tutorials.com/2010/01/17/install-dropbox-on-kubuntu-kde-without-nautilus/ covers how to install Dropbox and get it working w/o all the dependencies and the notifier running.  Might still work for you.

Right click in the applet, Preferences/General and disable Start Dropbox on system startup.


how do i stop root from running a program I would like to prevent my root user from running certain applications that can change the permissions of files which in turn prevents normal users from running those applications again.

for example, if i sudo to root, and then run thunderbird from the command prompt, it changes the permissions of files within my home dir / profile so i can no longer run it as a normal user; what i would like to do is prevent root from running thunderbird and hence stop this user error from repeating itself.

any suggestions?

to clarify,

if i have a lot of administration to do i use "sudo -s" which gives me a root shell, its just once a year or so, i shoot myself in the foot.

I believe as this is a case of stopping a bone headed user shoot them selves in the foot that there is no easy way to do this. with great power comes great responability, and it would probably be best if learnt not to use sudo -s quite so often.

that being said, i am going to wrap a bash script around thunderbird, that checks the user name using whoami or $SUDO_USER and then aborts if it is an administrator. its not a general solution, but it will help in this isolated case.

If you have thunderbird installed locally, somewhere in your home directory then you could change the permissions to 500 so that only you can execute that program.

Run this on the executable

chmod 500 thunderbird

Also as TrailRider has said, don't run programs by prefixing sudo, it can be potentially dangerous. You can fix the permissions by changing the ownership of the thunderbird directory to your user name.


Ubuntu.Components QML Module I installed QTCreator and Ubuntu SDK as shown here.
When trying to run the code sample provided here, QTCreator tells me it can't find the Ubuntu.Components QML Module.
Notes:
The build-logs says:

file:///home/giladnaaman/Programming/Projects/CurrencyConverter/CurrencyConverter.qml:2 module "Ubuntu.Components" is not installed

But the directory /opt/qt5/imports/Ubuntu/Components
exists (and is full of files).
After adding importPaths: [ "/opt/qt5/imports" ] to the qmlproject file:

QML module does not contain information about components contained in plugins.
QMetaType::registerType: Binary compatibility break -- Type flags for 'QPaintBufferCacheEntry'[1024] don't match. Previously registered TypeFlags(0x103), now registering TypeFlags(0x3).

It can not work, if you install Ubuntu UI toolkit according that website.
http://developer.ubuntu.com/get-started/gomobile/#step-get-toolkit

I reinstall Qt5 and Ubuntu UI toolkit according this website,
and problem have gone.

You must compile Ubuntu-components and then install it into Qt5.
This article tell how to do it.
Can't install qt-components-ubuntu because I'm using full release of QT 5.0.0

It will work for Qt Quick1/2 UI project not for Qt Quick1/2 Applications projects.

Hope it works for you!


No sound in Xubuntu 14.04 I have dual-booted my Chromebook with Xubuntu 14.04 and have found that the sound is broken. I have tried everyhting that has been mentioned on the internet. I have restarted pulse, uninstalled it, unmuted sound in alsamixer, fiddled around with pavucontrol, and nothing. If this helps, there is no sound notifier in my taskbar, and I can't find a way to add one. Is it just it's unmuted in the hardware but the OS is just muted and I can't find a way to unmute it? BTW I have a Samsung Series 3 chromebook.

UPDATE 1: I have gotten sound notifier in my taskbar now, and it's on full volume, but nothing comes out.

UPDATE 2: I have tried installing drivers but they fail to install.

UPDATE 3: In the volume control, when I play Youtube videos, it shows audio playing in volume control but no sound is coming out. No, my speakers are not fried as they work fine in ChromeOS.

UPDATE 4: I uninstalled Pulse, and works on bootup, but the sound is blasting. When I lower the volume, it mutes. How do I fix this?

Install the soundcard driver containing packages:

sudo apt-get install build-essential linux-headers-`uname -r`

Then reboot.

Similar problem (Xubuntu 14.04).  After updating, sound sometimes stops working, even though both input and output show graphically as working in Pulse controls.

Sometimes it has been restored by changing selections in the Configuration tab, but sometimes not.  This is extremely frustrating, as it seems to be random both as to when updates do this, and when manually selecting configuration in Pulse control fixes it.


Can't connect Android 4.1.2 device to Ubuntu 13.10 I'm having problems to connect my android 4.1.2 device to my recently installed Ubuntu 13.10. The system just don't recognizes the device to mount, but when I run dmesg it's pretty clear than the system catch all info about the attached device, see:

[  336.008777] usb 1-1.2: USB disconnect, device number 5
[  363.119059] usb 1-1.2: new high-speed USB device number 6 using ehci-pci
[  363.212290] usb 1-1.2: New USB device found, idVendor=22b8, idProduct=64b5
[  363.212294] usb 1-1.2: New USB device strings: Mfr=2, Product=3, SerialNumber=4
[  363.212297] usb 1-1.2: Product: X91x
[  363.212299] usb 1-1.2: Manufacturer: Motorola
[  363.212301] usb 1-1.2: SerialNumber: (DEVICE_SERIAL_NUMBER)
[  363.213303] cdc_acm 1-1.2:1.1: This device cannot do calls on its own. It is not a modem.
[  363.213339] cdc_acm 1-1.2:1.1: ttyACM0: USB ACM device

I also tried to install programs like gMTP but without any success...
So, what's going on? How can I make that stuff to work?

Thanks!

P.S.: Sorry my (terrible) english, I'm from Brazil.

I had the same problem.
Then I installed:

sudo apt-get install libmtp-common libmtp-runtime libmtp9:amd64 libnet-smtp-ssl-perl mtp-tools mtpfs


How do I remap the keyboard shortcut for Gnome Do? I am giving Unity a chance to win me over in Natty, but I admit I am a heavy Gnome Do user and Unity has remapped the Super+Space keyboard shortcut to show the Unity Launcher.

I am not yet convinced with the new Unity Launcher and would like to keep using Gnome Do, at least until such time as I am convinced that the Unity launcher is as frictionless as Gnome Do.

Is it possible to remap it to Gnome Do?

Install compizconfig-settings-manager
 sudo apt-get install compizconfig-settings-manager

Hit Alt+F2, type about:config and hit Enter to open the Unity configuration.

Either disable or bind the shortcut for Key to show the launcher  to another key:

Now the Super key should open Gnome Do as before.

You can also do:

System Settings
Type "Keyboard Shortcuts" in the search field.
Edit the shortcut key you want it be used for gnome-do. Add this shortcut key and bind it to "gnome-do" command.

Cheers :)


Running Pip3 ImportError: cannot import name 'main' I want to install Scipy (already have Numpy installed). I have Python 3.5.1-3 installed with OS and IDLE3 (3.5.2). When I hit in terminal

sudo pip3 install scipy

It prints out

Traceback (most recent call last):
File "/usr/bin/pip3", line 9, in <module>
from pip import main
ImportError: cannot import name 'main'

I've already tried to reinstall pip3 and restart OS, but it didn't change.
Has pip3 been working weirdly with someone else?

Use python -m pip install instead of pip install

Example:

python -m pip install --user somepackage
python3 -m pip install --user somepackage

I started getting this problem after a pip upgrade:

pip install --upgrade --user pip

The pip (resp. pip3) executable is provided by your distro (python-pip package on Ubuntu 16.04).

Therefore, it is not kept up-to date with the pip package itself as you upgrade pip, and may break.

If you just use python -m pip directly, e.g. as in:

python -m pip install --user somepackage
python3 -m pip install --user somepackage

it goes through your Python path and finds the latest version of pip, and executes that file.

It relies on the fact that that file is executable, but that is a very standard type of interface, and therefore less likely to break than the hackier Debian script.

Then I recommend adding the following functions to your .bashrc:

pip() ( python -m pip "$@" )
pip3() ( python3 -m pip "$@" )

The Ubuntu 18.04 /usr/bin/pip3 file does:

from pip import main

and presumably main was removed from pip at some point which is what broke things.

The breaking pip commit appears to be: 95bcf8c5f6394298035a7332c441868f3b0169f4 "Move all internal APIs to pip._internal" which went into pip 18.0.

Tested in Ubuntu 16.04 after an update from pip3 9.0.1 to 18.0.

pyenv

Ultimately however, for serious Python development I would just recommend that you install your own local Python with pyenv + virtualenv, which would also get around this Ubuntu bug: How do I install a different Python version using apt-get?

This worked for me:

pip install --upgrade --user pip

By install --upgrade, I mean whatever you're trying to install.


Why does Ubuntu always boot regardless of boot priority? I am running Ubuntu 12.10. I thought I had installed 64-bit but somehow I had installed 32-bit.

I wanted to install 64-Bit Ubuntu over the current installation with my flash drive but whenever I select my flash drive to boot, it boot into Ubuntu anyway.

My computer teacher gave me an Ubuntu 8.10 Desktop Edition DVD. Could I possibly boot from it and delete the partition so I can do a clean installation?

I looked this up for quite some time and I haven't found any answers.

If you have a SATA, SCSI, or SAS HDD, you could unplug the all of the connected HDDs prior to boot, insert the USB drive, boot it, and then plug the drives back in.

If that doesn't work, don't use the 8.04 disc, but burn a 13.04 disc, and then try the above with a disc instead of a USB drive.


Wired connection and ad-hoc wireless at the same time I'm setting up an Ubuntu Server 14.04 with a wired connection (p4p1) and creating an ad-hoc wireless network. Here's my interfaces file:

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto p4p1
iface p4p1 inet dhcp

# WiFi
auto wlan0
iface wlan0 inet dhcp
wireless-mode ad-hoc
wireless-channel 4
wireless-essid Augmented Learning
wireless-key 1234567890
address 192.168.0.2
netmask 255.255.255.0
broadcast 192.168.0.255
gateway 192.168.0.2

Things are running smooth when one of the two interface is up, but when both are up, I can neither access Internet (via p4p1) nor access my ad-hoc network (with wlan0).

What should I do to run them both at the same time ? I don't need to share the connection.

Thanks,

One thing you should not do is point the gateway to your own IP. The gateway tells the system how to route to any IP address not in any of the subnets to which it is directly connected. Normally this is the route to "the Internet", so should not be present for a connection to an internal network unless the route to the Internet is on a host on that network. So remove the gateway line from your definition of wlan0.

There may be multiple things wrong here, so this might not be the only change needed to fix your problem.

Maybe i know how you could use a file called asleep.d it can be downloaded here.

https://app.box.com/s/5nj2xuhby5kqk1y3o7wb

you just copy it over to /etc/pm


Simple udev rule does not work whats wrong with this simple udev rule?

KERNEL=="sdc1", ACTION=="add", RUN+="/bin/mkdir /tmp/folder1"

When I plug in my USB-Stick the rule does nothing.

Use a rule with UUID matching:

KERNEL=="sd??", ENV{ID_FS_UUID}=="<the_uuid>", RUN+="/bin/mkdir /tmp/folder1"

get the UUID with the command below

udevadm info /dev/<usb_stick_partition> | grep ID_FS_UUID=

Example

$ udevadm info /dev/sda1 | grep ID_FS_UUID=
E: ID_FS_UUID=c44a008d-58b2-467d-8814-f06973e49dcb

therefore

KERNEL=="sd??", ENV{ID_FS_UUID}=="c44a008d-58b2-467d-8814-f06973e49dcb", RUN+="/bin/mkdir /tmp/folder1"


Installing Ubuntu in a dual-boot EDIT: Plenty of info out there I'll get to it before I bother anyone for more answers.

A dual boot would be fine.

A Virtual Machine with Virtualbox might be better for you though. Less headaches and more flexibility, easier to set up.

To learn the basics about Linux I recommended the EdX Intro to Linux course. I've taken it myself and it's great. It's free, it's good, and you can do it at your own pace.


How do I disable my laptops builtin keyboard? I have a problem with my laptops default keyboard. It is broken... to sum up.

It gets stuck on the 'h' key and you see

ghsdhhhhhhhhhhhhhhhhhhhhhhhhhhhhh... ----> (arrow signifies that it goes on forever until I stop it)

I use a USB keyboard to type. I want to disable the default keyboard because I don't want to deal with this anymore. Is there a way to do that with ubuntu?

Please refer to:
How to get Xorg to ignore certain input devices?

  Input devices are now managed in /usr/share/X11/xorg.conf.d/ (in 10.04 Lucid, the directory is /usr/lib/X11/xorg.conf.d/).
  This directory contains configuration rules for all your input devices:

  root@3000-G530:/usr/share/X11/xorg.conf.d# ls
  10-evdev.conf      50-vmmouse.conf  51-synaptics-quirks.conf
  50-synaptics.conf  50-wacom.conf    60-magictrackpad.conf

  You fist need to find your input device there, note that those files are "rules" matching a number of possible devices. 50-wacom.conf for example will handle every wacom device. Look throgh them to find which one is responsible for your device, or create your own.
  To disable a device:

  Add the option Option "Ignore" "true" to the relevant configuration file.

  Open the file with root privileges (i.e. press Alt+F2 and type gksu gedit) and add this option to the others.

  Log out and back in for the changes to take effect.


How do I find out which process is eating up my bandwidth? I think I'm being the victim of a bug here. Sometimes while I'm working (I still don't know why), my network traffic goes up to 200 KB/s and stays that way, even tough I'm not doing anything internet-related.

This sometimes happens to me with the CPU usage. When it does, I just run a top command to find out which process is responsible and then kill it. Problem is: I have no way of knowing which process is responsible for my high network usage. Both the resource monitor and the top command only tell me my total network usage, neither of them tells me process specific network info.

I've found questions here about monitoring total bandwidth usage, but, as I mentioned, that's not what I need. Is there another command I can use to find out which process is getting out of hand?

The command iftop gives results that disagree entirely with the information reported by System Monitor. While the latter claims there's high network traffic, the former claims there's barely 1 KB/s.

I've already tried killing all the obvious ones (Firefox, update-manager, Pidgin, etc) with no luck. So far, restarting the machine is the only way I found of getting rid of the issue.

I've had a lot of success with nethogs. It has to run as root but there are different ways you can sort the statistics (like KB/s or total bandwidth monitored since nethogs started).

Also, if you use wireless you need to pass the device to it.

Install it with command: sudo apt-get install nethogs

Example: sudo nethogs wlan0

Here's one I like, it tells you what's reading from the network the most, anyway (doesn't seem to work for which one is "writing to" the network, so...you get half).

$ sudo apt install dstat
then
$ dstat --net --top-io-adv
-net/total- -------most-expensive-i/o-process-------
 recv  send|process              pid  read write cpu
   0     0 |chrome               1885   19k  17k0.4%
 504B  734B|chrome               1923    0   66k0.2%
 651k   18k|chrome               1923  597k 593k2.0%
  19k   26k|gnome-terminal-      25834 429B  59k0.8%


Touchscreen on HP Envy x360 is not working with 18.04 When I tried Ubuntu 18.04 LTS on my HP envy x360, the touchscreen of the laptop is not working. How can I fix it?

There are two options as for now, both of them presented in following link:
https://bugzilla.kernel.org/show_bug.cgi?id=198715#c14

The first option is to patch kernel manually and install it on your system, I've tested it, it works for my HP Envy x360 15-bq121dx.

Another option is to patch acpi table, people in discussion in link above report successful result. I haven't tried this method yet.

Download GNOME Tweaks from Ubuntu Software. Go to the Keyboard & Mouse section. Then go to Mouse, click Emulation, and select Area.


How to add a name server to Ubuntu I can ping to 8.8.8.8. I want to use automatic DNS or help me make it 8.8.8.8. I can't enter GUI, system crashed. I connected via wifi using root option in recovery. Crashed during upgrade to Ubuntu 17. resolv.conf/head shows nothing. Because I can't resolve name, I can't do an upgrade or install commands. I searched other answers, but I couldn't find a proper one.

Issue

Want to make dhclient push nameserver information to resolvconf.

I was missing r/w permission in root as its not there when opened in recovery mode. Once i did it i was able to get connected.

$ sudo vi /etc/resolv.conf

$ sudo nano /etc/resolv.conf

Append your ISP name server or free fast dns nameservers IP address as follows:

nameserver 208.67.222.222
nameserver 208.67.220.220
nameserver 202.51.5.52

Save and close the file. Test your dns configuration by typing the following commands:

$ host yahoo.com
$ nslookup google.com
$ ping nixcraft.in


Connect/disconnect from VPN from the command line I have two VPNs setup on my Ubuntu machine, one using vpnc and one using PPTP. These were both setup using the GNOME network manager interface and work great. However on occasion I need to access this machine remotely - is there a way to connect or disconnect to these VPNs from the command line?

If you want to interact with NetworkManager from the command line you can use the "nmcli" command.

list all NM connections: nmcli con

start connection (wifi, vpn, etc): nmcli con up id ConnectionName

down connection: nmcli con down id ConnectionName

(more nmcli commands in the nmcli manpage).

Also note that regular users usually don't have permission to control networking. Using the commands above with sudo should work for most connections, but VPN specifically might fail with "Error: Connection activation failed: no valid VPN secrets."

If that happens to you, it's likely that the VPN password is stored in your user's gnome-keyring, which makes it inaccessible to the root user. This comment explains why.

To fix this, edit /etc/NetworkManager/system-connections/ConnectionName and under [vpn], change the password flags line to:

password-flags=0

If there is a line starting with Xauth password-flags, change it instead.

Then add the following below the [vpn] block:

[vpn-secrets]
password=YourPassword

(If in the previous step you changed the line Xauth password-flags, add Xauth password=... instead.)

Now restart network manager by:

sudo service network-manager restart

Then starting the VPN connection with sudo nmcli con up id ConnectionName should work without problems.

ihashacks's answer with Matt's comments worked for me... almost.  Had to tweak one line.

my password-flag line actually read: "Xauth password-flag".  The accepted answer wouldn't work for me until I changed to the following

[vpn]
...
Xauth password-flag=0
IPSec secret-flags=0

[vpn-secrets]
Xauth password=<my pw> ## This is the one I changed.
IPSec secret=<group pw>

Not sure why my vpn connections have "Xauth" before every mention of password.

(Sorry this is a new answer, can't yet make comments.)


Sed problem  in a Bash script I'm having a problem using the sed command .  I'm trying to write a bash script that does the following :

search for the line that contain :@
then save the line that contained :@ and replace it with new line

as in the following:

#! /bin/bash

echo "Please enter the ip address of you file"
read ipnumber
find=`grep ':@' application.properties` # find the line
input="connection.url=jdbc\racle\:thin\:@$ipnumber\:1521\:billz" # preparing new line
echo `sed "s/'${find}'/'${input}'/g" application.properties` # replace old with new line

The problem is: nothing happens.

I've already tried to use "${find}"  instead of '${find}'

There are several problems with that snippet. I recommend you learn bash's syntax a little better before writing scripts in it.

Anyway, if you want to edit a file, you want a file editor. sed is not a file editor. I believe this will do what you want.

#!/bin/bash

read -p "Enter the ip address: " ipnumber

ed -s application.properties << EOF
/:@/c
connection.url=jdbc:oracle:thin:@$ipnumber:1521:billz
.
w
EOF

What that ed script says is: /:@/c - on the first line containing :@, change the line with everything following until a line containing only a .. Then w to write the changes to the file.

See http://wiki.bash-hackers.org/doku.php?id=howto:edit-ed for help with editing using ed, and http://mywiki.wooledge.org/BashGuide to learn bash.

Update:
sed can be used to achieve the same, but it can't edit files, it can only be used to create a new file.

# POSIX
sed "/:@/c\
connection.url=jdbc:oracle:thin:@$ipnumber:1521:billz" application.properties

Here sed will output the file with the changes applied. You can redirect to a new file, then move that file over the old one. GNU sed also has a non-standard -i option that does the last part transparently. GNU sed also doesn't require you to have that newline in the sed script.

# GNU sed
sed -i "/:@/c connection.url=jdbc:oracle:thin:@$ipnumber:1521:billz" application.properties

Note that the ed will only replace the first line that matches the regex while sed will replace all lines matching that regex.

my problem was  : i was using an variable name (value) ,, which is reserved :))
Solution is :

#!/bin/bash

read -p "Please Enter The ip address : " ipnum
find=`grep ":@" application.properties`
test="connection.url=jdbc:oracle:thin:@$ipnum:1521:e"
sed -i "s/"$find"/"$test"/g" application.properties

THANKS  geirha


Allow "root" program to run without privileges I've changed my ctrl-alt-l shortcut so instead of just locking the screen, the system goes into suspend.

(for reference, the command is gksudo pm-suspend-hybrid)

as you can see, the program needs to be run as root, so I added the gksudo. I'd really like to get the system to suspend without having to enter the password. Is there any way I can do this?

Open up a terminal and execute sudo visudo.

Then you can edit the sudoers file where you can specify who can execute which command as root with and without password. At the end of the file you paste either this line

nonprivilegeduser ALL=NOPASSWD:/usr/sbin/pm-suspend-hybrid

for every user to be able to execute that command as root without password, or

Your_Username ALL=NOPASSWD:/usr/sbin/pm-suspend-hybrid

for only your user to be able to do this (of course you have to adjust it for your user). Then you save the file (should be Ctrl+O) and exit the program (Ctrl+X).

At last, you have to edit your command to read sudo pm-suspend-hybrid instead of gksudo pm-suspend-hybrid.

NOTE: There should also be the possibility to do this with dbus (doesn't require sudoers editing) but this solution has the advantage that it works with every UI.

Type the command:

sudo visudo

and then enter the password.
You can see the below line in terminal

%sudo   ALL=(ALL:ALL) ALL

edit the %sudo line with

%sudo   ALL=(ALL:ALL) NOPASSWD:ALL

Save the modifications using CtrlX.


How to modify "/etc/bash.bashrc"? It is read only? Trying to modify /etc/bash.bashrc I get an error:

$ echo "my edit" >> /etc/bash.bashrc
bash: /etc/bash.bashrc: Permission denied

ls -ll /etc/bash.bashrc shows:

-rw-r--r-- 1 root root 1975 2011-05-18 19:54 /etc/bash.bashrc

How could I modify /etc/bash.bashrc ?

sudo bash -c "echo 'text' >> /etc/bashrc"

Don't change the owner. Don't chmod it. Just use sudo. Open it with sudoedit if you need to do complicated things.

By the way, you can make changes for one user by just editing ~/.bashrc without requiring any special permissions.


Wireless and Wired networks don't work I have this issue with my Ubuntu budgie 20.04 which both wired and wireless networks don't work any more. I had this problem with wireless before and I reinstalled the os to fix it! It worked fine for a month but slowly the wireless network got disabled in middle of work and now after many restarts and shutdowns, it may work for 1 minute! today the same is happening with the wired connection but The odd thing is that the problem is only with the Ethernet cable connection and when I use usb and my mobile usb tethering option, my laptops internet works fine! I don't know whether it is software or hardware and after many searches and command I couldn't figure out the problem. Please help!
farzin@farzin-X541UVK:~$ lsb_release  -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.1 LTS
Release:    20.04
Codename:   focal

Try resetting the root password, this is only a temporary fix lmfao, read my post and you'll know why, reset the password and it'll work for a few days atleast


Can VirtualBox and KVM run alongside each other? I have a KVM virtual instance running on my machine. I installed VirtualBox; but, when I tried to start the VirtualBox VM machine, I got the following error:

VERR_VMX_IN_VMX_ROOT_MODE

I searched based on this error message and the problem is that KVM is already installed.

I know that I can switch between them by removing some modules then use VirtualBox. However, my question is how to make them run simultaneously?

You can't make them work together. They both need access to the CPU's virtualization features, but that's not designed to be used by more than one hypervisor at once.

You could try disabling Virtualbox's VT-X support so it doesn't try to use hardware virtualization. Edit the virtual machine's settings, in the system tab find the "enable vt-x/amd-v" tick box and unmark it. I don't promise it will work, and even if it does, it will use software virtualization for virtualbox so your VMs will be slower.

If at all possible, I strongly recommend you choose just one hypervisor and use it for all your VMs.

Well, both VBox and VMware will run in parallel to KVM, at least today.
You must, though, disable the usage of hardware acceleration (disable VT, put Binary Translation) to all but KVM. Then, the other hypervisors will play in software mode and KVM will be happily using any VT-facilities alone.


Upgrade to Ubuntu 13.04 Problem - Boots into Blank Black Screen After upgrade my desktop system (asrock z77, intel i5, geforce gtx 650, 16 GB ram) can only boot to a black screen. I mean after the GRUB interface (kernel is 3.8.8-19-generic) and purple screen.

I have attempted pretty much every work around listed that I have been able to locate on the forums and elsewhere, here are a couple of resources (if anyone else is having a similar issue):

BlankScreen

How to set NOMODESET and other kernel boot options in grub2

I have modified grub entry several times in different ways. It tends to hang at this point with statement "Loading initial ramdisk ..."

Attempted to reinstall Ubuntu's system files following UbuntuReinstallation guide, but:

(i.) option to upgrade is not available;
(ii.) install via manual partitioning (something-else) has issues, when I select the "sda1" partition and click install now I get an error message saying that "No root file system is defined".

**this error message occurs regardless of setting mount point as "/"

I then tried 'boot repair', thinking it might be something that could help: http://paste.ubuntu.com/5627802/

I am at the point that I am thinking the microsoft solution for serious BSOD was to take the box outside and shoot it or toss it off a bridge from a moving vehicle is the only viable option.

If anyone can help, make some suggestions - it would be greatly appreciated.

Thanks in advance.

Footnote: Sunday 10th May 2013

Over the last week, I have attempted multiple times to create a work around to this 'blank screen' issue. To the point I have built a second identical machine, two separate Nvidia graphics cards (GTX650 & GTS450) to play around on with fresh installs of 12.10 and 13.04

I have followed numerous suggestions from forum threads, bug reports and askubuntu posts:

Ubuntu 12.10 / 13.04

sudo apt-add-repository ppa:xorg-edgers/ppa
sudo apt-get update
sudo apt-get install nvidia-current nvidia-settings
sudo apt-get install linux-headers-generic
sudo apt-get --reinstall nvidia-current nvidia-settings
sudo reboot

As well as:

sudo apt-add-repository ppa:ubuntu-x-swat/x-updates
sudo apt-get update
sudo apt-get install nvidia-current nvidia-settings
sudo apt-get install linux-headers-generic
sudo apt-get --reinstall nvidia-current nvidia-settings
sudo reboot

I have done the 'remove':

sudo apt-remove nvidia-current nvidia-common
sudo apt-remove nvidia-current-updates

I have 'reconfigured':

sudo dpkg-reconfigure nvidia-current
sudo dpkg-reconfigure nvidia-current-updates

I have purged the butthead drivers released by nvidia:

sudo apt-get purge nvidia*; sudo rm /etc/x11/xorg.conf

Installed new nvidia drivers (310, 319) following some of the above:

sudo apt-get install-experimental-319
sudo apt-get install-319-updates

Cleared Nouveau (as it was not being blacklisted):

sudo apt-get --purge remove xserver-xorg-video-nouveau
sudo apt-get install linux-headers-'uname -r'
sudo apt-add-repository ppa:ubuntu-x-swat/x-updates
sudo apt-get update
sudo apt-get install nvidia-current nvidia-settings
sudo apt-get-alternatives --config gl_conf
sudo ldconfig
sudo update-initramfs -u
sudo nvidia-xconfig

Redone Unity by installing 'dconf-tools'.

Original and test system both have nvidia graphics cards to which monitors are attached, however neither appear in 'additional drivers'. In the case of the test system, this is regardless of whether the card is in the PCI slot with fresh install or added later in both 12.10 and 13.04.

When I do: 'lsmod | grep -i nv' after install nvidia, the nvida data is there, but the system still boots into blank screen. I have played with 'lightdm' and 'nomodeset'.

In the case of editing grub to add 'nomodeset' in test system, this causes the system to hang after 'Loading initial ramdisk ...'

So, if anyone has some thoughts, I am all ears.

I had this happen, I had to experiment by loading up previous versions as listed in the grub 2 boot selection screen. then when i found a kernel that loaded I set it as default.

what I had discovered by searching google, was for some reason 13.04 places two unusable kernels in the boot selection. I had 3.8.0-19 and 3.5.0-28 which are non functional kernels. the kernel that is needed was 3.2.0-40. after removing and setting the right kernel in grub to the new default , all was fine and 13.04 works beautifully

Black Screen LightDM SSD Boot Fix

The above link should fix the boot problem.

happy ubuntuing!!


How to measure GPU usage? Using the top command in the terminal lists processes, sorted by their CPU usage (and you can change it to sort by another parameter)

Is there an equivalent for the GPU?

This fellow is asking about RAM used by GPU

For Nvidia GPUs there is a tool nvidia-smi that can show memory
usage, GPU utilization and temperature of GPU.
For Intel GPU's you can use the intel-gpu-tools.
AMD has two options

fglrx (closed source drivers):

aticonfig --odgc --odgt

And for mesa (open source drivers), you can use RadeonTop .

Source:GPU usage monitoring

I just found this command:

nvidia-smi --query-gpu=utilization.gpu --format=csv --loop=1

Here is a demo:


Brightness Settings Ubuntu or Mint for Toshiba Satellite C55D-B5102 I have a Toshiba Satellite C55D-B5102 that I would really love to put Ubuntu or Mint on, however I am unable to lower the brightness settings at all under MATE, Cinnamon, KDE, GNOME, or XFCE. When I move the slider, it literally does nothing. When I press the brightness button, it puts the computer to sleep. I haven't noticed anything other than the trackpad not turning off, but I know how to disable that, so not too worried. Has anyone experienced this issue and if so, how did you fix it?

This worked for my C50-B-14Z :

Step 1: Changing GRUB (using leafpad or gedit or whatever....)

1. Edit the grub configuration file:
Code:
gksu leafpad /etc/default/grub

2. Add the paramater to the line:GRUB_CMDLINE_LINUX=""...so that it reads:
Code:
GRUB_CMDLINE_LINUX="acpi_backlight=vendor"

3. Save the file.

4. Update grub with the changes:
Code:
sudo update-grub

Step 2: Make file "70-keyboard.hwdb" in /etc/udev/hwdb.d/

1. gksu leafpad /etc/udev/hwdb.d/70-keyboard.hwdb

2. Fill the file with (Exactly!) this: (Satellite.............wlan)

Satellite C50-B
keyboard:name:Toshiba input device:dmi:bvn*:bvr*:bd*:svnTOSHIBA*:pnSATELLITEC50-B:pvr
 KEYBOARD_KEY_13c=brightnessdown
 KEYBOARD_KEY_13d=brightnessup
 KEYBOARD_KEY_13e=switchvideomode
 KEYBOARD_KEY_13f=f21                                   # Touchpad toggle
 KEYBOARD_KEY_158=wlan

3. Save the file.

4. Update the file
Code:
sudo udevadm hwdb --update

5. Reboot & Done

Depends on kernel, but on mine I have to set brightness from the power management panel [KDE].  It isn't a problem once set.


How do I compress a directory? I'm trying to compress a directory and ftp it to a windows ftp.

I have tried every tar command I can find to compress a directory. It appears to be ok. Then I transfer it and view it's contents using Winrar. Winrar keeps telling me the file is corrupted. I have viewed other .gz or .bz2 files using winrar but for some odd reason I can't get it to work.

I would prefer just to have it zip the files so they have a .zip extension but even then when i try to browse it's contents both windows and winrar claim it's corrupt.

Does anyone else have a suggestion as to something else to try?

Well, most probably your files are perfectly fine before FTP transmission.

Unfortunately, probably you are transferring your files using wrong FTP mode.

FTP do have two modes: binary and ASCII. By default most clients use ASCII mode, which breaks your binary files completely. I don't know which FTP client you are using, but for example in ncftp you can use command "binary" to switch to binary mode.

If you want to create ZIP files using Ubuntu (or almost any other Linux), use zip. You can install it to Ubuntu by running

sudo apt-get install zip

Then you can create zip file by running

zip -r compressed_filename.zip foldername

On related note, you should know that FTP is insecure transmission protocol. Consider switching to sftp, for example. There is many free ssh servers for Windows, including minimal OpenSSH port.

Compression of directories, using parallel compression is an efficient way to save time.
pbzip2 can help you getting directories compressed.

tar cf <outputfile_name> --use-compress-prog=pbzip2 <directory_name>


Ubuntu doesn't detect second monitor After a fresh ubuntu install I had some problems with the mouse flickering and disappearing. I intalled the AMD drivers from AMD's website but after restart I got a graphics error so had to remove the installed drivers. After that I installed the radeon drivers so I was able to get my screen back up. The mouse is stopped flickering but my second monitor is not detected by ubuntu.

I tried to debug this but found no solution.

lshw -c video:

01:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc.
[AMD/ATI] Pitcairn PRO [Radeon HD 7850] [1002:6819]

sudo lshw -c video:

  *-display
       description: VGA compatible controller
       product: Pitcairn PRO [Radeon HD 7850]
       vendor: Advanced Micro Devices, Inc. [AMD/ATI]
       physical id: 0
       bus info: pci@0000:01:00.0
       version: 00
       width: 64 bits
       clock: 33MHz
       capabilities: pm pciexpress msi vga_controller bus_master cap_list rom
       configuration: driver=fglrx_pci latency=0
       resources: irq:48 memory:e0000000-efffffff memory:f7c00000-f7c3ffff ioport:e000(size=256) memory:f7c40000-f7c5ffff
  *-display
       description: Display controller
       product: Xeon E3-1200 v2/3rd Gen Core processor Graphics Controller
       vendor: Intel Corporation
       physical id: 2
       bus info: pci@0000:00:02.0
       version: 09
       width: 64 bits
       clock: 33MHz
       capabilities: msi pm bus_master cap_list
       configuration: driver=i915 latency=0
       resources: irq:47 memory:f7800000-f7bfffff memory:d0000000-dfffffff ioport:f000(size=64)

xrandr:

Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 16384 x 16384
DFP1 disconnected (normal left inverted right x axis y axis)
DFP2 disconnected (normal left inverted right x axis y axis)
DFP3 disconnected (normal left inverted right x axis y axis)
DFP4 disconnected (normal left inverted right x axis y axis)
DFP5 disconnected (normal left inverted right x axis y axis)
DFP6 disconnected (normal left inverted right x axis y axis)
DFP7 disconnected (normal left inverted right x axis y axis)
CRT1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 598mm x 336mm
   1920x1080      60.0*+
   1680x1050      60.0
   1400x1050      60.0
   1600x900       60.0
   1360x1024      60.0
   1280x1024      75.0     60.0
   1440x900       59.9
   1280x960       75.0     60.0
   1280x900       75.0     60.0
   1360x768       59.9
   1280x800       59.8
   1152x864       60.0     75.0
   1280x768       59.8
   1280x720       60.0
   1024x768       75.0     70.1     60.0
   800x600        72.2     75.0     60.3     56.2
   640x480        72.8     75.0     67.0     59.9

I'm a total beginner on desktop ubuntu, used linux only for hosting. I have a i7-3770 processor and Radeon HD 7850 VGA.

You will probably need to mess around with your xorg.conf file.

However, you have 2 different GPUs by the look of it. Of course, you won't manage to use 2 X Screens, and for me Xinerama didn't work.

I got mine to work (1 screen on each GPU) by not specicifically referencing the second GPU. I (however) am using 2 nVidia GTS 450s, and 2 identical screens, so you may struggle with that method.

Here is what you need for an xorg.conf file:

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0" 0 0
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
    Option         "Xinerama" "0"
EndSection

This sets up the layout. Note how we only have 1 screen (with the location 0,0) and Xinerama is disabled (set to "0").

Section "InputDevice"

    # generated from default
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/psaux"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"

    # generated from default
    Identifier     "Keyboard0"
    Driver         "kbd"
EndSection

This is the section for your mouse and keyboard. Your xorg.conf file (if it exists) should already have this. If not, just use this. It should work, as this seems to be a default.

Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "Acer S220HQL"
    HorizSync       31.0 - 82.0
    VertRefresh     56.0 - 76.0
    Option         "DPMS"
EndSection

The monitor section is likely to be different for you - keep the name the same, and leave DPMS alone, but the Name and the HorizSync / VertRefresh will probably be different for you.

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce 450 GTS"
    BusID          "PCI:1:0:0"
EndSection

Now I tell it my GPU exists. This may be the issue for you, and I think(?) your GPUs are different. Anyway, the key for me was only to tell it that there is one GPU.

Section "Screen"

    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "Stereo" "0"
    Option         "nvidiaXineramaInfoOrder" "CRT-0"
    Option         "metamodes" "GPU-56281125-01c7-ee85-b8b9-b3e5cf94b7c5.GPU-0.DVI-I-0: 1920x1080 +0+180, GPU-cbc59e3f-e8c1-a347-a069-b62f6b885f7d.GPU-1.DVI-I-0: 1920x1080 +1680+180"
    Option         "MultiGPU" "Off"
    Option         "SLI" "off"
    Option         "BaseMosaic" "on"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

Finally, the screen section. This is where the second GPU appears. I don't know what the 56281125-01c7-ee85-b8b9-b3e5cf94b7c5 means, and this may just be a name. The 1920x1080 is your screen resolution, and the +1680+180 is really confusing, but essentially positions it. Why it's 1680 I don't know.

MultiGPU is off, as is SLI, but BaseMosaic is on. I guess the Depth is the colour depth.

I've stuck this all together in a paste bin, here for you.

I'm afraid I do most things in the GUI, and not the CLI, where possible, but here is how I solved a similar problem.

Firstly plug in and switch on the monitor (as I'm sure you're doing,
but the order is important).
Open the Application 'Screen Display'
Press the button 'Detect Displays'
From there your second monitor should be ready for use, and it is just a matter of setting it up to suit your requirements.  I searched for how to do this here in ask Ubuntu and ended up using Compiz Manager to force applications to the second screen using a keyboard short-cut.


Graphical glitches in chromium-based apps Since yesterday I have been experiencing annoying graphical glitches in all chromium based applications - atom, popcorn-time and chrome itself. Here are the screenshots:

atom:

popcorn-time:

How can I get rid of them?

It turned out that problem solves by restarting computer. Thanks anyway guys.


Alternate Installing Ubuntu 12.04 on new Vaio svz (RAID0) I am attempting to install Ubuntu 12.04 LTS 64-bit on my brand new Vaio SVZ laptop. I am using alternate installer, since the machine has a RAID0 SSD (fake raid?).

After activating ATA RAID, Partition Disks step show correct Windows 7 partitions, and some free space I have produced in Windows 7 partition tool for Linux, as follows:

Serial ATA RAID isw_cagi....Volume0 (stripe) - 512 GB Linux device-mapper (strip
#1 primary   22.1 GB       ntfs
#2 primary  367.0 MB  B    ntfs
#3 primary  355.2 GB       ntfs
   logical  125.8 GB       FREE SPACE
#5 logical    8.6 GB

I then create /boot, / and swap space, resulting in:

#1 primary   22.1 GB       ntfs
#2 primary  367.0 MB  B    ntfs
#3 primary  355.2 GB       ntfs
#6 logical  499.9 MB     F ext4      /boot
#7 logical  121.0 GB     F ext4      /
#8 logical    4.2 GB     F swap      swap
   logical  325.2 MB       FREE SPACE
#5 logical    8.6 GB

After that, installer goes into "Installing the base system", "Configure the package manager", without problems. When it gets to "Select and install software", it reports "Installation step failed". Even though there is the option of skipping it, I am not sure this is a good idea.

BTW, I was intending on directing installation of GRUB boot loader on a separate partition, but don't want to proceed skipping the failed step.

Interesting thing is that after I abort, and come back again to re-try installation, the partition tool sees:

#1 primary   22.1 GB       ntfs
#2 primary  367.0 MB  B    ntfs
#3 primary  355.2 GB       ntfs
#6 logical  499.9 MB     F ext4      (Use as: do not use; no mounting point)
#7 logical  121.0 GB     F ext4      (Use as: do not use; no mounting point)
#8 logical    4.2 GB     F swap      swap (Use as: swap area)
   logical  325.2 MB       FREE SPACE
#5 logical    8.6 GB

That is, /boot and / root partition are marked as "do not use"; only swap partition remains as it was created.

Can somebody help me getting through the installation process?

A system disk can have a maximum of 5 partitions, 1 boot and 4 other.

On the SVZ with Windows you have one recovery (that I recommend you keep), one boot, one windows, leaving space for two partitions. (incl. any linux partitions). Hibernate uses one partition also - which means there's room for only one more. To top it off, you can have a maximum of three primary partitions.

If your going to install linux on the SVZ I recommend the following:

-Keep your vaio recovery partition
-Remove your hibernate/rapid wake partition and function and allocate enough space here for linux (20GB or whatever you need)

When installing Linux you stick with only one partition, the root (/) partition. Thus not having a separate swap partition (you can add a swap file to the root (/) if you need swap. Your /home will be a folder on the root (/) partition.

When partitioning the drive, write down the mapper-name of the raid-disk (isw_xxxxxx_xxxx) as you'll need that information later when setting up the GRUB bootloader.

When you get to the GRUB installation, install it under /dev/mapper/isw_xxxxxxxx_xxxx

Good luck!


SNAP leaves behind some references after removal of NMAP package, causing APT version of NMAP not to be found To test I first installed NMAP on my Ubuntu 20.04 using a snap, but that version gave a dnet error (Failed to open device enp1s0), so I removed the snap package and installed the native version with apt instead.
The apt version works fine if I include the full path, but if I run nmap without the full path I get:
-bash: /snap/bin/nmap: No such file or directory
(Note the /snap/bin/ path...)
How do I remove that reference, so that it can find the nmap installed in /usr/bin?
(I tried searching the Internet with DDG, but there are either NO hits or TOO MANY, depending on the search keywords used!)
Because user535733 (great username, BTW!) asked for it, the information [s]he asked for:
# snap list nmap
error: no matching snaps installed
# snap remove nmap
snap "nmap" is not installed

Removed SNAPD from my host. Don't need it, don't want it, problem gone!


Ubuntu 13.04 : no sound I have recently installed Ubuntu 13.04,  my headset/earplug isn't working on it, sound is produced only through speakers.

What should I do ? I need to make the earphones work. Thanks.

Here is the output of my alsa-info.sh:

http://pastebin.com/hSznC2QA

And here is the output of my alsamixer:

Depending on where your pulse audio config is you should try removing it and checking if it automatically reconfigures correctly.

I'm on 13.10 so you'd need to do

# cd ~/.config/
# mv pulse/ pulse.bak/

Restart your system and Ubuntu will recreate the pulse config. Test and see if it's working now.

This fixed some issues I was having.

Try configuring System Settings ==> Sound ==> Output
choose headphones.


How exclude folders for remove when using ( rm -rf *) on the parent dir i run the following command line to remove all files/dirs in directory :

       cd /home/abdennour/android/

       rm -rf *

the architecture of this directory is as following :

   /home/abdennour/android/
   /home/abdennour/android/documents/
   /home/abdennour/android/documents/medialib/
   /home/abdennour/android/documents/preview/
   /home/abdennour/android/fixtures/
   /home/abdennour/android/images/
   /home/abdennour/android/images/hard/
   /home/abdennour/android/images/mlibrary/
   /home/abdennour/android/images/mlibrary/thumbs/
   /home/abdennour/android/js/
  .....

i want to remove all with excluding the following directories :

  /home/abdennour/android/documents/
  /home/abdennour/android/images/mlibrary/

You can use GLOBIGNORE environment variable. Suppose that you want to delete everithing except /home/abdennour/android/documents/ and /home/abdennour/android/images/mlibrary/, then you can do the following:

cd /home/abdennour/android/
export GLOBIGNORE="documents:images"
rm -rf *
cd images
export GLOBIGNORE="mlibrary"
rm -rf *
export GLOBIGNORE=""

As the list of those dirs you don't want to remove is pretty short and it doesn't seem to fit any obvious pattern, I think you will just have to move those dirs somewhere prior to deleting the rest.


Making a password avaible during fixed time intervals I would like to store and encrypt a password that I can access only during specific time intervals, such as after 9 pm. (The reason being that I force myself to stick to behavioural commitments, enforced by password-protected anti-procrastination software.)

An online solution is available at lockbox.pluckeye.net, but I would like to store the password locally or in a Dropbox, in case the service is discontinued.

I would appreciate any methods/software tips!

What you describe involves a chicken & egg problem. Using encryption, how would you encrypt your password such that it can only be decrypted with information that is not available in the present? If you don't know that information until a time in the future, you can't encrypt your password now.

The simplest option it probably just to give that password to someone you trust and make them promise they will not give it back to you until the time that you specify. Better yet, have them create the password so that you don't have access to it to begin with. If you don't completely trust the other person, you could type the first half of the passphrase and have them type the second half. If neither of you reveals his/her portion of the password to the other, neither of you would be able to access the service without the other's help.

Other solutions I can think of would involve setting up a service like this of your own and then locking yourself out of it. You could set up a server that will tell you the password only when queried at pre-defined times. Then turn administrative access over to another person or lock yourself out so that you are unable to break in and obtain your password anytime you want it.

If you just want a simple script that would accomplish this on the fly, try something like the following script. Just realize that if the script is somehow terminated, your password is lost forever if you don't have a copy somewhere else that is inconvenient to access like a safe deposit box or entrusted with a friend.

#!/bin/bash

echo "Nothing will be displayed as you type"
read -sp "Password to store: " pwd && echo
while :
do
    read -p "What time should I reveal the password: " time
    date -d "$time" && break
    echo "Invalid time format. Try again"
done
echo "Please destroy all records of your password now. Except for one copy that you will not have convenient access to."

unlockTime=$(date -d "$time" +%s)
now=$(date +%s)

timeout=$((unlockTime - now))
sleep $timeout && echo "Your password: $pwd" || echo "Shame on you for killing sleep. No password for you!"

This script will prompt you for the password and a time at which to reveal it. Then it will keep the password concealed "safely" in RAM (don't let the script die) until the time you specified. If you are brazen enough to kill the sleep command, this script will terminate without revealing the password! Simply copy the script text above into a plaintext file saved with a .sh extension, make it executable, and run it from a terminal window.


Error while installing unity-tweak-tool on Ubuntu 14.04 sudo apt-get install unity-tweak-tool

results in

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  account-plugin-windows-live libupstart1 linux-headers-3.16.0-30
  linux-headers-3.16.0-30-generic linux-image-3.16.0-30-generic
  linux-image-extra-3.16.0-30-generic
Use 'apt-get autoremove' to remove them.
The following NEW packages will be installed:
  unity-tweak-tool
0 upgraded, 1 newly installed, 0 to remove and 15 not upgraded.
Need to get 0 B/333 kB of archives.
After this operation, 2,610 kB of additional disk space will be used.
Selecting previously unselected package unity-tweak-tool.
dpkg: unrecoverable fatal error, aborting:
 reading files list for package 'texlive-fonts-recommended': Input/output error
E: Sub-process /usr/bin/dpkg returned an error code (2)

before doing this I used this command.

sudo -E apt-add-repository ppa:izx/askubuntu -y

sudo apt-get update results in this error

W: Failed to fetch http://ppa.launchpad.net/izx/askubuntu/ubuntu/dists/trusty/main/binary-i386/Packages  404  Not Found

E: Some index files failed to download. They have been ignored, or old ones used instead.

Edit1: I tried to install other packages but that dpkg error keeps showing up.

This is reiterating what the first two replies said,  but I've added a few extra steps along with why you're  doing them.

First run

 uname - r

to find what kernel version you're using.  As the update is reporting that you have an older kernel installed that is no longer required.

The first two listed are programs you no longer need - these can be safely removed, they'll be reinstalled later if they are in fact needed.

Let me repeat,  IF, AND ONLY IF,  your computer is giving you no problems run 'sudo apt-get autoremove'

The PPA error is saying that either you mistyped the address for the PPA or that the PPA no longer exists. As previously reported,  its nit for your version,  remive it.

This error can be ignored for the moment, more on this later.

In other words perform the following steps:

uname - r
sudo apt-get autoremove
sudo apt-get autoclean
sudo apt-get install --fix-missing
sudo apt-get update && sudo apt-get upgrade
sudo apt-get dist-upgrade
sudo apt-get install unity-tweak-tool

My original post had a few more steps until I saw that the PPA is not for Trusty.


Install Xubuntu to SD card via USB memory stick I would like to install Xubuntu. I have a 2 Gb USB stick and it works fine every time I try Xubuntu in live mode.
My plan is to install it on an SD card with 32 Gb capacity.

I do not want to do partitioning on my current hard disk, I am not the only user of the computer. We have no external or portable hard disk.

I will try Xubuntu in live mode and install it on the SD card without modifying any portion of the current hard disk (now with Windows 7).

Will my plan work? I do not know if it will affect any content on our Windows 7 or any portion of the boot manager.

Yes. This can be done provided you proceed with caution. The grub bootloader doesn't have to be installed on the same drive as your Windows installation.  I do similar things with USB sticks often. If your BIOS supports booting from SDcard it's a standard installation, if not, there's a tutorial on how to do exactly what you have in mind here.

That is not a very good idea.. Once you install any version of Ubuntu or Xubuntu, it creates and manages the GRUB loader, which stores all the information about the booting point of both Windows and your current distro. If anything should go wrong, you might have to repair Windows for recovering the bootloader for Windows.


Install Doom Editing Tools i'm working in a wad for doom and i need an editor , a zdoom based source port and a ubuntu version of slade...

I have windows but slade has a problem on it and the OS itself hangs...

Searching did not give me any useful result...

Can anyone help me with this ?

well , if someone doesn't know what is doom (which i don't think so) see Doom Page on Wikia

I use both Slade and Eureka on Ubuntu 18.04.
The current Eureka supports (G)ZDoom features, including rendering of 3D floors and slopes. The 3D mode displays both of these correctly. It does not support UDMF however. It will allow you to write ACS scrpts, but NOT compile them. For this I use Slade. Slade is better for resource editing but does also have a map editor, but this does not display 3d floors. Slade does however compile ACS scripts as long as a BSP builder is configured.

Found the way :

Compile SLADE on ubuntu

Compile ZDoom on Linux


Ubuntu GNOME live not loading properly on MacBook Pro Before installing Ubuntu gnome 17.04 on a MacBook Pro (mid 2012), I wanted to try the live version from a USB stick.

The problem here is that after the system loads, I just see the default gnome wallpaper, without the top bar or anything else. Also, if I press  I don't see the window modifier with all the apps, but rather only the vignetted background image. If I suspend the laptop by pressing the power button and resume it, I see the lock screen without date and time.

Loading the system with nomodeset option also seems not to solve anything, as the system will then hang during boot.

What can I do?

I learned about the gpt kernel option from the guide below.  There is an open source, but paid for binaries system available called Mac Linux USB Loader at https://www.sevenbits.io/mlul/ .  It can help you generate the live USB stick, and gives you some easy kernel modifications on boot.  I'm sure you can do this directly off the default installer too, but I'm not sure exactly how.

It works for the live boot from a USB stick for me (both for Ubuntu GNOME and regular Ubuntu).  For some reason, I haven't been able to get the install that I do using Ubuntu GNOME to work, but the install from regular Ubuntu DOES work.  I've been experimenting with getting GNOME to install after getting the initial system up and running, but so far I keep getting a black screen after rebooting once I've installed ubuntu-gnome-desktop.

The guide I mentioned lead me to the Mac Linux USB Loader is here: https://medium.com/@racter/how-to-install-ubuntu-16-04-on-a-retina-macbook-11-2-74e7779c0e47 .


How can I make a shortcut to close all the windows of the same application? When I right click on an application's icon in the Unity launcher, I can press Quit to close all the windows corresponding to that application. Is it possible to do the same with a keyboard shortcut which operates on the active window (and all the other windows corresponding to the same application)?

I could do something similar with xkill, but in that case I do not have the message that remembers me of unsaved files.

How to safely close all windows of a gui application with a shortcut key

The safest way to close an application's window gracefully, and make sure you will not lose data, is using wmctrl (not installed by default):

wmctrl -ic <window_id>

To use it in a script to close all windows of an application:

install both xdotool and wmctrl

sudo apt-get install wmctrl xdotool

Copy the script below into an empty file, save it as stop_active.py

#!/usr/bin/env python3
import subprocess

def get(cmd):
    return subprocess.check_output(cmd).decode("utf-8").strip()

pid = get(["xdotool", "getactivewindow", "getwindowpid"])
for w in get(["wmctrl", "-lp"]).splitlines():
    if pid in w and not "Desktop" in w:
        subprocess.call(["wmctrl", "-ic", w.split()[0]])

Add the following command to a shortcut key:

python3 /path/to/stop_active.py

Choose: System Settings > "Keyboard" > "Shortcuts" > "Custom Shortcuts". Click the "+" and add the command:

python3 /path/to/stop_active.py

N.B. don't use ~ or $HOME in a shortcut key, but use absolute paths instead.

Now the shortcut can be used to gracefully close all windows of the frontmost window.

Explanation

I tried the various kill options (kill -2, kill -HUP, kill -s TERM <pid> etc), which are mentioned in several posts to close an application gracefully. Tested on a gedit window with unsaved changes, all of them closed the window happily however, without any interaction.

wmctrl does ask what to do however, similar to Ctrl+Q.

The script then first finds out the pid of the frontmost window, with the command:

xdotool getactivewindow getwindowpid

subsequently, the list of currently opened windows is called with the command:

wmctrl -lp

From this list, the corresponding windows are picked and closed with the command:

wmctrl -ic <window_id>

Note

If you are closing all nautilus windows, in the line

if pid in w and not "Desktop" in w:

"Desktop" is referring to your Desktop window, which normally should always stay. If you are not using an English version of Ubuntu, replace "Desktop" by the localized name of the Desktop in your language.

You could create a shortcut for xkill.

settings < keyboard < shortcuts < custom shortcuts

Add a custom shortcut, then simply write "xkill" in the command menu and set your own shortcut by pressing the keys you want.

Like you said that doesn't give you a "saved unsaved files" message though.


Webcam not recognized on my Sony Vaio VGN-CR363 laptop when I open Cheese it says No device found.

and i've also tried changing the gstreamer properties

my lsusb http://pastebin.com/BX6B4Wpe

my lspci http://pastebin.com/FZmseTST

i've also tried ricoh drivers..but i'm not sure whether i installed them correctly...

Follow the instructions in this ppa: https://launchpad.net/~r5u87x-loader/+archive/ppa

It should work with your webcam.

When I installed cheese on my bodhi 2.4 on my sony vaio vgn-cr353.  Cheese said 'no device found'. I ran the following commands in the terminal:

sudo add-apt-repository ppa:r5u87x-loader/ppa
sudo apt-get update
sudo apt-get install r5u87x
sudo /usr/share/r5u87x/r5u87x-download-firmware.sh

Cheese started working after that.  Hope this helps someone.


How to type "ç" when using USA intl as the keyboard layout? I asked the same question when I used Maverick Meerkat but I can't make that solutions work on Unity. I want to use the keys ´ followed by c and the output should be "ç". It works that way in Windows out of the box, and it did work in Ubuntu 10.10 following the solutions given in the question above. But in 11.04 it outputs "ć". How to change that?

Edit /usr/lib/gtk-2.0/2.10.0/gtk.immodules
Modify the line where you can find "cedilla" add ":en" at the end

"cedilla" "Cedilla" "gtk20" "/usr/share/locale" "az:ca:co:fr:gv:oc:pt:sq:tr:wa:en"

Edit /etc/environment
Add: export GTK_IM_MODULE=cedilla

Edit for Ubuntu 12.10: (according to the other answer by Hoerlle)

the gtk.immodule file is located at:

/usr/lib/x86_64-linux-gnu/gtk-2.0/2.10.0/gtk.immodules

or

/usr/lib/i386-linux-gnu/gtk-2.0/2.10.0/gtk.immodules

For KDE and other applications that are not GTK:
Edit: /usr/share/X11/locale/en_US.UTF-8/Compose

Find all ocorrencies for ć and replace it all for ç, remember to look for the the uppercase matches too Ć and Ç

You may need to restart your gnome.

EDIT:
If all you want is to change the ç and not the others consonant accented keys that comes with US-international layout from Linux:

Create a file named .XCompose
Put in the beginning of the file include "%L" this will import the original configuration of /usr/share/X11/locale/en_US.UTF-8/Compose
Then add those lines :

< dead_acute>< C> : "Ç"
< dead_acute>< c> : "ç" without the spaces inside the < >

Save your file in ~/ directory

Reboot

===========================================================================
But if you want your keyboard act like US-international from Windows :
For everyone that wanted that US-international keyboard like Windows.
There is a github repo that can make this work: https://github.com/raelgc/win_us_intl Here what you want to do:

download the zip file

extract wherever you want, your focus should be on the XCompose file.

Open the XCompose file with your preferred text editor, and then put bellow include "/usr/share/X11/locale/en_US.UTF-8/Compose" a line like this: include "%L"

Move the XCompose file to the ~/ directory

Reboot


Ubuntu got uninstalled automatically I installed Ubuntu 17.04 along with Windows 10 in my Lenovo ideapad and it was working great until today.

During the normal reboot procedure to get into the Ubuntu OS, 'system tools', the last option in the list, was selected by mistake; apparently there is some problem with the down-arrow key of my keypad. When the BIOS screen appeared, no tab was available to quit from the appeared screen. So, as it was written 'Click enter to go to set up', by mistake, I clicked ENTER and alas my screen was booted to Windows and I can't go back to my Ubuntu partition any more.

Any help to get back to Ubuntu will be appreciated. I spent some three days to complete the installations of necessary languages in it. I wanna retrieve them back without any loss of information.

The Boot-info can be viewed here.

Thank you.

Make a live flash drive, and install boot repair on it and follow the instructions.

sudo apt-add-repository ppa:yannubuntu/boot-repair

sudo apt-get update

sudo apt-get install -y boot-repair

boot-repair

You can get more details at: https://www.howtogeek.com/114884/how-to-repair-grub2-when-ubuntu-wont-boot/


Is there any way to open more than one folders(Home folder, videps etc..) by clicking the 'files' icon on the unity bar? Why only one nautilus window manager is opens when clicking on the 'Files' icon on the unity bar? I need to open two or more HomeFolder windows by clicking on the 'files' icon on the unity pane. I cannot create more than one nautilus window manager unless i tap superkey(windows key) and type homefolder,videos etc or typing the same in gnome-do. Is there any way to open more than one folders(Home folder, videos etc..) by clicking the 'files' icon on the unity bar??

Use the middle mouse button to open a second instance of an application.

Or hold the shift-key while clicking with the left mouse button.

Use Ctrl+N in the first Nautilus (aka Files) window.


How can I search the internet via unity dash? I would like the option to be able to search the internet in directly in unity. Much like the calculator package works, just adding numbers in and having it compute, I would like to be able to type in a word or phrase, and have an option to search Google for it.

Sorry if this has already been asked, but I can find nothing other than "Web Sources" but it really is not what I am looking for. Is this already an idea for a lens?

Install the DuckDuckGo Unity Lens !
I think it is perfectly what you are searching for. You will get three scopes: Results, Related Searches and Related Topics.

To install it, type the following commands in a terminal:

sudo add-apt-repository ppa:w-vollprecht/ppa
sudo apt-get update
sudo apt-get install duckduckgo-lens

More details on http://www.iloveubuntu.net/unity-duckduckgo-lens-released-ppa-available

'starting from first principles ..' - Marcus Aurelius

What do you need?

Starting with a small Firefox browser window, already open, with the 'search box' at top right.  You need somewhere to type the search query (and/or select which provider) and somewhere to see the results.  This describes a browser.

Are your needs somehow different?


problems with logging in Just updated  to 14.04 through the software updates. Restarted my computer because everything was crashing, and now I cant log in. It sees my password and accepts it. But just doesnt open. What do I do.the details are. At the log In prompt I type my password and get failed to start session note. Everything I can see works like it should, but no matter what I do it wont open fully. I have gone to recovery and cleaned, repaired, updated,and checked the os. And the only thing I have found out of place is durring init. Start up. A file reading "starting reload cups, upon starting avahi-daemon to make sure the remote queues are populated" shows a fail.

O.k. ill answer my own question here. first of all if there is a pop up for failure to start session. what it means is you havent finished the upgrade process yet. also you will need a constant and good internet connection, I recommend using a wifi connection that has already been set up on the computer or it wont be knoticed, and it cant be the sort that needs you to accept like starbucks. also as for code and tricks read all of whats on here some will work others wont. but you will have to make your own salad from the bar. I had to install gnome and then install desktop through the root.


My internet is very slow and freezes-unfreezes-freezes-unfreezes (16.04) I'm wondering if there's a command I can write in Terminal to search for and update any outdated things (like network drivers, adapters, etc)?

I have a Lenovo ideapad. When it ran Windows 7, the Internet was perfect.

Output of lspci -knn | grep Net -A2:

03:00.0 Network controller [0280]: Intel Corporation Centrino Wireless-N 2200 [8086:0891] (rev c4)
Subsystem: Intel Corporation Centrino Wireless-N 2200 BGN [8086:4222]
Kernel driver in use: iwlwifi

I believe you're asking about: How do I determine if my drivers are up-to-date on Ubuntu.

For starters, you should post the results of lshw -short and nano /etc/os-release to provide hardware and OS information about your current build.

Now, assuming I interpreted your question correctly, the first thing you want to do is make sure your applications are up to date, so run the following:

sudo apt-get update

sudo apt-get autoremove

Once done here, click on your Unity Dash and search for checkbox, run the tests within this application. This will perform some automated tests (along with tests requiring user input).

Just a side note: Refer to Rmano's answer here about how Linux uses generic drivers.

Now as for the software side of things, if you're still under the impression there are delays, try another browser and see if it software related. To begin testing I would recommend is installing nethogs and bmon and do some investigation, are there applications that seem to be over-utilizing the network card? If you need a GUI to assist, try etherape.

Here is the community fix to an issue relating to yours:

Fix the bug in Debian Avahi-daemon

The slow WiFi in Ubuntu problem could also be related to a bug in Avahi-daemon of Debian. Ubuntu and many other Linux distribution are based on Ubuntu so this bug propagates to several Linux distributions. To fix this bug, you have to edit the nsswitch configuration file. Open a terminal and use the following command:

sudo gedit /etc/nsswitch.conf

This will open the configuration file in gedit so that you could edit it easily in GUI. In here, look for the following line:

hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4

If you find this file, replace it with the following line:

hosts: files dns

Now restart the PC and see if the speed improves.

Here are some links to questions that relate to this issue:

Ubuntu Wireless slow
Very slow internet on Ethernet
Internet Slow on Ubuntu 14.04

If this has not assisted, view the article here on "how to speed up internet"

Answer by the OP
sudo tee /proc/sys/net/ipv6/conf/all/disable_ipv6 <<<"1"

in Terminal has made my Internet super fast now. I don't understand why it worked, but I guess all I need is that it works.


Dualboot - replace Linux Mint with Ubuntu without cd and usb I have dualboot(Windows 10, Mint 18.) I want replace Linux Mint to Ubuntu 17.10 because performance in Mint isn't satisficing me. I can't do it with CD or USB because i don't have it. Is there any safe method to do it?

I have two Windows partitions and three Linux (System (10GB), Home(20GB), Swap(8GB))

What you can do without losing your home files is that you can do a install from the live cd and start it as normal. When it gets to the installation type screen, select 'Something Else', then click 'next'. You then select your linux mint system drive and click on 'Change'. You make sure it is the same file system, make sure the mount point is '/' and make sure there is a tick in the box next to 'Format the partition' then click on 'OK'. For your home folder, select that drive, make sure it is the same file system, set the mount point as '/home' and leave the box next to 'Format this partition' UNCHECKED. Then click on 'OK' then continue onto the rest of the installation. Whenit gets to the user creation screen, just make sure you have THE EXACT SAME LOGIN USERNAME AND PASSWORD as before. Then you will not lose any personal files whilst you are moving to Ubuntu or to any other Linux Distro. No need to shrink partitions, or setup a triple boot or a VM like your other replies that you got.


Ubuntu gui taskbar and launchbar icons disappear, then eventually crash Ubuntu 17.04, I've been having an issue where:

I'll be doing normal stuff (web browsing with a few tabs)
I notice that the taskbar icons (battery life, bluetooth, volume) have been replaced with a grey "post-it note" icon (default or missing icon).
At the same time, the launchbar icons (chrome, "files", terminal") disappear completely.

The computer usually keeps working for a few minutes, then crashes. On restart, everything works again.

Some probably-related information:

I recently updated to Ubuntu 17.04
I also recently enabled CUDA on my GPU.
I am seeing similar symptoms as in this question. I'm not sure if it is exactly the same error code, but it is showing "[hardware errors]" for a brief moment when starting up. I'm having trouble getting a photo of exactly what the error is.

Any help, or where to look, would be much appreciated.

Thank you!

Edit: After the errors begin, I have observed the following other symptoms before it crashes:

From vim, when I try to write I get error 212, "Can't open file for writing".
cd works but ls does not. The error when I try to ls is something along the lines of "/bin/ls: cannot execute binary file".

Perhaps your hard drive/flash drive is failing and it unmounts/becomes inaccessible for whatever reason. I know that if you unplug the media that the system is running on, your system will either freeze up, or tell you that it can't read from the OS media and stop working.

The problems could also arise if the system is too new, for Ubuntu uses an old stable kernel. try installing the mainline kernel and then tell me if it works. or, try reinstalling Ubuntu, as maybe your installation medium was corrupted, or maybe it didn't install properly. the issue could ALSO be a graphics problem. try disabling that graphics driver you said you installed.


How to easily remove old kernels in Ubuntu 20.04 LTS? I have old Linux kernel versions that I don't use so I was trying to remove them.
List of installed kernels from dpkg --list | grep linux-image
linux-image-5.4.0-26-generic (5.4.0-26.30)
linux-image-5.4.0-33-generic (5.4.0-33.37)
linux-image-5.4.0-37-generic (5.4.0-37.41)

Here are the steps to remove unused kernels.
Check what current kernel You run:
uname -a
Linux blackhole 5.6.13-050613-lowlatency #202005141310 SMP PREEMPT Thu May 14 13:17:41 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

I am running 5.6.13-050613-lowlatency
List all installed kernels in Your OS:
dpkg --list | egrep -i --color 'linux-image|linux-headers|linux-modules' | awk '{ print $2 }'
linux-headers-5.6.11-050611
linux-headers-5.6.11-050611-lowlatency
linux-headers-5.6.13-050613
linux-headers-5.6.13-050613-lowlatency
linux-image-unsigned-5.6.11-050611-lowlatency
linux-image-unsigned-5.6.13-050613-lowlatency
linux-modules-5.6.11-050611-lowlatency
linux-modules-5.6.13-050613-lowlatency

Uninstall kernels You don't need:
sudo apt purge linux-headers-5.6.11-050611  linux-headers-5.6.11-050611-lowlatency linux-image-unsigned-5.6.11-050611-lowlatency linux-modules-5.6.11-050611-lowlatency

I wanted to delete 5.4.0-26 kernel, and tried apt, but apt is getting bad at doing things, unlike in 18.04, where apt purge of the kernel version used to delete all the related packages.
But apt-get still does it great.
sudo apt-get purge <older_linux_version_number>

Example: sudo apt-get purge 5.4.0-26
and if you are so very sure of deleting the old kernel and its related packages, then say yes, using -y
sudo apt-get purge <older_linux_version_number> -y

Example: sudo apt-get purge 5.4.0-26 -y
you can delete multiple such old kernels in one go, just by passing multiple kernel versions separated by space.
sudo apt-get purge <older_linux_version1> <older_linux_version2> <older_linux_version3> -y

Example: sudo apt-get purge 5.4.0-26 5.4.0-28 5.4.0-32


Change default installation directory for a program I use a Asus EEE PC 901 with one 4GB SSD and one 8GB SSD with an installed Ubuntu Netbook Remix 10.04.
Because the 4GB SSD is much faster then the 8GB SSD, I installed UNR on the 4 GB SSD and mounted the 8 GB SSD to the home directory.
But now my space is very limited.

Thats the reason why I want to know how I can change the installation path of a program.

Apps tend to install themselves to several different places in the filesystem, it's generally not straightforward to install them somewhere other than the default (although though some will work fine if you shift them.

4GB should be enough for an Ubuntu install, assuming user data is not on the same partition. In the meantime it might be worth having a cleanup. Ditching old kernels will create 100MB of space per kernel, so that's a quick way to free a lot of space.

You seem to know what you want placed where. If so, at the cost of re-installation, why not simply repartition your SSDs, then place your various directories where you want them?

On a netbook, always consider using RAM disk for temporary stuff eg /tmp.


Which version is recommended for my system? my system specifications are:
Compaq Presario model
CPU: Intel Celeron(R) CPU 2.93GHz
Speed and Memory: 2.95GHz, 632 MB of RAM
hard disc: 40 GB

Use 32Bit of recent Lubuntu or maybe Xubuntu (consume a little more ressources).

Your system does not support 64Bit.

Try: Ubuntu 10.04, 10.10 & 11.04.

Although you could install something more lightweight like Lubuntu.


Cannot WOL dual-booted PC - Firewall? I cannot figure this out; I swear I am doing everything correctly:

In BIOS:

Wake from Onboard LAN -> Enabled

In windows:

I have enabled every capable NIC to Wake on LAN (Magic Packet)
I have checked all the boxes under the Power Management Tab for the same NIC's ^ and not allowed the computer to power them off

In ubuntu:

ethtool output:

ethtool enp0s31f6
Settings for enp0s31f6:
    Supported ports: [ TP ]
    Supported link modes:   10baseT/Half 10baseT/Full
                            100baseT/Half 100baseT/Full
                            1000baseT/Full
    Supported pause frame use: No
    Supports auto-negotiation: Yes
    Advertised link modes:  10baseT/Half 10baseT/Full
                            100baseT/Half 100baseT/Full
                            1000baseT/Full
    Advertised pause frame use: No
    Advertised auto-negotiation: Yes
    Speed: 100Mb/s
    Duplex: Full
    Port: Twisted Pair
    PHYAD: 1
    Transceiver: internal
    Auto-negotiation: on
    MDI-X: off (auto)
    Supports Wake-on: pumbg
    Wake-on: g
    Current message level: 0x00000007 (7)
                   drv probe link
    Link detected: yes

Why cant my computer WOL... I cant figure it out

EDIT:
I’m starting to wonder if maybe there is some issue with my network infrastructure like a firewall or something?
Is this true - https://forums.techguy.org/threads/not-allowed-to-to-set-up-wake-on-lan-on-a-xfinity-modem.1201350/ ?

I feel like an idiot. After reading every forum post on WOL that every existed and spending hours on this:

I determined that packet was being sent via Wireshark
I needed to know if NIC was still on even though the computer was off... Pretty orange light when on; nothing when off
Decided it was probably something in the BIOS... Went through EVERY menu option and found whole 'nother page of settings that I wouldnt've have thought to look for. Found what I needed in there.

To anyone with a similar problem:

Make sure packet is broadcasted
Go through all settings in your BIOS just to be sure


How do I turn off Gnome Shell Activities Animations? I'd like to turn off the animation (windows zoom back) effect when the activities overview is activated because it really gets slow and laggy with a lot of open windows.

Is there ANY way to do this, as internet search only lead me to the "Disable Window Animations Extension" which obviously only affects window animations but not the animation of the overview.

In Gnome 3.8, just do this command to disable all animations:

gsettings set org.gnome.desktop.interface enable-animations false

To rollback:

gsettings set org.gnome.desktop.interface enable-animations true

Check out:

System -> Preferences -> Appearance

Then choose the Visual Effects tab.

Change the radio button to 'None' and close.


Ubuntu 16.04 login screen in loop after installing AMD radeon driver My laptop is an HP 14-AM118TX with a AMD Radeon R5 M430.

Before I installed the driver only black screen was visible with an AMD error message. After installing the driver the login screen is visible but I cannot login! ttys 1 through 6 are accessible to me but I cannot login.

After I enter the password, the "System problem detected" window is displayed and the login screen appears again.

At Login Screen

ALT + CTRL + F2

type your username and password. Create a new user.

sudo adduser username

new password for the user.

ALT + CTRL + F7

login from new user you created.If worked you need to delete all the files related to your login in your home dir.

like .gconf , .gnome, .gnome2 and so on if not imp.

And will work like a charm

I had the same problem with my nVidia Optimus laptop. The only way I could fix it was to purge the system of the nvidia drivers and the Bumblebee GPU switching package by pressing Crtl + Alt + F2, login, and then running:

sudo apt-get purge nvidia.* bumblebee

Perhaps you should try purging the AMD drivers and then installing the one you need.


16.04 Can't enable bluetooth I've tried enabling from settings, doing sudo /etc/init.d/bluetooth start, sudo /etc/init.d/bluetooth restart, rfkill list says

2: hci0: Bluetooth
Soft blocked: no
Hard blocked: no

I have rfkill unblock bluetooth in rc.local but it just won't turn on. If I try enabling it via checkbox from settings the checkbox changes state but the text "bluetooth is disabled" is still there. Btw, yes, I've double checked that I didn't disable it with hardware button. How do I make bluetooth work on 16.04?

UPD: requested console output

yxfxmx@yxfxmx-pc:~$ lspci -knn | grep Net -A2; lsusb
13:00.0 Network controller [0280]: Broadcom Corporation BCM43142 802.11b/g/n [14e4:4365] (rev 01)
Subsystem: Hewlett-Packard Company BCM43142 802.11b/g/n [103c:804a]
Kernel driver in use: wl
Bus 001 Device 002: ID 8087:8000 Intel Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 002 Device 004: ID 05c8:022a Cheng Uei Precision Industry Co., Ltd (Foxlink)
Bus 002 Device 003: ID 0a5c:216d Broadcom Corp.
Bus 002 Device 005: ID 22b8:2e76 Motorola PCS
Bus 002 Device 002: ID 0458:012b KYE Systems Corp. (Mouse Systems)
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

UPD2:

yxfxmx@yxfxmx-pc:~$ dmesg | grep Blue
[    6.446411] Bluetooth: Core ver 2.21
[    6.446433] Bluetooth: HCI device and connection manager  initialized
[    6.446438] Bluetooth: HCI socket layer initialized
[    6.446442] Bluetooth: L2CAP socket layer initialized
[    6.446450] Bluetooth: SCO socket layer initialized
[    8.478642] Bluetooth: hci0 command 0x1001 tx timeout
[    8.827513] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[    8.827519] Bluetooth: BNEP filters: protocol multicast
[    8.827526] Bluetooth: BNEP socket layer initialized
[   16.474175] Bluetooth: hci0: BCM: Reading local version info failed (-110)
[   18.478015] Bluetooth: hci0 command 0x1001 tx timeout
[   26.473545] Bluetooth: hci0: BCM: Reading local version info failed   (-110)

UPD3: after installing firmware

yxfxmx@yxfxmx-pc:~$ dmesg | grep Blue
[    6.249804] Bluetooth: Core ver 2.21
[    6.249829] Bluetooth: HCI device and connection manager initialized
[    6.249835] Bluetooth: HCI socket layer initialized
[    6.249839] Bluetooth: L2CAP socket layer initialized
[    6.249858] Bluetooth: SCO socket layer initialized
[    8.393500] Bluetooth: hci0 command 0x1001 tx timeout
[    8.877281] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[    8.877286] Bluetooth: BNEP filters: protocol multicast
[    8.877292] Bluetooth: BNEP socket layer initialized
[   16.389750] Bluetooth: hci0: BCM: Reading local version info failed (-110)
[   18.393828] Bluetooth: hci0 command 0x1001 tx timeout
[   26.390149] Bluetooth: hci0: BCM: Reading local version info failed (-110)
[  430.267410] Bluetooth: hci0 command 0x1001 tx timeout
[  438.263237] Bluetooth: hci0: BCM: Reading local version info failed (-110)
[  438.268233] Bluetooth: hci0: BCM: chip id 70
[  438.284219] Bluetooth: hci0: BCM43142A
[  438.284225] Bluetooth: hci0: BCM (001.001.011) build 0000
[  438.742225] Bluetooth: hci0: BCM (001.001.011) build 0227
[  438.758225] Bluetooth: hci0: Broadcom 43142 Bluetooth 4.0 Adapter
[ 3600.950603] Bluetooth: hci0: BCM: chip id 70
[ 3600.966645] Bluetooth: hci0: Broadcom 43142 Bluetooth 4.0 Adapter
[ 3600.966653] Bluetooth: hci0: BCM (001.001.011) build 0227
[ 3601.421687] Bluetooth: hci0: BCM (001.001.011) build 0227
[ 3601.437680] Bluetooth: hci0: Broadcom 43142 Bluetooth 4.0 Adapter

Can you post the output of dmesg | grep Blue and lsusb -t.

Also it could be something as simple as incompatibility with Unity, try running:

sudo apt-get update
sudo apt-get -y install unity-control-center


Pair Bose QuietComfort 35 with Ubuntu over Bluetooth In System Settings > Bluetooth, the Bose QC 35 is visible when searching for devices but pairing fails.

After multiple attempts and playing with the PIN options I managed to pair it but once selected in System Settings > Sound, it would fail and fall back to Built-in Audio or playback some garbled sound.

It seems the Bose Quiet Comfort 35 does has issues with pairing with Bluetooth LE (Low Energy).

Get back to a clean state

I would recommend to clean up you past attempts to pair:

On Ubuntu, remove the headphones from the Bluetooth paired list.
On the headphones, hold the switch in Bluetooth pairing position for 10 seconds to delete all paired devices (You'll get a voice confirmation).
If you can, deactivate Bluetooth on other surrounding devices to make sure they won't interact.

Deactivate Bluetooth LE

Edit Bluetooth configuration file:

sudo nano /etc/bluetooth/main.conf

Replace:

#ControllerMode = dual

with:

ControllerMode = bredr

Restart Bluetooth:

sudo service bluetooth restart

Pair

Make sure the headphones are in pairing mode.
Pair with System Settings > Bluetooth
Select & test the headphones in System Settings > Sound. You may want to choose High Fidelity Playback (A2DP Sink) for high playback quality.

Reactivate Bluetooth LE (optional)

As it is only the pairing that has to be done without Bluetooth LE, once it is paired you can go back to the original configuration:

sudo nano /etc/bluetooth/main.conf

Replace:

ControllerMode = bredr

with:

#ControllerMode = dual

Restart Bluetooth:

sudo service bluetooth restart

Troubleshooting

If you have issues connecting back after disconnecting/rebooting:

Make sure you have the computer and Bluetooth turned on before the headphones.
If Connection is grayed out in System Settings > Bluetooth, you can use the Bluetooth menu in the menu bar (next to the clock) to do Connection On/Off.

The solution above didn't work for me. I got it to work, but you need to set it up manually every time you reboot.

First close bluetooth and bluez by effectively stopping them (not restarting), then starting them again using systemctl start bluetooth and sudo /etc/init.d/bluetooth start.
Start bluez manager and connect the device using setup with the audio sink profile.
Manually change sound to the headphones.

I am a newbie with scripts, maybe someone more experienced than me can make a script that does all these actions at boot.


lubuntu installation failure I had ubuntu 16.04 installed in my device. A few days ago I tried to install lubuntu on my device . However, something went wrong.Probably It was not installed properly. Now, when I start my laptop , it shows lubuntu icon first, and then it shows the line :
      /dev/sda6 : clean, xxxxxx/yyyyyyy files ,xxxxx/yyyyyyy blocks.(the x and y's are some numbers)
After that ubuntu 16.04  is started. Again when I shut down my laptop lubuntu icon shows up.
Now, How should I fix the problem?

you didn't install lubuntu - you installed the lubuntu-desktop or really added the LXDE desktop to your ubuntu system.  at the username|passwd screen you'll find a gear type log that will let you select ubuntu (unity DEsktop) or lubuntu (LXDE desktop) as you'd installed both.  what you've been left with is only the plymouth screen, which is only a 'icon-screen-filler' as most people don't like seeing text messages as system boots. have a look at

How do I change the plymouth bootscreen?

if you want to remove the lubuntu plymouth screen (return it to what it used to be, or select another etc).  the plymouth screen is really just a 'theme' type graphic; which was left behind when you removed it (you probably got a warning message telling you this)

you probably have the wrong uuid defined for sda6 in /etc/fstab.

use gparted or parted to get the correct uuid of the prtition and correct fstab

anything in fstab is considered a dependent mount and will crash boot if it is incorrect.

PS you need root privileges to edit fstab


How can I change my command line (bash) prompt? i'm new to ubuntu .presently i'm using ubuntu 12.04 version.I want to know how to change terminal's displaying text.
currently my terminal displaying the text..

narasimha@narasimha:~$

how can i change it with narasimha@reddy:-$

Narashima is the hostname of the machine, you can alter is by issuing the command:

sudo hostname reddy

If you open a new shell it will read narasimha@reddy:-$

It can be not possible, but there are 2 ways, don't know.

Case 1 (easier)

Make a new account "reddy" and look up the terminal. See if it works.

Case 2

Well, you might need a reinstall. When you install, in the username type reddy, and when you finally install the OS, make an account named "narasimha".

Case 2 is probably going to work, but I have no idea. Try the Case 1 first.


How to automatically unlock private SSH key? I have generated an RSA public / private key pair using ssh-keygen. However, I am prompted to enter the password to unlock it the first time it is used each session. How can I automatically have it unlocked after login?

Even better: since this is running on an Ubuntu server, it would be great if it was never locked at all - that way the automated daemons that need it would not require manual intervention to use it.

For reusage of encrypted key use ssh-agent. It prints some output containing environment variables that you have to export. Then add keys with ssh-add.

You have to unlock your key only once until ssh-agent is running.

I may be mistaken here, but it sounds like what you're trying to do is to not need to unlock your key every time it is used?

If that's the case, it seems like the easiest solution would be to just not create a passphrase while creating the key.  i.e. run

ssh-keygen

and when it asks for a passphrase, just press enter twice. I apologize if this is too simplistic, but it's what I've always done when creating keys so I don't need to unlock them.  Hope it helps!