How to Install Node.js without sudo access but with npm 1.3.10 installed? I have little knowledge of Ubuntu 14.04.

I need to install Node.js. The Ubuntu I am using is a big system for an organization so I don't have sudo access, but I found that npm 1.3.10 is installed.

I am looking for a sequence of commands to install Node.js into my user directory. I have downloaded Node.js from here on nodejs.org (LTS version, 64 bit) in ~/Downloads/node-v8.9.1-linux-x64.tar.xz. What do I do next?

In order to install Node.js and npm locally without having to use sudo open the terminal and type:

echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
wget -c http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install
wget -c https://www.npmjs.org/install.sh | sh

The curl package is not installed in Ubuntu by default. If you don't have curl installed on your system, replace all instances of curl in the install.sh file with wget -c and save the changes to the install.sh file before running it.

This will install node-v9.2.0 which is a later version of Node.js than the file you already downloaded.

I like to use ubuntu groups to achieve this. It's quite simple.

First install nodejs and npm using apt-get

sudo apt-get update && sudo apt-get install nodejs npm
Figure out who is logged in i.e username, run following command to see it in terminal

whoami
You can see the list of groups you are assigned by using a very simple command, normally the first group is your username itself

groups
Run following to allow access to logged in user

sudo chmod 777 -R /usr/local && sudo chgrp $(whoami) -R /usr/local
Update npm and nodejs

npm install -g npm

You are allset, your user can run npm commands without sudo

You can also refer to npm throws error without sudo.


How do I install Ubuntu for phone on Samsung Galaxy Mini? Any completed procedure to install Ubuntu on Samsung Galaxy Mini.

Browse these pages for help:

http://www.ubuntu.com/devices/phone

http://www.ubuntu.com/devices/android


How to add a Python module to syspath? I have a file structure like this:

Folder
   Common
      foo1.py
   TestFolder
      foo2.py

I want to import in foo2.py  and foo1.py. I tried but it doesn't work on Ubuntu:

sys.path.append(os.path.abspath('../../'))
from Common import foo1.py

How python finds its modules

Strictly taken, a module is a single python file, while a package is a folder containing python files, accompanied by a (can be empty) file named __init__.py, to tell python it is a package to import modules from. In both cases, modules need their .py extension, but importing them is done without (see further below).

By default, Python looks for its modules and packages in $PYTHONPATH.

To find out what is included in $PYTHONPATH, run the following code in python (3):

import sys
print(sys.path)

How to add a directory

Occasionally

From within a python file, you can add path(s) occasionally to the default path by adding the following lines in the head section of your python application or script:

import sys
sys.path.insert(0, "/path/to/your/package_or_module")

For example:

if I have a folder: /home/myname/pythonfiles, and I want to import the file module_1.py, located in that directory, I add this to the head section of my code:

import sys
sys.path.insert(0, "/home/myname/pythonfiles")

And I can simply import the file module_1.py by:

import module_1

When I create a package and want to import module(s) from the package, I need to create a folder in $PYTHONPATH, containing the modules, accompanied by a (can be empty) file called __init__.py

For example:

To import from a package (folder) called my_package in /home/myname/pythonfiles , add the /home/myname/pythonfiles path to your $PYTHONPATH, like in example 1, and import the module called module_2.py (inside the package folder) simply with: `

from <packagename> import module_2

Adding directories to $PYTHONPATH permanently:

Add the following line to your ~/.profile file.

export PYTHONPATH=$PYTHONPATH:/path/you/want/to/add

Subdirectories

From within a package, subdirectories are not included just like that; you need to "chain" the directories. To import a module module_3.py, inside folder subfolder inside folder packagename:

import packagename.subfolder.module_3

Given the fact that all subfolders in the package include their own __init__.py file.

When a module is in the same directory as the script or application

There is no need to insert the path to a module when it is in the same directory as the script or application, it is automatically added.

Example:

If I have a folder, containing script.py and module.py, I can simply import the module by:

import module

NB: This answer is outdated for the latest version of python 3, but is here for earlier version. For more information read the comments and https://www.python.org/dev/peps/pep-0420/

Essentially every folder with python code you want to add to the syspath needs an __init__.py file. These __init__.py files can be empty.


MBR Lost after shrinking Active Partition I've got a serious issue with MBR.

Initially got Windows 7 Up on my machine.
I shrinked the active partition to create space for installing ubuntu. I formatted the new available space. Now i simply cannot boot to my Windows 7. So, plugged into Ubuntu LIVE USB drive, tried to access partitions and it says:

  Unable to mount System: Adding read ACL for uid 999 to `/media/ubuntu' failed: Operation not supported

Didn't loose hope, so tried Boot-Repair, Now simply stuck at FreeDos screen at bootup

Please find Boot Info Below:

  http://paste.ubuntu.com/5652026/

Any Help much appreciated!
Thanks...

No worries people!
Found the solution by myself like all the time..

Following are steps to recover/fix your MBR in such case:

Create Windows 7 Bootable USB Using Windows 7 USB/DVD Tool (link to
download)
Boot using this USB Disc
When the setup shows partitions, press Shift+F10
Type "bootrec /fixBoot", enter
Type "bootrec /fixMbr", enter
Restart and boot without USB, Enjoy!

In this case you have to fix your MBR. put your windows installation disc to you dvd rom and restart and boot your computer through Windows DVD and repair your OS. now then try to install Ubuntu
Learn more about MBR


What media (music and video) players are there? This question is present as a matter of historical interest.  While you are encouraged to help maintain its answers, please understand that "big list" questions are not generally allowed on Ask Ubuntu and will be closed per the FAQ.

What media (music and video) players are there?

Please list one piece of software per answer, as per this meta post.

VLC Media Player

VLC is a free and open source cross-platform multimedia player and framework that plays most multimedia files as well as DVD, Audio CD, VCD, and various streaming protocols.
Features:

Simple, fast and powerful media player.

Plays everything: Files, Discs, Webcams, Devices and Streams.

Plays most codecs with no codec packs needed: MPEG-2, DivX, H.264,
MKV, WebM, WMV, MP3...

Runs on all platforms: Windows, Linux, Mac OS X, Unix...

Completely Free, 0 spyware, 0 ads and no user tracking.

Can do media conversion and streaming.

From the VLC media player home page.

(source: hostmar.co)
I was using it the other day to play back 3 720p videos simultaneously on a 1 1/2 year old HP notebook. Performance was flawless.
Very advanced customizations/settings.

Separate window that includes playlist, file browser, external devices and local network access, internet features (radios, postacasts, Freebox TV channels for registered users)

(Using skins reduces the easy access to some of these features.)
VLC media player supports many audio and video compression methods and file formats, including DVD-video, video CD and streaming protocols. It is able to stream over computer network and to transcode multimedia files. (from Wikipedia)

It can use extensions, plugins and skins - to be downloaded from addons.videolan.org.
Among these, some that can find movie subtitles. (More answers on this: here and here.)

Real Player - http://uk.real.com/realplayer/other-versions

Music and video Player, well known.

Note :Just for i386 architecture.


Installation of Lubuntu 20.04 failed: “non-zero exit status 32” I had first posted this as an extension of an unrelated question, but I guess it makes more sense to start its own thread here. I have tried to install lubuntu-20.04.2-desktop-amd64.iso (downloaded from the lubuntu.me URL). I soon received the following error message:
Installation Failed
Boost.Python error in job "unpackfs".
Command 'mount' returned non-zero exit status 32.

None. Traceback: File "/usr/lib/x86_64-linux-gnu/calamares/modules/unpackfs/main.py", line 423, in run return unpackop.run()
 File "/usr/lib/x86_64-linux-gnu/calamares/modules/unpackfs/main.py", line 241, in run return unpackop.run()
 File "/usr/lib/x86_64-linux-gnu/calamares/modules/unpackfs/main.py", line 302, in run return unpackop.run()
[X Close]

Do you have any suggestions about how to resolve this issue? I'm not sure this has anything to do with this bug, and even so I'm not sure how to work around it.
Unfortunately, I had not managed to verify the iso file before installing. (I'm using a Windows 10 computer, but apparently I need another program for verifying? At least in the regular command line, "gpg" or "sha256sum" are not recognized as valid commands. Do you have any suggestions where I can read up on how to use those commands?) A first web search did not help, so I tentatively proceeded and tried burning to USB, booting and installing. If you should think that my failure to verify ties into the problem: How can I read up on verifying / using "gpg" and "sha256sum" / ...?

Turns out my USB stick was formatted to exFAT. When I used NTFS, everything worked out and I am now writing this from my own computer on Linux. Hooray! :-)
[Sorry for the late reply, I was sick and for some days didn't get to anyone's computer... at least at the end of the time I suddenly got the idea about NTFS.
Oh, and askubuntu seems to have added "32-bit" - I had just meant to tag "zero exit status 32", which apparently went completely wrong...]
Nonetheless thanks a lot for your comments!!

I had exactly same error. None of tips suggested here didnt work. I found out later issue was with selected format of image in Rufus. It should be DD, not ISO. Now it works fine.


Does GUI have shell behind it like terminal? In Unix, the text we type on terminal window is sent to shell as input. How about GUI and TUI? Does it have shell too that handles mouse clicks and keyboard?

By definition, a graphical user interface (GUI) is used by a shell.[1]

Moreover, Unity, the default user interface in Ubuntu, is a shell interface for the GNOME desktop environment.[2]

References:

Shell (computing)
Unity (user interface)

It depends on the program, things like GParted are just graphical versions of CLIs. In GParted's case it's obviously the GUI for Parted. What really happens is eventually anything running needs to get down to a compiler so that the computer can understand what's happening. If you want to get a better grasp on the underbelly of a computer, learn some C code.


Wifi doesn't work on Ubuntu 14.04 anymore! I've been struggling with my wifi for a week now. Since we changed router and provider(O2 box 6431), the connection doesn't work on Ubuntu anymore, yet it does work on windows (and also on ubuntu with other connections). The crazy thing is that it sometimes randomly works and then just stop after sleep mode and doesn't recover. One of my last attempts was to install another firmware

sudo apt-get install linux-firmware-nonfree
sudo apt-get purge bcmwl-kernel-source broadcom-sta-common broadcom-sta-source && sudo apt-get install b43-fwcutter firmware-b43-installer

but now it fails connect to the router, while before I was connected but had internet didn't work.
I add further information here:

mario@ThinkPadMG:~$ ifconfig
eth0  Link encap:Ethernet  HWaddr 3c:97:0e:66:d5:a9
      inet addr:192.168.1.26  Bcast:192.168.1.255  Mask:255.255.255.0
      inet6 addr: fe80::3e97:eff:fe66:d5a9/64 Scope:Link
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:2779028 errors:0 dropped:0 overruns:0 frame:0
      TX packets:1396404 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000
      RX bytes:4100463259 (4.1 GB)  TX bytes:105833025 (105.8 MB)
      Interrupt:20 Memory:f3a00000-f3a20000

lo    Link encap:Local Loopback
      inet addr:127.0.0.1  Mask:255.0.0.0
      inet6 addr: ::1/128 Scope:Host
      UP LOOPBACK RUNNING  MTU:65536  Metric:1
      RX packets:7830 errors:0 dropped:0 overruns:0 frame:0
      TX packets:7830 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:0
      RX bytes:667794 (667.7 KB)  TX bytes:667794 (667.7 KB)

