Turn off my touchpad Ubuntu 12.10 I am not a fan of the trackpad/touchpad and I want to turn it off while using Ubuntu and I can't figure out how. I have a Dell Inspiron N5110 running Windows 8 with a dual boot option of Ubuntu 12.10.

The Dell Touchpad Properties show:

 "Driver"
Driver Provider:  Alps
Driver Date:  7/12/12
Driver Version: 8.1200.101.209
Digital Signer: Microsoft Windows Hardware Compatibility publisher

 "General"
Device type: Mice and other pointing devices
Manufacturer: Alps Electric
Location: plugged into PS/2 mouse port

In Windows 8 the Fn shortcut is Fn+F3 and that works but in Ubuntu it does not, even though a red box appears in the top right corner indicating it may have. It shows a trackpad icon with an X when the Fn key are pressed.

When I go into system settings, there is only a tab for mouse and nothing for the touchpad.

I've tried several methods listed here and nothing seems to work.

The following methods will ensure your changes persist as long as you use gnome:

Using GUI (dconf-editor)

Install and run dconf-editor (if you're on 12.10, dconf-editor might be pre-installed):

$ sudo apt-get install dconf-tools

$ dconf-tools
Go to the following settings directory:

org.gnome.settings-daemon.peripherals
Under touchpad, uncheck the touchpad-enabled checkbox.

Command-line

If you prefer not to meddle with dconf-editor's GUI, run the following command instead:

$ gsettings set org.gnome.settings-daemon.peripherals.touchpad touchpad-enabled false

Check in the Setting, under Keyboard, Shortcuts. Here you can browse to any number of features and enable them to your chosen key combinations. Trackpad is under System, Hardware.


Errors after upgrading Ubuntu from 19.04 to 19.10 I was trying to download a package and I couldn't do it because the sources.list contained links that were deprecated.
While upgrading, I saw the following error:
 An upgrade from 'disco' to 'focal' is not supported with this tool.

So, I searched and came across this link Cannot upgrade from disco 19.04 to focal 20.04 after end of life using do-release-upgrade method
In it's comments, I came across this link https://tips.graphica.com.au/upgrading-from-retired-ubuntu-releases/
Briefly, I did the following steps:

Edited /etc/apt/sources.list to point to:
"deb http://old-releases.ubuntu.com/ubuntu" and not any other repository.
Ran sudo apt-get update && sudo spt-get upgrade
The 19.04 was fully updated and upgraded and I could install softwares from there.
I tried to now update to 19.10 and then to 20.04. For it, I ran command: do-release-upgrade
It said that disco to focal is not possible.
So, I followed the link specified earlier and I modified  ~/.cache/update-manager-core/meta-release
I found out that, there disco, eoan, focal were present in which only focal's supported parameter was 1 so I changed the supported parameter of Eoan and disco to 1 too
Then I ran the command do-release-command.
It was running smooth. 2 hours were past. I was left at a purple screen for half an hour. I pressed power off button and restarted the system with Ubuntu. The grub's look was a bit changed which specified that it got installed., but then when I clicked on Ubuntu, following error was present. This is the picture after I clicked on BIOS.

You cannot upgrade from an unsupported release (19.04, and b.t.w., even your target release, 19.10, currently is not anymore supported). You always should remember upgrading while your current release is still supported.
At this stage, a fresh reinstall is your only option to install a newer and supported system.


Unable to install Internet Explorer 11 When I am try to install Internet Explorer using the command sudo apt-get install wine cabextract) my VLC player gets unpacked/uninstalled/removed.

Please provide me with a suitable command to install Internet Explorer.

The host of that file at http://www.tatanka.com.br now advises

"The new Internet Explorer and Edge can not be run on Wine anymore"

Instead, they recommend

"So Microsoft has its own VMs for this:"

https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/

"Virtual Box, vagrant, VMWare and others are supported."

Ubuntu's default web browser is Mozilla Firefox. Some web sites require Internet Explorer for full functionality, and it is possible to make the browser claim to be Internet Explorer.

To install Internet Explorer you will need to install two components first, Wine and cab extract.

sudo apt-get install wine cabextract

To finish the install you need to download Internet Explorer.

wget http://www.tatanka.com.br/ies4linux/downloads/ies4linux-latest.tar.gz
tar zxvf ies4linux-latest.tar.gz
cd ies4linux-*
./ies4linux

This should open up a GUI. In the case of Command Line being used:

Welcome, ! I'm IEs4Linux.
I can install IE 6, 5.5 and 5.0 for you easily and quickly.
You are just four 'enter's away from your IEs.

I'll ask you some questions now. Just answer y or n (default answer is the bold one)

IE 6 will be installed automatically.
Do you want to install IE 5.5 SP2 too? [ y / n ]

Select y to install.

And do you want to install IE 5.01 SP2? [ y / n ]

IEs can be installed using one of the following locales:
EN-US PT-BR DE FR ES IT NL SV JA KO NO
DA CN TW FI PL HU AR HE CS PT RU EL TR
Default is EN-US. Hit enter to keep it or choose a different one:

Hit enter to select the default language or choose another.

By default, I will install everything at /home/.../.ies4linux
I will also install Flash 9 plugin and create Desktop shortcuts.
Is that ok for you? (To configure advanced options type n) [ y / n ]

Internet Explorer will now install!


Dell Vostro 3568 model ubuntu 17.04 touch-pad left and right click behaving same way I'm using Dell Vostro 3568 model, recently installed ubuntu 17.04. My touch-pad left and right click working same way.

If left radio button selected in my settings( All Settings->Mouse & Touchpad->General->Primary button) then left and right click behaving like left click always no matter even I clicked left or right.

If right radio button selected in my settings( All Settings->Mouse & Touchpad->General->Primary button) then left and right click behaving like Right click always no matter even I clicked left or right.

Can some one help me to get this fixed, please?? Thanks in advance.

First add the line  Option "ClickPad" "true" to the file /usr/share/X11/xorg.conf.d/70-synaptics.conf so that the final output looks like:

Section "InputClass"
        Identifier "touchpad catchall"
        Driver "synaptics"
        MatchIsTouchpad "on"
        MatchDevicePath "/dev/input/event*"
        Option "ClickPad" "true"
EndSection

Then reboot the system. Right click should work fine now.

Adapted from this Red Hat bug report, as suggested by Hi-Angel.

Hold the right touchpad button for 2 seconds and if will work.


How to install JDK sources? How can I download the source code of Java on my local machine, so I can reference it in an IDE?

Example for Java 8:

sudo apt-get install openjdk-8-source

apt-get puts it under the relevant JDK location as src.zip: /usr/lib/jvm/java-8-openjdk-amd64/src.zip

Intellij IDEA recognized it automatically and started showing me the source code.

In case of java 13 simply run sudo apt-get install openjdk-13-source


How to run apache2 in chroot jail setup Ubuntu 14.04

I was trying to setup apache in chroot,but i can't found any related          answer.

I was googling over a week but i can't get my answers

so some one please help me.....

Thanks in advance

Apache >= 2.2.10 has built in chroot support. See the ChrootDir directive in the Apache docs:

Description:  Directory for apache to run chroot(8) after startup.
Syntax: ChrootDir /path/to/directory
Default:    none
Context:    server config
Status: MPM
Module: event, prefork, worker
Compatibility:  Available in Apache 2.2.10 and later

  This directive tells the server to chroot(8) to the specified directory after startup, but before accepting requests.

  Note that running the server under chroot is not simple, and requires additional setup, particularly if you are running scripts such as CGI or PHP. Please make sure you are properly familiar with the operation of chroot before attempting to use this feature.


How is login.ubuntu.com implemented? I'd like to build a single sign-on system similar to login.ubuntu.com.

Is there any source code available? If not, do you know on which technologies this has been built?

login.ubuntu.com is an OpenID provider. It is a Free Software project released under the terms of the GNU Affero GPL v3. You can find it on Launchpad in the canonical-identity-provider project.

It would use PHP probably and then save your data into a SQL database. Pretty much you enter the data into the HTML form which is then sent to the server. The server analyses the data to see if it's legitimate and then performs an action based upon it. If you are logging in, the server will likely sent session data and cookies to and from the server-client in order to establish a secure login. If you are registering, the server would create a new table into its SQL database with your username on the left and other data in the cells to the right.


Battery drains down even after shut down I am using ubuntu 16.04 on my HP 15 ab522tx laptop.Even after I shut down my pc after few hours I find it discharged completely .Also,battery is quite new and was performing better in previous OS(windows 10).

I also tried various power saving workarounds but I am not able to figure out why this happens!Please explain.

Is there any solution for this!

Output of systemd-inhibit --list  :

hemant@hpnb:~$ systemd-inhibit --list
     Who: NetworkManager (UID 0/root, PID 1258/NetworkManager)
    What: sleep
     Why: NetworkManager needs to turn off networks
    Mode: delay

     Who: Telepathy (UID 1000/hemant, PID 3222/mission-control)
    What: shutdown:sleep
     Why: Disconnecting IM accounts before suspend/shutdown...
    Mode: delay

     Who: Unity (UID 1000/hemant, PID 2637/compiz)
    What: sleep
     Why: Unity needs to lock the screen
    Mode: delay

     Who: hemant (UID 1000/hemant, PID 2569/unity-settings-)
    What: handle-power-key:handle-suspend-key:handle-hibernate-key
     Why: GNOME handling keypresses
    Mode: block

     Who: hemant (UID 1000/hemant, PID 2569/unity-settings-)
    What: sleep
     Why: GNOME needs to lock the screen
    Mode: delay

5 inhibitors listed.

Remove the battery for several hours and check if it will drain out. If the battery still charged, it should be healthy.

One possible trouble maker could be any USB port or other device that still powered while the system is shut down.

Extra powered USBs are feature for some laptops. Usually these ports are yellow colored. Port as this could be troublemaker especially if something is plugged in this port. In most cases this feature could be disabled via the BIOS settings.

Recently I've discovered that the new batteries should be charged to 100%. Unfortunately I can't find the source of this statement but this solve my problem with my new battery jump drain from ~35% to 5%.

Within Ubuntu the package tlp (apply laptop power management settings) could be helpful. It is capable to handle the power management of the devices (USB, PCI, etc.) at kernel level.

  TLP [1] brings you the benefits of advanced power management for Linux
  without the need to understand every technical detail. TLP comes with
  a default configuration already optimized for battery life, so you may
  just install and forget it. Nevertheless TLP is highly customizable to
  fulfil your specific requirements.

  Please note: TLP runs on every laptop brand. Setting the battery
  charge thresholds is available for IBM/Lenovo ThinkPads only.

  TLP is a pure command line tool with automated background tasks. It
  does not contain a GUI.

  TLP [2] (TLP - Linux Advanced Power Management) is more progressive
  management utility battery-for Linux, which applies different settings
  automatically when you log on and every time you change the power
  source, depending on your distro and hardware.

Basic usage of tlp:

Install the package: sudo apt update && sudo apt install tlp.

If you are using tp-smapi the better way to install the package is:

