amd64, i386 (32bit / 64bit) - Which version to choose? Can every CPU (in my case a Intel i7 890) install both of them ?
Amd64 and i386 ? I would like to install Ubuntu 64bit. So what is the right download ?

Your CPU can run both versions. Which version you install is more or less up to you, however, if your machine has at least 4GB of RAM, I would recommend installing the amd64 version. Some more insight into the differences between 32 and 64bit architectures can be found here. As for stability and availability, it seems you've already covered this in another question, so I won't go deeper. ;-)

You can get your download here. Choose 10.10, the latest version.

If you're in no hurry, you can wait about a month, then the next version (11.04 - Natty Narwhal) will be released, with significant changes to the default user interface.
If you're a beginner you will save yourself some re-learning.

If you're especially patient, it may be good to wait another two weeks or so, then the worst, inevitable, bugs popping up at release will probably be fixed already, and your ride will be smoother.

If your processor is 64 bit use that one.
If you have an older machine that is 32bit use that one.
The 32 bit version will run on a 64 bit processor but not vice versa.
The 32 bit version will only support 2G memory. If you have more than
2G you probably have a 64bit processor.


Missing desktop app icon I'm using Ubuntu 18.04, and have a custom desktop file for ST:

[Desktop Entry]
Name=st
GenericName=Terminal
Comment=standard terminal emulator for the X window system
Exec=st -t "st" -f "Source Code Pro:style=Semibold:size=18" -g "80x24"
Terminal=false
Type=Application
Encoding=UTF-8
Icon=utilities-terminal
Categories=System;TerminalEmulator;
Keywords=shell;prompt;command;commandline;cmd;

For some reason I always get an "icon don't exist" icon.

Other applications that use utilities-terminal as an icon parameter show it so this is very strange. Does anyone know what might be the problem?

You can add the path of your app icon, as the value of the directive Icon.

Icon=/home/username/Documents/youapp/youricon.png

Use the shortcut key Ctrl+Alt+t to open the terminal window on the Ubuntu desktop.

Then the system monitor window opens; Click the search button in the upper right corner to find "Nautilus".

Next, right click on the "Nautilus" process to "end the process".

Now, once again, Ctrl+Alt+t reopens a terminal window command to open the file management software.
Enter:
 nohup  nautilus  &


Network connection error after suspend Ubuntu 14.04 I'm using ubuntu 14.04 and a DSL connection for internet. However, whenever I suspend and resume my session, I'm no longer able to connect to the internet. Could someone help me fix this?

Robbin's answer fixes it for me.  To have this run every time the system wakes create a script with this content...

#!/bin/sh

case "${1}" in
    resume|thaw)
        service network-manager restart;;
esac

and put the script in /etc/pm/sleep.d and make it executable.  (The script is a slight variation of the one on this page)

On a desktop running kubuntu 14.04 without wireless but having one nic with two vlans, static configuration in /etc/network/interfaces, none of all your suggestions helped.
This did the trick, no undesired sideeffects:

aptitude purge network-manager

and accepting the removal of plasma-nm;
now it works like a charm;
apt-get purge ... should do the same


How to format a USB flash drive? In Windows there is a straightforward "Format" option in a flash drive's right-click pop-up menu. Where's that in Ubuntu?

You can use Disks. It's installed by default and easy to use.

Click on the Dash icon
Search for "Disks"
Click on Disks

The application will show up:

1st: Choose the USB flash drive
2nd: Click on the "gear" icon and choose "Format"

This little window will appear, just choose the option you want and click on Format:

Here is a very simple way:
In linux system:
use
     fdisk to check which is your usb disk. then use fdisk sdx,usually is sdb, to do some operation on your usb disk.

press o enter
press d enter to empty your disk.

then you can plug your usb drive to a windows operation system and do the normal format.


How do I update to Ubuntu 12.04 if update manager doesn't prompt it? I was updating to Ubuntu 12.04 and I lost my wireless connection. I turned off my computer and got to a better connection and now my "Update Manager" does not prompt for the upgrade.

Make sure that all possible updates are installed using update-manager.

After that you can trigger the update-manager with the dist-upgrade option which should start it showing the upgrade option to 12.04.
Do it like this:

Press Alt+F2
Type "update-manager --dist-upgrade" and press enter

If that doesn't work it might be that all your repositories are already changed to the new distribution. You just need to finalize the installation:

Press Alt+F2
Type "gnome-terminal" and press enter
In the terminal window type "sudo apt-get update; sudo apt-get upgrade"
Enter your password when prompted
Accept the proposed update

Please let us know if one of these ways worked for you.

Try sudo apt-get dist-upgrade; if your system is fully updated before you type that, it SHOULD upgrade to the newer version.

Uh, good luck; this usually works, but not every time.


Can I get copies of Ubuntu 13.04 on CD's to give our Free Software Club members? I want the new Ubuntu 13.04 to give to our club members for free. Can get them?

I have a club named 'Free Software Club'  with 100+ members. We discuss free software, Linux, Python and give training.

If you mean Ubuntu Desktop go to Download Ubuntu Desktop and burn it to CD.

For Ubuntu Server got to Download Ubuntu Server


Unable to bypass password, /etc/sudoers not taking effect I need to be able to run two bash scripts as sudo without having to provide the password.

One of these scripts is run on startup, it checks for inactivity, and if so, dims my laptop's backlit keys.

The other script is just something I use a lot, so its convenient to run it without password.

I had this working for a while, but during an update recently, my /etc/sudoers file was overwritten. I had my changed copy saved, but for some reason, the lines I put in there are no longer working, I'm being asked to provide the password.

I'm on Ubuntu 16.04. Here's my current /etc/sudoers file:

#
# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults        env_reset
Defaults        mail_badpass
Defaults        secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin"

# Host alias specification

# User alias specification

# Cmnd alias specification

# User privilege specification
root    ALL=(ALL:ALL) ALL

# CUSTOM:
ali ALL= NOPASSWD: /usr/local/bin/dim_keyboard.sh
ali ALL= NOPASSWD: /usr/local/bin/go

# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL

# Allow members of group sudo to execute any command
%sudo   ALL=(ALL:ALL) ALL

# See sudoers(5) for more information on "#include" directives:

#includedir /etc/sudoers.d

These lines:

ali ALL= NOPASSWD: /usr/local/bin/dim_keyboard.sh
ali ALL= NOPASSWD: /usr/local/bin/go

are what I've put in.

From looking at similar questions, I seem to be using the right syntax, but for some reason these lines still won't work.

Any ideas?

Why do we even need to use sudo for this application?

You can use a program such as shc to "compile" your shell scripts into a standalone executable binary, which you can just add to the sudoers file. Or, you can even set the setuid bit on it so it actually runs as root without needing sudo.

So, let's try an example:

shc -f myscript.sh -o myscript
sudo chown -R root:root myscript
sudo chmod a+x myscript
sudo chmod u+s myscript

This will take a shell script, and make it into a C executable that has setuid root. Whenever this is called (with or without sudo), it should always run (effectively) as the root user.


fsck can't find fsck.ntfs On several machines that I've upgraded from Natty to Oneiric, I get an error every boot (one for every NTFS partition):

Serious errors were found while checking the disk drive for /windows/c.

Press I to ignore, S to skip mounting, or M for manual recovery

Following the suggestion in this answer, I ran fsck from the manual recovery shell. I got this output:

fsck from util-linux 2.19.1
fsck: fsck.ntfs: not found
fsck: Error 2 while executing fsck.ntfs for /dev/sda1

I can't find fsck.ntfs, and command-not-found doesn't help either. How can I make this error go away?

By the way, I've tried booting into Windows (XP) several times, thinking that Windows would repair the filesystems. But apparently Windows thinks the filesysystems are just fine. And it's odd that all NTFS filesystems are affected.

Also, I can work around this problem by dropping to a recovery shell and issuing mount -a, but for my coworkers' sakes I need unattended boot.

fsck.ntfs is usually only a link to ntfsfix which is an utility from the package ntfsprogs that is already available with a standard installation of Ubuntu.

You can make a simbolic link between fsck.ntfs and ntfsfix to solve this permanently:

sudo ln -s /usr/bin/ntfsfix /sbin/fsck.ntfs
sudo ln -s /usr/bin/ntfsfix /sbin/fsck.ntfs-3g

Keep in mind that this utility came from a reverse engineering process and are not the best option to manage your filesystem, the NTFS filesystem does not belong to the GNU/linux world.

$ man fsck

  fsck - check and repair a Linux filesystem

To repair a broken NTFS system on GNU / Linux you could use ntfsfix which is part of ntfs-3g as following:

$ ntfsfix /dev/sdc1


Problem with spaces in file names I want to do something repeatedly on a list of files. The files in questions have spaces in their names:

david@david: ls -l
total 32
-rw-rw-r-- 1 david david 13 Mai  8 11:55 haha
-rw-rw-r-- 1 david david  0 Mai  8 11:55 haha~
-rw-rw-r-- 1 david david 13 Mai  8 11:55 haha (3rd copy)
-rw-rw-r-- 1 david david 13 Mai  8 11:55 haha (4th copy)
-rw-rw-r-- 1 david david 13 Mai  8 11:55 haha (5th copy)
-rw-rw-r-- 1 david david 13 Mai  8 11:55 haha (6th copy)
-rw-rw-r-- 1 david david 13 Mai  8 11:55 haha (7th copy)
-rw-rw-r-- 1 david david 13 Mai  8 11:55 haha (another copy)
-rw-rw-r-- 1 david david 13 Mai  8 11:55 haha (copy)

Now I want to stat each of these files:

david@david: echo '
for file in $(ls)
do
stat $file
done' | bash

(I use echo and a pipe in order to write multi-line commands.)

When I do that, it works correctly on those files that do not have any spaces in their names.  But the others...

stat: cannot stat ‘(another’: No such file or directory
stat: cannot stat ‘copy)’: No such file or directory

Changing $(ls) to "$(ls)" or $file to "$file" does not work. What can I do?

Edit:

echo '
for files in *
do
stat "$files"
done' | bash

does the trick! As I'm new to bash, I want to keep things as simple as possible - so nothing with trying to escape spaces, or using xargs or the solution with read -r, although they solve the problem.

As some have asked: Yes, using this instead of stat * is weird. But I just wanted to find a general way to apply the same command on a bunch of file names in bash, using a for loop. So stat could stand for gzip, gpg or rm.

The multiple quote from the echo ' is complicating the thing.

You can just use:

for f in *; do stat -- "$f"; done

But also

stat -- *

...and if you want to collect the files and then apply the command (why?) you can go with (but be careful with file containing new lines...(1))

for f in *; do echo "$f"; done | xargs stat --

...and if you want hidden files too, just use * .* as a pattern, but then remember that . and .. will be in the set.

As an aside, you shouldn't parse ls output.

(1) but if you have file names with newlines, you somewhat deserve it... ;-)

This answer will solve the problem of parsing ls and take care of the backspaces and new lines

Try this, it will solve your problem using Internal Field Separator IFS.

IFS="\n" for f in $(ls); do   stat "$f"; done