wlan0 Link encap:Ethernet  HWaddr 6c:88:14:f0:6a:28
      inet6 addr: fe80::6e88:14ff:fef0:6a28/64 Scope:Link
      UP BROADCAST MULTICAST  MTU:1500  Metric:1
      RX packets:50 errors:0 dropped:0 overruns:0 frame:0
      TX packets:50 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000
      RX bytes:6750 (6.7 KB)  TX bytes:7750 (7.7 KB)

mario@ThinkPadMG:~$ iwconfig
wwan0     no wireless extensions.

eth0      no wireless extensions.

lo        no wireless extensions.

wlan0     IEEE 802.11abgn  ESSID:off/any
      Mode:Managed  Access Point: Not-Associated   Tx-Power=15 dBm
      Retry  long limit:7   RTS thr:off   Fragment thr:off
      Power Management:off

mario@ThinkPadMG:~$ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.1.1     0.0.0.0         UG    0      0        0 eth0
192.168.1.0     0.0.0.0         255.255.255.0   U     1      0        0 eth0

mario@ThinkPadMG:~$ nmcli nm
RUNNING         STATE           WIFI-HARDWARE   WIFI       WWAN-HARDWARE   WWAN
running         connected       enabled         enabled    enabled         enabled

mario@ThinkPadMG:~$ lspci -nn | grep 0280
03:00.0 Network controller [0280]: Intel Corporation Centrino Advanced-N 6205 [Taylor Peak] [8086:0085] (rev 34)

Please help!!

[Update] paste.ubuntu.com/9912617
dmesg | grep iwl gives no output

[Update2] I used the command echo "options iwlwifi bt_coex_active=N" | sudo tee -a /etc/modprobe.d/iwlwifi.conf and wifi was ok: I was on Mozilla, watched a video, did stuff and it worked. Then I didn't use my laptop for 10 minutes and now it only shows it's connected to the router, but no actual connection.
Using the command again, connection is back.

This is the result of dmesg | grep -e iwl -e wlan0 : http://paste.ubuntu.com/9921077/

Wireless diagnostic script output: http://paste.ubuntu.com/9912617/

I wonder if the router might be wireless n only, if so the next command and a reboot should fix echo "options iwlwifi 11n_disable=8" | sudo tee -a /etc/modprobe.d/iwlwifi.conf

disable IPv6 in network manager by selecting ignore and add the terminal results for dmesg | grep iwl
then add another change to the module
echo "options iwlwifi bt_coex_active=N" | sudo tee -a /etc/modprobe.d/iwlwifi.conf

Reboot with ethernet cable unplugged

i had the same problem with the o2box 6431. (Ubuntu 14.04, Samsung Ativ book)
after setting the router to "n-only" mode it suddenly worked


bash:no such file or directory dhruvhadoop1@hadoopmaster:~$ cat /home/hadoopuser/.ssh/id_rsa.pub >> /home/hadoopuser/.ssh/authorized_keys
bash: /home/hadoopuser/.ssh/authorized_keys: No such file or directory
dhruvhadoop1@hadoopmaster:~$ cat /home/hadoopuser/.ssh/id_rsa.pub >> /home/hadoopuser/ .ssh/authorized_keys
bash: /home/hadoopuser/: Is a directory
dhruvhadoop1@hadoopmaster:~$ cat /home/hadoopuser/.ssh/id_rsa.pub >> /home/hadoopuser/ .ssh/authorized_keys/
bash: /home/hadoopuser/: Is a directory
dhruvhadoop1@hadoopmaster:~$ cat /home/hadoopuser/.ssh/id_rsa.pub >> /home/hadoopuser/.ssh/authorized_keys
bash: /home/hadoopuser/.ssh/authorized_keys: No such file or directory
dhruvhadoop1@hadoopmaster:~$

The .ssh directory and it's files have strict access permissions: The files are only readable/writable by the owner (or root). If you are not hadoopuser, then you'll have to:

sudo sh -c 'cat /home/hadoopuser/.ssh/id_rsa.pub >> /home/hadoopuser/.ssh/authorized_keys'

The error message is a bit misleading. You're trying to append, so the shell has to check if the authorized_keys file exists. You don't have read permission on the .ssh directory, so the shell cannot complete that check.

Most of the error messages you posted are because you are not using the correct path as you have added a space in various locations or specified a directory rather then a file.

The only error message of any real relevance is

  /home/hadoopuser/.ssh/authorized_keys: No such file or directory

You can not append a non-existant file so either copy the file (preferred method)

cp /home/hadoopuser/.ssh/id_rsa.pub /home/hadoopuser/.ssh/authorized_keys

or create the file with a single >

cat /home/hadoopuser/.ssh/id_rsa.pub > /home/hadoopuser/.ssh/authorized_keys


How to run BitTorrent Sync? I am in Ubuntu 12.04 (precise) 64bit and downloaded the btsync executable from http://labs.bittorrent.com/experiments/sync/ but running it doesn't seem to have any effect. Double-clicking the executable does nothing, and running ./btsync in the terminal also exits immediately without any output.

Has anyone successfully ran this under Ubuntu, and if so, is there any special configuration changes that need to be made to make it work?

There are 2 ways to use BitTorrent Sync , 1st Install it using PPA & 2nd Download

1st PPA

sudo add-apt-repository ppa:tuxpoldo/btsync
sudo apt-get update

For normal desktop use, you only need to install btsync-user:

sudo apt-get install btsync-user

Alternatively, if you're setting up your BTSync server, install btsync:

sudo apt-get install btsync

During the installation just use the default setting and set the administrative password as well ,You can access it by

127.0.0.1:8888     # This will redirect to the 2nd link

OR

http://127.0.0.1:8888/gui/

Username = admin , Password = ( Use have set during installation )

2nd Download

Download the BitTorrent Sync client

cd Downloads
tar xzpf btsync_glibc23_x64.tar.gz # I have downloaded 64 bit. So check your version
./btsync

The output will be

./btsync
BitTorrent Sync forked to background. pid = 5771  # some what like this pid will be change

Open any web browser & copy paste the following line

127.0.0.1:8888     # This will redirect to the 2nd link

OR

http://127.0.0.1:8888/gui/

If you type ./btsync --help you can also run it no deamon mode

./btsync --help
 BitTorrent Sync 1.0.132
 Usage:
 btsync [--config <path>] [--nodaemon] [--generate-secret] [--dump-sample-config] [--help] [--get-ro-secret <secret>]
 Options:
--config - location and name of configuration file
--nodaemon - do not use daemon mode
--generate-secret - generate shared secret
--get-ro-secret - get read only secret for existing master secret
--dump-sample-config - dump sample config file
--help - print this message and exit

  Help

forum.bittorrent.com

Video tutorial jupiterbroadcasting.com

Please also have look at Peer To Peer (P2P) Sync and Share Ubuntu

According to the original PPA maintainer tuxpoldo, the new way to do it for version (2.0+) is (must be run in bash):

sh -c "$(curl -fsSL http://debian.yeasoft.net/add-btsync-repository.sh)"
sudo apt-get update
sudo apt-get install btsync-gui
btsync-gui


Unity menu very slow and unresponsive I have a HP G62 laptop with Intel Pentium processor and ATI graphics.
Since upgrade to Ubuntu 13.10, my Unity menu is very slow and unresponsive. I am using proprietary driver for my graphics

For example, I'm switching between Gimp and Chrome. When I switch to Gimp, I will be stuck with Chrome menu at the top of the screen. It is really annoying and it is just one of many bugs that came up with 13.10.

Any ideas? Should I just revert to default driver?