sudo add-apt-repository ppa:linrunner/tlp
sudo apt-get update
sudo apt-get install tlp tlp-rdw
sudo apt-get install tp-smapi-dkms acpi-call-dkms

There are two services installed tlp.service and tlp-sleep.service.
Use sudo tlp stat to check the current settings.
Use nano /etc/default/tlp to tweak the configuration.
Use sudo tlp start to apply the configuration.

Another useful tool is powertop, that is not just a monitoring tool, but has also a calibrating option: powertop -c.

tlp powertop

Are you sure your battery hasn't just begun to enter ill health. You need to charge it fully and drop test it to see if there is good current holding capacity.
remember Li-ion have a memory effect and should be charged for 24 hours from new without switching the device on. My laptop when fully charged reports theres 10 and a half hours of usage this is nearer 3 hours and it still trickle leaks when switched off so i have to plug it into the charger every time i want to boot from a long cold period.


Missing HDMI audio output(device unplugged), NVidia audio card not detected My ALSA information is located at:

http://www.alsa-project.org/db/?f=85ca372146c77ccef3fd60151d30fb86dd6c2dcf

Introduction:

I'm running Ubuntu 16.04 with an NVidia chipset 'GeForce GT 525M'.

I've installed the proprietary tested driver of NVidia, version 361.42 as suggested in 'Softwares and updates' section.
I'm able to connect my laptop to my Sony Bravia TV 48W600B using a HDMI cable and I'm getting the video output perfectly.

Problem Statement:

The problem I'm facing is that I'm not getting any audio output.

NVidia audio card is not detected.
In /proc/asound, I don't find an NVidia folder, but a PCH folder(the one for Intel), exists.

Probes:

i.)
Command: aplay -l

Result:

  **** List of PLAYBACK Hardware Devices ****
  card 0: PCH [HDA Intel PCH], device 0: ALC665 Analog [ALC665 Analog]
    Subdevices: 1/1
    Subdevice #0: subdevice #0
  card 0: PCH [HDA Intel PCH], device 1: ALC665 Digital [ALC665 Digital]
    Subdevices: 1/1
    Subdevice #0: subdevice #0
  card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]
    Subdevices: 1/1
    Subdevice #0: subdevice #0

ii.) Command:

lspci

Result:

  00:1b.0 Audio device: Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller (rev 05)

  01:00.0 VGA compatible controller: NVIDIA Corporation GF108M [GeForce GT 525M] (rev a1)

As you can see, there is no HDMI audio device listed.

Things I've tried (with the help of various other links):

I tried going to sound settings but I don't see any HDMI option there.
I tried pulseaudio -k but in vain.
I opened alsamixer and there is no HDMI audio device listed when I press 'F6'.
I tried using the command sudo adduser $Username audio and got myself added to the audio group, with no effect.
If I use the command pactl set-card-profile 0 output:hdmi-surround
, I get the HDMI 5.1 and 7.1 output option under 'Digital Output(S/PDIF)', but it doesn't work when I test it. Soon, the option disappears when I go back.
And I'm not able to increase the S/PDIF volume from alsamixer window either.
Ran the following utility to get static.
speaker-test -c 2 -r 48000 -D hw:0,3.
Did not get any noise.
And finally, I had installed pavucontrol and set the configuration as 'HDMI output+Analog Input'.

There is a dummy output and no sound.

I had a similar issue with a zotac micro pc with Nvidia card.  In the end, mine had nothing to do with the Nvidia drivers.  It was a default setting issue in the BIOS.  I was able to access the audio settings there.  Mine were set to the external (headphone) jack only.  I switched audio to the HDMI port, saved and exited.
HTH,

It is not the first time that proprietary drivers for NVidia give issues. In this post https://askubuntu.com/a/117773/805192 a similar problem (maybe the same) was addressed and therefore might be useful for you.

Otherwise you may consider installing a non-proprietary driver, for which I already gave instructions in this post: https://askubuntu.com/a/1029124/805192. However this was a solution for a situation where also the video wasn't working, so it's not guaranteed that will be relevant for your problem.


How can I use Left Ctrl+Alt combination for special characters? I've been using Ubuntu for few days and I really like it, but I have a problem with my keyboard:
I can't use the left Ctrl+left Alt combination to type special characters like in Windows.

How can I activate this combination?

Open Text entry ,mark input source and press on keyboard icon. You will see all characters available for particular input source.(As you can see not many options for English (US) layout but instead you can use English (US, alternative international) layout)

If you want to use additional keys open keyboard>shortcuts>typing and set a Compose key and Alternative characters key. The latter is used to write additional keys of present keyboard layout (My guess is that's what you've been looking for).

In this case I have set RCtrl as Alternative characters key. Note that you can set only one key for this and not a combo like LCtrl+Alt, which is by all means simpler. You can change the layout however suites you to gain missing keys, but I don't think you can rebind the way you want and not create further mess with your system.

The Compose key is used to write special characters(lets say it is AltGr):

AltGr+Shift then release followed by a+e will produce æ.

To write Unicode Characters press:
Ctrl+Shift+u, you will get underline u then release and type the Unicode without the leading zeros, e. g.:

Ctrl+Shift+u followed by aeEnter will produce ®, or

Ctrl+Shift+u followed by1f44fEnter will produce

You can use Character map to drag and drop any of the symbols you need.

Useful, but little old link.

On Ubuntu, you have to use AltGr.

This key is also the one you can/should use in Windows, but as Windows predates the AltGr key, they (still) treat AltGr and the combination Ctrl+Alt the same way (most of the time) whereas Ctrl+Alt is used for navigation under Ubuntu.


Wrong kernel running after install I have installed Ubuntu 14.04 from unetbootin. When it reboots after the install, uname -r says:

3.5.0-17-generic

..this means that no modules have loaded for the kernel that is actually installed (3.13.0-32-generic).

Does anyone know why this kernel should be installed via the install process? Is it an artifact of using Unetbootin? Booting into the Unetbootin image gives the correct kernel, and thus the modules load.

Knowing why is one thing, but I'm not sure how to remedy it now. Because no modules are loaded, I can't connect to the network or connect a USB drive.

I've tried update-grub, which seems to find the correct kernel, but doesn't seem to tell the system to boot from it.

I've also tried selecting the kernel at boot time using the "Advanced Options for Ubuntu", and the 3.13.x kernel is the only one listed. Selecting this lead to the 3.5.x kernel stubbornly loading..

I'm a fairly accomplished sysadmin, but this one has me flummoxed :) Can anyone help?

OK, I worked this out. It was a Unetbootin issue. I hadn't formatted the USB stick before putting a new image on there, and as a result it was installing the kernel from the previously installed version (on the USB) to the machines hard drive.

I'm not so sure why the live boot image seemed to work properly if that was the case, but in the end, the fix was to format the USB stick completely and re-image using Unetbootin.

EDIT: The simple solution is just to recreate the USB stick with Ubuntu's own Startup Disk Creator instead of UNetbootin, or try to format the stick first, as another answer suggests.

I also ended up having the wrong kernel on first boot of Ubuntu 14.04 after installing with an USB stick created with UNetbootin. The symptoms were that the boot partition could not be mounted, since there were no ext2 drivers available for the kernel.

The strange thing was that the kernel in /boot seemed to be the correct one, at least based on it's name. However, only the name was correct. The kernel in the file was old, which could be seen from it's modification date. The problem was solved by downloading the actual kernel package with

apt-get download

unpacking it with

dpkg -x

and copying the (identically named, but different size) kernel image to the boot partition.

I carried out the fix operation by starting the Live Ubuntu with the same UNetbootin USB stick, from where I could mount the actual boot partition (sda1 on my system).


How to boot from a USB drive in VirtualBox? The question is simple and straight forward:

How to boot from an USB drive in VirtualBox?

EDIT:

I have attached usb to VirtualBox as shown in the screenshot.

But it is not possible to boot from an USB drive even when attached  (reference).

So I would like to know if there is any other possiblity to boot from an USB drive?

VirtualBox itself does not support booting from a USB device. In order to boot from a USB device, another bootloader is required. The steps below provide one possible way to accomplish this:

Download Plop Boot Manager (currently v5.0.15)
Extract the file plpbt.iso from the ZIP archive and save it somewhere.
Open the settings for the virtual machine and attach the ISO file:

Add a filter for the USB device:

Boot the VM and select the "USB" option in the menu:

If all went well, the machine should now boot from the USB device.

I did not want to run Virtualbox as root.
I did not want my user to be of the disk group, having full permissions to all disks.

So here is what I got to work:

Find out what sd the memory stick is. In the following instructions it's sdc.

Unmount memory Stick

su -
chmod 666 /dev/sdc1
chmod 666 /dev/sdc
exit # Run the following command as regular user:
VBoxManage internalcommands createrawvmdk -filename usb.vmdk -rawdisk /dev/sdc
su - # Back as root again:
chmod 777 usb.vmdk
chmod 666 /dev/sdc

Attach usb.vmdk virtualbox machine

chmod 666 /dev/sdc

Start virtualbox machine
After done, reset sdc1 permission for security:

chmod 660 /dev/sdc1

In the above you can see that I had to reset the permissions for the memory stick a few times, because it would get set back to root each time.

I'm using Mandriva Linux, but it should be about the same in Ubuntu


How can I mirror my iPhone to Ubuntu 16.04? How can I mirror my iPhone to Ubuntu 16.04?

I have an iPhone 5 and I just want to mirror its screen on my monitor. Is there currently any way to do that? I would prefer a native solution instead of a VM.

Airshou is not working properly. You can look into Everycord to mirror your iPhone to Ubuntu. Everycord is available for all operating systems. You can download Everycord very easily. I hope this is useful.


How can I force apt to optimize the dependency tree for minimal download size? Some background information:

As you may know, in a Debian package, there may be alternative dependencies, written in the CONTROL file as Depends: apache2|something-else, for example. How does apt select which dependencies to choose, and how can I override this so I can minimize download size?

I'm on a slow connection on some locations and need it to use the smallest total download size. How can I force it to do so?

Edit: I'm not asking about skipping recommends.

Edit 2: I am not asking about skipping dependencies. I am trying to get all dependencies, just in the smallest total size, especially noting and deeply traversing package1|package2 choices.

Edit 3: A grep or otherwise shell script is acceptable.

Unfortunately, since the current answers do not really answer the question, they can't really get the bounty. It's still out there for someone willing to write a bash script!

Edit 4: Although the bounty has been awarded to a good answer which I encourage you to upvote, I am still seeking a more concrete answer. If it also elegantly handles virtual packages provided by one or more packages, then I'll possibly give another after-the-fact bounty to award that answer.

You could always have apt list all the dependencies then by hand you could install the packages that you would rather install but I've searched man pages and several forums but I could not answer your exact question other than rewriting the source to apt that's how opensource works anyways.

I think you're confusing how dependencies work. If something is dependent- then by definition it is needed. I suppose what you could do is find out exactly which files from the dependency the app you want is using... and remove everything that it doesn't call.. but that seems like a lot of work for a few megabytes..