But Also you can eaisly solve it without need to parse ls output using

for f in *; do   stat "$f"; done


How do I install PostgreSQL 9.6 on any Ubuntu version? How do I install PostgreSQL 9.6 on any Ubuntu version since it doesn't come by default with the most recent version?

Ubuntu Xenial (16.04) comes with PostgreSQL 9.5 from the default repositories.

For the following Ubuntu versions, you can install with the given commands, as per the official PostgreSQL Apt Repository.

Ubuntu 17.04 - 17.10

Version 9.6 comes with the distribution.

sudo apt-get install postgresql-9.6

Ubuntu 14.04, 16.04

sudo add-apt-repository "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -sc)-pgdg main"
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get install postgresql-9.6

I followed this Github gist -
I am running ubuntu xenial inside vagrant and wanted to upgrade existing postresql official repository vesion 9.5 to 9.6 so that I can use PostGIS extension which is served best by version 9.6 (officially mentioned in their site)
Hope this helps someone.


How to show gnome-terminal menubar? I accidentally unchecked View -> Show Menubar which hides the menubar for gnome-terminal,  and there doesn't appear to be a keyboard shortcut to show the menubar again.

How can I make gnome-terminal show the menubar again?

Right click anywhere inside the terminal, and you'll get a similar pop up menu that lets you reenable it.

If you're running an application like vi you won't get this menu.  In that case exit or suspend the application first, then it should work.  (I.e. ^Z (control-Z) to suspend, then right click to get this menu, and select Show MenuBar, then finally enter % and ↵ Enter to resume.)

You can also make it via terminal command line:

gnome-terminal  --show-menubar

If you read the man gnome-terminal you can find this:

  --show-menubar
                 Turn  on  the menu bar for the last-specified window; applies
                 to only one window; can be specified once for each window you
                 create from the command line.


TeamViewer does not start automatically, how do I make sure it does? After installing TeamViewer x86 on Ubuntu, it will not start automatically on boot, even when telling it to do so via the application settings ("Start TeamViewer with system"). How do I make sure TeamViewer starts with the system, before even logging in?

TeamViewer provides a script called teamviewerd.sysv available in /opt/teamviewer/tv_bin/script. Here's an excerpt:

#!/bin/bash
#
# /etc/init.d/teamviewerd
#
# chkconfig: 2345 95 05
# description: daemon for TeamViewer
#
# processname: teamviewerd
# config: /etc/teamviewer/global.conf
# pidfile: /var/run/teamviewerd.pid

### BEGIN INIT INFO
# Provides:          teamviewerd
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Required-Start:    $all
# Required-Stop:     $local_fs $network $named
# Short-Description: TeamViewer remote control daemon
# Description:       TeamViewer remote control daemon
### END INIT INFO

All you need to do is make sure this script runs on startup. Making sure of this is relatively simple, just copy it to /etc/init.d like so:

cd /opt/teamviewer/tv_bin/script
sudo cp teamviewerd.sysv /etc/init.d/

Don't forget to make the script non-writable to anyone but the owner!

sudo chmod 755 /etc/init.d/teamviewerd.sysv

Then run

sudo update-rc.d teamviewerd.sysv defaults

The service will now start automatically with each boot. If you don't feel like rebooting, you can start the service manually with:

sudo service teamviewerd.sysv start

2019 EDIT: This answer was written in 2013. Since then, systemd has arrived in force and is normally used for constructing services that start upon boot. For instructions on how to achieve this in systemd instead, please see this question: How do I run a single command at startup using systemd?

Create a soft-line of teamviewer in your run level file location. You can do that by using:

sudo ln -s /usr/bin/teamviewer /etc/init.d/

or if your system is using systemctl then use:

sudo ln -s /usr/bin/teamviewer /etc/rc.d/rc5.d/


How do I change the chat and mail clients in the indicator area? I am new to Unity thanks to my Natty upgrade the other day. While I like some of the new things, I would also like to reconfigure some stuff.

Can I change the tray apps to use different applications? I'd prefer to stay with my old applications (thunderbird, pidgin) instead of evolution and empathy. I would really like to integrate those that I use into the tray and remove the "references" to the ones that I do not use.

So this is 2 parts
a) how to I remove evolution/empathy from the tray (upper right, to clarify: I already removed both from the launcher)
b) how to get pidgin/thunderbird to have a tray icon again

Thanks for your help!

To remove Evolution and Empathy, use the Ubuntu Software Center if you don't need or want them anymore, also use it to Install Thunderbird and Pidgin, both of them will integrate into the Messaging menu next to the Indicators area on the top panel automatically without editing any file, and when opened click add to launcher to add them do the Launcher.

Right click on evolution/empathy icon in the launcher and uncheck 'Keep in Launcher'
Click 'Applications' in launcher, locate your application (pidgin/thunderbird) and just drag and drop in the launcher.


What does udisks-daemon do and do I need it? I was looking into htop and the only process having > 0.0% CPU (apart from htop itself) was /usr/lib/udisks/udisks-daemon.

So the questions are: What is this service? Do I need it? (Or when do I need it?) Why is it accessing the drives?

Official package description for udisks:

  The udisks daemon serves as an interface to system block devices, implemented via D-Bus. It handles operations such as querying, mounting,  unmounting, formatting, or detaching storage devices such as hard disks  or USB thumb drives.

  This package also provides the udisks utility, which can be used to trigger these operations from the command line (if permitted by PolicyKit). External tools such as hdparm are used if available to implement extra operations, such as configuring disk spindown times.

  Creating or modifying file systems such as XFS, RAID, or LUKS encryption requires that the corresponding mkfs.* and admin tools are installed, such as dosfstools and mtools for VFAT, xfsprogs for XFS, or cryptsetup for LUKS.

  Do I need it?

This should be considered an essential package by almost everyone. The only time I would consider removing it is if I had a simple /dev/sdX CLI install on a machine where there was no need for udev -- i.e., the hardware never changes (which in practice almost always means a virtual machine, a VPS or a very very old machine).

Here is another take on your second question about whether you need it: It depends on what your objectives are. If you want to learn about how your system works under the hood, you definitely do not need any udisks daemon. Not even on Ubuntu.

I am speaking out of my own experience here. The world needs more people who are curious about what is going on under the hood. See my code on GitHub for reference.


How can I use convert to resize images to a specific width keeping the ratio for the height? I have a file with the full path to an image on each line, all are jpg.  I want to resize every image/line in the file to 1024px in width, while keeping the aspect ratio for the height.  I simply want to overwrite the original file.

The main thing I'm having issue with is, I want to SHRINK only.  I do not want to enlarge images smaller than 1024px in width up to 1024px in width.

Here is the bash script I'm working with and just need help with the convert line as I have no experience with imagemagick.

#!/bin/bash

while read p; do
  convert $p
done < listofimages

This should do it:

#!/bin/bash

while IFS= read -r jpg
do
    convert "$jpg""[1024x>]" "$jpg"
done < "$1"

Save the script above as ~/bin/shrink.sh, make it executable (chmod a+x ~/bin/shrink.sh) and run it, giving the list of files as an argument:

shrink.sh /path/to/list

This is basically the same as the proposed duplicate, adapted to i) match your desired size and ii) read the names from a file. The [1024x>] ensures that only images whose size is greater than 1024 pixels will be resized.

Try something like this:

#!/bin/bash

for p in "$@"
do
    w=`identify "$p" | cut -f 3 -d ' ' | sed 's/x.*//'`
    if [ $w -gt 1024 ]
    then
        convert -scale 1024x1024 "$p" "$p"
    fi
done

Explanation:

The "identify" command produces all sorts of info about the image. The third field is the size, in the format "1024x968".
The "cut" command grabs the third field, delimited by spaces.
The "sed" command deletes the height, leaving the width.
The "if" only processes images whose width is larger than 1024.
Finally, convert rescales the image. It automatically keeps the aspect ratio.

If you've got file names in a file, and name the above script "reaspect", you can use this:

% reaspect `cat file`


Ubuntu 12.04 Mobile Broadband Settings with Terminal I installed Ubuntu 12.04 LTS to my beaglebone and now want to make appropriate changes to be able to use my Huawei e173 modem. I can successfully use Huawei e173 on my desktop ubuntu 12.04. But I cannot use the same method on my beaglebone. Because I can only use terminal screen. Therefore I thought if I know the files that my desktop PC modifies for mobile broadband settings, than I can copy them to the beaglebone and start using Huawei modem. However I could not find all the files that are related to mobile broadband settings.

Seems like all the files under /etc/ppp are related
/usr/sbin/chat is related
/etc/chatscripts/pap is related.

What more do I need? For example I could not figure out where it saves my 3g modem's password. Where is it located?

Regards

You can use find to find all files changes since a timestamp file.

in bash:

touch time-stamp-file
set up modem
find / -newer time-stamp-file

This method finds a few false positives, but should find all files you are looking for.


Wine: Install Windows Program for Multiple Users I'm trying to install programs through wine so that it's available to all users.  Reasons are obvious: save space and I don't like the idea of doing separate multiple installations of a program for multiple users.  One installation per machine should be sufficient.

Here's what I've done:

(1)  Installing a program to my user account drops the program in [/home/me/.wine/].  I made that program read/write/execute to all users.  Programs seem to work from another user account if he/she browses to my home folder, into ~/.wine/drive_c/Program Files (x86)/the-program/program-executable.exe

Not ideal but workable.

(2) I then moved my ~/.wine folder out of my home directory onto a shared partition and  created a sym-link to it in my home folder and called it “.wine”.  I've effectively replaced my .wine folder with a link to a .wine folder on a shared folder.

It seems to work alright.

My question: Does anyone know a better way to do this?  My solution seems a bit crazy and a bit hacky.  Any smart people out there think this is a bad idea?

I would do it the same way you did it... put the binaries in a public location and link to the home dirs for who needs access.
I do have my questions however with opening the same Windows program by multiple users at the same time. Not sure how they react to it. Most are not created for multi-user environments. Even though they operate in Linux, I think it could create unwanted behaviour...


pantheon-files depends on libhandy-1-0 but it is not installable on Ubuntu 20.04 I am getting dependency error while installing pantheon-files
$ sudo apt install pantheon-files
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 pantheon-files : Depends: libhandy-1-0 (>= 0.82.0) but it is not installable
                  Recommends: exfat-fuse but it is not going to be installed
                  Recommends: tumbler-plugins-extra but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

$ sudo apt-cache policy pantheon-files
pantheon-files:
  Installed: (none)
  Candidate: 4.5.0+r4099+pkg96~daily~ubuntu6.0.1
  Version table:
     4.5.0+r4099+pkg96~daily~ubuntu6.0.1 500
        500 http://ppa.launchpad.net/elementary-os/daily/ubuntu focal/main amd64 Packages

Focal Fossa (20.04) has libhandy-0.0-0 instead and libhandy-1-0 is in Groovy Gorilla (20.10) which is still in development stage. However, you can download and install the deb file for libhandy-1-0 on 20.04 using
wget http://mirrors.edge.kernel.org/ubuntu/pool/main/libh/libhandy-1/libhandy-1-0_0.90.0-1_amd64.deb
sudo apt install ./libhandy-1-0_0.90.0-1_amd64.deb