This fix for this issue got released on 2013-11-01 (https://bugs.launchpad.net/ubuntu/+source/gtk+3.0/+bug/1199877/comments/73). Just keep an eye out for gtk+3.0 in the Softare Updates and apply it once it arrives on your machine. I can confirm that this fix solves it for me.

I have run into similar issues when upgrading to new Ubuntu versions. Usually, ATI Graphics cards don't usually play well with Ubuntu. Try reverting back to the default driver or look for other updated version that might work with your system. Good luck!


I want to install Ubuntu 16.04.2 over my old Ubuntu which will not boot I have Ubuntu 16.04 lts.

While removing some applications using synaptic my system crashed and then I restarted my laptop, but the system wouldn't boot.

Now I have Ubuntu 16.04.2 on a USB flash drive.

How can I install Ubuntu 16.04.2 LTS from the USB to my
 laptop before booting the laptop?

I must assume you are asking about booting from the USB instead of from the hard drive

When you start your laptop, when still on manufacturers logo screen (be quick!) you can press (depending on make/model) F2 or F12

This should bring up the efi or bios. Choose to boot from USB as first device.

You should be able to boot from the USB this way.


What does indicator-application-service do? My attention was brought to a process named indicator-application-service because it was idling at 28% CPU usage. What does this program do?

indicator-application-service is the service that is used to manage application indicators.    Application indicators are a way for applications that don't provide any indicator integration with any of the existing indicators such as Messaging, Session, DateTime, etc.  You can think of it as the replacement for the former systray.

Applications that want to provide status that doesn't fit into the existing categories can register with indicator-application-service and get an icon displayed in the panel.

Read here:
https://launchpad.net/indicator-applet

The indicator applet exposes Ayatana Indicators in the Gnome Panel. Ayatana Indicators are an initiative by Canonical to provide crisp and clean system and application status indication. They take the form of an icon and associated menu, displayed (usually) in the desktop panel. Existing indicators include the Message Menu, Battery Menu and Sound menu.


How do I install the Nvidia drivers? I just ordered the Nvidia GTX card. I have a dilemma, though. Should I keep using the driver which is available in "additional drivers" in Ubuntu, or should I install the driver from the Nvidia site?

So which driver is the best for me?

Updated - January 25, 2020

1. The quick way

Before adding this PPA, please read the PPA's Description on their page which mentions important information about using it, which version is right for your Nvidia card and more. This is for desktop users who want the latest version of the driver or the last supported one for their card.

Using 18.04+ To install run the following command:

sudo add-apt-repository ppa:graphics-drivers/ppa

This will automatically update the repositories and then you can run the following line:

sudo apt install nvidia-driver-440

If your desktop does not load after installing the corresponding driver, then do the following:

sudo nano /etc/gdm3/custom.conf

then remove the comment (# symbol) from the line that says

# WaylandEnable=false

and save. Then reboot. If this still does not work, then please disable Secure Boot since you might actually be using UEFI.

2. Common questions regarding Nvidia

For Troubleshooting Nvidia Problems or Overclocking Settings please see this answer which covers:

What common bugs are solved by using the latest drivers?
My video card is not installing (Installation problems)
Tuning and Tweaking by Video card
Quick way of setting default screen resolution

Top questions asked about video cards discussed below:

Can I use the latest driver on an older version of Ubuntu?
Difference between video cards & drivers: Official Nvidia site, Ubuntu's Default, PPA & Nouveau?
What PPAs are recommended when using any video card?
How to know which driver or package to install?
How to install a driver?
Difference between Proprietary Drivers?
How to know if my video card is supported in Ubuntu?

2.1 Can I use the latest driver on an older version of Ubuntu?

Since 12.04+, video drivers are maintained and updated more often. It is easier to handle and solve the problems that showed with older ones. You most likely won't need additional PPAs unless you have the latest Nvidia card.

2.2 Difference between video cards & drivers: Official Nvidia site, Ubuntu's Default, PPA & Nouveau

I recommend them in the following order according to problems found, how the "out of the box" experience feels to end users, how compatible they are, how easy it is to update, install or remove and how it will feel once you have it set up:

Nvidia PPA - Great Performance. It works out of the box for most cards by using the driver included in the PPA (Which are different for each generation of Nvidia cards.
Ubuntu Default Recommended Drivers - Ubuntu does an amazing job in figuring out which Nvidia driver you need depending on the card you are using.
Nouveau - This is the open source implementation of the Nvidia driver. They also do an amazing job and although they are not on par with the official drivers or the ones in the PPA (Even more so with the latest Nvidia cards), the speed of development, the commitment, dedication and advancements that they do per week, gives confident that this is in fact an option to have and promote.
Official Nvidia Site - These are the official drivers (Same as the ones in the PPA), the key difference is that they do not upgrade automatically and have some issues when updating, uninstalling and installing (Very rare but it happens).

The differences can be summed in the following points:

Official Site

Offers the latest driver
Installation is through the terminal
When an update appears you have to manually download the new package
It has more issues than any other method (Specially for Nvidia)

PPA Repositories

Offers the latest driver hours/days after its official release
Installation is either through terminal or GUI
If you have a previously installed a driver it will update the package automatically
When an update appears you will be notified to update using the Update Manager
It is more stable and tested than the official ones
It has less issues than using any other method (Less issues for all video cards)
It is the 1st recommended way for Nvidia Cards.

Default Ubuntu Drivers

For every new release the drivers get better and better
Gets updated less frequently than a PPA
In most cases the drivers will work out of the box (Nouveau for Nvidia)
Not up to date when compared with the official site or a PPA
It is by far, more tested in Ubuntu than any other way (PPA or Official)
Easier to update

2.4 How to know which driver or package to install?

Depending on how many video cards you have and if they are integrated or not, the installation method and packages to install will change from the PPA mentioned above which is for Single Cards.

Computer with two video cards in hybrid mode

Starting with Nvidia 319.xx, both Nvidia Optimus and the common PCIe drivers are integrated into one, so if you install the Nvidia-319 package or newer, you will get the driver for the Integrated Nvidia cards and also for the PCI ones.

There are two solutions possible for hybrid cards: The first one is a package called bumblebee, which is able to use different configurations for different applications. To install it, run:

sudo apt install bumblebee linux-headers-generic

The second one is an official NVIDIA package called nvidia-prime, which is automatically installed together with the nvidia-355 package. It is able to decide on which card to use at profile level, i.e. when the user logs in. This decision is adjustable at NVIDIA X Server Settings Control Panel. Note that nvidia-prime and bumblebee are incompatible: If bumblebee is installed then nvidia-prime won't function correctly, and its options won't be shown at NVIDIA X Server Settings Control Panel. You'll have to 1. remove bumblebee 2. reinstall nvidia-430 in order to make it work again.

After this, it is recommended to turn off the computer and then back on.

The following picture should be seen with nvidia-prime installed, but not necessarily when bumblebee is also installed.

Computers with a SLI setup

If you have 2 or more video cards in SLI mode you can do the following:

For NVidia cards, when creating the Xorg.conf add the following to the line:

sudo nvidia-xconfig --sli=On

Lastly, Ubuntu has a neat way of recommending which driver to use depending on your video card and drivers available (This is why I also recommend adding the PPAs first). Simply type:

ubuntu-drivers devices

It should show you a list of driver packages available for your hardware, including but not limited to the video card. If you wish to see which driver is recommended for your video card then simply type the following:

ubuntu-drivers devices | grep recommended

2.5 How to install a driver?

The method used will depend on how many video cards you have and which type of video cards you are using. The following are some of the ways of installing an Nvidia video card:

NVIDIA (old drivers that need the headers)

For Nvidia, many times you need to first install the header files of the kernel version you are using at that moment for the driver to install correctly. So you would first need to execute the following line:

sudo apt-get install linux-headers-generic

And then install the package related to the driver (nvidia* for Nvidia cards). In other cases you might need to go a little further and install the sources and specific header files, for example:

sudo apt install linux-source linux-headers-3.5.0-16-generic

which installs the linux-source package and the specific header file assuming you have in this case the 3.5.0-16-generic kernel version.

To check which version you have at any given time type uname -r which should give you the specific kernel version in use.

For Nvidia, it depends on the video card and package needed for it, for the latest video cards and assuming you added the PPA mentioned above, the terminal line would be:

sudo apt install nvidia-driver-440

The number at the end would change depending on how old your video card is or how new it is (Some versions available are 390, 410, 415 and 418).

For GeForce 10, 20 and RTX series GPUs use nvidia-430
For GeForce 8 and 9 series GPUs use nvidia-340
For GeForce 6 and 7 series GPUs use nvidia-304

The latest versions bring more fixes and correct issues related to graphics corruption, HDMI support, thermal support and more for the latest Nvidia cards. Normally, updating the video drivers solves many issues.

Note that Fan Control and any other Nvidia features that are not found on the nvidia-settings app, are not Ubuntu related, but Nvidia related. I would recommend, asking the Nvidia developers in the official Nvidia forum about features you may want to include (Fan Control, Overclocking features, etc...)

CUDA

For CUDA you can follow this link Installing and testing CUDA in Ubuntu 14.04

Bumblebee

For Bumblebee (NVIDIA Optimus) you can use the following PPA (Ubuntu 15.04+ users can optionally not do this since it is already included):

 sudo add-apt-repository ppa:graphics-drivers/ppa
 sudo apt-get update
 sudo apt-get install bumblebee linux-headers-generic

2.6 Difference between Proprietary Drivers?

Please visit Difference between Additional Drivers (Nvidia) for more information about Proprietary Drivers.

2.7 How to know if my video card is supported in Ubuntu?

Here are a couple of hints to know if your video card is supported in Ubuntu:

If the video card existed BEFORE the release of the Ubuntu version you are using, it has a 99% change it will be supported.
If the video card appeared less than 6 months AFTER the release of the Ubuntu version you are using and you kept that Ubuntu version updated, then you have a pretty good chance it will be supported.
If you added one of the PPAs I mentioned above then you have a 99.99% chance that it will be supported.
Checking the Nvidia Site or the PPA for support might yield a quicker answer, but in almost 100% of all cases, your video card will be supported either by the open source driver or by the proprietary driver.
Using the latest Ubuntu version will also improve your chances of having your latest video card supported.

In general, I make it a rule of thumb that if you have the latest video card or almost one of the latest video cards, you will need the latest drivers. So always install the latest drivers through the PPA or the Software Sources that come with Ubuntu if you have the latest Nvidia card.

NOTE - Ubuntu might show in the Graphics option in "About This Computer" the value Unknown. If this is happening, please install the mesa-utils package.

This answer is oriented towards resolving common Nvidia bugs (Black screen, drivers not working in general, low FPS, etc...)

What common bugs are solved by using the latest drivers?
My video card is not installing (Installation problems)
Tuning and Tweaking by Video card
Quick way of setting default screen resolution

2.7.1 What common bugs are solved by using the latest drivers?

Common bugs shared by all video cards are:

Missing Unity launcher or panel
Missing options inside Nvidia Settings
Desktop does not appear (Black screen)
Top/Bottom of the screen are cut out
Video looks cut into pieces
Higher Resolutions are not usable (Not found)
Video shows with VGA but not with HDMI (And Vice Versa)
Suspend not working on Laptop when closing Lid
Fan speed makes a lot of noise or is always at full speed
Heat Problems
nvidia-xconfig not creating xorg.conf correctly

If you happen to have any of this, it is a good idea to add one of the PPAs and update your video drivers to the latest they can manage. In almost all cases, the problem is solved after updating and rebooting. For these cases I also recommend using the Graphics Drivers PPA.

I also invite you to take a look at some of the related questions:

Which ATI/AMD, or Intel, or NVIDIA Graphics for Unity?

What is the correct way to install proprietary ATI Catalyst Video Drivers (fglrx) directly from AMD?

How to correctly enable Desktop Cube in Unity 3D?

Enable HDMI audio for an Nvidia card

How do I enable desktop visual effects?

NVIDIA drivers not working after upgrade. Why can I only see terminal?

Desktop does not show when I installed nvidia drivers!

Black screen on latest Nvidia/Ati Cards when starting LightDM/Ubuntu

HDMI/VGA connection cuts borders of screen or creates blurry text

/etc/X11/xorg.conf doesn't exist?

Installing latest Nvidia from Xorg PPA gives black screen

Now some pointers I want to mention:

For NVIDIA Cards, it also helps to create the xorg.conf file using the nvidia-xconfig command line. Just go in the terminal to type the following and then reboot:

sudo nvidia-xconfig

Know that if nvidia-xconfig throws one of the following errors you most likely need to delete the existing xorg.conf file first before executing the nvidia-xconfig command again:

VALIDATION ERROR - It can mention section missing, incorrect information in a section, not closed sections or simply requiring at least 1 section to proceed.
WARNING - It can mention several errors in values regarding any parameter found in a section, for example not specifying explicitly a value for a parameter.
FATAL SERVER ERROR - After running nvidia-xconfig you can get in small cases a "no screens found" error which most likely means that the recommendations mentioned above like installing the PPA were not applied first or a possible module is still working (Either the nouveau is loading or an nvidia driver installed using the Nvidia driver package from the nvidia site.
ERROR - You will get an error similar to Unable to write to directory '/etc/X11' if you executed the nvidia-xconfig command without sudo. If the error persists via the nvidia-settings you need to delete the xorg.conf file first.

For all the cases where you need to delete the xorg.conf file, please make sure to backup any changes to did to it before deleting it.
Reinstalling the driver solves several issues. For example, if you are using the nvidia-graphics-drivers-355 driver package, then do the following to reinstall it:

sudo apt-get install --reinstall nvidia-graphics-drivers-355

Reinstalling Xorg also helps in other cases:

Remove existing xorg using the following command

sudo apt-get remove --purge xserver-xorg

Install xorg using the following command

sudo apt-get install xserver-xorg

Reconfigure xorg using the following command

sudo dpkg-reconfigure xserver-xorg

After this it is recommended to reinstall the video driver if you are using Nvidia or ATI as mentioned above.

I have to add that if you suffer from Black Screen after installing the Nvidia drivers from the PPA and rebooting (And you don't have a Hybrid System) then your problem might be the need to remove the bumblebee package along with the bumblebee.conf file. Follow the steps provided in Installing latest Nvidia from Xorg PPA gives black screen for this or simply run the following lines:

sudo apt-get purge bumblebee primus
sudo rm -fr /etc/modprobe.d/bumblebee.conf
sudo reboot

2.7.2 My video card is not installing correctly (Installation problems)

Most installation problems related to ATI or Nvidia can be solved by following the steps provided in Can not install Nvidia driver but in short I can summarize that in the following steps assuming you have one of the following issues:

Installed the official Nvidia drivers and have a problem updating or removing them
Screen looks wrong/corrupted
Unity does not load of fails to load
Can not access the GUI environment in no way

If you have installed the official Nvidia Drivers, follow all steps below after having started Ubuntu in Recovery Mode. If not, skip to step 2:

If you installed the Nvidia driver from the Nvidia site or the ATI driver from the official AMD site, then type the following on the terminal (In this example assume you have the Ubuntu 64Bit with the 304.51 version of Nvidia):

sudo sh NVIDIA-Linux-x86_64-304.51.run --uninstall

If you have install any nvidia package like nvidia-current or nvidia-current-updates remove them. Same goes with ATI drivers. sudo apt-get remove nvidia-current for example.
ANY change you did to blacklist the Nvidia/ATI driver for instance or changes to any other files related to the Nvidia/ATI drivers should be reversed. This is just in case you went ahead and started editing like crazy (Which happens I know ^^).
Delete or backup/move the xorg.conf file. You will not need this file right now.
After doing all the steps above then Reboot the PC and make sure it loads with Nouveau and not with any Nvidia drivers for Nvidia cases or with ATI drivers and not with fglrx for Ati/AMD cases.
If right now you KNOW you are running Unity with the Nouveau driver (Or ATI open source driver) or if you just happened to get a video error, or it just fails to correctly load LightDM, do not worry, all 3 options will end the same way. When rebooting, in the GRUB menu, select the "Recovery Mode". After the recovery mode shows you the recover options, choose the root option or the Failsafe X option. In this modes and after all previous steps have been done, install the Nvidia/ATI driver using the PPA I mentioned above. Always try to install the latest driver if you have a recent video card: sudo apt-get install nvidia-430 for Nvidia cards or sudo apt-get install fglrx for the latest Ati/AMD Cards. Remember there should not be anything installed before doing this in regards to Nvidia/ATI drivers (Except obviously the Nouveau drivers).
Now reboot and all should work.

NOTE - In Step 6, if it looks as though the PC is stuck loading just press CTRL+ALT+F1 to go to the TTY1 terminal and do step 6 from there.

Other common installation problems involve resolution. You can check and change the resolution via terminal in the following way:

Open the terminal and type xrandr this will show you all possible supported resolutions (This depends on your video card and monitor/tv). Take note on the order they appear listed. The first line that shows the resolution is line 1, the next one is 2 and so on for all resolutions supported. A value of 0 will reset the resolution to the default one after you actually set a resolution.
Type xrandr -s X where X is the line number as mentioned above. So it would look something like: xrandr -s 1.

Lastly for users that have reported not seeing the Unity Launcher/Panel after updating the Kernel and/or Nvidia version, the first thing to do is to check if the Unity Plugin is enabled. For this go to the Compiz Config Settings Manager (Am assuming it is already installed) and go to the Unity Plugin. Check to see that the checkbox for it is activated. If not then activate this option and follow the on-screen suggestions.

2.7.3 Tuning and tweaking my video card

For Nvidia Video Cards follow these steps:

In the terminal type: sudo nano /etc/X11/xorg.conf
Find the device section and add the following line:

 Option "Coolbits" "4"

it should look something like this:

 Section "Device"
     Identifier     "Device0"
     Driver         "nvidia"
     VendorName     "NVIDIA Corporation"
     Option         "Coolbits" "4"
 EndSection

Now save and reboot. You should now see (Depending on your video card model) a new option about Fan Speed like this:

A brief explanation of CoolBits:

CoolBits enables various unsupported features, such as support for GPU clock manipulation in the NV-CONTROL X extension. This option accepts a bit mask of features to enable. Which means a value of 0, 1, 2 or 4.

CoolBits = 1 - When "1" (Bit 0) is set in the "Coolbits" option value, the nvidia-settings utility will contain a page labeled "Clock Frequencies" through which clock settings can be manipulated. "Coolbits" is only available on GeForce FX and Above.

CoolBits = 2 - When "2" (Bit 1) is set it will attempt to initialize SLI when using GPUs with different amounts of video memory.

CoolBits = 4 - When "4" (Bit 2) is set the Thermal Monitor page will allow configuration of GPU fan speed, on graphics boards with programmable fan capability.

The default option is 0 (unsupported features are disabled).

As of Nvidia 337.XX the following options are available:

CoolBits = 8 - When "8" (Bit 3) is set the PowerMizer page in the nvidia-settings control panel will display a table that allows setting per-clock domain and per-performance level offsets to apply to clock values. This is allowed on certain GeForce GPUs in the GeForce GTX 400 series and later. Not all clock domains or performance levels may be modified.

CoolBits = 12 - When "12" (Bit 3 + 2) this will be the same as activating the effects of Coolbits 8 + Coolbits 4. So you will get the new overclocking features and fan control.

This options can also be activated by issuing the following command:

nvidia-xconfig --cool-bits=4

WARNING: this may cause system damage and void warranties.

I also want to add that the information for Proprietary drivers is typically saved in the home folder. For example, the information saved by nvidia-settings is stored in ~/.nvidia-settings-rc which you can access by typing the following:

nano ~/.nvidia-settings-rc

I mention this because if the xorg.conf is not used, then how do the settings for ATI or Nvidia work? The reason is that X can automatically detect and configure many options of xorg.conf like input/output devices and Video cards. This did not happen automatically before, but since 2010, X can handle many options and detect them without any problems or the need to configure a file for them.

Note that, many of these are still present but divided into more specific files in /usr/share/X11/xorg.conf.d/

For example, some video cards do not show the Unity Launcher or top panel unless xorg.conf is present. In other cases, users that want to tweak their video card, may need the Coolbits option which is added to xorg.conf. These are the reasons why nvidia-xconfig exists. To provide an additional level of support in case X does not detect or offer all the options for the video card.

Another trick is to run update-pciids so it updates the PCI Id List. On very rare cases, the ID is not found or detected incorrectly for the video card (Actually any PCI device) so this will help solve any problem related to it.

In some cases it also helps to change the Texture Filter value to Fast in the OpenGL Plugin inside the Compiz Config Settings Manager.

Lastly, changing the Image Settings options to "High Performance" in the OpenGL Settings of the Nvidia Settings Panel can help in some cases.

2.7.4 Quick way of setting default screen resolution

I have read and done some of the tips about using xrandr or editing the xorg.conf file, but the quickest way that I found was literally editing the ~/.config/monitors.xml file and changing the resolution around lines 15 to 18 (The ones that mention Width, Height and Rate). So set the correct Width, Height and Rate and reboot to test this. This is only to set the default resolution you wish to see once the computer starts.

Download the driver and place it in your home directory

Download for 64bit: http://www.nvidia.com/object/linux-display-amd64-295.53-driver.html

Download for 32bit: http://www.nvidia.com/object/linux-display-ia32-295.53-driver.html

Do: ctrl + alt + F6 (Warning: This will switch you to a TTY, no GUI)
Login using your username and password
Type: sudo service lightdm stop
Type: sudo ./NVIDIA*
Type: sudo reboot

The driver should work with no problem now (I just did this with my GTX 570)

Test the driver by opening a terminal: (ctrl + alt + T)

Type: glxinfo | grep direct
It should report back: direct rendering: Yes
To adjust your NVIDIA settings Type: nvidia-settings

NOTE: The script should blacklist the nouveau driver by default. If the NVIDIA driver isn't working, try to do this manually:

Type: sudoedit /etc/modprobe.d/blacklist.conf

Append the following lines:

blacklist nouveau
options nouveau modeset=0

Type: sudo reboot


Ubuntu 19.04 dynamic dock not working Had 18.10 before upgraded and I had dynamic dock.
Now my dynamic dock doesnt work anymore, it stay black any way.

This is my screen on dynamic mode, my dock just stays black at every screen I switch:

Tried

gsettings set org.gnome.shell.extensions.dash-to-dock transparency-mode 'DYNAMIC'

and tried changing with the tweak-tool to dynamic, didn't help too.

The devs disabled it for now but I believe they are planning to re-enable it in future

There is a Dynamic Panel Transparency GNOME extension you can get to enable it, which can be installed from the Ubuntu Software app.

Source: https://www.omgubuntu.co.uk/2019/04/how-to-re-enable-dynamic-transparency-on-the-ubuntu-19-04-desktop


How to install OTF fonts? I know how to install TrueType fonts (by copying them to /usr/share/fonts/truetype and doing sudo fc-cache -f) but what about OTF formats?

I didn't find a suitable folder to copy them to.

The directory you're looking for is /usr/share/fonts/opentype. If it's not there, you can just create it. Copy your OTF files there; this will install the font for all users. Then, recreate the fonts cache with the command sudo fc-cache -f -v.

You can also install fonts per user at ~/.fonts/. It makes no difference whether they're in any sub-folders or what type they are. Mine, as an example, are organised by foundry.

Alternatively, you can just double click them, this will open them with the Font Viewer, which let's you install them with one click:

Another approach is to convert the OTF font to TTF.  There are free online converters where you upload the OTF font files and they are then converted to TTF.  You then open with the font viewer and install as per usual. I've just done this and the font installed fine.


Does LVM option delete existing operating systems? I accidentally clicked this option when installing 12.10. Now, I am not seeing my other operating systems show up. I tried fgrep menuentry /boot/grub/grub/.cfg and only see Ubuntu. When I checked my partitions using fdsik, I saw that there are three partitions still.

If the operating systems are still there, how would I be able to access them?

Can you describe clearly? What is yoru other operating system? Linux or Windows？

You can need to activate the existing volume groups if you access the existing file systems (partitions / logical volumes), for example, if you boot from system rescue CD and want to access the volume group and logical volumes, you need to do the following:

vgchange -a y

Then you can show the logical volumes and mount the logical volumes

lvdisplay

mount -t fs_type /dev/volume_group_name/logical_volume_name /mnt/mount_point

Anyway, you need to provide more information before we can help.


Required to enter password every time I want to save a file in VSCode As I read around from a few threads here. I shouldn't run VSCode as root because it is dangerous. But every time I hit CTRL+S, I need to go down to the bottom right and click run as administrator and enter my password. Not just once, but every time I save a file. Even the same file that I already just saved 2 seconds ago.

I'm saving the files in a folder on my desktop: ~/Desktop/github.

Why does this happen and how can I avoid it?

check ownership and permissions for that file.

ls -l

it will give you list of file, permission and ownership. Here is a example,
file list screen shot. If your user don't have ownership you can change it using

sudo chown -R $USER:$USER FOLDER_NAME

or if you are in user group (like www-data) and your user group own files but you can't do changes, you have to change permission level to 775, by doing this.

sudo chmod 775 FILE_NAME

You need to remove read-only permissions from the app folder as follows:

sudo chmod -R 7777 <project_folder_name>


Phonegap Error installation in ubuntu Good day every one,

I tried to install Phonegap in my PC but i counter the problem hopefully any can help me.

Here's the ubuntu version

Distributor ID: Ubuntu
Description:    Ubuntu 12.04.4 LTS
Release:    12.04
Codename:   precise

Here's the error during my installation

$ npm http GET https://registry.npmjs.org/phonegap
npm ERR! Error: SSL Error: CERT_UNTRUSTED
npm ERR! at ClientRequest. (/usr/local/lib/node_modules/npm/node_modules/request/main.js:483:26)
npm ERR! at ClientRequest.g (events.js:156:14)
npm ERR! at ClientRequest.emit (events.js:67:17)
npm ERR! at HTTPParser.onIncoming (http.js:1294:11)
npm ERR! at HTTPParser.parserOnHeadersComplete [as onHeadersComplete] (http.js:91:29)
npm ERR! at CleartextStream.ondata (http.js:1176:24)
npm ERR! at CleartextStream._push (tls.js:375:27)
npm ERR! at SecurePair.cycle (tls.js:734:20)
npm ERR! at EncryptedStream.write (tls.js:130:13)
npm ERR! at Socket.ondata (stream.js:38:26)
npm ERR! You may report this log at:
npm ERR!
npm ERR! or email it to:
npm ERR!
npm ERR!
npm ERR! System Linux 3.8.0-37-generic
npm ERR! command "node" "/usr/local/bin/npm" "install" "-gf" "phonegap"
npm ERR! cwd /home/my_name
npm ERR! node -v v0.6.17
npm ERR! npm -v 1.1.21
npm ERR! message SSL Error: CERT_UNTRUSTED
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/my_name/npm-debug.log
npm not ok

Thanks,
Wang

Hopefully you found an answer in the last 6 months, but in case anyone is still running into this problem, here are some options:

Update Node + NPM

If you installed Node.js through the official 12.04 repositories (which looks like the case, from this line: node -v v0.6.17), your Node version is badly out of date by now.

Back in late February, shortly before this question was posted, npm stopped supporting self-signed certificates. As a result, lots of people working on Node projects ran into similar issues.  The fix? Update npm.

For instructions on upgrading, see this question on AskUbuntu.  Personally, I recommend managing Node versions using NVM, but you can also get the latest version via PPA.

Living behind a proxy

It's also possible to run into issues like these if you're trying to access the npm repository from behind a proxy (e.g. at a corporate office).  While this is less likely to be your issue, it can be solved by the following (taken from here):

npm config set proxy http://proxy.company.com:8080
npm config set https-proxy http://proxy.company.com:8080

You can also set a proxy for a single npm install command by running:

npm --https-proxy=http://proxy.company.com install express -g

Don't disable SSL checks

It's true that you can suppress the error by setting npm's strict-ssl setting to false. Disabling security warnings is a bad idea.

Try setting:

npm config set strict-ssl false


Changing colors in terminal output When i write scripts i want that some lines are colored in output. My questions is not about changing prompt (PS1) but for example how can i change that the output, let us say, "cat /var/run/reboot-required.pkgs" would be in red, for example.

Thx for answers

This may help: How can I print text in various colors?


Why is my npm install having an error? When I run npm install, I get this error:

npm ERR! install Couldn't read dependencies
npm ERR! Error: ENOENT, open '/home/mramahy/Desktop/package.json'
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR!     <npm-@googlegroups.com>

npm ERR! System Linux 3.19.0-26-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! cwd /home/mramahy/Desktop
npm ERR! node -v v0.10.25

npm ERR! npm -v 1.3.10
npm ERR! path /home/mramahy/Desktop/package.json
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     /home/mramahy/Desktop/npm-debug.log
npm ERR! not ok code 0

Why is that so?

I think you'll find that node 1.3.x ended a long time ago. I did some hunting and found someone with the same or similar issues. They had issues just two days ago or so. Take a peek here:

https://github.com/npm/npm/issues/10007

Specifically at the bottom of the page:

A dependency of yo expects the binary to be called node:

Link to yo info


How to disable strict host key checking in ssh? I would like to disable strict host key checking in ssh for Ubuntu 11.04. How to do it?

In your ~/.ssh/config (if this file doesn't exist, just create it):

Host *
    StrictHostKeyChecking no

This will turn it off for all hosts you connect to. You can replace the * with a hostname pattern if you only want it to apply to some hosts.

Make sure the permissions on the file restrict access to yourself only:

sudo chmod 400 ~/.ssh/config

https://askubuntu.com/a/87452/129227 suggest to modify the config file which helps. But instead of opening things up for any host I wanted this to be done per host. The script below helps automating the process:

example call

./sshcheck somedomain site1 site2 site3

sshcheck script

#!/bin/bash
# WF 2017-08-25
# check ssh access to bitplan servers

#ansi colors
#http://www.csc.uvic.ca/~sae/seng265/fall04/tips/s265s047-tips/bash-using-colors.html
blue='\033[0;34m'
red='\033[0;31m'
green='\033[0;32m' # '\e[1;32m' is too bright for white bg.
endColor='\033[0m'

#
# a colored message
#   params:
#     1: l_color - the color of the message
#     2: l_msg - the message to display
#
color_msg() {
  local l_color="$1"
  local l_msg="$2"
  echo -e "${l_color}$l_msg${endColor}"
}

#
# error
#
#   show an error message and exit
#
#   params:
#     1: l_msg - the message to display
error() {
  local l_msg="$1"
  # use ansi red for error
  color_msg $red "Error: $l_msg" 1>&2
  exit 1
}

#
# show the usage
#
usage() {
  echo "usage: $0 domain sites"
  exit 1
}

#
# check the given server
#
checkserver() {
  local l_server="$1"
  grep $l_server $sconfig > /dev/null
  if [ $? -eq 1 ]
  then
    color_msg $blue "adding $l_server to $sconfig"
    today=$(date "+%Y-%m-%d")
    echo "# added $today by $0"  >> $sconfig
    echo "Host $l_server" >> $sconfig
    echo "   StrictHostKeyChecking no" >> $sconfig
    echo "   userKnownHostsFile=/dev/null" >> $sconfig
    echo "" >> $sconfig
  else
    color_msg $green "$l_server found in $sconfig"
  fi
  ssh -q $l_server id > /dev/null
  if [ $? -eq 0 ]
  then
    color_msg $green "$l_server accessible via ssh"
  else
    color_msg $red "ssh to $l_server failed"
    color_msg $blue "shall I ssh-copy-id credentials to $l_server?"
    read answer
    case $answer in
      y|yes) ssh-copy-id $l_server
    esac
  fi
}

#
# check all servers
#
checkservers() {
me=$(hostname -f)
for server in $(echo $* | sort)
do
  os=`uname`
  case $os in
   # Mac OS X
   Darwin*)
     pingoption=" -t1";;
    *) ;;
  esac

  pingresult=$(ping $pingoption -i0.2 -c1 $server)
  echo $pingresult | grep 100 > /dev/null
  if [ $? -eq 1 ]
  then
    checkserver $server
    checkserver $server.$domain
  else
    color_msg $red "ping to $server failed"
  fi
done
}

#
# check configuration
#
checkconfig() {
#https://askubuntu.com/questions/87449/how-to-disable-strict-host-key-checking-in-ssh
  if [ -f $sconfig ]
  then
    color_msg $green "$sconfig exists"
    ls -l $sconfig
  fi
}

sconfig=~/.ssh/config

case  $# in
  0) usage ;;
  1) usage ;;
  *)
    domain=$1
    shift
    color_msg $blue "checking ssh configuration for domain $domain sites $*"
    checkconfig
    checkservers $*
    ;;