You seem to be asking for a car that will still drive missing a 4th wheel(let's say the 'back-left', for the sake of this metaphor),to save on weight. At some point you're going to need to turn Right. The car will still roll, but only with certain functionality...  by not installing the 'Recommended' i think you are going as light as safely possible with out having to delve into development.


Remove or disable java due to the security issue According to the news there's java security hole that is still not fixed. How can Ubuntu users protect their PC? I've got gnome-shell installed and as far as I understand it depends on java. Which packages should I remove?

There's a guide for Mac users at Mozilla's site, but not for Linux. How to turn off Java applets

For Firefox,
Open Tools/Add-ons/Plugins (Keyboard shortcut is Shift+Ctrl+A) and find it on the list. Click the 'Disable' button to the right of it to disable the plugin. (Note that I've never bothered installing it so it's not present in my screenshot. If you have it installed you will see it here.)

For Chrome,
Go to chrome://plugins/. Find it in the list of plugins and click on 'Disable'. (Once again I am using Flash in my screenshot example because I never installed Java.)

Note that the Java plugin and Javascript are two different things. See here [Java.com] or here [stackoverflow.com] for an explanation of the differences.

Your browser should have the option to disable Java plugin.

For Chrome:

Under the Plug-ins section of the settings url: chrome://settings/content select "Block All".

With this option enabled, when you want to run plugins on a page you have 3 options:

1.Right click on the plugin and choose "Run this plug-in" from the context menu

2.Click the plugin icon in the URL bar and choose "Run all plug-ins this time

3.Add an exception for sites you trust so that they can run plugins without your explicit permission each time

Source - Dan Herbert

For Firefox

By default, Firefox allows Java applets to launch automatically. However, you may decide that you do not want Java applets to run. To disable Java applets in Firefox:

1.At the top of the Firefox window, click on the Firefox button (Tools menu in Windows XP), and then click Add-ons. The Add-ons Manager tab will open.

2.In the Add-ons Manager tab, select the Plugins panel.

3.Click on the Java (TM) Platform plugin to select it.

4.Click on the Disable button (if the button says Enable, Java is already disabled).

Java applets will no longer be permitted to launch in Firefox.

Source
Source 2

If you want to remove Java from your system, simply remove the packages you have installed.

To search Java packages, in a console type

dpkg -l java


Can't install software (Armory) - No install option I'm trying to create a offline BTC wallet using Armory. When I go to install it the software center pops up with 'Only install this file if you trust the origin" with an install button that can't be selected. I've tried to install via file > install but that's not available.

I think it may be a permissions issue but I'm not sure since I'm new.

How can I get around this to install the software?

Thanks

From the terminal type the following:

$ sudo dpkg -i /path/to/package.deb


How can I create a bootable USB stick on an Apple Macbook How do I create a bootable USB stick for Ubuntu using an Apple Macbook that can then be used on my Windows PC to replace it with Ubuntu?

New Method using Etcher

Make sure you have a USB Stick with at least 4GB of free space.
Get your Ubuntu ISO from here.
Open Disk Utility from Applications > Utilities
Select the USB stick and select Erase (This will remove all data stored on the USB drive)
Select the format: MS-DOS (FAT) and scheme: GUID Partition Map
Click Erase

Download, install and open Etcher (By default MacOS blocks running apps from unidentified developers. Follow this tutorial if you are experiencing problems with this.)
Select image and navigate to the location you saved the Ubuntu ISO you have downloaded in step 2
Select the USB drive you have formatted in step 3-6.
Click Flash

Congratulations! You now have Ubuntu on a USB stick, bootable and ready to go!

Old Method using UNetbootin (might still work)

Make sure you have a USB Stick with at least 4GB of free space.
Download and install UNetbootin USB installer
Download The Ubuntu Desktop ISO of your choice
Launch UNetbootin and allow the osascript to make changes

Select the Diskimage radio button and then click the ... button

Select the ubuntu ISO file you downloaded and click 'Open'

Then select your flash drive in the bottom row and click 'OK'
After Unetbootin finishes, click 'Exit' and now you have yourself an Ubuntu USB stick.

Source

Well, yes, you can. Look for the correct tool to do this, like unetbooting. For more information about, how to create a bootable USB you can look at this:

How to create a bootable USB stick on OS X.

And here: How do I create a bootable flash drive for installing Windows?,

And here: How to create a Windows 10 installer USB drive from a Mac.


Google Chrome - Profile could not be opened correctly error I am wondering if someone might be able to help me out.

I suddenly (well I believe it happened after some ubuntu system updates recently) have issues when going into Chrome with it complaining that the profile could not be opened correctly. I have tried many of the suggested fixes (which all work for a total of one launch of the program). What I'm finding is if I kill all google/chrome processes it won't give the profile error on next launch, it seems that chrome is not cleaning exiting (I have turned on the setting to not run chrome in the background... this made no difference). I've done an apt-get purge to clean before re-installing... did nothing to alleviate this issue. Chromium doesn't have the same issue.

Ideas? (On Version 45.0.2454.85 (64-bit) Google Chrome)
Ubuntu 12.04

PS: Also around this same time Firefox lost it's Minimize/Close buttons on the top right. I can only close it with alt-f4 now.

I had this problem too.

anyways. do:

cd ~/.config/google-chrome

then run

sudo rm -rf *

WARNING: THIS WILL MAKE CHROME RESET EVERYTHING! YOU WILL LOSE ALL BOOKMARKS!

This should fix this.

Try running

killall -9 chrome

Before starting chrome.


Check security mode of connected Wi-Fi network How do I check the security mode of the connected Wi-Fi network, using the command-line interface?

I want to know whether the current Wi-Fi connection is protected with WPA, protected with WEP, or is an open network.

I got it! :)

sudo wpa_cli status

command gives me information exactly that I want.

Selected interface 'wlan0'
bssid=80:1f:72:95:d2:b2
ssid=whatever
id=0
mode=station
pairwise_cipher=CCMP
group_cipher=TKIP
key_mgmt=WPA2-PSK
wpa_state=COMPLETED
ip_address=192.25.27.111
address=a4:4f:31:15:5f:44
uuid=6099d6ff-4b7d-538a-9e69-3479e250e401

Output of that command is easy to grep.

Click on the Wifi Icon on the top right corner.
Then click edit connections
Select the SSID and click edit
Go to security tab.
You will the find it there.

thank you


How to unzip a zip file from the Terminal? Just downloaded a .zip file from the internet. I want to use the terminal to unzip the file. What is the correct way to do this?

If the unzip command isn't already installed on your system, then run:

sudo apt-get install unzip

After installing the unzip utility, if you want to extract to a particular destination folder, you can use:

unzip file.zip -d destination_folder

If the source and destination directories are the same, you can simply do:

unzip file.zip

Follow these instructions: http://www.codebind.com/linux-tutorials/unzip-zip-file-using-terminal-linux-ubuntu-linux-mint-debian/

Install unzip
So First of all we need to install unzip on our system if it’s not installed. unzip command is used to extract files from a
ZIP archive.
Run the following command to install unzip
sudo apt-get install unzip

unzip Syntax
$ unzip [-aCcfjLlnopqtuvy] [-d dir] zipfile

Now Follow the steps below:
UnZip File
OPTION 1 – If the Zip File is in the same directory/folder in which your terminal is and we want to extract it in the present
working directory.
Use the following command to achieve the above described scenario
sudo unzip zip_file_name.zip

if the zip file is protected with some password, then use the
following command :
sudo ubzip -P zip_file_name.zip

Please make sure you use -P (capital P) not -p because the are
different options.
OPTION 2 – If the zip file is not present in the same directory and we want to extract/unzip the file in different directory.
Use the following command to achieve the above described scenario
sudo unzip path/filename.zip -d another_path_or_same_path

if we does not use option -d the file will be extracted to present
working directory.
And if the zip file is password protected we can also use -P.
use tar Command in Linux / Unix
tar is an acronym for Tape Archive. tar command is used to
Manipulates archives in Linux/Unix. System administrators uses tar
command frequently to rip a bunch of files or directories into highly
compressed archive which are called tarball or tar, bzip and
gzip in Linux/Unix system.
tar Syntax
tar [OPTION...] [FILE]...

Or
tar required Flags
tar {-r|-t|-c|-x|-u}

tar optional Flags
tar {one of the required Flags} [ -d ][-B] [ -F ] [ -E ] [ -i ] [-h ] [ -l ] [ -m ] [ -o ] [ -p ] [ -w] [ -s ] [ -U ] [ -v ]
[-Number] [-b Blocks] [-f Archive]

Examples
Create tar Archive File by Compressing an Directory or a Single File
The terminal command below will create a .tar file called
sample_dir.tar with a directory /home/codebind/sample_dir or
sample_dir in present working directory.
ripon@ripon:~$  tar -cvf sample_dir.tar sample_dir
sample_dir/
sample_dir/main.cpp
sample_dir/sample.png
sample_dir/output
ripon@ripon:~$ ls
sample_dir sample_dir.tar

Here’s what those flags (-cvf) actually mean
-c, --create– create a new archive
-x, --extract, --get– extract files from an archive
-f, --file ARCHIVE– use archive file or device ARCHIVE
Create tar.gz or tgz Archive File by Compressing an Directory or a Single File
The terminal command below will create a .tar.gz file called
sample_dir.tar.gz with a directory /home/codebind/sample_dir or
sample_dir in present working directory.
Notice that we have added extra flag -z to the command.Here’s what the
flag -z actually mean
-z, --gzip, --gunzip --ungzip– Compress the archive with gzip
ripon@ripon:~$ tar -cvzf sample_dir.tar.gz sample_dirsample_dir/
sample_dir/main.cpp
sample_dir/sample.png
sample_dir/output
ripon@ripon:~$ ls
sample_dir sample_dir.tar.gz

The command bellow will create a .tgz file. One this to notice is
tar.gz and tgz both are similar.
ripon@ripon:~$ tar -cvzf sample_dir.tgz sample_dirsample_dir/
sample_dir/main.cpp
sample_dir/sample.png
sample_dir/output
ripon@ripon:~$ ls
sample_dir sample_dir.tgz

Compressing Multiple Directories or Files at Once
Let’s say, For example we want to compress the sample_dir directory,
the java_test directory, and the abc.py file to a tar file called
sample_dir.tar.gz.
Run the following command to achieve the goal above.
ripon@ripon:~$ tar -cvzf sample_dir.tar.gz sample_dir java_test abc.py
sample_dir/
sample_dir/main.cpp
sample_dir/sample.png
sample_dir/output
java_test/
java_test/HelloCV.java
abc.py
ripon@ripon:~$ ls
sample_dir java_test abc.py sample_dir.tar.gz

Create .bzip2 Archive File by Compressing an Directory or a Single File
ripon@ripon:~$ tar -cjvf sample_dir.tar.bz2 sample_dir
sample_dir/
sample_dir/main.cpp
sample_dir/sample.png
sample_dir/output
ripon@ripon:~$

Notice that we have added extra flag -f to the command.Here’s what
the flag -f actually mean
-f, --file ARCHIVE– use archive file or device ARCHIVE