Once done retry installation of Pantheon Files.

I got the solution,
Actually, the Last answer is also working. But I got a new solution as well.
we are missing some dependency. We need to install those first and restart pc
Again try to install this file package. Now, you can see the color change on right-click
I am sharing commands bellow. But make sure, you check for the latest file first.
At first, you need to enable universe repository with
sudo add-apt-repository universe
and then you can manually download and install a newer version of the library with
cd ~/Downloads wget http://mirrors.kernel.org/ubuntu/pool/universe/libc/libcloudproviders/libcloudproviders0_0.3.0-1_amd64.deb
sudo apt install ./libcloudproviders0_0.3.0-1_amd64.deb
and then install pantheon-files with
Sudo apt-get install pantheon-files


External Hard Drive sync I was wondering whether there's a mechanism to sync two external hard drives, so that the files are updated both ways (and they end up containing the exact same information).

Ideally it could run when once both hard drives are connected.

I would advise Unison (unison-gtk )

This is a graphical sync program, and can be installed via the Software Centre, but the easiest way to install is via the terminal:

sudo apt-get install unison unison-gtk

Then it will be in the dash, search for unison. You can create profiles and such like to sync locally between USBs and remotely via SSH.

The best thing is the GUI, it is easy to use because you can see exactly what you want - no messing around with the command line with rsync.

If you want it auto, you do need to use the command line - cron. Have a look here for how to use it and below is an example:

30 17 * * * unison PROFILENAME

That will run at 5:30pm every day. Make sure the profile that you create is 1 word only, and that you remember it.

maybe for beginners conduit would be interesting and very easy to handle with it's GUI...
but it isn't developed anymore (like Unison)!


unable to download torrent in my ubuntu 14.04 I have installed BitTorrent , Transmission , K torrent , Vaduz etc.
But I am not able to download any torrent files.I have already tried every thing but i cont do any thing. Could you help me with the answer please ..

I have installed ubuntu 14.04

Right-click on torrent file link and choose Save file. A torrent file should be created in your Downloads or home folder. Click on that file and it should automatically open with a torrent software. Make sure you don't mistake magnet link for torrent file. Some torrent sites don't provide torrent files anymore, just magnet links. Magnet links cannot be downloaded as a file, they can only be opened directly by torrenting software.

If a magnet link doesn't open with any torrent software (it is not associated with any such program), just click-and-drag the magnet link into a torrent program window. That should open the magnet link.

Tutorial about how to associate magnet links with qbittorent here: How to associate magnet links to qBittorrent?


how do I install windows 10 alongside with ubuntu16.04? I am currently using Xenial and I love it. But still I would like to dual-boot my machine with windows 10. I have been trying to shrink the ubuntu partition to get back unallocated space and then create a partition for windows. But, I am unable to do that through GParted. Could someone please guide me through the process of partitioning and the steps after that to fully install windows 10 on my machine.
I already have the windows 10 package downloaded. Thank you
Please note that I am a newbie and have really less experience :)

Use a bootable Software Like partition wizard or ease us tool ...which can be used to create unallocated disk... (Download.iso and burn into pendrive) after unallocating disk..make a new partition of NTFS format only...again make bootable disk of win 10.iso ,boot and install as regular process..since u r installing win10 after Ubuntu... windows bootloader will overwrite grub and Ubuntu will not be booted...to solve that problem Ubuntu boot-repair program can be used to restore grub and menu will be given to choose in between Ubuntu and window boot loader :) that's it..

here i got a better idea.
1,buy a usb-portable-ssd
2,make a Win to Go disk on it (win8&&win10),using windows of cause
  or use Wintousb to create this disk.
3,when you wanna use Mswindows, plug it on, it will install drivers&&update itself, just like normal windows.Or you can install it yourself.

have fun @_@


Ubuntu 12.04 usb installation problem - login page I'm trying to do a fresh install of Ubuntu 12.04 from a USB drive. I downloaded the ISO file and loaded it onto the USB drive with from my existing Ubuntu 11.10 with the usb startup disk creator. When I boot from the usb drive, it loads the login page and asks for user name and password. I'm not sure what to do at this point. I tried to login with my 11.10 user name and it doesn't work. I've installed previous versions of Ubuntu from a usb drive and this has never happened--it usually takes me straight to the desktop from where I can run the installer. What do I do?

The liveCD username and password, by default, are:

Username: ubuntu

Password: ubuntu

Have you tried root and blank password? then change the pass via

$ passwd

Or I think you may have to set the password first via passwd root

You can also try this

  If you forgot you password for your ubuntu system you can recover
  using the following steps

  Turn your computer on.
  Press ESC at the grub prompt.
  Press e for edit.
  Highlight the line that begins kernel ………, press e
  Go to the very end of the line, add rw init=/bin/bash
  press Enter, then press b to boot your system.
  Your system will boot up to a passwordless root shell.
  Type in passwd username
  Set your password.
  Type in reboot


Unable to run .py file in 13.10 Unable to run .py file in Ubuntu 13.10 server. It returns this error:

Traceback (most recent call last):
File "events_send.py", line 2, in <module> import pika
ImportError: No module named pika

your missing the pika package
Before you installing the pika ,install python-pip and git-core, since the pika installation depends on these packages.
Then install pika Packages

sudo apt-get install python-pip git-core

sudo pip install pika==0.9.8

This may be a directory permission problem.
Check:

/usr/local/lib/python2.7/dist-packages/pika
/usr/local/lib/python2.7/dist-packages/pika-0.9.14.egg-info

(depend on which version of python and pika you use)


Store frequently used terminal commands in a file Okay, so I want add a command to my Desktop (Or any convenient location), and whenever I run it I want it to clone the HTML5 boilerplate.

$ git clone git://github.com/paulirish/html5-boilerplate.git

And I'm tired of typing it out all the time. So how could I store my commands in a file?.

Open your ~/.bashrc and put this at the end:

alias boil='git clone git://github.com/paulirish/html5-boilerplate.git'

or alternatively, this

boil() {
  git clone git://github.com/paulirish/html5-boilerplate.git
}

From now on, in every new terminal you can use the command boil as an alternative to your long command.

The second version is to prefer, because is more flexible being able to accept and manage parameter, for example if you define

boil() {
  [[ -z "$1" ]] && set "github.com"
  git clone git://"$1"/paulirish/html5-boilerplate.git
}

you can easily change server, if there are mirror.

# without a parameter, the function will use a default
boil
# override the default providing explicitly a server parameter
boid othergit.com

It is only an example, your fantasy surely will generate something more useful.

Obviously you can add as many functions as you need.

Why not create a document with that command, and every time you wish to use it you can simply copy and paste it into the terminal.


How do I download Ubuntu One files to my new computer? I need to know how to down load all my sync'ed folders from ubuntu one to my new computer..

Install/configure UbuntuOne and login to your account, your selected files/folders should start synchronizing automatically from the servers to your new computer.

For more information on how to setup UbuntuOne on different Ubuntu releases please refer to the official wiki guide.

If you are running Ubuntu 11.04 or 11.10 this simple illustrated guide will aid you on setting your account. After this is done you need to way a bit before all your files are downloaded from the server, the process time will change according to the amount of files you need to synchronize.

As its now in sunset mode, the synch still tries upload too, which it cant do, obviously that paging to upload is a conflict.  Download synch may take quite a while


Error while installing .net core 2.0 sdk in ubuntu Am trying to install .net core 2.0 in ubuntu 17.04 but it is showing error like below

**Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
 dotnet-sdk-2.0.0 : Depends: dotnet-runtime-2.0.0 but it is not going to be installed
E: Unable to correct problems, you have held broken packages.**

am using below process to install this

curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg
sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-zesty-prod zesty main" > /etc/apt/sources.list.d/dotnetdev.list'
sudo apt-get update

sudo apt-get install dotnet-sdk-2.0.0

Please help me to fix this.

SDK version and link depends on your ubuntu version you have to choose correct one in the list. But if you use 18.04 you have to follow these commands

# NO_PUBKEY EB3E94ADBE1229CF
sudo apt-key adv --keyserver packages.microsoft.com --recv-keys EB3E94ADBE1229CF

# NO_PUBKEY B02C46DF417A0893
sudo apt-key adv --keyserver packages.microsoft.com --recv-keys 52E16F86FEE04B979B07E28DB02C46DF417A0893

sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-bionic-prod bionic main" > /etc/apt/sources.list.d/dotnetdev.list'

sudo apt update
sudo apt install dotnet-sdk-2.1.300-preview2-008533

From Github issue

I had the same problem, and it turned out I was not using 17.04.  I was in WSL on Windows 10 and it's version is really 14.04.  I checked the version:

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 14.04.5 LTS
Release:        14.04
Codename:       trusty

So... The correct install commands were:

sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-trusty-prod trusty main" > /etc/apt/sources.list.d/dotnetdev.list'
sudo apt-get update
sudo apt-get install dotnet-sdk-2.0.0

The MS documentation is here:
https://www.microsoft.com/net/core#linuxubuntu


Backup Drive Issue: Seagate backup plus 1TB in not getting detected I just bought a new Seagate backup plus, 1 TB external backup drive, USB 3.0, it is working good with my windows, but when I login into my Ubuntu 12.04 it does not get detected by any way.

Before purchasing it, I did a short research to find out if its going to work with Ubuntu, and I found a thread here (askubuntu) justifying that SGate-1TB ext drive is going to work(lost the link for that thread). I tried with my other machines with 12.04 running - No success, however with windows it works great.

I tried to see if getting detected in

    fdisk -l (doesn’t show up in the list)

Cant see in /mnt - Cant mount it. (checked with root and normal users)

After failing with all attempts, I check if its getting detected at all , even the USB.

    lsusb

with some ray of hope it showed in terminal

Bus 001 Device 006: ID 0bc2:a013 Seagate RSS LLC

Then I opened the Disk Utility, it display me bank, something like this.

Please help me. I don’t want to be dependent on Windows for this. I have been a great admirer of Linux Ubuntu since from the time I installed it my computer, never crashed or gave any issue except for a superblock once long time back. Please Help.

I also had the same screen when I put it in the USB 2.0 but when I plugged it into the USB 3.0 port then it would be detected and you can see it with lsusb.

This was easily remedied on my 5TB seagate by
sudo nautilus
and then changing the permissions to the drive and its sub folders.


How to automatically kill a process using script? How to write a script that kills a java process?

From console it looks like

root@ubuntu-s-1vcpu-1gb-ams3-01:~# lsof -i tcp:8080
COMMAND  PID USER   FD   TYPE  DEVICE SIZE/OFF NODE NAME
java    9657 root   26u  IPv6 4694148      0t0  TCP *:http-alt (LISTEN)
root@ubuntu-s-1vcpu-1gb-ams3-01:~# kill 9657

How should it be implemented in .sh file?

Just use the killall command. That should work.
Like this:

killall java