esac


What is the difference between adduser and useradd? What is the difference between the commands adduser and useradd on Ubuntu?

useradd is native binary compiled with the system. But, adduser is
  a perl script which uses useradd binary in back-end.

  adduser is more user friendly and interactive than its back-end
  useradd. There's no difference in features provided.

Source: What's the difference between “adduser” and “useradd”?

I'll also point out that adduser does not always have the -M option and also does not respect the --system flag which specifically says:

  Note that useradd will not create a home directory for such an user, regardless of the default setting in /etc/login.defs (CREATE_HOME). You have to specify the -m options if you want a home directory for a system account to be created.

If you're trying to create a system user without a home directory then use useradd --system -M.


How do I enable the "partner" repository? I keep seeing places refer to the "partner" repository as a place I can get software, how can I enable this repository? Please specify how to do this graphically and via command line.

GUI Way:

Click on the ubuntu button, then search for  "Software Sources" (or "Software & Updates" on Ubuntu 16.04+) and go to the "Other Software" tab.

Command Line Way:

Open the sources.list file: gksudo gedit /etc/apt/sources.list (or with the command line editor of your choice, sudo nano /etc/apt/sources.list would use nano on the command line without a GUI)
Add the partner repositories by removing the # in front of the following lines (maverick is the version of your Ubuntu installation, it may differ, so use the codename of the release you are using instead of 'maverick'. If you're not sure run lsb_release -c to find out.)