Extract .tar Archive File
We can extract or untar the compressed file using the tar command. The
command below will extract the contents of sample_dir.tar to the
present directory.
ripon@ripon:~$ tar -xvf sample_dir.tar
sample_dir/
sample_dir/main.cpp
sample_dir/sample.png
sample_dir/output
ripon@ripon:~$

The following command will extract or untar files in specified
Directory i.e. /home/codebind/dir_name in this case.
ripon@ripon:~$ tar -xvf sample_dir.tar -C /home/codebind/dir_name
sample_dir/
sample_dir/main.cpp
sample_dir/sample.png
sample_dir/output
ripon@ripon:~$

we have added extra flag -C to the command.Here’s what the flag -C
actually mean
-C, --directory DIR – change to directory DIR


How to install recommend packages from a file (package.deb)? I have a package.deb and want to install all dependencies (Depends field in debian/control) and all recommend packages (Recommends field in debian/control).

Options considered so far:

Gdebi apparently does not support installing recommend packages.
"sudo dpkg -i package.deb" followed by "sudo apt-get install --install-recommends -f" also only installs dependencies (Depends field in debian/control), but not recommend packages (Recommends field in debian/control).

Any other ideas?

One solution would be to set up your personal APT repository and install the package with APT from there.

Another possibility is to extract the dependencies from the package description. This script pulls the Recommends: line from the description in the .deb file and removes versions and keeps only the first alternative when there are several.

apt-get install $(dpkg-deb -I foo.deb |
                  sed -n 's/^ *\(Depends\|Recommends\)://p' |
                  tr , $'\n' |
                  sed 's/[|(].*//')

With aptitude, you can install the set of packages matched by a pattern. If there are alternatives, install the one you want first.

aptitude install '?reverse-recommends(foo)'

From the aptitude full-screen interface, highlight the package, press Enter, navigate to “Recommends” and press + then g.

there is a parameter in dpkg named --nodependencies ( that was in earlier days )
today parameter is named - see in man page -

--ignore-depends=package,...
Ignore  dependency-checking  for specified packages (actually, checking is performed, but
only warnings about conflicts are given, nothing else).

you could try that, but it can be a risk too.

I know only that mostly the risk is not so high. in terminal/konsole :

dpkg -i --ignore-depends=package1,package2,package3...    package-to-be-installed-name.deb


I used the updater on ubuntu 14.04 and when I restarted, it still shows 14.04 and Chromium no longer works, how do I get 16.04? I have a Dell Inspiron 3552 that came with ubuntu 14.04.  I used the updater to get updates (hoping to get 16.04) and when I restarted the computer, following the prompts, it still showed version 14.04 and Chromium no longer works.  how do I get the 16.04 version and should I scrap Chromium and download another browser?

You will not upgrade to a new release this way.

The correct command is do-release-upgrade.

Also I don't recommend to upgrade a pre-installed Dell Ubuntu 14.04 to 16.04. It causes lot's of trouble in many cases.

The recommended way is to do a fresh install of Ubuntu 16.04.

Regarding Google Chrome and probably other Chromium based browsers, they don't support 32-bit systems any more. You can use Firefox.

As with any major operation, the first thing to do is backup any data you can't afford to lose. Although problems are rare they do occur.

to check which version will be applied, open a terminal and do:
sudo do-release-upgrade -c

to make it easier on the dependency resolver, be sure your current software is up to date:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade

next clean up apt:
sudo apt-get clean
sudo apt-get autoremove

now you are ready to upgrade:
sudo do-release-upgrade

the installer should give a list of actions it will perform. read over the removal list carefully before committing to the upgrade.


Automatically copy podcasts onto ipod I'd like to be able to plug my 5th gen iPod nano into my Ubuntu 10.04 box and have it sync podcasts. I'd like newly downloaded podcasts to be copied onto the iPod, and played podcasts to be removed from the iPod.

I've tried syncing with:

Rhythmbox detects the iPod when it's plugged in, but doesn't sync podcasts to it.
Banshee doesn't detect the iPod unless I kill Nautilus. It also doesn't sync podcasts without intervention.
gPodder doesn't seem to detect the iPod. It will sync, but only if I tell it to. And it marks podcasts as unheard. The gpo sync commandline app has the same problem.
gtkpod doesn't detect the iPod. It will sync with intervention, but it syncs podcasts as songs.

This feels like a problem that someone else would have encountered by now. How do I get my Ubuntu box to sync podcasts with my iPod?

Interesting that you couldn't get it working with gPodder. I had this working with Ubuntu 10.04 but with an iPod 30GB video (a generation before yours?). I did have to fiddle a bit to make it work, but once working it was pretty much automatic.

Have you tried a newer version of gpodder than we have in Ubuntu?

The gpodder authors ppa has 2.7, Ubuntu Lucid has 2.2

https://launchpad.net/~thp/+archive/gpodder

You cant really "sync" but you can copy,paste and move things to-and from the iPod. What you can do is set up a cron job to sync hourly. You would need to set up a script to see where the mount point of the iPod is and to copy to the appropriate folder.


Why is Ubuntu unable to mount my hard drive when I use Nvidia Discrete graphics? I have a Lenovo Thinkpad T520 with Nvidia Optimus graphics. Optimus is designed to let you switch between discrete and integrated graphics as needed for performance and battery life.

The BIOS has three options for display: Optimus, Integrated, and Discrete. Integrated and Discrete enable only the Intel or Nvidia chipsets, respectively.

The system boots fine if I selected integrated (or Optimus) graphics in the BIOS, however if I choose Discrete graphics, I'm unable to boot. It appears, weirdly, that when discrete graphics are enabled, Linux is unable to access my hard drive. Here's a screenshot:

Unfortunately, while it appears to dropped to BusyBox, the system is totally unresponsive at that stage and must be rebooted.

The problem persists regardless of whether I've installed Nvidia's drivers, the Open Source Nouveau driver, or both. This is the Nvidia chipset, and the Intel chipset:

00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)
01:00.0 VGA compatible controller: NVIDIA Corporation GF119 [Quadro NVS 4200M] (rev a1)

I have a discrete Radeon card in an HP Pavilion m6. HP has recently locked the BIOS to only operate in "mixed" mode so I didn't have an option to BIOS disable Intel HD graphics, and here was my workaround.

BIOS set to mixed - couldn't change this, but in the end it didn't seem to matter.
Synaptic > Settings > Repositories > Additional Drivers

Bingo, under the default xorg option is fglrx proprietary drivers for AMD graphics card.

Download base packages from the proprietary from apt-get or Synaptic. When I just tried to switch drivers without doing this the progress bar would hang with no error, so this one is important.
Once downloaded switching the selected driver to proprietary.
All systems report resources of the AMD graphics, MUCH cooler operation, instant and noticeable improvement in the general GUI.

Hope that translates to your hardware and helps you out a bit :)


Add android-studio/bin/ to PATH environmental variable Recently I installed Android Studio. Now I want to add android-studio/bin/ persistently to PATH environmental variable as Session-wide environment variables and not as System-wide environment variables. To do that I tried to edit ~/.profile as described here. So I have these at the end of ~/.profile:

if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/bin:$PATH:/usr/local/Android/android-studio/bin"
fi

Then I re-login to initialize the variable. But when I run studio.sh in terminal, I get this:

  studio.sh: command not found

Here are results of $PATH and echo $PATH:

$ $PATH
bash: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:
No such file or directory
$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games

Also I'm sure that ~/.bash_profile and ~/.bash_login do not exist. Now what cause the problem and how I can solve that?

Edit:

I change end of ~/.profile to this, but it does not work:

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/bin:$PATH"
    PATH="$PATH:/usr/local/Android/android-studio/bin"
fi

It looks like you edited this code snippet:

if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/bin:$PATH"
fi

which is included in ~/.profile by default.

The answer which lead you to do so is confusing IMNSHO.

I'd suggest that you change that code back to what it looked like before, and instead add a new line underneath it:

if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/bin:$PATH"
fi

PATH="$PATH:/usr/local/Android/android-studio/bin"

Then, next time you log in, PATH ought to be altered, whether $HOME/bin exists or not.

OK, there's a couple issues here:

Use echo $PATH instead of $PATH to check it!
The reason for this is that bash replaces $PATH with the contents of that variable everywhere, so just running $PATH tries to execute the contents of the variable, which is nonsense to hte bash interpreter.

You should add the content you added to ~/.profile to ~/.bashrc as well.

Make sure that "$HOME/bin" exists by running ls -d $HOME/bin.  If you get an error like bash: ls: No such file or directory. then it doesn't exist.  If it does exist then you should get an output something like /home/[username]/bin.

If all those are satisfied then you should be good to go.  If you're not, then just use this command: cd [path_to_studio_directory]; ./studio.sh instead.  That way you will start inside that folder and guarantee its execution.


Creating a .desktop file for a new application I just installed the lastest version of UGENE. I works fine but in order to use it, I have to enter the following in the terminal: cd ugene-1.11.5/ then execute ./ugene -ui to launch UGENE GUI.

This takes too long. I would like to build a .desktop file for UGENE to be used in Ubuntu 12.04 so that I can simply open it from the unity launcher.

Not sure if this is helpful but the website says: By default ugene script launches the command-line version of UGENE.

Here's what I have (not sure if it's right):

[Desktop Entry]
Version=1.0
Name=my Unipro UGENE
GenericName=Integrated Bioinformatics Suite
Comment=Unipro UGENE is a cross-platform visual environment for DNA and protein sequence analysis.
MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++;
Exec=/home/samuel/ugene-1.11.5 ./ugene -ui -c %F
Icon=/usr/share/icons/hicolor/scalable/apps/ugene.svg
Type=Application
Terminal=true
Categories=Utility;Development;
StartupWMClass=UGENE

I added the launcher named my Unipro UGENE to my unity bar and tried opening it but it doesn't appear. I must be missing something. I don't know what the StartWMCClass field is suppose to be nor do I know whether I entered the correct MimeType.

For reference see the Freedesktop Desktop Entry Specification, but this should work:

[Desktop Entry]
Version=1.0
Name=Unipro UGENE
Comment=Unipro UGENE is a cross-platform visual environment for DNA and protein sequence analysis.
Exec=/home/samuel/ugene-1.11.5/ugene -ui
Path=/home/samuel/ugene-1.11.5/
Icon=/usr/share/icons/Humanity/apps/32/access.svg
Terminal=false
Type=Application
Categories=Utility;Development;

Some notes:

Version

Should be 1.0, it refers to the .desktop file version, not to the program version.

Name

The name that should be displayed on the menu.

Exec

The full path to the executable. No need to use '.', it just means the current dir

Path

The dir that will be set as current when the entry is run. You usually don't need to set it, but I have added it just in case. It is the same as using 'cd' in your command line

Icon

The path to the icon file that will be used for the file, it's likely that the one that you put doesn't exists, I have changed it for a generic one. You should change this to the file that you want the icon to use

Mimetype

Specifies the kind of files that this program is able to open. I've left it empty.

StartupWMClass

Only needed for some programs, It is usually needed by java programs but only set it if you notice some problems.