(Just in case you don't know how to create a executable .sh file (It's not quite clear):
A .sh file should begin with a shebang, something like

#!/bin/sh

After that, you just write commands like you would in a terminal, separated into lines.
Then you run

chmod +x <insert filename>

and are able to execute the .sh file just fine.
killall should be no exception


Why does my laptop restart instead of waking up after resuming from suspend? My laptop is a Vaio VPCF11M1E, running Ubuntu 10.10 64-bit.

After being suspended, I press the power button to wake it up, but it restarts the machine and I lose all my work. I do not have the same issue under Windows.

But hibernating works.

This worked for me on Ubuntu 10.10 before I installed ATI drivers

Edit the file /etc/default/grub (as root)

Change the line with:

  GRUB_CMDLINE_LINUX=""

to:

  GRUB_CMDLINE_LINUX="acpi_sleep=nonvs"

run update-grub (as root).

This worked just fine after installing the ATI drivers:

  I've solved a similar issue (reboot on resume) with a Sony Vaio VGN-FW51ZF by changing the last line of the file /etc/acpi/sleep.sh from pm-suspend to pm-suspend --quirk-radeon-off (guess it was a problem related with ATI proprietary drivers)."

So thanks for those tips and I hope this save you some time. I'm about to do the same on my Ubuntu 11.10 I'll let you know if it worked!

Did not worked on Ubuntu 11.10 it still reboots instead of resuming :(

https://askubuntu.com/a/64408

If you have grub2 you should run sudo update-grub2 (run both just in case)


How to install a package with apt without the "Do you want to continue [Y/n]?" prompt? Of course when you type:

sudo apt-get install whatever

It asks you:

Do you want to continue [Y/n]?

Is there any way I can just install it without it asking me if I want to continue? I don't really care about space, I have more then enough.

sudo apt-get install -y whatever

From the man page (man apt-get):

 -y, --yes, --assume-yes

           Automatic yes to prompts; assume "yes" as answer to all prompts and
           run non-interactively. If an undesirable situation, such as
           changing a held package, trying to install a unauthenticated
           package or removing an essential package occurs then apt-get will
           abort. Configuration Item: APT::Get::Assume-Yes.

Add -y to any library install
Eg : sudo apt-get install -y nodejs
Eg : sudo apt-get install -y postgres
Eg : sudo apt-get install -y mongodb

There is --force-yes as well, and careful of accidental spaces.
depreciated for recent distros


libdvd-pkg: `apt-get check` failed, you may have broken packages. Aborting FYI: I am using Kubuntu 18.04

I keep getting the following error when I install apt-transport-https

Things I have already tired to fix this error are:

sudo apt-get autoremove libdvd-pkg
sudo apt-get install libdvd-pkg
sudo apt-get update
sudo apt-get install -f
sudo apt-get purge apt-transport-https && sudo apt-get install apt-transport-https

The error I continue to see is

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
  apt-transport-https*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 152 kB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 246794 files and directories currently installed.)
Removing apt-transport-https (1.6.6) ...
libdvd-pkg: Checking orig.tar integrity...
/usr/src/libdvd-pkg/libdvdcss_1.4.2.orig.tar.bz2: OK
libdvd-pkg: `apt-get check` failed, you may have broken packages. Aborting...
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  apt-transport-https
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 1,692 B of archives.
After this operation, 152 kB of additional disk space will be used.
Get:1 http://ca.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 apt-transport-https all 1.6.6 [1,692 B]
Fetched 1,692 B in 0s (6,872 B/s)
Selecting previously unselected package apt-transport-https.
(Reading database ... 246791 files and directories currently installed.)
Preparing to unpack .../apt-transport-https_1.6.6_all.deb ...
Unpacking apt-transport-https (1.6.6) ...
Setting up apt-transport-https (1.6.6) ...
libdvd-pkg: Checking orig.tar integrity...
/usr/src/libdvd-pkg/libdvdcss_1.4.2.orig.tar.bz2: OK
libdvd-pkg: `apt-get check` failed, you may have broken packages. Aborting...

One thing I did to fix this was after installing libdvd-pkg, run the following command to complete the setup:

sudo dpkg-reconfigure libdvd-pkg

If this problem persist, you can select not to do "automatic" updates.

@devguy's answer echoes /usr/share/doc/libdvd-pkg/README.Debian:

dpkg-reconfigure libdvd-pkg may be used to build and install libdvdcss* package(s).

For background, take a quick look at the installed package to see how it works and where/why the problem occurs:  The package installs the debian source packaging for a libdvdcss package, and from the postinst script, downloads the .orig.tar.gz source from videolan.org, and builds and installs binary packages.  Most of the work is done in the /usr/lib/libdvd-pkg/b-i_libdvdcss.sh script and in the Debian source package in /usr/share/libdvd-pkg/debian/.  The failure appears to be deliberately triggered before the source package build, since apt-get check will always fail when an apt-get install is running:
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?

The author's reason for deliberately triggering the failure when installing via apt-get is described in this bug report just a little more clearly than in README.Debian:

Trouble is that libdvd-pkg hooks into APT post-invoke
handler and run commands that normally never run on that stage. Therefore
there is a risk and potential to break APT operations and cause system-wide
effect...

I assume the reason to build libdvdcss.so from source is to skirt some legal or other issue surrounding distributing binaries.  However, reading through the bug report, it's not clear why the package builds and installs a Debian package from source, and nesting the package installs (i.e. installing the libdvdcss package during the install of the libdvd-pkg package) is the root problem here.  Alternative means of building and installing libdvdcss.so from source that could skirt this issue aren't discussed anywhere I've found.
Again, until the package's issues can be cleaned up, it appears @devguy's answer is the best interim workaround:
# Install base files; .postinst fails; libdvdcss package NOT installed
sudo apt-get install libdvd-pkg
# Re-run .postinst; libdvdcss package successfully builds and installs
sudo dpkg-reconfigure libdvd-pkg


Can't get wifi to work on Ubuntu 16.04 with Intel wireless 7260 (rev c3) I am new to using Ubuntu. I dual booted my HP laptop with Windows 10 and Ubuntu 16.04. I am unable to see any wireless networks on Ubuntu, but it works perfectly if I use a wired connection. My network controller is an Intel 7260 (rev 3). When I check "Software & Updates" my wireless driver does not show up. Any suggestions as to how I should proceed?

Running

lspci -nnk | grep 0280 -A2

produces the output:

09:00.0 Network controller [0280]: Intel Corporation Wireless 7260 [8086:08b1] (rev c3)
DeviceName: Intel Stone Peak 2 7260 ac 2x2 + BT4 LE Combo
Subsystem: Intel Corporation Dual Band Wireless-AC 7260 [8086:c070]

Running

rfkill list all

produces the output:

0: hci0: Bluetooth
Soft blocked: no
Hard blocked: no
1: acer-wireless: Wireless LAN
Soft blocked: yes
Hard blocked: no
2: phy0: Wireless LAN
Soft blocked: no
Hard blocked: no

Running

dmesg | grep iwl

produces

[    6.101194] iwlwifi 0000:09:00.0: Direct firmware load for iwlwifi-7260-17.ucode failed with error -2
[    6.118974] iwlwifi 0000:09:00.0: loaded firmware version 16.242414.0 op_mode iwlmvm
[    6.191797] iwlwifi 0000:09:00.0: Detected Intel(R) Dual Band Wireless AC 7260, REV=0x144
[    6.191938] iwlwifi 0000:09:00.0: L1 Enabled - LTR Enabled
[    6.192203] iwlwifi 0000:09:00.0: L1 Enabled - LTR Enabled
[    6.428960] ieee80211 phy0: Selected rate control algorithm 'iwl-mvm-rs'
[    6.430845] iwlwifi 0000:09:00.0 wlo1: renamed from wlan0
[   16.944519] iwlwifi 0000:09:00.0: L1 Enabled - LTR Enabled
[   16.944781] iwlwifi 0000:09:00.0: L1 Enabled - LTR Enabled
[   17.139952] iwlwifi 0000:09:00.0: L1 Enabled - LTR Enabled
[   17.140212] iwlwifi 0000:09:00.0: L1 Enabled - LTR Enabled

Run in terminal

sudo tee /etc/modprobe.d/blacklist-acer.conf <<< "blacklist acer_wmi"

and reboot.

Update your software. In the window that is left open after the updates notice additional tabs. Go to the Additional Drivers tab & apply changes to accept the use of proprietary drivers. You might see individual hardware drivers appear & you must check off the ones you want to use. Then click on apply changes.
Go to your network connections tab.
There you will be able to enable wifi. On the same tab go to edit connections. Add your SSID & password.
If all fails try rebooting & run updates again. Try to connect.
Good Luck!


Why isn't the wallpapers changed when I upgrade to a beta release? I updated 13.10 Saucy Salamander to 14.04 through the terminal.  System settings says I am running 14.04 but I see nothing different.  The desktop wallpapers are all the same with Saucy Salamander. I didn't use a USB stick. Should I just re install?

Did I do something wrong?

This is because the branding is the last thing Ubuntu does to the system installations. If you want your system completely rebranded, you should wait until the final release.

Just open synaptic package manager and uninstall ubuntu-wallpaper saucy.  Worked for me.


Updating from 12.04 to 14.04 - Autolaunch error: X11 initialization failed I'm attempting to upgrade my work machine from 12.04 to 14.04, but having issues.

sudo update-manager -d:

** (update-manager:20416): WARNING **: Command line `dbus-launch --autolaunch=f01c8e2b23ace751460ef7f800000009 --binary-syntax --close-stderr' exited with non-zero exit status 1: Autolaunch error: X11 initialization failed.\n
Traceback (most recent call last):
  File "/usr/bin/update-manager", line 26, in <module>
from gi.repository import Gtk
  File "/usr/lib/python2.7/dist-packages/gi/importer.py", line 76, in load_module
dynamic_module._load()
  File "/usr/lib/python2.7/dist-packages/gi/module.py", line 224, in _load
overrides_modules = __import__('gi.overrides', fromlist=[self._namespace])
  File "/usr/lib/python2.7/dist-packages/gi/overrides/Gtk.py", line 1533, in <module>
raise RuntimeError("Gtk couldn't be initialized")
RuntimeError: Gtk couldn't be initialized

I've tried stuff like removing .Xauthority

Launching it without sudo works, but it fails when I click upgrade:

authenticate 'trusty.tar.gz' against 'trusty.tar.gz.gpg'
extracting 'trusty.tar.gz'
can't load DistUpgradeViewGtk3 (Gtk couldn't be initialized)

Any ideas on how I can launch sudo update-manager -d ?

Try:

sudo DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY update-manager -d


Tor is already running/won't open Alrighty. So, I've checked out this thread in Ubuntu forums. I've run the commands killall tor to ensure that tor wasn't just already running (which it was) and then sudo /etc/init.d/tor start. I get the notification

[ ok ] Starting tor (via systemctl): tor.service.

But then I don't see anything happen. I sit there for five minutes and tor doesn't open. Maybe I'm doing something wrong at this point, I don't know. So, after trying this, I try running command tor to see if that happens. Terminal spits this at me (I've included my input so as not to confuse anyone)

~$ tor
Dec 08 19:50:28.740 [notice] Tor v0.2.7.6 (git-605ae665009853bd) running on Linux with Libevent 2.0.21-stable, OpenSSL 1.0.2g and Zlib 1.2.8.
Dec 08 19:50:28.740 [notice] Tor can't help you if you use it wrong! Learn how to be safe at https://www.torproject.org/download/download#warning
Dec 08 19:50:28.740 [notice] Read configuration file "/etc/tor/torrc".
Dec 08 19:50:28.744 [notice] Opening Socks listener on 127.0.0.1:9050
Dec 08 19:50:28.000 [notice] Parsing GEOIP IPv4 file /usr/share/tor/geoip.
Dec 08 19:50:28.000 [notice] Parsing GEOIP IPv6 file /usr/share/tor/geoip6.
Dec 08 19:50:28.000 [notice] Bootstrapped 0%: Starting
Dec 08 19:50:29.000 [notice] Bootstrapped 5%: Connecting to directory server
Dec 08 19:50:29.000 [notice] Bootstrapped 80%: Connecting to the Tor network
Dec 08 19:50:29.000 [notice] Bootstrapped 85%: Finishing handshake with first hop
Dec 08 19:50:30.000 [notice] Bootstrapped 90%: Establishing a Tor circuit
Dec 08 19:50:31.000 [notice] Tor has successfully opened a circuit. Looks like client functionality is working.
Dec 08 19:50:31.000 [notice] Bootstrapped 100%: Done

After sitting here for another five minutes, still nothing. Again, maybe there's something I did wrong or need to do after I do this step, but I don't know it. If that's the answer, please just tell me which step I'm missing and stop reading now.

So, after this doesn't work, I ensure tor isn't running by using my friend killall and then I open up tor using my search thing (forget what it's called) and click tor. The little icon pops up and then disappears and tor never opens. I was able to use tor after I first installed it. I've tried reinstalling it but I never got it to work again. Is it possible that there's a config file somewhere that I screwed up? Anyway, any help would be appreciated. Thanks, sorry for tons of terminal output!

The output you pasted from your terminal would seem to indicate that tor is running. Now you just have to use it! Did you set up a browser for that?

The Tor Browser will work for you if you haven't got it already. Configuring your browser use localhost:9050 as a SOCKS5 proxy also works, but just using tor as a proxy doesn't make a browser private/secure.

To verify that you're using tor, point the browser you think is configured to use it at https://check.torproject.org/. If you get a message that "the proxy server is refusing connections" or similar, it may mean that your browser is configured to use tor, but it isn't running. Otherwise the page will give you the good/bad news about whether you seem to be using tor.

$tor
$ cat /var/lib/tor/ssh_hidden_service/hostname
like
3l5zstvt1zk5jhl662.onion

so is ok

Tor Nat Traversal

# install to server
$ apt-get install tor torsocks

# or in mac os
$ brew install torsocks

# bind ssh to tor service port 80
$mkdir -p /var/lib/tor/ssh_hidden_service/
$chmod 700 /var/lib/tor/ssh_hidden_service/

# vi /etc/tor/torrc
SocksPolicy accept 127.0.0.1
Log notice file /var/log/tor/notices.log
RunAsDaemon 1
HiddenServiceDir /var/lib/tor/ssh_hidden_service/
HiddenServicePort 80 127.0.0.1:1221
PublishServerDescriptor 0
$ /etc/init.d/tor stop;/etc/init.d/tor start

# or
$service tor start

# or
$tor --service start
$/etc/init.d/tor status
$cat /var/log/tor/notices.log
$ netstat -lntp|grep tor
$cat /lib/systemd/system/tor.service

$ cat /var/lib/tor/ssh_hidden_service/hostname
3l5zstvt1zk5jhl662.onion

# ssh connect from client
$ apt-get install torsocks
$ torsocks ssh login@3l5zstvt1zk5jhl662.onion -p 80


How to create a ext4 partition for all users? I know it sound like a dublicate questions but I tried the following and it didn't help:

My drive is mounted under

/media/data

so I entered

sudo chown -R :users /media/data

However I still cannot write to that partition as a user.
I also tried to make an entry in the /etc/fstab

UUID=... /media/data ext4 rw,suid,dev,exec,auto,user,async 0 0

but after that my computer could not boot anymore because he could not find the disk.

I have Ubuntu 14.04 Server installed. The partition is listed under /dev/nvmeOn1p1
and does not appear in the /etc/fstab (see pics below).

(the device is a "Intel DC P3700" 800GB SSD)

Additional Remark:
Since the partition is empty i could also format it and recreate it using gparted for example. Is there a way in gparted or other gui programs to specify that the partition should be usable by all users?

Maybe you're doing the things in the wrong order. When you create a file system with mkfs.ext4, everything inside it is owned by user root and group root with your system default permissions set.

When you mount that file system on a directory, you see file system permissions and owner, regardless of the original owner and permissions on that directory.

So doing something like this won't work:

sudo mkfs.ext4 /dev/some/data
sudo mkdir /media/data
sudo chown -R :users /media/data
sudo chmod -R g+rw /media/data
sudo mount /dev/some/data /media/data

The right thing to do is create the file system, mount it, and then change permissions and ownership on it. It doesn't matter what you do in /etc/fstab.

The right way to do it is this:

sudo mkfs.ext4 /dev/some/data
sudo mkdir /media/data
sudo mount /dev/some/data /media/data
sudo chown -R :users /media/data
sudo chmod -R g+rw /media/data

This should answer your question. If you need more details, read on.

To better understand what happens, let's experiment a little with an image file

Create an empty file to format and mount using fallocate -l 100MB /tmp/filesystem.img. Then format it as an ext4 file system with sudo mkfs.ext4 /tmp/filesystem.img (it's not a block device, but if you answer yes you can put a working ext4 file system on it anyway) and create a directory to use as mount point mkdir /tmp/experiment.

Now try to change the owner and permissions on that directoy with sudo chown -R :users /tmp/experiment and sudo chmod -R g+rw /tmp/experiment, and check permissions with ls -la /tmp/experiment. You'll get something like this:

 ls -la /tmp/experiment/
 total 0
 drwxrwx--x 2 gerlos users  40 feb 19 10:37 .
 drwxrwxrwt 8 root   root  180 feb 19 10:38 ..

This tells you that /tmp/experiment is owned by user gerlos and group users, and group members can read, write and execute on it. You can put files in it, for example with touch /tmp/experiment/somefile.

Now mount the file system on that directory with sudo mount /mnt/filesystem.img /tmp/experiment, and look again at ls output:

$ ls -la /tmp/experiment/
total 13
drwxr-xr-x 3 root root  1024 feb 19 10:41 .
drwxrwxrwt 8 root root   180 feb 19 10:41 ..
drwx------ 2 root root 12288 feb 19 10:41 lost+found

As you can see, now /tmp/experiment seems owned by root, with different permissions! Why? Because we are not looking at /tmp/experiment itself, but at the root directory of the file system contained in /mnt/filesystem.img, mounted on /mnt/experiment.

Additionally, your normal user won't be able to put files there with touch /tmp/experiment/anotherfile.

If you now try again to run chown and chmod as above, you will change owner and permissions not on the mount point, but on the mounted file system, and your users will be able to use the file system. To confirm this look at ls output one last time:

$ ls -la /tmp/experiment/
total 13
drwxrwxr-x 3 root users  1024 feb 19 10:41 .
drwxrwxrwt 8 root root    180 feb 19 10:45 ..
drwxrw---- 2 root users 12288 feb 19 10:41 lost+found

As you can see, now members of users group can put files on the file system! In fact, nothing prevents your normal user from creating a new file there with touch /tmp/experiment/myfile:

$ ls -la /tmp/experiment/
total 13
drwxrwxr-x 3 root   users   1024 feb 19 11:05 .
drwxrwxrwt 8 root   root     180 feb 19 11:02 ..
drwxrw---- 2 root   users  12288 feb 19 10:41 lost+found
-rw-rw---- 1 gerlos gerlos     0 feb 19 11:02 myfile

Mission accomplished! :-)

It`s manual - "How create EXT4 partition"
https://superuser.com/questions/643765/creating-ext4-partition-from-console

After you can add it on FSTAB. Add next text in end of file /etc/fstab:

/dev/nvme0n1p1    /media/data    ext4    defaults    0    2

Where /dev/nvme0n1p1 - your physical device, /media/data - your mountpoint.

After use command mount -a for mounting all partition in FSTAB.


Pidgin unable to connect to GTalk I can't believe I'm raising this question after years, but after a fresh installation of Ubuntu 12.10, I'm unable to connect Pidgin to Google Talk.

I use a Google Apps domain name, and the settings that I'm using are :

Protocol : XMPP
Username : ****
Domain   : ********.com
Resource : Home

In the advanced tab,

Connection security : Require encryption.
UNCHECK Allow plaintext auth over unencrypted steams
Connect port  : 5222
Connect sever : talk.google.com
File transfer proxies : proxy.eu.jabber.org
Bosh URL : (blank)

In the proxy tab,

No proxy.

I had used these same settings on 12.04 and it had worked like a charm.

Any help will be appreciated.

Use the following setting and check if it works:

Connection Security : "Use old-style SSL"
     Connect port   : 5223
     Connect sever  : talk.google.com

Mind  I am using the same

go to the file
go to account
3 go to buddy account

then add/edit
and then later

it should look like this

same with the first answers

Protocol : XMPP
Username : ****
Domain   : ********.com
Resource : Home
In the advanced tab,

Connection security : Require encryption.
UNCHECK Allow plaintext auth over unencrypted steams
Connect port  : 5222
Connect sever : talk.google.com
File transfer proxies : proxy.eu.jabber.org
Bosh URL : (blank)
In the proxy tab,

No proxy.

then after that you are done


installArchives() failed: dpkg: dependency problems prevent configuration of "package" Every time I attempt to use the Ubuntu Software Center, I get an error message that says "Items cannot be installed or removed until the package catalog is repaired". When I try to repair, it then says "The installation or removal of a package failed".

Under details, it says:

installArchives() failed: dpkg: dependency problems prevent configuration of linux-generic:
 linux-generic depends on linux-image-generic (= 3.2.0.38.46); however:
  Version of linux-image-generic on system is 3.2.0.58.69.
 linux-generic depends on linux-headers-generic (= 3.2.0.38.46); however:
  Version of linux-headers-generic on system is 3.2.0.58.69.