# deb http://archive.canonical.com/ubuntu maverick partner
# deb-src http://archive.canonical.com/ubuntu maverick partner

Save and Close.
Resynchronize the package index files from their sources: sudo apt-get update
Official documentation for reference

TERMINAL
just to make it easier,
copy and paste this one command:

sed 's/\# deb http\:\/\/archive\.canonical\.com\/ubuntu natty partner/deb http\:\/\/archive\.canonical\.com\/ubuntu natty partner/' /etc/apt/sources.list | sed 's/\# deb-src http\:\/\/archive\.canonical\.com\/ubuntu natty partner/deb-src http\:\/\/archive\.canonical\.com\/ubuntu natty partner/' - > /tmp/newfile && sudo mv -f /tmp/newfile /etc/apt/sources.list


Firefox fails to securely connect to Google services at random times [Ubuntu 16.04] Ever since yesterday, when I try to access Google or Youtube or Google Images, sometimes the page won't load and it will say that secure connection failed and display the following message:

SSL_ERROR_RX_MALFORMED_SERVER_HELLO

It has only happened few times so far and whenever I hit F5 the page just loads normally, but I'm still concerned. I tried to look for solutions online but every topic was Windows specific. Is there something wrong?

Are you using Firefox? This appears to be a FF bug:

https://bugzilla.mozilla.org/show_bug.cgi?id=1462303

Be aware that this can also be caused by something getting in the way of your traffic, either good-natured things like intrusion prevention systems or bad things like malware.

Set security.tls.version.max = 3 in about:config

  3 will use TLS 1.2

  4 will use TLS 1.3


sudo apt-get update not working. Err:1 http://archive.ubuntu.com/ubuntu bionic InRelease I have tried installing the package "httpd" on Ubuntu but it always fails. I read a lot of tutorials on how to install "Apache" on my computer. I found that after performing these tutorial operations, my computer was unable to perform sudo apt-get update.

I tried many solutions from internet