To use the desktop file from the Dash you will need to copy it to /usr/share/applications for any user to be able to use it (you will need administrator permissions) or to ~/.local/share/applications (where ~ means your user directory) if you just want it to be available for one user.

Instead of manually adding .desktop files, you can use the little GUI tool alacarte (Main Menu) to do this for you.

Installation:

sudo apt install alacarte


Keyboard Shortcut not Appearing in Keyboard I'm trying to play Minecraft (A video game) that makes use of F3. However, I'm on a laptop which requires you to hold down Fn in order for a F# key to be registered. The problem is that Ubuntu registers Fn+F3 as the lock keyboard shortcut. How can I turn this behavior off? Also, the shortcut isn't appearing in Keyboard.

Here is some background info that could help.

Check out the section on replacing shortcut keys. It's near the bottom. You can use xbindkeys to set hot-keys.  Here's how:

Install xbindkeys with:
sudo apt-get install xbindkeys.

Create a default config file with:
xbindkeys --defaults > /home/your-user-name/.xbindkeysrc

Install the GUI for xbindkeys with:
sudo apt-get install xbindkeys-config

The xvkbd utility must also be installed:
sudo apt-get install xvkbd

Next, bring up "Run Application" and type
xbindkeys and xbindkeys-config

If you want to override the system hot-keys already in effect, you need to install xmacro:
sudo apt-get install xmacro

Start xmacro with xmacroec :0.0
After giving a key that will allow you to quit xmacro, you can press the key(s) you want to know the code for.  You can then use xbindkeys to override the system hot-keys that are bothering you.

Here is the home page for xbindkeys.

This may help as well :
Here is a tutorial for turning off a shortcut.

I was having the same problem with Minecraft. Just as a hunch, I tried pressing F3 without Fn and it worked.


Configuring Atom for running Python I have been trying to setup Atom editor for running python programs on Ubuntu 18
The packages I installed are :
script
atom-runner
autocomplete-python
python-tools

I even configured the config.cson file as per the atom-runner configuration .

I am getting the following error:

Atom Runner: testing.py
Atom Runner: testing.py

Unable to find command: python
Are you sure PATH is configured correctly?

is there something else I need to do ?

There is a section about this error in the FAQs for the atom-runner package here that may help you.

It would seem that the python command is not in your path. Check where python is in your system with

which python

and check that the path (or at least part of it) is in your PATH:

echo $PATH

If not, adding the path to python to your PATH should solve the problem. To do so, add the following line to your .bashrc file:

export PATH=$PATH:[your path to python here]

replace the square bracket with the output from which python

It just needed to install Python on system. Make sure you have installed it well before.

To install it :

http://ubuntuhandbook.org/index.php/2017/07/install-python-3-6-1-in-ubuntu-16-04-lts/


14.04 fresh install, freezes before login/no keyboard mouse Ubuntu noob here, replacing Windows XP on a dell dimension 9200. Installed 14.04 from USB, and everything worked before/during install. Now after booting, if I don't choose advanced options, etc, the screen freezes(purple screen displaying Ubuntu, 5 dots below, and enter passphrase box). Keyboard and mouse work before this screen is displayed. Using a Logitech USB keyboard/mouse combo, and I believe an Nvidia graphics card.

In the terminal (press Ctrl+Alt+T to open or otherwise login in recovery mode, jump to root command line then try this) run this

 sudo apt-get purge nvidia*
 sudo reboot

This will remove any installed nvidia drivers.

Then install the new drivers

sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt-get update
sudo apt-get install nvidia-361
sudo reboot

This will fix at least the nvidia issue - once you can login you can determine what other issues are there?


How to re-compile NM0.9 with enabled wimax? I found that the new Ubuntu comes with the Network Manager 0.9, but without the enabled wimax support. Please, give some advices how to re-compile it with --enable-wimax features. Thank you.

I found the solution, quite simple:

sudo apt-get source network-manager=0.9
sudo apt-get build-dep network-manager=0.9

Afterwards, we have to extract the archive network-manager_0.9.1.90.orig.tar.bz2 or another one depending on the version.

Compile with parameters:

$ ./configure --sysconfdir=/etc --localstatedir=/var --enable-wimax --with-distro=debian --enable-ppp --enable-polkit --with-udev-dir=/etc/udev --with-dbus-sys-dir=/etc/dbus-1 --with-pppd-plugin-dir=/usr/lib/NetworkManager --with-resolvconf --libexecdir=/usr/lib/NetworkManager --with-systemdsystemunitdir=/etc/systemd --with-dhcpcd=yes
$ sudo make
$ sudo make install

Of course, you need to have the wimax service and stack installed, pls, see the linuxwimax.org.

That's it. Should work, at least for my Intel Centrino 6250 it works greatly.

PS My recommendation to Canonical is to include the option --enable-wimax as default.

To get the driver for Wimax installed, just type the following in the terminal:

To open Terminal: Ctrl+Alt+T

Type in the following commands:

sudo apt-get update
sudo apt-get install madwimax


Best practices on using sudo in a bash script I have a long and long-running bash script where a handful of commands need to be run as root while the majority of commands need to be run as the regular user before sudo, because it would mess up file ownership and such.

I came up with some methods, but each of them have some problems

Method 1: Using sudo inside the file

#!/bin/bash
sudo echo "I must be run by root"
touch needsToBeOwnedByUser1
echo "needs to be run by user"
sleep 1000
sudo echo "I, again, must be run by root"

This would look good, from the way the code is written. sudo is written before the few statements that actually need to be run by root, but if the time between each sudo call is too long sudo again asks for a password. Also, if the first execution of sudo fails, e.g. due to an invalid password, the rest of the script is still executed.

Method 2: using sudo to call the file and then change back to the original user when needed

#!/bin/bash
echo "I must be run by root"
su username -c 'touch needsToBeOwnedByUser1'
su username -c 'echo "needs to be run by user"'
su username -c 'sleep 1000'
echo "I, again, must be run by root"

This also sucks, because I need to add su username -c in front of almost every line. Also finding the original username after sudo is possible, but cumbersome.

Is there a better way?

Edit: I only posted small, nonsensical scripts here to show what I am talking about. In the actual script I have some lines that need sudo (starting and stopping services), some lines where it does not matter if there is sudo and quite a lot of lines that really need to be run without sudo.

Regarding method 2, it's easier to use a function. For example:

#!/bin/bash

func(){
    echo "Username: $USER"
    echo "    EUID: $EUID"
}

export -f func

func
su "$SUDO_USER" -c 'func'

$SUDO_USER is the sudoer's username. You could also use $(logname) in its place.

Running on my machine:

$ sudo bash test.sh
[sudo] password for wja:
Username: root
    EUID: 0
Username: wja
    EUID: 1000

Maybe this can help:

chmod 775 yourscript.sh

Then you can use sudo inside of the script (without password prompt)
And can not use sudo for other commands inside your script.


Bluetooth Audio interfering with WiFi? My Issue

Wifi is slow or completely broken when using Bluetooth headphones.

It is said that this is a well know issue as BT and WiFi share the 2.4Ghz frequency.

Is this something that could be solved? Are cheap/low end devices more problematic than quality ones?

What I Have Tried

Disable coexistence in iwlwifi, run following command and reboot:

$ sudo tee /etc/modprobe.d/iwlwifi-opt.conf <<< "options iwlwifi bt_coex_active=N"

This was only a slight improvement as it changed the speed of wifi from zero to unusably slow.

Try different channels on router.

I tried both ends of the spectrum (1 and 11), neither created any improvement. Wifi still broken as soon as headphones are turned on. Setting router channel to auto has the best results so far.

System Info

$ uname -a
Linux alien-box 4.15.0-29-lowlatency #31-Ubuntu SMP PREEMPT Tue Jul 17 17:49:04 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

$ lspci -knn | grep Net -A3; lsusb
04:00.0 Network controller [0280]: Intel Corporation Wireless 7265 [8086:095a] (rev 59)
    Subsystem: Intel Corporation Dual Band Wireless-AC 7265 [8086:5410]
    Kernel driver in use: iwlwifi
    Kernel modules: iwlwifi
Bus 002 Device 002: ID 8087:8000 Intel Corp.
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 8087:8008 Intel Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 006: ID 1058:07a8 Western Digital Technologies, Inc. My Passport (WDBBEP), My Passport for Mac (WDBLUZ)
Bus 004 Device 005: ID 0bc2:ab31 Seagate RSS LLC Backup Plus Desktop Drive (5TB)
Bus 004 Device 004: ID 2109:0812 VIA Labs, Inc. VL812 Hub
Bus 004 Device 003: ID 2109:0812 VIA Labs, Inc. VL812 Hub
Bus 004 Device 002: ID 2109:0812 VIA Labs, Inc. VL812 Hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 005: ID 08bb:2902 Texas Instruments PCM2902 Audio Codec
Bus 003 Device 004: ID 28de:1142
Bus 003 Device 003: ID 8087:0a2a Intel Corp.
Bus 003 Device 002: ID 062a:4101 Creative Labs Wireless Keyboard/Mouse
Bus 003 Device 010: ID 2109:2812 VIA Labs, Inc. VL812 Hub
Bus 003 Device 009: ID 2109:2812 VIA Labs, Inc. VL812 Hub
Bus 003 Device 008: ID 05e3:0727 Genesys Logic, Inc. microSD Reader/Writer
Bus 003 Device 007: ID 0b33:0020 Contour Design, Inc. ShuttleXpress
Bus 003 Device 006: ID 2109:2812 VIA Labs, Inc. VL812 Hub
Bus 003 Device 011: ID 0d8c:0012 C-Media Electronics, Inc.
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

$ lsmod |grep 'bt\|blue\|rfcomm\|bn'
rfcomm                 77824  4
bnep                   20480  2
btusb                  45056  0
btrtl                  16384  1 btusb
btbcm                  16384  1 btusb
btintel                16384  1 btusb
bluetooth             548864  33 btrtl,btintel,bnep,btbcm,rfcomm,btusb
ecdh_generic           24576  2 bluetooth

Bluetooth works on the same 2.4 GHz freq as Wi-Fi.

BT coexistence is bad in iwlwifi, but enabled by default.

Run

sudo tee /etc/modprobe.d/iwlwifi-opt.conf <<< "options iwlwifi bt_coex_active=N"

and reboot.

This solution worked for me (using Qualcomm Atheros module):

echo "options ath9k btcoex_enable=1"  >  /etc/modprobe.d/ath9k.conf

see details: WiFi and Bluetooth coexistence: Qualcomm Atheros ar9462: Ubuntu 16.04


Show extra icon in Unity notification area (14.04, Copy Agent) I have installed Copy Agent but when I launch it the icon doesn't show up in the notification area ...

How can I fix this issue ?

please try

sudo apt-get install libappindicator1


How can I remove Amazon search results from the dash or disable the feature? How can I disable Amazon search results in the Dash?

Click on the Ubuntu button, search for "Privacy" and then turn off "Include online results" :

You can also remove it entirely by clicking on this button, then the orange "Available on the Ubuntu Software Center" button and selecting uninstall:

or via the command line

sudo apt-get remove unity-lens-shopping

You then need to log out and back in.