dpkg: error processing linux-generic (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
Errors were encountered while processing:
 linux-generic
Error in function:
dpkg: dependency problems prevent configuration of linux-generic:
 linux-generic depends on linux-image-generic (= 3.2.0.38.46); however:
  Version of linux-image-generic on system is 3.2.0.58.69.
 linux-generic depends on linux-headers-generic (= 3.2.0.38.46); however:
  Version of linux-headers-generic on system is 3.2.0.58.69.
dpkg: error processing linux-generic (--configure):
 dependency problems - leaving unconfigured

Thanks for any help that can be provided.

You will need a terminal to solve the situation, the Software Center isn't able to handle this kind of problems. To do this use:

sudo dpkg -r linux-generic linux-image-generic
sudo apt-get install linux-generic

That should solve the problem.

First do the following:

sudo apt-get update

sudo apt-get -f upgrade

Then:

sudo apt-get autoremove

PS: As you are not an enterprise I would recommend you to update to the latest version 13.10. Hope it helped


Running a cron job on the first weekday of the month I am trying to run a job on the first weekday of each month with the following crontab entries:

00 07 1-3 * * [ "$(date '+\%a')" == "Mon" ] && echo "Its Monday!"
00 07 1 * * [ "$(date '+\%a')" == "Tue" ] && echo "Its Tuesday!"
00 07 1 * * [ "$(date '+\%a')" == "Wed" ] && echo "Its Wednesday!"
00 07 1 * * [ "$(date '+\%a')" == "Thu" ] && echo "Its Thursday!"
00 07 1 * * [ "$(date '+\%a')" == "Fri" ] && echo "Its Friday!"

But this morning I got the following error:

/bin/sh: 1: [: Thu: unexpected operator

From man test:

   STRING1 = STRING2
          the strings are equal

Note that it is =, not ==. However, this is not the only problem...

firas@itsuki ~ % sh
$ [ "$(date '+\%a')" == "Thu" ] && echo "Its Thursday!"
sh: 1: [: \Thu: unexpected operator
$ [ "$(date '+\%a')" = "Thu" ] && echo "Its Thursday!"
$

The other problem is that since your date string +\%a is between single quotes, it will be interpreted literally, and so

$ date '+\%a'
\Thu

which is not what you want. Instead you should remove the unnecessary backslash, and then

$ [ "$(date '+%a')" = "Thu" ] && echo "Its Thursday!"
Its Thursday!

The problem is a mix of syntax and suitable commands in the code you're using, rather than the way the cron has been set up. For what you're trying to achieve, the bash code should really utilise an if statement, like this:

if [[ "$(date '+\%a')" == "\Thu" ]]; then echo "Its Thursday!"; fi

(Note the extra set of square brackets, use of semi-colon, and the terminating fi entry).

The result of which looks like this:

chris@loki:/$ if [[ "$(date '+\%a')" == "\Thu" ]]; then echo "Its Thursday!"; fi
Its Thursday!

It's worth noting that in your code, the boolean && isn't suitable, as it's really supposed to be used for stringing conditional statements. For example:

if [ $condition1 ] && [ $condition2 ]

Hope this is what you were after!


Mongo db left a big folder after remove I've removed mongodb sudo apt-get remove mongodb but then found its parts:

    root@vickers:/var/lib/mongodb/journal# ls -lh
    total 768M
        -rw------- 1 mongodb nogroup 256M Nov 18 17:35 prealloc.0
        -rw------- 1 mongodb nogroup 256M Nov  7 19:11 prealloc.1
        -rw------- 1 mongodb nogroup 256M Nov  7 19:11 prealloc.2

It's so strange that it took so much space since I didn't used it much (just some tests in console).

How should I remove Mongo to force it remove all its parts?

UPD. Also tried sudo apt-get purge mongodb. The same

You can remove the mongodb folder by just simply doing this:

sudo rm -r /var/lib/mongodb

Try apt-get purge mongodb.  If that still doesn't clean it up, just do a rm -rf /var/lib/mongodb


Swap Full But Memory Available In RAM I've a AWS ec2 instance running Ubuntu 16.04 with 64 GB RAM and have a swap file configured for 8GB. During a nightly batch process which syncs the backup data from an EBS volume of this instance to a S3 bucket, the swap memory is almost 100% utilised but the main memory still has abundant space in the range of 10-15 GB available.

Here's the swappiness default:

$ cat /proc/sys/vm/swappiness
60

Is it worrying? If yes, shall I add more swap space by having a larger swap file or opt for swap partitions instead?

This observation where you see significant swap use after a nightly batch job despite having plenty of RAM is not worrying. It is especially not worrying, because it happens during the night with no users in front of the computer. Thus,your user experience is in no way affected by this use of swap. Likely, as it stands now, your specific batch processes are performed with maximum efficiency and speed.

This high swap usage would only be of practical concern if you were in front of the computer during that time, doing other tasks. A high tendency to swap would then lead at times to  a slight delay in response of the user interface, as certain RAM of your applications needs to be retrieved from swap as you need it. Having a lower swap tendency will decrease the likelihood that software is swapped out, and that you experience delays. You will perceive this as snappier performance, i.e. instant response of the system throughout, but at the expense of other processes that have less "breathing room" to do their activities because you keep occupying the RA even for processes yo do not immediately need again.

If you want a stricter swap policy you can lower the swapiness setting you posted.
This answer nicely explains what swapiness is all about.

In my personal experience I've seen that a swapiness of 10 works fine if you want to utilize as much of your RAM as possible without losing system stability.


How do I get and modify the source code of packages installed through apt-get? I am assuming that all application installed through apt-get are open source; but for those that are available in that manner, where can I get the source code for these applications as well as update them?

I have a couple applications I use regularly that aren't being actively developed any longer and I would like to add features. Where would I go to get the rights to update these applications?

In this case specifically, I am referring to the hellanzb package

Use the command apt-get source <package> (don't use sudo with it) to download the source of a package.

From man apt-get:

   source
       source causes apt-get to fetch source packages. APT will examine the
       available packages to decide which source package to fetch. It will then
       find and download into the current directory the newest available version of
       that source package while respect the default release, set with the option
       APT::Default-Release, the -t option or per package with the pkg/release
       syntax, if possible.

       Source packages are tracked separately from binary packages via deb-src type
       lines in the sources.list(5) file. This means that you will need to add such
       a line for each repository you want to get sources from. If you don't do
       this you will properly get another (newer, older or none) source version
       than the one you have installed or could install.

       If the --compile option is specified then the package will be compiled to a
       binary .deb using dpkg-buildpackage, if --download-only is specified then
       the source package will not be unpacked.

       A specific source version can be retrieved by postfixing the source name
       with an equals and then the version to fetch, similar to the mechanism used
       for the package files. This enables exact matching of the source package
       name and version, implicitly enabling the APT::Get::Only-Source option.

       Note that source packages are not tracked like binary packages, they exist
       only in the current directory and are similar to downloading source tar
       balls.

To build a package from source, first install the build dependencies:

sudo apt-get build-dep <package>

Then use dpkg-buildpackage to create a .deb file. From APT and Dpkg Quick Reference Sheet:

  dpkg-buildpackage Builds a Debian package from a Debian source tree. You must be in the main directory of the source tree for this to work. Sample usage:

 dpkg-buildpackage -rfakeroot -uc -b

  Where -rfakeroot instructs it to use the fakeroot program to simulate root privileges (for ownership purposes), -uc stands for "Don't cryptographically sign the changelog", and -b stands for "Build the binary package only"

In a terminal, cd into the directory containing the package source (e.g ~/code/hellanzb-0.13) and run the following command:

dpkg-buildpackage -rfakeroot -uc -b

If the build is successful, there will be a .deb file located in the parent
 directory (e.g ~/code/hellanzb_0.13-6.1_all.deb).

To get more information about a package including upstream URL and project/program contacts you can have a look at the copyright file (referenced from packages.debian.org).

When the package is included and installed on your system, you can also read the copyright file directly at /usr/share/doc/$package_or_program_name/copyright.

See how to download Debian package's source code?.


Ubuntu and LAN games (specfically Minecraft) We both have Ubuntu 12.04, same Minecraft version, same network as each other via wireless.

It says scanning for LAN and it never shows up.

Does Ubuntu have a built-in firewall that blocks connections from the local area network, and if so is there anyway to change it?

First, you should check the firewall configuration on the computer running the server (the one on which you opened your world to LAN).

ufw is the default firewall interface on Ubuntu (you will need a terminal).

> sudo ufw status verbose

Bellow is the configuration for one of my home server:

Status: active
Logging: on (low)
Default: deny (incoming), allow (outgoing)
New profiles: skip

To                         Action      From
--                         ------      ----
22/tcp                     ALLOW IN    Anywhere
5901/tcp                   ALLOW IN    Anywhere
22/tcp                     ALLOW IN    Anywhere (v6)
5901/tcp                   ALLOW IN    Anywhere (v6)

We can see that all incoming connections are denied, while all outgoing are allowed (this a standard configuration).
Additional rules allow incoming connections to SSH (22) and VNC (5901) ports.

If you are on a LAN, behind a router and the router doesn't forward ports to your computers, it should be safe to disable the firewall:

sudo ufw disable

An other option I would feel more comfortable with is to allow anything coming from your LAN:

sudo ufw allow in from 192.168.0.0/24

This assuming that is using addresses looking like this : 192.168.0.*
You can check that using

ip addr show | grep "inet "

Mine is on IP 192.168.0.9 :

inet 127.0.0.1/8 scope host lo
inet 192.168.0.9/24 brd 192.168.0.255 scope global wlan0

I don't really know how minecraft works, but it should only be necessary to change the firewall settings on the minecraft server.

It probably is your router configuration. This happened with me a long time ago in Windows. Search in your router's manual about "How to open ports". Or search the internet. Just remember that the process can change depending on your model. The default Minecraft LAN Server port is 25565.


Chrome desktop notifications use notify-osd? Is there a way to make Chrome/Chromium's notifications use notify-osd instead of the ugly boxes it uses by default?

Yeah: Chromify-OSD.

This can be installed from the Google Chrome Web Store.

To install it, just go to the webstore and click the "Add to Chrome" button - it'll do the rest.

To use it, you'll probably need to restart Chrome, at that point it should be working.

All bugs should be reported to the launchpad.net project page - for more on reporting bugs, take a look at this question: How do I report a bug?

Once you have installed it in Chrome, Click on the Wrench Icon, then select the Prefences Menu, then Extensions and you should see:

The Chromify-OSD extension Icon and that it is enabled. The extension is now installed and enabled.

The only other requirement to make this work is that you have the notify-osd packages installed in your system or this will not do anything at all.

HTH. Have a nice day. :)


Connect to MySQL DB tunneling with SSH using Emma I have tried using the mysql-workbench but it was too confusing, then I decided to use emma instead. I am trying to connect to my MySQL DB through SSH, but I don't see that option when I try to make a new connection. Any suggestions? Thanks!

( I did try some researching but I could not find helpful results )

You can create an SSH tunnel manually with:

ssh -L 33060:localhost:3306 user@remotehost

While this ssh session is open, connections to your port 33060 will be forwarded to (the standard mysql server) port 3306 on the remote server.

Then any mysql client can connect to the mysql server running on 'remotehost', e.g.:

mysql -P 33060 -h 127.0.0.1 -u mysqluser -p

I've used this method to connect emma to a mysql server running privately (not accessible externally) on another machine before. Unfortunately, with this method, you have to establish the tunnel manually before emma's stored server connection will work.

A much more reliable way to create an ssh tunnel to a remote mysql database is to use gstm, the Gnome SSH Tunnel Manager...

sudo apt-get install gstm

Then run the gui application, create a named config for your connection, with host set to destination host and port set to 22 (probably) as the ssh port. Tick autostart if you want this tunnel to auto-launch on start up. Then add a port redirect, type local, port 33060, host same as destination, to port 3306.

One thing to note is that in clients, php config etc, you will probably want to use 127.0.0.1:33060 rather than localhost:3306 because reasons. (Something to do with sockets).


Is it possible to pass passwords on a shell script? Long time i am searching for this, i would like to know is it possible to pass passwords in a shell script? Many of the answers returned with no. Recently i read an article stating that how to pass passwords in a shell script. I have tried that, but it doesn't seem to work. This is the link. Can anyone checkitout and revert back? Also pls say me is there a way to pass passwords in a shell script? If no pls say me how linux gets the input for the password?

By "entering passwords", you likely mean entering data without being visible for the user.

(suggested by geirha) When using bash, you can use the -s option to prevent typed characters from being displayed:

read -p "Password please: " -s pass

Alternatively, change the behavior of the terminal to hide typed characters with stty -echo (disable echo). After reading the password with the shell built-in read into a variable (in the below example, $pass), turn it back on with stty echo. Because the new line from Enter is hidden to, you've to print a newline to get future output on a new line.

stty -echo
read -p "Password please: " pass
stty echo
printf '\n'

read and printf are shell built-ins. stty is provided by the coreutils package which is installed by default. That means that this snippet is very portable.

Note: the -p option is not standard, but from bash. If you need to display a prompt in other shells, use:

printf "Password please: "
stty -echo
read pass
stty echo
printf '\n'

References:

Manual page of stty
Manual page of bash

you can simply do something like this.

# echo -e "password_here\npassword_here" | su user

source


Installing Ubuntu 13.10 on new Macbook Pro. Installs then fails after restart So I installed Ubuntu from a Live USB. No problems there. I get to the end of the the installation and am told to restart. I restart it then get a white screen with a blinking file icon with a question mark in it. Ubuntu is installed as if I try to install again it says Ubuntu is running when you are asked whether you want to erase the previous operating system.

I don't believe Macs are able to use Ubuntu natively. I think you need a third-party bootloader such as rEFInd. Although if you still have Mac OS X installed I seriously recommend you use this tool: Mac linux USB loader


Graphics not working with Intel i5-3470 I recently upgraded my PC to the following Spec:

Processor: Intel Core i5-3470
Motherboard: GA-B75M-D3H - GIGABYTE B75M-D3H IVY BRIDGE  MOTHERBOARD
RAM: JM1333KLN-4G - TRANSCEND 4GB JETRAM DDR3 1333 DIMM 9-9-9
HDD: ST31000524AS - SEAGATE 1TB 3.5"HDD 7200RPM SATA 6GB/S 32MB CACHE
Graphics Card: Using the onboard graphics

When installing Ubuntu 12.04, all the boxes shown on screen as well as the menu bar across the top are corrupted. It seems to be a 3d related issue because 2d items such as pictures display in the install window and/or icons are ok during the install.

I can upload pictures later but basically all the boxes look as if they have horizontal and vertical tears/pixelation. The edges which are supposed to have a nice shadow effect are also all choppy and jagged. Text on the boxes is barely visible and as the text updates different letters become partially visible.

It was a bit difficult but I managed to setup my Wi-Fi (for updates) and complete the install.

When booting the background image displays as does the mouse cursor but then the screen just flickers a few times before turning off completely.

Pressing Ctrl-Alt-F1 gets me to the terminal prompt and I was able to run:
    $sudo apt-get update
    $sudo apt-get upgrade

After installing 305 updates the issue was still not resolved.

Does anybody have any ideas??
I also tried the 12.10 daily build but the Kernel crashed during install

I'm new to Ubuntu but so far this is really disappointing, I was hoping to use this PC for some development projects I had in mind but it doesn't work out the box! I also don'thave unlimited bandwidth so I can't keep downloading updates all the time.

Windows 7 worked just fine....

This is a known bug. A patch has been submitted though it has not yet made it in to the official repo. You can get the updated files using the developer's PPA and following the instructions below:

Do a fresh install of 12.04, boot installer with nomodeset
On first boot add nomodeset in GRUB (hold shift on boot, press 'e' to edit)
Open a Terminal and type sudo add-apt-repository ppa:tjaalton/ppa
Run apt-get dist-upgrade
Reboot

Note: I've found that upgrading the kernel to 3.6-rc1 breaks the Intel driver, it also seems to be incompatible with the xorg-edgers packages.

if you can login :
Firstly, Open terminal and type:

sudo add-apt-repository ppa:ubuntu-x-swat/x-updates
Followed by sudo apt-get update
And sudo apt-get install xserver-xorg-video-intel

This will install INTEL latest drivers. Just reboot once installed and look for changes that have taken place.

If this does not work then try this testing PPA repository:

Open terminal type in:

sudo add-apt-repository ppa:intel-gfx-testing/ppa
Followed by sudo apt-get update

Once you are done, reboot and try to change resolution you are looking for.


Android SDK can't be installed on Ubuntu 12.04-64 I am trying to install Android SDK on Ubuntu 12.04 but the Manager goes blank after downloading the first component of the SDK. I followed the installation steps mentioned here and tried to reinstall Ubuntu and nothing works. The terminal doesn't show any error messages the system monitor shows no network activity during this process.

Screenshot:

Can anyone help? How can I get this to install?

It is highly recommended that you install ia32-libs so that the SDK is compatible with your 64-bit machine.

sudo apt-get update
sudo apt-get install ia32-libs

Or, if you're running Ubuntu 12.04, you may have to install ia32-libs-multarch instead:

sudo apt-get update
sudo apt-get install ia32-libs-multiarch

I've been maintaining this thread on XDA-Developers for a while now, I took bits & pieces from other forums, and put this method together. Googles method never worked for me, and made me hate Ubuntu. But, eventually it grew on me and I've gotten more advanced with Linux distros. Hope my thread can help someone. Enjoy the possibilities!!!!!

http://forum.xda-developers.com/showthread.php?p=9393280#post9393280

I had similar problems on ubuntu 12.04 -64, nothing gets downloaded by the SDK manager. This seems to be due to https, but I haven't looked much deeper into it. I resolved the issue by updating sdk via command line SDK_HOME/tools/android update sdk --no-https --no-ui. Note also that android update sdk --no-https doesn't seem to work, the UI still uses https. This is likely a bug.


Quickly place a window to another screen using only the keyboard I know that using Alt+F7, I can use the keyboard to move the window around. I can also use the "Grid" plugin of Compiz to position quickly the window around my current monitor. The grid plugin doesn't seem work across monitor however.

What I need is a quicker way to move the current window to the other screen. In my current dual-monitor setup, I find myself needing to move the focus window to the other monitor as I focus on working on something else (and move it back afterward).

If I use XMonad (or other tiling managers), this would be rather easy. However, many applications that I use (Gnome Do, MATLAB, image viewers, custom apps that I write, ...) do not work well with a tiling manager.

So my question is: is there a shortcut key combination that moves the currently focused window to the other monitor (and back)?

Install CompizConfig Settings Manager

sudo apt-get install compizconfig-settings-manager

Run CCSM → Go to bottom (Window Management) → Go to "Put."
Enable the plugin.
Configure shortcut for "Put to next Output."
Log out and back in again.

If the plugin put doesn't appear in CCSM, install the compiz-plugins  package. (sudo apt-get update && sudo apt-get install compiz-plugins)

EDIT: The required plugin package is now called compiz-plugins on 12.10 and higher. compiz-plugins-extra  is still used for 12.04.

Addendum: If the solution with Put plugin doesn't work.

Try to disable some features you don't use that may interfere. I left only Put To Next Output enabled and it started to work.


How to restart Ubuntu upgrade from command line? I am trying to upgrade from 11.10 to 12.04. After numerous hours, the upgrade finally hung on the replacing packages stage. It was showing 'replacing network adaptor' for more than half an hour. There was no way to get any response.

So eventually I powered off the machine. When I powered it back on, it boots into command line mode showing release 12.04. How can I restart the process from the command line?

I'm not very much sure about how to restart the packages, I would advice you to download the Ubuntu image from here or from torrent and install it from a CD or flash drive.

12.04 has got a very good set of options to Install 'Freshly' or 'Upgrade it from 11.10'. This way it would be a lot more stabler without any interruptions and moreover it will be quick.

Try to use the command:

kill

For more information, run:

man kill


How can I remove desktop environments on 18.04 I have a home server running Ubuntu Server 18.04.
I came across a couple of tasks that I needed a GUI for so I installed xfce4. I didn't get on with this so I quickly uninstalled it using:

sudo apt remove --purge xfce4
sudo apt autoremove

I thought this had removed it. After a complete error using 'tasksel' I accidentally removed everything somehow. Long story short I installed Ubuntu desktop. I found this a little graphically intensive so I installed Mate.

sudo apt install ubuntu-mate-desktop

Now when I run

ls -l /usr/share/xsessions

I am returned

total 24
-rw-r--r-- 1 root root 7001 Feb 13  2018 mate.desktop
-rw-r--r-- 1 root root  323 May  2  2018 ubuntu-communitheme-snap.desktop
-rw-r--r-- 1 root root  247 May  2  2018 ubuntu.desktop
-rw-r--r-- 1 root root 5465 Sep 22  2016 xfce.desktop

So I can see mate here which is fine but I thought I uninstalled xfce. Also how do I go about removing ubuntu.desktop? I am not even sure what the other option is here.
I have searched but I only seem to find information for 12.04 or older which doesn't appear to work.
Any advice is appreciated :)

Try this, it worked for me:

apt remove --purge ubuntu-desktop

To remove the old desktop that are interfering with
each other:

When you're in the folder /usr/share/session
do:

rm -rf ubuntu-c* ubuntu.d* xfce*

Only mate.desktop will be left alone

ls -al /usr/share/session

Now you just have to reboot and it will be fine.
Tested a few minutes ago on Ubuntu 18.04.3


How to know the pid of active window How to know the pid of active (focused) window?

I want to write a script in which it is necessary to know whether the user is actively  using a program [browsing internet with somthing say firefox] or doing something else [writing text with something say gedit]

In my case i want to download big files but don't want to hurt browsering speed. so when i browse the active window is of firefox and i want to stop downloading. When i read pdf active window is of pdf reader and i want to resume download. That's it.

Finally I managed to work get the PID of actively focused window with xdotool

xprop -id `xdotool getwindowfocus` | grep '_NET_WM_PID' | grep -oE '[[:digit:]]*$'

You can install wmctrl then use it to list all windows, wmctrl -l.


Why does CTRL not work in VirtualBox VMs? I have recently noticed that for some reason when pressing CTRL in a VM in VirtualBox it doesn't get through... So I can't easily copy and paste etc, it just doesn't get through, the VM doesn't think that I've pressed anything when I press CTRL or at least it doesn't do anything, why is this? It doesn't seem to matter what I run as guest, and it didn't happen before with these same VMs so it's not that they all just don't like it, the problem probably is with VirtualBox. I have tried running Ubuntu GNOME 15.10, Ubuntu 16.04, and Ubuntu GNOME 16.04.

Information Update:

Neither the left, nor the right CTRL keys actually do anything, they don't even seem to interact with Virtual Box because pressing the right one should change something in it.

I have tried installing the Guest Additions CD in my VMs, but it makes no difference to my problem.

OS Information:

No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 15.10
Release:    15.10
Codename:   wily
Flavour: GNOME
GNOME Version: 3.18

Package Information:

Version: 5.0.14 r105127

I have figured out the problem!

The problem was that for some reason when one has the Show location of pointer option enabled in the gnome-tweak-tool, as this is assigned to CTRL, for some reason this prevents programs from capturing this key. So disabling that option in the gnome-tweak-tool fixes the issue.

Do you have the guest additions installed?  This helps with a lot of these issues.

In the VirtualBox window running your VM:

Devices > Insert Guest Additions CD Image

Or, Right Ctrl + D

Follow the prompts and then restart your VM and it should work.

As others have mentioned, Right Ctrl is the host key by default and as so will not work for copy/paste type actions but the left one works fine.


How do I configure Ubuntu for a 21:9 screen? I have an ultra wide screen, 21:9 resolution, AOS. There's no option for 21:9 in the Ubuntu display settings though so I have to have the monitor set to 16:9 which kind of defeats the purpose of having an ultra-wide screen! If the monitor is set to 21:9 the desktop is stretched significantly.

Anyone know how to add the 21:9 settings into Ubuntu?

Along the lines of this, I was able to find some information:

  This link helped me.

  In short: run xrandr and cvt like you did, then create the following file:

/usr/share/X11/xorg.conf.d/10-monitor.conf

  In the file change the parameters in < > according to your specs:

Section "Monitor"
  Identifier "Monitor0"
  <INSERT MODELINE HERE>
EndSection
Section "Screen"
  Identifier "Screen0"
  Device "<INSERT DEVICE HERE>"
  Monitor "Monitor0"
  DefaultDepth 24
  SubSection "Display"
    Depth 24
    Modes "<INSERT MODENAME HERE>"
  EndSubSection
EndSection

Here's what you should do:

For the modeline, first run this command:

cvt <X> <Y> <R>

Where XxY is your resolution and R is your refresh rate.

To test the resolution, first do this:

xrandr --newmode <MODELINE>

Be sure to remove the Modeline keyword.

Then, copy the output and replace the placeholder with it.

For the device, run xrandr|tail -n+2|head -n1|cut -d\  -f1, and replace the placeholder with its output. Keep the quotes.

For the modename, run cvt <X> <Y> <R>|cut -d\  -f2, replacing the last placeholder with the output of this command. As before, keep the quotes.

After that, do this:

xrandr --addmode <DEVICE> <MODENAME>

Replace <DEVICE> and <MODENAME> appropriately. Then, to test your resolution, do this:

xrandr --output <DEVICE> --mode <MODENAME>

If you encounter problems with the new resolution, please log out and then back in (worst case scenario: press Ctrl+Alt+Delete and then Enter to sign out.)

If you didn't encounter problems, save the file, then restart X. To do this, first press Ctrl+Alt+F1, login as an 'Administrator' account, then run these commands:

killall Xorg
X

There is nothing to do, it should just work out of the box. Just plug the HDMI cable, and the screen should work.

Please have a look at the screenshot below.

On the left, the default 1366x768 screen of the laptop. On the right, the 21:9 screen. See that the resolution and ratio is detected on the display setup.

The laptop is a Lenovo E531, with a Core i5, with integrated Intel GPU. No extra graphic card.


"Diablo-esque" game that runs on linux (preferably free) Is there any game with similar gameplay to Diablo II/III that is playable on linux? My preliminary google search yielded no results and on steam I didnt find any game similar to diablo.. I thought i found one (strife) but it turned out to be a moba that had a diablo like intro...

I think the closest games to Diablo are Torchlight 1 (Humble Bundle Store) and its successor Torchlight 2 (Humble Bundle Store or on GoG). In fact, part of the developers of these games, were inside the Diablo development team.

Tales of Maj'Eyal aka TOME.

https://te4.org/

free as in freedom. dungeon crawling roguelike.


Close current tab firefox using terminal I have firefox already running on my system, and now in minimised state. What I want is to close the current tab running in firefox. How can I do this by simply using commands in terminal?

To keep Firefox minimized after closing its current tab (according to OP, see the comment) use the following commands in a terminal,
wmctrl -a firefox; xdotool key Ctrl+w; wmctrl -r firefox -b add,shaded

How it works

wmctrl -a firefox
Go to the window with a name containing 'firefox' in it
xdotool key Ctrl+w
Send the keystroke Ctrl+W to firefox which is the shortcut to close current tab in firefox.
wmctrl -r firefox -b add,shaded
Shade a window with a title that contains the word 'firefox' in it.

To know more about these see man xdotool and man wmctrl
Alias for above command
You can make an alias for the above commands, say the alias name be cfct ( Close Firefox Current Tab) in ~/.bashrc or better in ~/.bash_aliases from a terminal as,
echo -e "\nalias cfct='wmctrl -a firefox; xdotool key Ctrl+w; wmctrl -r firefox -b add,shaded'" >> ~/.bash_aliases
. ~/.bash_aliases

If you don't have ~/.bash_aliases replace ~/.bash_aliases in the above commands with ~/.bashrc
Usage
open a terminal and enter
cfct

And it will close Firefox’s current tab instantaneously.
Note: You need to have wmctrl and xdotool installed in your system. To install them use,
sudo apt-get install wmctrl xdotool

Just press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, run the command(s) below:

xkill

and click on the tab you want to close.


Grub menu doesn't appear on dual boot with win8.1 After installing Ubuntu 14.04.3 on a HP Pavilion G6 that had windows 8.1 pre-installed, I am unable to see the grub menu. I can see two entries of Ubuntu if I hit the Esc key while booting and press F9 to go into boot menu. Ubuntu boots fine if either entry is selected.
(note:Secure boot is disabled in BIOS. Legacy is also turned off.)

First I tried boot-repair (default) which announced that it has successfully repaired the boot, but the situation did not change.

Then I tried the 'bcdedit' method shown here:
Grub not showing on startup for Windows 8.1 Ubuntu 13.10 Dual boot
I now find 4 Ubuntu entries in the boot-menu, but still grub does not show up automatically.

Is there anything else I could try? Thanks in advance for any suggestions.

I finally solved the problem by running boot-repair once again in advanced mode with 'Backup and Rename EFI Files' ticked.

This is not a big issue.

Launch Terminal (CTRL + ALT + T) and run:

sudo update-grub

That should fix the issue.


Unable to install missing video and audio plugins When I try to install missing plugins on terminal, the following output appears:

arif@arif-HP-Pavilion-15-Notebook-PC:~$ sudo apt-get purge ubuntu-restricted-extras
[sudo] password for arif:
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package ubuntu-restricted-extras
arif@arif-HP-Pavilion-15-Notebook-PC:~$ sudo apt-get install ubuntu-restricted-extras
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package ubuntu-restricted-extras
arif@arif-HP-Pavilion-15-Notebook-PC:~$

Go to the software center -> edit -> software sources and check all boxes. I think the one you need is multiverse, but just to be sure, enable all.
Then do sudo apt-get update (unless it updates automatically), now the package should be able to be located.

purge command is used to remove the component with all its dependencies. If you want to install the package use the following command in terminal

sudo apt-get install ubuntu-restricted-extras


How to customize on-screen notifications? There was a tool to configure notifications in earlier versions of Ubuntu as described here. I tried to install it in Ubuntu 12.04 too but I failed.

I want to have the notifications dynamically located (e.g. notifications for music player and volume control will be shown at the same place) and to reduce the notification duration.

How do I change settings of notifications?

There is no official way of modifying the notifications, but many changes can be made to the notifications bubbles by installing a 3rd party patch which allows various changes to be made. More details are available here: http://www.webupd8.org/2012/06/closable-movable-notifyosd.html

To install:

Open a terminal window and enter these commands one by one:

sudo add-apt-repository ppa:leolik/leolik
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install libnotify-bin
pkill notify-osd

This installs a patched version of the notify-osd package. Then you will need to install the GUI configuration tool, to do this enter these commands one by one into a terminal window:

sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt-get update
sudo apt-get install notifyosdconfig

To use the congfiguration tool type "notify" into the dash and launch the NotifyOSD Configuration application.

Modifying the Notifications

From this application you can change the colour of the notifications
by clicking on the Background Colour box (in the picture below
I've turned it a horrible green!).
To change the length of time the notifications appear on screen
adjust the value in the Timeout box

The tool also includes other customisations including:

Change font, opacity, size, corner radius
Disable fade out
Close the notifications on click
Enable/disable "use Dash background colour for the notification
bubbles"

Changing the position

To change the location that the notification appears you need to open a terminal and enter the following:

gsettings set com.canonical.notify-osd gravity #

the # in the above code should be replaced by a number between 1-6 depending on where you want the notification to appear (3 doesn't seem to work for me though):

1 - top-right corner
2 - middle-right
3 - bottom-right corner
4 - bottom-left corner
5 - middle-left
6 - top-left corner

In the Position drop down box you can choose from Fixed and
Dynamic, dynamic gets rid of the gap between the notification bubble and the top dash

In my tool there are 3 Checkbox options at the end of Bubble tab which is not shown in previous answer's image, these options worked for me, I'll suggest U recheck the procedure of installation of this tool.


How to reset the Xorg / xserver? Xserver keeps crashing on my general user account both in Unity 3D and 2D.
It doesn't do it on the guest account.

That's why I want to reset / rollback everything xserver related, hoping this is going to fix it.

Most answers on this involve sudo dpkg-reconfigure xserver-xorg. However, this does nothing for me (generates no output) and I read in other forums, that it's deprecated.

So, what's the current way to reset all xserver / xorg options; what's the alternative to sudo dpkg-reconfigure xserver-xorg? X crashes during work, not before login or so. And the effect of a crash is, that I get thrown out of the session, not a freeze or machine crash.

If your guest account is not affected this could be a user-specific setting that is causing the problem. Try deleting ~/.config/monitors.xml

After trying all you guys mentioned here I solved the very same problem by setting ownership (and permissions) of .Xauthority and .ICEauthority (located inside: /home/username/ folder) back to my general user.

to check own/perm start tty1 (CTRL+ALT+1) and login, take superuser (sudo su) and:

cd /home/username/
ls -a -l

in my case .Xauthority wasn't even readable by my general user, so first I had to chmod:

chmod 775 .Xauthority

then:

chown username .Xauthority
chown username .ICEauthority

after this, reboot and try to login -- it worked for me.

Another note: I faced this problem after iterative experiments with xorg.conf and NVidia drivers - trying to setup 3 monitors with 2 cards. So, I spent huge amount of time trying to solve the problem playing around xserver and video settings -- while the reason of crash was totally unrelated.