"This is the history of command line argument"

  799  sudo ufw default deny incoming
  800  sudo ufw default allow outgoing
  801  sudo ufw allow ssh
  802  sudo ufw allow 2222
  803  sudo ufw allow http
  804  sudo ufw allow 80
  805  sudo ufw allow https
  806  sudo ufw allow 443
  807  sudo ufw deny from 203.0.123.5
  808  sudo ufw enable
  809  sudo ufw status verbose
  810  sudo ufw status
  811  sudo ufw allow 'OpenSSH'
  812  sudo ufw status
  813  sudo systemctl start apache2.service
  814  ls
  815  yum install httpd
  816  sudo yum install httpd
  817  sudo systemctl start apache2.service
  818  cat /etc/redhat-release
  819  sudo apt-get update
  820  echo "nameserver 8.8.8.8" | sudo tee /etc/resolv.conf > /dev/null
  821  sudo apt-get update
  822  sudo nano /etc/apt/sources.list
  823  #deb http://archive.ubuntu.com/ubuntu/
  824  sudo apt-get update && sudo apt-get upgrade
  825  apt-get clean
  826  sudo apt-get clean
  827  sudo apt-get update
  828  ls
  829  cd ..
  830  ls
  831  cd etc
  832  ls
  833  cat resolv.conf
  834  sudo ufw default allow incoming
  835  sudo apt-get update
  836  sudo ufw status
  837  history
  838  sudo systemctl stop apache2.service
  839  echo "nameserver 8.8.8.8" | sudo tee /etc/resolvconf/resolv.conf.d/base > /dev/null
  840  cd ~
  841  echo "nameserver 8.8.8.8" | sudo tee /etc/resolvconf/resolv.conf.d/base > /dev/null
  842  echo "nameserver 208.67.222.222" | sudo tee /etc/resolvconf/resolv.conf.d/base > /dev/null
  843  clean
  844  clear
  845  sudo apt-get update
  846  /etc/network/interfaces.d/50-cloud-init.cfg
  847  /etc/network/interfaces
  848  sudo /etc/network/interfaces
  849  sudo apt-get /etc/network/interfaces
  850  sudo rm /var/lib/apt/lists/* -vf
  851  sudo apt-get update
  852  history

Err:1 http://archive.ubuntu.com/ubuntu bionic InRelease
  Temporary failure resolving 'archive.ubuntu.com'
Err:2 http://security.ubuntu.com/ubuntu bionic-security InRelease
  Temporary failure resolving 'security.ubuntu.com'
Err:3 http://archive.ubuntu.com/ubuntu bionic-updates InRelease
  Temporary failure resolving 'archive.ubuntu.com'
Err:4 http://archive.ubuntu.com/ubuntu bionic-backports InRelease
  Temporary failure resolving 'archive.ubuntu.com'
Reading package lists... Done
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic/InRelease  Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-updates/InRelease  Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-backports/InRelease  Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/bionic-security/InRelease  Temporary failure resolving 'security.ubuntu.com'
W: Some index files failed to download. They have been ignored, or old ones used instead.

same problem; my solution:
DNS Server has changed...

sudo nano /etc/netplan/50-xxxx-yyyyy.yaml

-->   addresses: [1.1.1.1,8.8.8.8,xx.xxx.xx.xxx]

sudo netplan --debug apply


ubuntu 13.04 installed with windows 7 but not showing option to select OS to boot with Hi I am running Windows 7 home basic 64-bit, with amdA8 and radeon graphic card pre installed.
My notebook is HP-Pavilion g6.

I have created the partitions to my 500GB-HDD before installing the ubuntu 13.04, Then i use the ubuntu 13.04 installer disk to install ubuntu. I use the same process as described in the guide which is

boot with the installer disk
select language, local time etc.
Then I select the option to install ubuntu alongside with Windows 7
and follow the process.

I got the message for installation complete and restart to begin boot with ubuntu. I do remove the disk from the tray and hit Enter to restart the system.

But when my system started it continued to boot with Windows 7 without showing me the option to select the OS. In my windows disk manager I am able to see two unknown partitions which i think is for swap partition and ext 4 partition.

Insert the live cd and use gparted program to delete those partitions. Then create them again. Choose at least 4GB for ex4 partition and 3GB for swap partition.

I'm guessing you have two hard drives and the master n
Boot record is on the windows drive.  Trying changing your bios setting to point to the one Linux was installed on and grub should load giving you multiple boot options.


Couldn't Kill Bluetooth Daemon I couldn't kill Bluetooth daemon in Ubuntu 16.04.

I tried below steps by seeing suggestions in internet.

rfkill unblock Bluetooth

sudo service Bluetooth stop

killall -9 bluetoothd

But still process is there even though if I kill it.

Perhaps systemctl disable bluetooth.service will work?  Do you actually have a bluetooth device?

In order to kill easily your process, get his PID with ps

and use the folliwing command :
kill -9 <PID> where PID is the PID of your process (here, PID of bluetoothd)


Login screen is reappearing, what to do? I am using Dell inspiron 3558, after opening the laptop, when I put password in the login screen the same screen appears after two or three seconds.
Please tell me what should I do.

In terminal, type (use the correct username):

cd /home/your_username
ls -l .ICEauthority # (that's a lower case L)
ls -l .Xauthority   # (that's a lower case L)

If either ls command returns one of these (where it shows root, instead of your username):

-rw------- 1 root root 242476 Nov  6 12:48 .ICEauthority
-rw------- 1 root root 58     Nov  6 12:48 .Xauthority

Then type (changing your_username to the correct username):

sudo chown your_username:your_username .ICEauthority

and/or

sudo chown your_username:your_username .Xauthority

I had the same issue before. It may be the same case as described in question What represent .Xauthority file?.

Try:

sudo chown your_username .Xauthority

And then try to log in again.


Ssh X11 forwarding very slow using Xshell My server is Ubuntu 12.10

And my client is Windows 7 64bit

Now I am using Xshell to connect my server via ssh

But after I forwarding X11, it's take a long time!!

after I enter

$matlab -nodesktop

it's almost take 5~10 mins to ready for use

I have found some speed up issue on the web but it's work on MAC not on windows(Xshell)!

following is solution for mac and it's worked perfect!

ssh -c arcfour,blowfish-cbc -XC username@host

But when I use Xshell it's always think  -c arcfour,blowfish-cbc -XC usernameis my username!

Is there any other way to make it faster?

First of all you should read ssh manpage.
-C (capital) enable zlib compression, this means server and client will spend time doing
   data compression/decompression. Since you want to speed up and - i guess - bandwith is
   not a problem you should not use it

-c arcfour,blowfish-cbc is to specify a different cipher to encrypt. while those cipher
   could be faster,they are known to be insecure. Unless you know what you are doing you
   should not use them

Last, those are option for ssh not xshell which is a totally different program


What is the most ms Word-compatible word processor available? I have to write a dissertation for my university. I have to respect various format guidelines, and my professor uses MS Word on his workstation. In my experience, LibreOffice has been faulty when it comes to MS Word compatibility, with many incorrect parameters (happened earlier this month). I can't afford a MS Office licence to install it in Wine, so I'd like to know if there are any alternatives for Linux.

As of right now, LibreOffice is the most compatible word-processor with MS Office.

KingsoftOffice has an interface which is more similar to MS Word than LibreOffice, but the documents made in KingsoftOffice are less compatible with MS Office than the documents made in LibreOffice.

Even though KingsoftOffice has a similar interface (GUI), that doesn't mean that it is compatible with MS Office.

I understand your problem, and I want to give you a good advice: Make the entire document in LibreOffice. Work in LibreOffice, but use MS Office only for final editing.

My advice does not work with complicated files with tables, but is sufficient for university dissertation with text and the occasional simple table. For final editing you can use someone else's MS Office, for example - The MS Office in your universities library.

I know that My proposition is not ideal, but it is a proper solution: Editing mainly with LibreOffice, but using MS Office Word only for compatibility checking and compatibility editing. In some cases it may occur that the document made in LibreOffice is 99% compatible to MS Office Word, in some cases not.

Format editing usually takes less time than creating an entire document in MS Office.

For example, when I learned in university, I wrote my thesis in LibreOffice, but my roommate had legal installation of MS Word. I asked him for his MS Office installation only few times a month, when I need proper MS Word formatting.

There is also Open Office which many people still use for free. It is compatible with all word documents and you can save as a word document. I recommend this software.


How do I disable "An update for GNOME Shell extensions" notifications? Or automatize the updates? Or delete/disable the update notifier? It is not in the list of "installed extensions" and re-installing it does not help.

Where are its files located?

To get rid of the update notification, you will need to disabling the automatic check for updates to Gnome Shell Extensions in preferences of the "Gnome Shell Preferences" extension of your browser.
In Firefox:
- Select Tools - Add-ons (or "Add-ons" under the Open Menu button)
- Select "extensions" in the menu on the left, then click the "Preferences" button next to "GNOME Shell Integration".
- Scroll to the bottom of the page, where you can disable the option "Check for extensions update".

The automatic check does do only that: check whether there is an update and notify you. If yo do not want the notification, then it does not make sense to check. So deleting the notification means you need to disable the check.

There is currently no mechanism where updates to Gnome Shell extensions that have been installed by the user are automatically installed. In contrast, extensions that have been installed system-wide will be automatically updated like any other software through your package manager.

Files are located at: ~/.local/share/gnome-shell/extensions

disable notifications for app:
settings->notifications
select that app and turn notifications off


Comodo in Ubuntu 18.04 LTS 64-bit I have this problem with Comodo:

   (Reading database ... 143450 files and directories currently installed.)
Preparing to unpack cav-linux_x64.deb ...
Unpacking cav-linux (1.1.268025-1) over (1.1.268025-1) ...
Uninstallation succeed!
dpkg: dependency problems prevent configuration of cav-linux:
 cav-linux depends on libssl0.9.8 (>= 0.9.8m-1); however:
  Package libssl0.9.8 is not installed.
dpkg: error processing package cav-linux (--install):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 cav-linux

Is any simple solution or is better to wait for Comodo updates that fit Ubuntu 18.04 LTS 64-bit.

Thanks

You may try to install with

sudo dpkg -i --ignore-depends=libssl0.9.8 /path/to/cav-linux_x64.deb

or download libssl0.9.8 from http://security.ubuntu.com/ubuntu/pool/universe/o/openssl098/libssl0.9.8_0.9.8o-7ubuntu3.2.14.04.1_amd64.deb
and install it before installing cav-linux_x64.deb.

For me, it leads me to a partial working application, even after installing make which was somehow required when running sudo /opt/COMODO/post_setup.sh. But try yourself and decide yourself if you want to keep it or not.

At least the package is not half-configured anymore but installed and if you don't want to keep it you can easily purge it with

sudo dpkg -P cav-linux

Note: A lot of files are already created when the installation stops during the configuration of the package but it's not possible to remove or purge the package as it's not seen as installed yet.

Update: If you experience errors during reboot after purging cav-linux just run sudo update-initramfs -u.


Cannot run maven2 on Linux Ubuntu 12.04 I am trying to compile a program using maven in my Linux 12.04. In order to do, I use the mvn clean install command. However I get a build error:

[ERROR] Unable to locate the Javac Compiler in:
  /usr/lib/jvm/java-6-openjdk-amd64/jre/../lib/tools.jar
Please ensure you are using JDK 1.4 or above and
not a JRE (the com.sun.tools.javac.Main class is required).
In most cases you can change the location of your Java
installation by setting the JAVA_HOME environment variable.

I check the path and indeed I am missing that critical file. This is what I have:

user@modelX:/usr/lib/jvm/java-6-openjdk-amd64/jre/lib$ ls
accessibility.properties  im                    net.properties
amd64                     images                psfontj2d.properties
calendars.properties      jar.binfmt            psfont.properties.ja
charsets.jar              javazic.jar           resources.jar
classlist                 jce.jar               rhino.jar
cmm                       jexec                 rt.jar
compilefontconfig.jar     jsse.jar              security
content-types.properties  jvm.hprof.txt         sound.properties
currency.data             logging.properties    swing.properties
ext                       management            tz.properties
flavormap.properties      management-agent.jar  zi
fontconfig.properties     meta-index

So apparently, I am running openJDK, but I am missing files. How do I fix this?

Apparently I was missing some important packages. I found the solution in this website:

http://sixarm.com/about/error-unable-to-locate-tools-jar.html


update manager and it won't work I'm trying to update Ubuntu 12.04 to 12.10 so I could update to most current Ubuntu.
when I used the "update manager" it doesn't work.

I read that it could be corrupted and to try the code:

sudo apt-get update && sudo apt-get upgrade

then I get a screen that shows: configuring ttf-mscorefonts-installer with a box that has the EULA agreement in it.

Nothing else is showing and nothing is happening. When I click on the red X, I get a message that says a process is going on, but I don't see anything going on.

So how can I get the manager updater to work so I can update to the latest Ubuntu.
I have a windows XP laptop 32 bit and I have Ubuntu as a dual boot.

I would first recommend to do the following:

sudo apt-get -f update

sudo apt-get -f upgrade

sudo update-manager -d

sudo do-release-upgrade -d

To upgrade do the following:

sudo apt-get install update-manager-core

sudo apt-get -f dist-upgrade


Installing Webmin on ubuntu? When trying to install webmin on ubuntu I get

Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package webmin

I am using this guide https://www.digitalocean.com/community/tutorials/how-to-install-webmin-on-ubuntu-16-04 and have tried it multiple times, any ideas? Oh I also have little to know understanding of things ubuntu. Thanks

Follow the following steps:

install wget package

$sudo apt install wget

install webmin

$ wget -qO- http://www.webmin.com/jcameron-key.asc | sudo apt-key add

$ sudo add-apt-repository "deb http://download.webmin.com/download/repository sarge contrib"

$ sudo apt update

now install webmin

$ sudo apt -y install webmin

installation complete.

now access with http://localhost:10000


TP-Link AC1300 T3U drivers for Ubuntu 18.04.2 LTS i am  new to Ubuntu and linux ,can any one help me with the installation of USB wifi adapter drivers on  Ubuntu . please see the link below for the adapter description .

https://www.tp-link.com/en/home-networking/adapter/archer-t3u/?utm_medium=select-local

Thank you

Download this GitHub file.
Traverse to the download directory then do the following:
Compile using make command
Install using sudo make install
Note : To unload driver you may need to disconnect the device
Then Run the following commands:cd ~
sudo dkms add ./rtl8822bu
sudo dkms install 8822bu/1.1

Reboot the system for new module to be picked up
P.S.
You might need to install dkms as well, if not already present.
To install dkms type following: sudo apt install dkms


how to edit grub.cfg to boot win 7? I can boot win7 when my laptop is on the start menu,by changing "insmod ldm" into "insmod part_msdos" in grub.cfg to boot window 7.

Before I update the kernel to 4.4.0-42, I can save the change. Now I can't save the file because it is read only.

Any suggestions?

You might notice that the grub.cfg file advises not to make changes to that file.  To edit grub, make your changes to /etc/default/grub.  Then run sudo update-grub.  The update-grub will make the permanent changes to your grub.cfg file.

If you are trying to make Windows your Priority Boot device, you can do that by make grub default to saved.  This way Grub will remember the last OS you booted to and will boot to that OS until you decide to boot to a different one.

To do this, make these changes to your /etc/default/grub files:

File Edit Options Buffers Tools Conf Help
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
#   info -f grub -n 'Simple configuration'

GRUB_DEFAULT="saved"
GRUB_SAVEDEFAULT="true"
#GRUB_HIDDEN_TIMEOUT="0"
GRUB_HIDDEN_TIMEOUT_QUIET="true"
GRUB_TIMEOUT="15"
GRUB_DISTRIBUTOR="`lsb_release -i -s 2> /dev/null || echo Debian`"
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obt

The changes from the default is highlighted by bold letters.

Alternatively you can use the GUI application GRUB Customizer.  It's available via a the ppa:

$ sudo add-apt-repository ppa:danielrichter2007/grub-customizer
$ sudo apt-get update
$ sudo apt-get install grub-customizer

After installing the PPA you can run it from the Ubuntu Dash search (grub-customizer).

This GUI application allows you to easily perform a number of options that you might not know how to look for such as sorting the order in which the Launchers Appear in the Boot Menu.

If the file permissions is your only problem, just change it.

sudo chmod 777 "whateverfile"

or if you want to be able to edit the entire directory.

sudo chmod 777 "directory" -R

*as a note 777 gives r/w access to every user so keep that in mind.

Best, BoB


How do I run a python script with Wine? I'm using Calibre to manage my ebooks and I'm trying to install a plugin that will allow me to manage library books that I get through Adobe Digital Editions via Wine. I've got everything installed, but I need to run an additional script to tie it all together. I get to one step in the instructions that says "you'll need to run the adobekey.pyw script using the python installation in your Wine system."

So how do I run a script using the python installation in Wine?

This is my first time using Wine, so please make your answers as basic as possible.

Here's the steps provided by the Calibre Ineptepub plugin's Readme

DRM tool available here: http://apprenticealf.wordpress.com/2012/09/10/drm-removal-tools-for-ebooks/

Linux and Adobe Digital Editions ePubs

Here are the instructions for using the tools with ePub books and Adobe Digital Editions on Linux under Wine. (Thank you mclien and Fadel!)

download the most recent version of wine from winehq.org (1.3.29 in my case)
properly install Wine (see the Wine site for details)
python 2.7 should already be installed on your system but you may need the following additional python package

apt-get install python-tk

all programms need to be installed as normal user. The .exe files are installed using ‘wine ’ but .msi files must be installed using ‘wine start ’
we need:

a) Adobe Digital Edition 1.7.2(from: http://kb2.adobe.com/cps/403/kb403051.html)
(there is a “can’t install ADE” site, where the setup.exe hides)

b) ActivePython-2.7.2.5-win32-x86.msi (from: http://www.activestate.com/activepython/downloads)

c) Win32OpenSSL_Light-0_9_8r.exe (from: http://www.slproweb.com/)

d) pycrypto-2.3.win32-py2.7.msi (from: http://www.voidspace.org.uk/python/modules.shtml)
now get and unpack the very latest tools_vX.X (from Apprentice Alf) in the users drive_c of wine
(~/.wine/drive_c/)
start ADE with:
wine digitaleditions.exe or from the Unity Dash search "Adobe Digital Editions"
register this instance of ADE with your adobeID and close it, open terminal and change to the tools_vX.X dir:

cd ~/.wine/drive_c/tools_vX.X/Other_Tools/

create the adeptkey.der with:
wine python ineptkey.py (only need once!)
(key will be here: ~/.wine/drive_c/tools_vX.X/Other_Tools/adeptkey.der)
Use ADE running under Wine to dowload all of your purchased ePub ebooks
install the ineptepub and ineptpdf plugins from the tools as discribed in the readmes.
copy the adeptkey.der into the config dir of calibre (~/.config/calibre in debian/ubuntu). Your ADE books imported to calibre will automatically be freed from DRM.

Here's an updated version that works in Mint 18.2

Install Wine from the repository (I have v 1.6).
Use Winetricks to install Python 2.6.
Copy file from
https://github.com/psyrendust/dedrm-ebook-tools/blob/master/DeDRM_Windows_Application/DeDRM_App/DeDRM_lib/lib/adobekey.py
to a text file adobekey.py in ~/C and make it executable. This file is also included with the DeDRM plugin - perhaps also PyCrypto as well. I just didn't take the time to see how to use those.
Install PyCrypto 2.6 for Python 2.6 from http://www.voidspace.org.uk/python/modules.shtml#pycrypto
Download link: http://www.voidspace.org.uk/downloads/pycrypto26/pycrypto-2.6.win32-py2.6.exe. I used the 32-bit version even though I'm running a 64-bit system.
Install Adobe Digital Editions (ADE) version 1.7.2 from http://download.macromedia.com/pub/developer/digitalpublishing/digitaleditions_172.exe. Later versions of ADE might work, but v 1.6 doesn't work.
Authenticate your computer with your Adobe ID account when ADE first starts.
Download the protected book (ePub or PDF) and open in ADE. I just drag the URLLink.acsm file into ADE, and it downloads and opens the book. Make certain you can open the book, and then exit ADE. Note that ADE saves the files in ~/My Digital Editions.
cd to your ~/C directory.
Run wine \\\\python26\\\\python.exe adobekey.py

If all goes well, it should create a file adobekey_1.der in that directory.
Install / Open Calibre with the DeDRM plugin already installed. Instructions for doing this are easy to find online (and linked above).
Go to Preferences -> Plugins -> File type plugins and double-click the DeDRM plugin. Select Adobe Digital Editions ebooks from configuration list. Click Import Existing Keyfiles and select the adobekey_1.der from ~/C .

Calibre should now be able to remove the DRM and open ADE protected documents. You should be able to remove PyCrypto and Python 2.6 and delete the adobekey_1.der keyfile.


Upgraded from 10.10 to 12.04. How can I remove any remnants of settings of Gnome? I formatted / but I used my old home folder. I am seeing some strange behaviours in Unity that I am guessing that may be because of configuration files from Gnome 2 (that I was using in 10.10). Could this be happening?
If I deleted several folders in my home, like .compiz, could I make sure there were not remnants of Gnome and if yes, which folders would they be?
Thanks for any help!

Have a look in ~/.config. There's a bunch of gnome related configurations there.

Unfortunately, this is one of the problematic things about using your old home folder.  You'll likely have to check your hidden folders that contain application settings (folders that begin with a .) for incompatibilities. .config is a good place to start.  You might also look for things like .gnome as well.  On the nVidia driver question.  You probably need to try using the nVidia 173 driver as it's the one with legacy support.  Lastly, nVidia-173 is available in Ubuntu 12.04.  This forum thread might be of some use on getting nVidia-173 in Ubuntu 12.04:  http://ubuntuforums.org/showthread.php?t=1984913


How to downgrade PHP from 5.3.x to 5.2.x I need to downgrade my PHP to 5.2.x from 5.3.x  Certain software I currently use requires it.
I found all these link explaining how to do it but they no longer work because they show you how to use the Karmic archives to downgrade but as those archives no longer exist on archive.ubuntu.com

Downgrade PHP to PHP5.2?
https://askubuntu.com/questions/47103/how-to-downgrade-from-php-5-3-to-php-5-2-in-ubuntu-10-10-maverick

I found this script on the ubuntu forums which worked for me

http://ubuntuforums.org/showthread.php?t=1566808

On ubuntu 10.10 you'll need to install aptitude as it is no longer installed by default.

sudo apt-get install aptitude

I would suggest you install the following:

sudo apt-get install php5=5.2.12.dfsg.1-2


Ubuntu 14.04.2 won't start up Ubuntu boots into a console instead of the graphical interface.
This is the result:
Ubuntu 14.04.2 LTS Ubuntu tty1

ubuntu login: steven
Password:
Last login: Mon Jul 20 05:51:12 EDT 2015 on tty1
Welcome to Ubuntu 14.04.2 LTS (GNU/Linux 3.16.0-30-generic x86_64)

* Documentation:  https://help.ubuntu.com/
steven@ubuntu:~$ _

I’m not sure how to make Ubuntu boot up from this stage.

You probably installed Ubuntu server instead of desktop.

Server version does not have a graphical interface.

You can download and install Ubuntu Desktop or run in console

sudo apt-get install ubuntu-desktop

If you find you do have ubuntu-desktop installed, execute the following:

gdm

It should fire up the GUI login page if it's configured correctly.


I have corrupted my sources.list Ubuntu 14.04 While installing python-pip I accidentally edited sources.list file and it's corrupted my entire pc. Please help me! I want to factory reset Ubuntu but nothing on the internet is helping me here. All the terminal commands related to apt are returning an error that
"cdrom/d " (the line I edited) is not known in sources.list
Can someone please please help me out here. Never used Ubuntu in my life and my first experience was this -_-

1.sudo nano /etc/apt/sources.list

2.Put a # at the beginning of the cdrom line you edited/added.

3.Ctrl+o to save, Ctrl+x to exit nano.

4.sudo apt-get update

If that works and you get no errors, you can try

5.sudo apt-cdrom add to get the cdrom entry added properly.

You can reinstall the entire OS, that'll get your file back. That's a big thing to do though.

You could also use a 3rd party service like SimplyLinux's RepoGen, but that's a 3rd party tool, so your mileage may vary here.

If that scares you, you could always try $ sudo apt edit-sources and comment out the offending line(s) in your sources file.

A third option (a risky one!) would be to reinstall apt:

$ sudo apt-get --reinstall install apt

Hope this helps!


Teamviewer - Cannot install libc6:i386 error I have download teamviewer.deb and click on it . It opened in Ubuntu Software center. And it shows the error

 cant install libc6:i386

so i found this below command and i tried it on terminal.

  sudo apt-get install libc6-amd64 libc6

but it shows some error.

Reading package lists... Done
Building dependency tree
Reading state information... Done
libc6 is already the newest version.
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
 or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
  libc6-amd64:i386 : Depends: libc6:i386 (= 2.19-0ubuntu6) but it is not       going to be installed
 E: Unable to correct problems, you have held broken packages.

any helps to solve and install teamviewer on my ubuntu 14.04 lts

Note : I have already read this articles. But no helps.

libc6:i386 : Depends: libgcc1:i386 but it is not going to be installed (on 14.04.2 64-bit)

still i am getting this error

varadha@varadha-X551CAP:~$ sudo dpkg --add-architecture i386
 varadha@varadha-X551CAP:~$ sudo apt-get -f install
  Reading package lists... Done
 Building dependency tree
 Reading state information... Done
 The following packages were automatically installed and are no longer     required:
 efibootmgr libtimezonemap1 secureboot-db
Use 'apt-get autoremove' to remove them.
 0 upgraded, 0 newly installed, 0 to remove and 49 not upgraded.

Are you on Ubuntu 64 bits or 32 bits ?
Have you downloaded Teamviewer 64 bits or 32 bits ?

In my case, when I was under Ubuntu 14.04 64 bits, I remember that I had  to use TeamViewer 32 bit for making it working.

I had the same problem, too. Please check your repositories in source list, because my wrong is put repositories ubuntu 14.04 for my ubuntu 15.04. Now, I have solved my problem.


Internet becomes unavailible after connecting through vpn I am connecting to vpnc which breaks my internet connection. I understand, that this is because all my traffic is forwarding to vpnc now, so the problem is about routing.

So, how can I manage my routes so only one port (1433) will use vpnc and all other connection won't pass traffic through vpn

I think I have a solution. Please follow the procedure as mentioned below;

Open Network connection and click on VPN tab.
Click on VPN to be configured.
Now click on Edit
Go to IPV4/6 Settings
Click on Routes button
Now check the box in front of the text "Use the connections only for the resources on its network" (This will solve the problem of breakage of your internet connection)
Add a route using add button. (I am not expert in adding routes, so wont be able to help you out here. But this is the way, you would be able to add the routes).

infact that with my vpn connection (ubuntu 10.04) i still could not connect to internet though i have already set "Use the connections only for the resources on its network" and "ignore auto obtain route...". This because network manager vpn alway add route 0.0.0.0         0.0.0.0         0.0.0.0         U     0      0        0 ppp0
when it connect. So i need to change default root again with add default gateway command:
sudo route add default gw 192.168.2.1 dev eth0
192.168.2.1 --> is gateway which i connect to internet.
And it's fine!


How to add WPA Enterprise TLS connection in Kubuntu? how to add WPA2 Enterprise connection over TLS in Kubuntu 10.13, using its standard network manager? I want to connect to my university’s eduroam network and cannot do it.

When I try to do it in connections editor, when I do “add wireless connection”, after filling all necessary data (network’s ssid and security details with WPA2 Enterprise over TLS authentication) after clicking “OK” nothing happens. No connection’s being added.

When I add some empty connection (only ssid filled, no security checked) it is being added to connections list, and I can edit it, but again after inserting security data it does not save changes. So I cannot configure this connection.

Details I try to insert:

Security: WPA & WPA2 Enterprise
Authentication: TLS
Identity: my.identity@student.put.poznan.pl
User’s certificate: [None]
CA certificate: [path/to/cacert.pem]
User’s private key: [path/to/user.p12]
User’s key password: [pass]

What are other ways to set the connection?

Create new connection to eduroam without setting security options (just to get connection file with UUID etc.)
Edit /etc/NetworkManager/system-connections/<connection_name_from_point_one> as root
Delete everything but connection, ipv4, and ipv6 sections
Add:

[802-11-wireless]
ssid=eduroam
mode=infrastructure
security=802-11-wireless-security

[802-11-wireless-security]
key-mgmt=wpa-eap

[802-1x]
eap=tls
identity=XXXXXXXX@student.put.poznan.pl
client-cert=file:///path/to/your/private/key/XXXXXXXX@student.put.poznan.pl.p12
ca-cert=file:///path/to/ca-cert/cacert.pem
private-key=file:///path/to/your/private/key/XXXXXXXX@student.put.poznan.pl.p12
private-key-password=XXXXXXXX
system-ca-certs=false

I think client-cert can be any file. The network doesn't need this, but NetworkManager does.

Apparently if you skip the user certificate, Network Manager won't save the configuration. Try to use the same certificate for both CA certificate and User certificate.


How to set JAVA_HOME for Java? I've installed a version of Java. How can we set the $JAVA_HOME environment variable correctly?

You can set your JAVA_HOME in /etc/profile as Petronilla Escarabajo suggests. But the preferred location for JAVA_HOME or any system variable is /etc/environment.

Open /etc/environment in any text editor like nano or gedit and add the following line:

JAVA_HOME="/usr/lib/jvm/open-jdk"

(java path could be different)

Use source to load the variables, by running this command:

source /etc/environment

Then check the variable, by running this command:

echo $JAVA_HOME

Update

Usually most linux systems source /etc/environment by default. If your system doesn't do that add the following line to ~/.bashrc (Thanks @pje)

source /etc/environment

If you do not know the path and you only have openJDK installed, you can type
update-alternatives --config java and you should find the path. To set the variable you can write JAVA_HOME=<PATH> followed by export JAVA_HOME. Notice there's no space when declaring the variable. To check if the variable is stored you simply type echo $JAVA_HOME to verify.


List of Twitter clients that support Oauth? Possible Duplicate:
  GUI Twitter clients: what are my options?

Can we get a list of Twitter clients that support Oauth going?

Gnome:

Gwibber

KDE:

Choqok source >= beta 3 has oauth

Air:

TweetDeck

Twhirl

If you don't insist on using free software - twhirl and TweetDeck (Adobe AIR apps) support Twitter's OAuth. Note that both of them support multiple accounts and can be used with status.net instances too.

At this point, if a client does not support OAuth, it won't work. Check the bug tracker for complaints about the program not working to see if they support it or not.


Android studio buggy after upgrade to 16.10 I recently upgraded from 16.04 LTS where my android studio was working fine to 16.10 but on trying to run my avd emulators, this is the error log i get back instead

Cannot launch AVD in emulator.
Output:
libGL error: unable to load driver: i965_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: i965
libGL error: unable to load driver: i965_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: i965
libGL error: unable to load driver: swrast_dri.so
libGL error: failed to load driver: swrast
X Error of failed request:  GLXBadContext
  Major opcode of failed request:  155 (GLX)
  Minor opcode of failed request:  6 (X_GLXIsDirect)
  Serial number of failed request:  55
  Current serial number in output stream:  54
libGL error: unable to load driver: i965_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: i965
libGL error: unable to load driver: i965_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: i965
libGL error: unable to load driver: swrast_dri.so
libGL error: failed to load driver: swrast
X Error of failed request:  GLXBadContext
  Major opcode of failed request:  155 (GLX)
  Minor opcode of failed r

In the recent android studio updates, google use a libstdc++ that is
incompatible with the intel driver installed on the system

You first have to install the following packages if there not on the system
lib64stdc++6 and mesa-utils

sudo apt-get install lib64stdc++6 mesa-utils

Then symlink the libraries to the android sdk tools path

## For the /Sdk/tools path

cd ~/Android/Sdk/tools/lib64/libstdc++
# making a copy of the file
sudo mv libstdc++.so.6 libstdc++.so.6.og
# symlink
sudo ln -s /usr/lib64/libstdc++.so.6 ~/Android/Sdk/tools/lib64/libstdc++

## For the /Sdk/emulator path

cd ~/Android/Sdk/emulator/lib64/libstdc++
# making a copy of the file
sudo mv libstdc++.so.6 libstdc++.so.6.og
# symlink
sudo ln -s /usr/lib64/libstdc++.so.6 ~/Android/Sdk/emulator/lib64/libstdc++

This link help. I did modify the location of the libstdc++.so based on my Ubuntu 17.10 installation. The libstdc++.so file location was different. Search your computer for libstdc++.so

Ubuntu 17.10 and Android Studio 3.1

cd /opt/android-sdk/emulator/lib64/libstdc++
mv libstdc++.so.6{,.bak}
mv libstdc++.so.6.0.19{,.bak}
ln -s /usr/lib/gcc/x86_64-linux-gnu/7/libstdc++.so


Tails 1.0 Frugal install: How to? I work on Ubuntu 13.10 and I'd like to "frugal install" Tails 1.0.
Is there anybody who knows how to edit 40_custom file to do it?
I found the following:

menuentry "Tails" {
    set isofile="/boot/iso/tails-i386-1.0.iso"
    loopback loop (hd0,7)$isofile
    linux (loop)/live/vmlinuz boot=live config noswap nopersistent
iso-scan/filename=$isofile nomodeset
    initrd (loop)/live/initrd.img
}

after that, I update grub and restart my Pc; System found Tails, but doens't start.
Any solution?

Try using this entry in 40_custom instead:

menuentry "Tails Security" {
loopback loop (hd0,7)/boot/ISO/tails-i386-1.3.2.iso
linux (loop)/live/vmlinuz boot=live union=aufs noswap noprompt ip=frommedia findiso=/boot/ISO/tails-i386-1.3.2.iso toram=filesystem.squashfs
initrd (loop)/live/initrd.img
}