Another option would be to move the lens entirely out of the home dash and make it a standalone lens:

How can I move Amazon search results into a dedicated shopping lens and out of the home lens?
I have permanent connections to Canonical servers, what are they for and how can I turn them off?

From this tutorial, I have run in terminal -

sudo apt-get remove unity-lens-shopping

And then-

gsettings set com.canonical.Unity.Lenses disabled-scopes "['more_suggestions-amazon.scope', 'more_suggestions-u1ms.scope', 'more_suggestions-populartracks.scope', 'music-musicstore.scope', 'more_suggestions-ebay.scope', 'more_suggestions-ubuntushop.scope', 'more_suggestions-skimlinks.scope']"

And after that-

sudo apt-get -f install

Worked for me :)


Cannot Boot Ubuntu 12.10 (No wubildr / Cannot find GRLDR) I'm new to using Ubuntu and installed it using Wubi.exe on Windows 8. I created the partition, booted Ubuntu and everything was fine. I shutdown my laptop for the night and when I attempted to boot Ubuntu i got this screen: http://imgur.com/iKgPVMO

I've searched the forums and found one answer saying to copy "all 3" wubildr files into c\, which I see only two (wubildr and wubilder.mbr). Also my grub folder is empty, there are no hidden files in it what-so-ever. Please help?

It's the wubildr file it cannot find. It looks on all partitions until it finds one. So, maybe it has a problem finding it on C: (for whatever reason). Just copy it to the root of another drive. e.g. D:\wubildr. It doesn't matter which drive.

The problem is, you cannot install OS within windows and run it. Create Bootable USB (Easier than CD), you can go to http://unetbootin.sourceforge.net/ to create bootable disk. You can save ISO image from http://www.ubuntu.com first and then create bootable using the ISO image.Boot from the USB and you are good to go.


Music Organization via command line? I have a pretty decent library of songs I was able to grab from my Google Music account. However, there is no structure to them right now, only a mass of songs in a single folder.

Is there a command line only tool that can read through these, and tag/sort them for me? I know there are tons of UI based tools for this, but my server is headless.

I was able to find beets, which is pretty much exactly what I could have hoped for. It's a command line tool , written in Python, that will tag, sort, and clean up music libraries for you. the plugin possibilities are also pretty good.

I can't find/think of any headless programs to sort your music in the way you have described (although I think there should be). All I can suggest is connecting to the file system remotely on a desktop and using some program (such as Banshee) to help sort your music.


What is "cached" in the top command? When running top, I get:

top - 09:10:52 up 18:37,  1 user,  load average: 1.56, 1.33, 1.15
Tasks:  39 total,   1 running,  38 sleeping,   0 stopped,   0 zombie
Cpu(s):  0.1%us,  0.6%sy,  1.0%ni, 92.5%id,  5.8%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:   4194304k total,  3045460k used,  1148844k free,        0k buffers
Swap:        0k total,        0k used,        0k free,  2256128k cached

See the part: 2256128k cached?  What exactly does that mean?

I am comparing two VPS from two provider, this one always has a large amount there (70% of the used memory) and the other VPS provider always shows 0.

the Linux kernel will use available memory for disk caching, unless it's required by a running program.

This is considered good; say you have 4 GB RAM, and your programs are using only 1 GB. The other 3 GB are going to waste. Despite the "feel-good" impression from knowing you're only using 25% of your memory, the counterpart is that the other 75% is going unused. So the kernel uses that for caching files which significantly improves performance. It's automatic; unlike older operating systems you don't need to decide how much to devote to disk cache, or manually configure it.

"The Linux disk cache is very unobtrusive. It uses spare memory to greatly increase disk access speeds, and without taking any memory away from applications. A fully used store of ram on Linux is efficient hardware use, not a warning sign."

This is such a common question that there's an entire website devoted to it:

http://www.linuxatemyram.com

The website even has a way to empty the disk cache so you can then run some applications and see how much faster they are with the cache enabled :)

That number before cached is the amount of physical memory that is being used by cache buffers for your filesystems.

It's not actually related to SWAP, despite being on the "Swap:" line.

To verify my answer with a little experiment try the following:

Run top and note the value of 'cached'. Now run

dd if=/dev/zero of=~/trick bs=1M count=128

if you run top again you'll notice that 'cached' has grown by 128M

Now remove the file

rm ~/trick

Run top again and you'll see 'cached' has dropped by 128M

So for Mem:

total = used + free and

used = <all apps> + buffers + cached

(where buffers is basically metadata for the cached).  A bit confusing of a UI.


How to install Chrome browser properly via command line? I am trying to install chrome browser via command line.  I tried this:

$ apt-cache search chrome browser

The results show that the proper term is "chrome-browser," so I tried that:

$ sudo apt-get install chrome-browser

And then "Y" for the Y/n question.

But the installation threw errors.  Does someone see anything wrong with the commands I issued?

Google Chrome isn't in the repositories - however, Chromium is.

Google Chrome is only available for 64-bit Linux. I've included directions for 64 below.

To install Google Chrome, run the following:

sudo apt-get install libxss1 libappindicator1 libindicator7
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo apt install ./google-chrome*.deb

If error messages pop up after running the command sudo apt install ./google-chrome*.deb then run the command

sudo apt-get install -f.

If you want Google Chrome, just search it in google. If you want Chromium add this ppa:

sudo add-apt-repository ppa:chromium-daily/stable
sudo apt-get update
sudo apt-get install chromium-browser

And that's it. Enjoy your browser.


Why can't Ubuntu see wireless? 12.04 LTS

I just instaled Ubuntu on my Samsung Series 3 laptop. When the installation started from the dvd, it was able to easily connect to my wireless network, then during installation it's disconnected and when it's finished, wireless just doesn't work it cannot even see the networks anymore. Lists nothing. With cable I still can access internet but no wireless. It's a laptop so wireless internet is kinda important to have.

Please advise how to fix this. Thank you!

Assuming you have the WiFi drivers properly configured and installed in your recently built Ubuntu system, and from a root shell or with su (other privs might suffice but a root shell is the fastest reliable method to alter configs ), Linux shell commands and switches are case sensitive:

An instant "shotgun to the wall" method to determine if your WiFi adapter is properly installed but potentially just awaiting to be enabled is to do the following commands:

ifconfig wlan0 up
ifconfig wlan1 up

If there aren't error messages, your adapter was disabled and needed to be enabled.

If that still fails, can you run iwconfig and copy/paste the output since it isn't terribly lengthy as your dmesg that is best served hosted at codebin.org

iwconfig

And look for a wireless interface likely named wlan0 or wlan1, etc., that should have some description of your missing adapter.

Just because the installation bootstrapper managed to detect your adapter, doesn't mean the installed version is just as capable.


How to retrieve the data from Ubuntu one to windows 7? I have downloaded the zip file from ubuntu one for my windows 7 and when i open the exe file then it asks for id and password and after i enter them nothing gets displayed and the window gets closed. so how can i retrieve my data?

The UbuntuOne service was shut-down as of 20140601, so there's a good chance that your issues are related to that.

You have until 20140731 to retrieve your data, which you should be able to do by browsing to the limited file access page (after successful login) from any OS.

Download 7-zip and try to open the zip with that.

If that doesn't work, explain in your question how the zip was created.

You talk about an exe file? Where did that come from? When I hear exe in combination to zip, I see viruses flying around!


How do I change the length of time the lock screen appears for? When my screen is locked and I then reawaken it, by moving the mouse or pressing the keyboard, the password entry screen appears. How can I change the amount of time that is taken before the password entry screen turns off?

To be specific:

I lock my screen Ctrl+Alt+T
Screen goes blank
Move mouse to bring up login screen
If I do nothing else the screen turns off again after 1 minute

In my Brightness and Lock settings I have the screen set to turn off and lock after 10 minutes, but I can't see a setting to determine how long it takes for the screen to turn off after the lock screen has been woken. It seems to be set to 1 minute by default, can this be increased/reduced?

Ubuntu 17.04 and earlier (Unity)

Open System Settings, click Brightness & Lock and select a value for the screen turn off option, Turn screen off when inactive for:

Choose your time delay in the drop-down menu.

Ubuntu 17.10+ (Gnome Shell)

Check this question.

Press the windows button to get the unity search, then type lock in the search bar.
Open brightness and lock and change the timeout.


How to add a user without /home? I want to create a new user to run a service on the system but don't want to have /home and other configuration files for it. Like there is a user for postgres but it doesn't have any /home directory.

By default the command useradd doesn't create home directories, but for a daemon I recommend you to use the system option and change the shell to a non-existent one so no one can login with said account (in ssh for example):

sudo useradd -r -s /bin/false USERNAME

You can see all the options with man useradd and man groupadd if you want to create a group for the user too.

try this command:

sudo useradd vivek

This will create a user without creating your home folder at /home/vivek


Problems installing operating system I have encountered a problem while trying to install ubuntu operating system on my laptop. The laptop is not able to boot from the CD even if I selected, "help me boot from CD" and by the way I was currently using windows 8

Probably you have enabled UEFI boot on your machine. Try to enter BIOS and select legacy boot for your Ubuntu. There can be some problems though. I personally had to install both Windows and Ubuntu in Legacy mode, because dual boot didn't run with UEFI enabled.

I experienced the same problem. These are the steps I took:

In the BIOS, turn the secure boot off
Also select legacy boot instead of UEFI boot.
Also check the boot order.

That will do the job.


Unable to mount the CD/DVD image on the machine Sandbox I installed Ubuntu 12.10 Server AMD 64 with VirtualBox 4.2 latest version. I've installed it successfully. I've to install now Guest Additions but I am getting a error message like the below exactly same

Unable to mount the CD/DVD image
/usr/share/virtualbox/VBoxGuestAdditions.iso on the machine Sandbox. Would you like to force mounting of this medium?

Could not mount the media/drive
'/usr/share/virtualbox/VBoxGuestAdditions.iso'
(VERR_PDM_MEDIA_LOCKED).

Details

Result Code: NS_ERROR_FAILURE (0x80004005)

Result Code: NS_ERROR_FAILURE (0x80004005)
Component: Console
Interface: IConsole {db7ab4ca-2a3f-4183-9243-c1208da92392}
Callee: IMachine {22781af3-1c96-4126-9edf-67a020e0e858}

I research a lot with Google and other places and I removed the installation disc image from ~/.VirtualBox/VirtualBox.xml file to edit a line but didn't get any luck

I installeddkms too but still didn't get any luck

Can anyone please help me about that? I am stuck now :(

I struggled with this for about 2 hours on a Windows 7 host running Ubuntu 13.10 Server guest. In the end, I just copied over the VBoxGuestAdditions.iso to the guest (using WinSCP), mounted it, and then ran VBoxLinuxAdditions.run from the guest.

Here are the steps I took:

Locate VBoxGuestAdditions.iso on your host (in my case, C:\Program Files\Oracle\VirtualBox\VBoxGuestAdditions.iso).
Copy VBoxGuestAdditions.iso to your guest (in my case, I used WinSCP).
In the terminal for the guest mount the ISO using the following:

sudo mkdir /media/GuestAdditionsISO

sudo mount -o loop path/to/VBoxGuestAdditions.iso /media/GuestAdditionsISO
At this point you'll probably get a message that the ISO has been mounted as READ-ONLY. That's perfectly fine. If you change into the directory /media/GuestAdditionsISO you should see VBoxLinuxAdditions.run and it should be executable:

cd /media/GuestAdditionsISO

ls -l
Now just run VBoxLinuxAdditions.run:

sudo ./VBoxLinuxAdditions.run

You also have the option of extracting VBoxGuestAdditions.iso in Windows (or whatever host OS you're using) and then SCP'ing (or WinSCP'ing) it over to the Ubuntu guest, and then just running: sudo ./VBoxLinuxAdditions.run

Better doing what I have listed above instead of wasting time and putting faith in methods that may or may not work on your particular configuration.

Hope this helps.

I got it installed -
Go to VM Manager -- select the VM -- Select Storage -- Controll IDE
Select the icon with + sign "Add CD/DVD device"
Add the VBoxGuestAdditions.iso from Programs\Oracle\VirtualBox
Boot into Ubuntu on VM
Open files and Select the CD under Devices
I had an option to run the CD on top right. But it is same as running the autorun.sh file.
Let the installations run.
Shutdown ubuntu VM
Go to VM Manager and remove the disk.
Boot into vm and it should be in full screen mode.
Good luck!!!


Can I recover a file from /dev/null? mv ~ /dev/null

moves my home directory to a black hole. Can I recover my home directory from /dev/null?

The accepted existing answers are at least partially incorrect. /dev/null is a "black hole" but you can't move directories to it. The whole mv ~ /dev/null thing appears to be some sort of hoax. It looks really dangerous but it shouldn't actually work.

Still, I wouldn't recommend testing it on a home directory with irreplaceable data. Here's a quick test harness with a new user called test. We'll ask them to move their home into the ether.

$ sudo adduser test
$ sudo usermod -aG sudo test

$ sudo su test  # we are now running as test but let's check
$ cd ~; pwd
/home/test

$ sudo mv ~ /dev/null
mv: cannot overwrite non-directory ‘/dev/null’ with directory ‘/home/test’

If something you wanted does end up in /dev/null, the recovery procedure is the same as any other data loss (as if you typed rm). Ideally stop using that disk as quickly as possible and start using something like TestDisk to recover. Ourdata-recovery tag can be really helpful here.

Just to clarify that you can sudo mv file /dev/null where file is a single file but this will not delete the file, it will replace /dev/null with that file. This has all sorts of fairly important ramifications because things rely on being able to redirect to /dev/null. Anyway, here's a simple proof of this as well as a fix in case you do end up moving a file over the top:

$ echo "this is my file" > test
$ cat test
this is my file

$ sudo mv test /dev/null
$ cat /dev/null
this is my file

# Fix this!
$ sudo rm /dev/null
$ sudo mknod -m 0666 /dev/null c 1 3

Obviously if you want to rescue your file be quick and cp /dev/null ~/Desktop/file (or somesuch) before you replace it with the system definition of /dev/null.

In such a case, the first thing to do is to stop the system. The hope is that the files are still somewhere on the hard disk; by stopping the system we want to avoid that they are overwritten (if removed, they are marked as free space).

The second thing to do is to read data recovery manual and follow the instructions therein. Unfortunately, this succeeds as often as not.

The third is to check your backups (there are two sorts of people: those who do backups and those who will; hope you are the former kind).


How to clear the terminal history from vim? My python file:
print('HelloWorld')

After executing the file in terminal history:
HelloWorld
Press ENTER or type command to continue

This is fine.
Now, if I then run the file again, it shows the previous history as well.
HelloWorld
Press ENTER or type command to continue
HelloWorld
Press ENTER or type command to continue

It should only return one 'HelloWorld', and clear the past history.
Please help.

You need to add a clear before each external command you run. For example, with ls, that would be
:!clear;ls

It would admitedly be pretty clumsy to type that for each command, so a map can be added in .vimrc. For example,
noremap ! :!clear;

will map ! in normal and visual modes. (That overrides the default ! behavior. If you do not want to override default maps, use one of the unused keys instead.)

There is no one answer. Different shells offer different options for configuring where your history is stored. Generally, the default filename is either .history or .SHELL_NAME_history (for example .bash_history). It’ll be stored in your home directory. You can delete that file, but there’s no guarantee that an open shell process doesn’t have some cached history information waiting to be written.
Run the history command to find out the number of the command you want to delete and then issue the following command
$ history -d number

You can also simply edit the history file using vim and delete whatever you want to:
$ vim $HISTFILE

Or for bash:
$ vim ~/.bash_history


Proper Installation of Kali linux tools in Ubuntu I think everyone has known - we need to install katoolin to use Kali Linux Tools on Ubuntu. Before did anything I had looked through the internet and also found out these solutions: Can I install Kali tools on Ubuntu, How to Auto Install All Kali Linux

So here are my steps:

apt-get install git
git clone https://github.com/LionSec/katoolin.git && cp katoolin/katoolin.py /usr/bin/katoolin
chmod +x  /usr/bin/katoolin
sudo katoolin

Then, to add Kali Linux repositories and update them, I selected option 1 from the katoolin Menu

Then, to view the available categories and install all available tools, I selected option 2 from the main menu of katoolin and then pressed 0.

But after that I got this:

What do you want to do ?>

1) Add Kali repositories & Update
2) View Categories
3) Install classicmenu indicator
4) Install Kali menu
5) Help

kat > 2

************************** All Categories **************************

1) Information Gathering                      8) Exploitation Tools
2) Vulnerability Analysis                     9) Forensics Tools
3) Wireless Attacks                           10) Stress Testing
4) Web Applications                           11) Password Attacks
5) Sniffing & Spoofing                        12) Reverse Engineering
6) Maintaining Access                         13) Hardware Hacking
7) Reporting Tools                            14) Extra

0) All

Select a category or press (0) to install all Kali linux tools .

Furthermore, I got an error in Software Updater - it didn't let me do anything. Ubuntu just hung up. I solved this problem by deleting kali linux repositories in katoolin and then in Software Updater.

Does anyone know how to install Kali Linux tools in Ubuntu 16.04 in a proper way?

Introduction

Katoolin is a collection of scripts for automating the installation of Kali linux tools in different platforms other than Kali linux, and installing Kali linux tools with Katoolin in other OSs or Windows Subsystem for Linux is always less secure than installing the same tools in Kali Linux. Kali Linux is named after the Hindu goddess of destruction which should give the user some indication that even Kali Linux itself is risky and difficult to manage, especially for new users.

Katoolin draws its tools from a variety of sources including apt and GitHub. Katoolin doesn't know anything about the platform that it is running on, so the safest way to use Katoolin is to install each tool the hard way one tool at a time, checking each time to see if that tool is included in the default Ubuntu repositories and if so installing it that way instead. When the installation is finished, the software sources that were added by Katoolin should be immediately disabled in order to prevent Katoolin from replacing packages that were installed from the default Ubuntu repositories with its own updated packages whenever Ubuntu software is updated.

Installation of Kali linux tools

(Re)install Katoolin as follows:

Open the terminal and type:

sudo apt install git
git clone https://github.com/LionSec/katoolin.git && sudo cp katoolin/katoolin.py /usr/bin/katoolin

Make /usr/bin/katoolin executable.

sudo chmod +x /usr/bin/katoolin

Run Katoolin as follows and you will see the Katoolin interface:

cd /usr/bin/
sudo ./katoolin

View the categories of available software in katoolin interface

  Press 0 to install all Kali linux tools.

  When you go to View Categories and then enter 0 for all, the installer will immediately return to where you were. Scroll up, and you'll see that a number of the packages can't be found. Those packages are no longer maintained or have been removed from the Kali repositories. Even with this issue, you'll still find a lot of the Kali software available for installation.

  So the best option is to install Kali linux tools in a series of distinct steps. Just like if you want to install Forensic tools on your system, then choose its option from the category and then type 0 to install all forensics tools. If this still doesn't work, then you have to install whatever forensic tools that can be installed one package at a time.

  This is why the Katoolin interface sometimes hangs when you try to install all of the Kali linux tools at once. Take the time of waiting for the server to respond to a request for a package that is not available and multiply it by how many unavailable Kali linux tools there are in the Katoolin repositories.

  If you wish to go back to the main menu, type gohome in your katoolin interface. Now select the option 3 or 4 to install either the classicmenu indicator or the Kali menu. Press the y key to continue and then press Enter to start its setup.

  Once you are done with installation of Kali tools using katoolin, you can quit by pressing the keyboard combination Ctrl+C and you will see the goodbye message.

  shutdown requested....Goodbye...

Credit for the above text block goes to Kashif at How To Install Kali Linux Tools On Ubuntu 16 And CentOS 7 with my additions italicized.

Warning about updates after installing Kali linux tools

The LionSec Katoolin GitHub webpage clearly warns Katoolin users to be careful when updating software.

  Before updating your system, please remove all Kali-linux repositories to avoid any kind of problem.

I have faced the very same
Edit the file /usr/bin/katoolin (eg use sudo -H gedit usr/bin/katoolin) and remove those two packages, just search for text dff and webshag. Remove those two from apt-get commands too.


Rhythmbox doesn't add/import MP3s from ~/Music on Ubuntu Gnome 15.04 I just installed Ubuntu Gnome 15.04, all my music is located in /home/user/Music/, e.g. /home/user/Music/Back to The Future.

I run Rhythmbox and try to import all MP3s to the player, but nothing happens. I selected the path /home/user/Music/, but Import x listed tracks remains disabled. I checked the preferences, the parameter Music files are placed in has the right value: file:///home/user/Music. Why can't Rhythmbox just import my MP3s? What should I do in order to see these files inside Rhythmbox library?

All needed codecs are installed already. When I click on MP3-file it's opened with video player and played there. I paid attention that Gnome Music also doesn't display MP3s inside of ~/Music, probably, there is the same root of these two problems.

Execution of

ls -l ~/.local/share/rhythmbox

Returns:

total 132
-rw-rw-r-- 1 user user   1386 May  3 22:20 playlists.xml
-rw-rw-r-- 1 user user      0 May  3 21:31 podcast-timestamp
-rw-rw-r-- 1 user user 129653 May  3 22:16 rhythmdb.xml

Based on our discussion, I assume that the database was corrupted.

Delete it:

rm ~/.local/share/rhythmbox/rhythmdb.xml

or rename it:

mv ~/.local/share/rhythmbox/rhythmdb.xml ~/.local/share/rhythmbox/rhythmdb.xml.bak

And start the import again.

Had the same problem with Ubuntu 16.04. First installed clementine instead of rythmbox. Worked fine. Later I opened an .ogg soundfile with rythmbox and immedeatly after that, rythmbox started to import all .mp3 files. Now I have both players that work. Maybe it helps for someone.


How to find owner and group of a directory? How can I find out owner and group of a directory in Ubuntu?

You can do this:
1st way:

ls -l /path/to/file

*the third field in the ls -l output is the user and the fourth is the group

2nd way:

stat /path/to/file

$ stat py
  File: `py'
  Size: 32              Blocks: 8          IO Block: 4096   regular file
Device: 801h/2049d      Inode: 429064      Links: 1
Access: (0777/-rwxrwxrwx)  Uid: ( 1000/  razvan)   Gid: ( 1000/  razvan)
Access: 2012-07-27 17:49:05.682143441 +0300
Modify: 2012-07-01 03:58:02.848540175 +0300
Change: 2012-08-01 21:12:57.129819212 +0300

The razvan in the Uid field is the owner/user, the razvan in the Gid field is the group. 8-|

3rd way:
Get only the user and group with stat:

stat -c "%U %G" /path/to/file

My subtle way

ls -alF /path/to/folder | grep -Ei ' ./'

sample output

drwxr-xr-x 2 some-user some-group 4096 Feb 28 02:29 ./


How to activate Pinch-To-Zoom/Twisting with Synaptics Touchpad? Where do I find those features? In Ubuntu there's only an option to enable Two-Finger-Scrolling.

Greetz.

Holding down CTRL while pinching or zooming will allow you to perform the gesture.

Some multi-touch features can be activated with the instructions here (at least on hp dv9000, not sure about other laptops)
http://ubuntuforums.org/showthread.php?t=1999255


Why is 12.04 running so slow? I installed a fresh version of Ubuntu 12.04, and when I boot it is slow, everything is slow mouse movement loading an application etc. When I boot using "Recovery Mode" is is very snappy. What is causing the slowness?

The problem was I was on Ubuntu 64-bit, so I switched to Ubuntu 32-bit and everything works fine now.

It seems that either your computer can't handle Ubuntu 12.08 well or you need to install/enable the latest drivers for your computer.

I would suggest that you disable unity and use lxde or something other GUI that uses less resources.


Failed to mount Windows share: Connection timed out I was able to connect a few months ago by my Ubuntu 16.04 to Windows shared server driver of my institute using the "connect to server" option on a desktop panel using smb:// and the server IP address.

Now when I try to connect again it give me this error message:

Unhandled error message: Failed to mount Windows share: Connection timed out

What could be happened/changed to give this error?

Does that have to do with updating software? The samba is already at the newest version!

Edit and add the below entries to /etc/samba/smb.conf, under [global]
It should look like

[global]
client min protocol = SMB3
client max protocol = SMB3

For me, I used to be able to connect to a corporate Windows share drive with Nautilus with Ubuntu 16.04, but no longer after switching to Ubuntu 18.04. Nautilus is supposed to prompt my username and password to connect to the Window share drive, but in Ubuntu 18.04, it just immediately gave the error Unable to access location. Failed to mount Windows share: Connection Timed Out. without even prompting for the username and password. I think the reason is because Ubuntu 18.04 defaults to using SMB3, which may not be compatible with the Windows share, depending on your situation.

I was able to fix it by editing sudo vi /etc/samba/smb.conf and adding client max protocol = SMB2 under the [global] section. (You could also add client min protocol = SMB2, but it wasn't necessary for me.)

Then it prompted for my username/password, and I was able to connect to the Windows share drive.


Find a file by name using command-line I would like to determine the location of a file using command-line.  I have tried:

find . -type f -name "postgis-2.0.0"

and

locate postgis-2.0.0

to no avail. What is the command to determine the file's directory, provided its name?

Try find ~/ -type f -name "postgis-2.0.0" instead.

Using . will only search the current directory.  ~/ will search your entire home directory (likely where you downloaded it to).  If you used wget as root, its possible it could be somewhere else so you could use / to search the whole filesystem.

Goodluck

While find command is simplest way to recursively traverse the directory tree, there are other ways and in particular the two scripting languages that come with Ubuntu by default already have the ability to do so.

bash

bash  has a very nice globstar shell option, which allows for recursive traversal of the directory tree. All we need to do is test for whether item in the ./**/* expansion is a file and whether it contains the desired text:

bash-4.3$ for f in ./**/* ;do [ -f "$f" ] && [[ "$f" =~ "postgis-2.0.0" ]] && echo "$f"; done
./testdir/texts/postgis-2.0.0

Perl

Perl has Find module, which allows to perform recursive traversal of directory tree, and via subroutine perform specific action on them. With a small script, you can traverse directory tree, push files that contain the desired string into array, and then print it like so:

#!/usr/bin/env perl
use strict;
use warnings;
use File::Find;

my @wanted_files;
find(
     sub{
         -f $_ && $_ =~ $ARGV[0]
               && push @wanted_files,$File::Find::name
     }, "."
);

foreach(@wanted_files){
    print "$_\n"
}

And how it works:

$ ./find_file.pl  "postgis-2.0.0"
./testdir/texts/postgis-2.0.0

Python

Python is another scripting language that is used very widely in Ubuntu world. In particular, it has os.walk() module which allows us to perform the same action as above - traverse directory tree and obtain list of files that contain desired string.

As one-liner this can be done as so:

$ python -c 'import os;print([os.path.join(r,i) for r,s,f in os.walk(".") for i in f if "postgis-2.0.0" in i])'
['./testdir/texts/postgis-2.0.0']

Full script would look like so:

#!/usr/bin/env python
import os;

for r,s,f in os.walk("."):
    for i in f:
        if "postgis-2.0.0" in i:
            print(os.path.join(r,i))


How can I reinstall Apache HTTPD after deleting some of the configuration files? I recently was messing around with my Apache config and wanted to reinstall so I could start from fresh. I followed some forum posts about reinstalling the apache2 package and this ended up deleting my /etc/apache2 folder.

Now matter how many things I try I can't seem to do a full wipe of the Apache install and then reinstall. sudo apt-get install apache2 or reinstall doesn't do anything. I can't seem to remove it using Synaptic either.

Is there anything I can do to have a fresh Apache install on my computer again?

To replace configuration files that have been deleted, without purging the package, you can do

sudo apt-get -o DPkg::Options::="--force-confmiss" --reinstall install apache2

To fully remove the apache2 config files, you should

sudo apt-get purge apache2

which will then let you reinstall it in the usual way with

sudo apt-get install apache2

Purge is required to remove all the config files - if you delete the config files but only remove the package, then this is remembered & missing config files are not reinstalled by default.

try this

apt-get -f install

then run

sudo apt-get install apache2

Edit:  or possibly

sudo apt-get purge apache2
sudo apt-get install apache2


Ubuntu 16.04 + Nvidia Driver = Blank screen ORIGINAL QUESTION UPDATE 1:

Including Additional Drivers screenshot.  I have tried installing both 361.42 and 340.96 and both times, I get a blank screen after restarting.

ORIGINAL QUESTION:

When I install the nvidia driver for ubuntu and then restart, I get a blank screen. I have no tried 2 of the nvidia drivers and both times I get a blank screen.

How do I install the nvidia drivers and not get a blank screen?

Did a google search and it seems I'm the first to encounter this issue since 16.04 has been released:

https://www.google.co.uk/?gfe_rd=cr&ei=6tUZV-rEEuTR8geL_5PABA&gws_rd=ssl#q=ubuntu+16.04+nvidia+blank&tbs=qdr:d

Where/When do you get the blank screen? Is it when the grub menu should appear upon boot, or when the Ubuntu Unity login screen should appear? If it's the latter, try the following:

Add nomodeset on your Ubuntu grub entry. Highlight the entry you use to boot, press e, then add replace

...ro    quiet splash ...

with

...ro    nomodeset quiet splash ...

If that boots to the login screen correctly, press Ctrl + Alt + F2, login, then run sudo prime-select intel. Then reboot and see if that fixes it.

Also, how are you installing NVidia drivers? DOuble-check at nvidia.com if you're using the correct ones.

Try adding the following options to your grub /etc/default/grub config file.  You'll need to update grub afterward.

GRUB_GFXMODE=1280x1024x32,auto
GRUB_GFXPAYLOAD_LINUX=keep


Move Ubuntu partition to another drive and resize? The Ubuntu installer messed up and my Ubuntu partition is now 50GB and on /dev/sdc. I want it to be the 230GB free space on /dev/sda.
I'm a bit worried about this since I don't want to lose any data from /dev/sda or /dev/sdc, but I also can't live on 50GB and I can't have this eating up 50GB from /dev/sdc.
Edit: To clarify, I don't have enough space on /dev/sdc to resize before moving, I'd have to do it after.

Not sure whether I understood the problem completely, but you could do the following: Create a new partition on /dev/sda (with gparted) that is big enough for your liking, mark it as bootable. Remove the boot flag from the /sdc partition that currently has it.  Mount the new partition, copy your Ubuntu installation to this partition. Reboot. Ubuntu should now be running from the new copy on the /dev/sda partition, so you can unmount the old partition on /dev/sdc. Do that, delete it (with gparted) and use the free space in whichever way you want.


How to uninstall WUbi installed in E drive? Possible Duplicate:
  How do I remove wubi?
  How do I uninstall Ubuntu Wubi?

I am having Ubuntu installed in my E drive (Note: Not C drive) for over a year while I use window 7. For some reason, I want to format E drive, so I feel the need to uninstall Ubuntu first. The problem is that the option neither appears in Control panel nor is the uninstall-wubi.exe doing anything.

So help me to uninstall Ubuntu completely, manually. Also I don't want the option for selecting between Windows 7 and Ubuntu at boot time once I uninstall it.

In Windows Device Management identify the partition where linux or ubuntu is installed including swap partition,delete the partitions.Then boot from windows CD/DVD, choose repair, in System Recovery Option,click command prompt run the following command one by one
bootrec /fixmbr
bootrec /fixboot
Remove the CD from CD/DVDdrive and restart. Before doing the above it will be better to backup windows.


Replace one Ubuntu with another from USB pen drive I'm new to Linux. I'm using Ubuntu 11.04. Now i want to install Ubuntu 12.04 .

I got an ISO  image of Ubuntu 12.04 Desktop.
I put this image in to a pen drive which is formated,set the boot option boot from usb but nothing happened .

I searched this over the net and on Ubuntu website but nobody has given the complete steps . someone say you can install from the Ubuntu also ,someone says u can  do a fresh installation from usb pen drive you need to make you pen drive bootable etc. etc. .

My problem is that i don't know the exact steps how ton install Ubuntu from usb pen drive?

All I want to do is to completely remove my Ubuntu 11.04 and install Ubuntu 12.04 from usb pen-drive.

Can any body tell me how to make a pen drive bootable ?

How to install Ubuntu 12.04 from pen-drive?

Please give me a step by step procedure with screenshots.

Thanx in advance

I think there is no easier way than this illustrated here.

In short:

After Downloading Ubuntu.
Open the dash and search for Startup Disk Creator (for the dash click the icon on top right).

Start the Startup Disk Creator and Click on Other

Then select open and search the location that you have downloaded Ubuntu (normally in ~/Downloads)
Select the USB stick in the bottom box and click 'Make Startup Disk'.

Taken from this excellent guide.

When you start up there is a moment in the lower right of the screen where it says
F12 Boot. Hit F12 right when you see that then boot from USB.