Why is this rsync + ssh cron job giving me 'Permission denied (publickey)' errors? I make frequent backups to a local drive which I want to sync daily to a remote server.

The target server is configured for SSH key (no password) access only. Since my primary SSH key for that server is passphrase-protected, I've created a second SSH key (not passphrase protected) + user to use for unattended backups - this way I do not have to be present to enter my passphrase when cron runs.

I'm using cron and rsync, and all of the commands work individually, but fail when combined.

The furthest I've got while troubleshooting is running

env -i sh -c "rsync -lrstRO --delete --exclude 'lost+found' /Backups/auto-daily-backups/./ backups-only@XX.XX.XX.XX:/backups/desktop/"

which returns the error

Permission denied (publickey).
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: unexplained error (code 255) at io.c(226) [sender=3.1.0]

Any tips on how to troubleshoot this further?

Here's what I've tried so far and I'm out of ideas:

Cron is definitely running ps aux | grep cron
Nothing unusual in /var/log/syslog Sep  7 13:22:01 desktop CRON[6735]: (tom) CMD (sh /home/tom/Documents/Scripts/offsite-backup)
SSH in Terminal to remote server as the backup user works ssh backups-user@XX.XX.XX.XX
Running the command in Terminal works perfectly rsync -lrstRO --delete --exclude 'lost+found' /Backups/auto-daily-backups/./ backups-only@XX.XX.XX.XX:/backups/desktop/
Manually specifying the path to the backups-user key has no effect rsync -lrstRO --delete --exclude 'lost+found' -e 'ssh -i /home/tom/.ssh/backups-only' /Backups/auto-daily-backups/./ backups-only@XX.XX.XX.XX:/backups/desktop/
Replacing the non-functioning command with a simple test command works echo "Hello world" > ~/Desktop/test.txt
Shouting/swearing at the computer had no effect (but made me feel better temporarily).

Edit 1:

Here's my crontab file and the script it calls.

...
# m h  dom mon dow   command
MAILTO=""
* * * * * sh /home/tom/Documents/Scripts/offsite-backup

and

#!/bin/bash

rsync -lrstRO --delete --exclude 'lost+found' /Backups/auto-daily-backups/./ backups-only@XX.XX.XX.XX:/backups/desktop/

Edit 2:

Just to clarify, /var/log/auth.log on the target server contains the line Sep 11 08:23:01 <hostname> CRON[24421]: pam_unix(cron:session): session closed for user root This is confusing because I'm no longer running cron every minute locally, but a new entry still appears every minute in the server logs. Crontab files for all users (including root) on the server are empty & do nothing.

Also, user 'backups-only' was created only on the server and with limited rights, with a dedicated SSH key copied to my desktop machine. I'm assuming this is the way to go because everything works when running the commands manually.

The crontab file posted above is for me, user 'tom' on my desktop machine. My intent is to have it call the script which should log in to the server as user 'backups-only'. I just tried running the backup script (rather than the command inside it) and it successfully connected & worked. I ran it on my desktop as user 'tom', same user who created the cron job that won't work. Here's the output from the server log corresponding with that successful login

Sep 11 08:35:31 <hostname> sshd[25071]: error: Could not load host key: /etc/ssh/ssh_host_ed25519_key
Sep 11 08:35:32 <hostname> sshd[25071]: Accepted publickey for backups-only from <desktop IP> port 54242 ssh2: RSA e2:e6:07:27:c1:continues...
Sep 11 08:35:32 <hostname> sshd[25071]: pam_unix(sshd:session): session opened for user backups-only by (uid=0)
Sep 11 08:35:32 <hostname> systemd-logind[638]: New session 12 of user backups-only.
Sep 11 08:36:00 <hostname> sshd[25133]: Received disconnect from <desktop IP>: 11: disconnected by user
Sep 11 08:36:00 <hostname> sshd[25071]: pam_unix(sshd:session): session closed for user backups-only

Since everything is working fine from the command line, the error Permission denied (publickey) means that the SSH part of rsync is using a different identity file than the specified username.

From Jan's comment on the original question, we can specify the identity file in the rsync command using -e 'ssh -i /path/to/identity.file' ....

Using the below command to start off with a fresh environment in cron and specifying the complete path to the file apparently solves the issue:

env -i sh -c "rsync -lrstRO --delete --exclude 'lost+found' -e 'ssh -i /home/tom/.ssh/backups-only' /Backups/auto-daily-backups/./ backups-only@XX.XX.XX.XX:/backups/desktop/"

I'm still really interested in this finding. It probably has to do with cron, the fact that it starts with minimal environment variables, and the ssh-agent. I'll be setting up the same scenario ina a couple of days to test it out and report back.

I think you haven't configured the sshd_config file properly. Verify that PermitRootLogin yes and PubkeyAuthentication yes  for remote maintenance.


How to install Nginx in Ubuntu? Recently I have installed a LAMP server in my Ubuntu Desktop 12.04 LTS.

Now how can I install Nginx and implement with my present LAMP Server?

From Nginx Wiki:

Open a terminal and enter the commands (remember to replace the values!):

sudo -s
nginx=stable # use nginx=development for latest development version
ubuntu=trusty # Replace this with your ubuntu version!
echo "deb http://ppa.launchpad.net/nginx/$nginx/ubuntu $ubuntu main" > /etc/apt/sources.list.d/nginx-$nginx-$ubuntu.list
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C300EE8C
apt-get update
apt-get install nginx

To install stable Nginx Open terminal and run the following commands:::

sudo su
sudo add-apt-repository ppa:nginx/stable
sudo apt-get update
sudo apt-get install nginx


How do I increase the open files limit for a non-root user? This is happening on Ubuntu Release 12.04 (precise) 64-bit Kernel Linux 3.2.0-25-virtual

I'm trying to increase the number of open files allowed for a user. This is for my eclipse java application where the current limit of 1024 is not enough.

According to the posts I've found so far, I should be able to put lines into

/etc/security/limits.conf like this:

soft nofile 4096
hard nofile 4096

to increase the number of open files allowed for all users.

But that's not working for me and I think the problem is not related to that file.

For all users, the default limit is 1024, regardless of what is in /etc/security/limits.conf (I rebooted after changing that file)

$ ulimit -n
1024

Now, despite the entries in /etc/security/limits.conf I can't increase that:

$ ulimit -n 2048

-bash: ulimit: open files: cannot modify limit: Operation not permitted
The weird part is that I can change the limit downwards, but can't change it upwards - even to go back to a number which is below the original limit:

$ ulimit -n 800
$ ulimit -n
800

$ ulimit -n 900

-bash: ulimit: open files: cannot modify limit: Operation not permitted

As root, I can change that limit to whatever I want, up or down. It doesn't even seem to care about the supposedly system-wide limit in /proc/sys/fs/file-max

# cat /proc/sys/fs/file-max
188897

# ulimit -n 188898
# ulimit -n
188898

But even I get eclipse to run as root, my application still crashes because of "Too Many Open File" exception!

So far, I haven't found any way to increase the open files limit for a non-root user.

How should I properly do this? I have looked at several other posts but no luck!

The ulimit command by default changes the HARD limits, which you (a user) can lower, but cannot raise.

Use the -S option to change the SOFT limit, which can range from 0-{HARD}.

I have actually aliased ulimit to ulimit -S, so it defaults to the soft limits all the time.

alias ulimit='ulimit -S'

As for your issue, you're missing a column in your entries in /etc/security/limits.conf.

There should be FOUR columns, but the first is missing in your example.

* soft nofile 4096
* hard nofile 4096

The first column describes WHO the limit is to apply for. '*' is a wildcard, meaning all users.   To raise the limits for root, you have to explicitly enter 'root' instead of '*'.

You also need to edit /etc/pam.d/common-session* and add the following line to the end:

session required pam_limits.so

ulimit -S -n 4096

That should increase your soft limit for open files (-n) to 4096.


Ubuntu disappeared from my boot screen I have triple boot (XP, 7, Ubuntu in Wubi) and today my Windows 7 got messed up and request I insert the installation CD and do a repair. When I did the repair, my boot screen got messed up and I no longer have Ubuntu to choose to boot from.

I have used EasyBCD to add XP back to the boot screen, but I couldn't use it to add Ubuntu back.

My Advice is for you to use the commandline commands from a console screen via the Live CD.

First boot to live CD.  Choose the Try Ubuntu option.  Enter the Terminal Console.  Then run these steps:

Fix grup boot:

1) boot to the Ubuntu installation disk
2) Run the "Try Ubuntu" option
3) Bring up a terminal (Launch search "terminal")
4) Run these commands (exactly):

a) sudo mount /dev/sdaX /mnt  # Make "X" the partition that has Ubuntu installed (i.e. /dev/sda2).
b) for i in /sys /proc /run /dev; do sudo mount --bind "$i" "/mnt/$i"; done
c) sudo chroot /mnt
d) update-grub
e) if no errors skip this "e" section
    grub-install /dev/sdX (x is the hard drive that has linux installed (i.e. /dev/sda)
    update-grub

The key to your specific case is the "update-grub".  However, you have to have that installation active when you run it.  Therefore the other steps are important.

You Use Boot-Repair(https://help.ubuntu.com/community/Boot-Repair)

And use it to re-enable GRUB.
Just Follow the steps on the Help Page


How to run an Android emulator in Ubuntu 13.04 Is there any way of doing this in 13.04?
If so, can you also provide a step-by-step instruction on how to do it ?

Install VirtualBox  from the Ubuntu Software Center.
Download and install Genymotion
Create a new Virtual Machine with the steps mentioned here.

Download the SDK from here http://developer.android.com/sdk/index.html

and install ia32-libs (if you are using 64 bit system)

sudo apt-get install ia32-libs


What configuration does "Additional Drivers" corrupt? I have been using "Additional Drivers" to switch back and forth between the open source and binary drivers for my AMD video card (R9 270X)

The open source driver is my only choice for gaming, because it performs with immensely vastly ridiculously lower latency. Gaming on fglrx is literally physically disgusting, but I need to switch back to fglrx occasionally for software development.

The other day, I did my routine switch back to the open source driver, but it utterly screwed my configuration somehow and now neither driver works. I've tried almost every single thing found online, here, google, anywhere. I've literally even tried silly suggestions that are barely related, just on the off chance it maybe uncovers something. I've tried EVERY solution you will find on Ask Ubuntu.

I had never manually installed a driver! It even said it successfully switched back to the open source one before I rebooted!!

AFTER all of this, after trying to work it out the "Ubuntu Way", I decided to actually try manually installing a driver, since the software seems so keen on that anyways lol. I got fglrx from AMD's website, of course this resulted in further mutilation of my configuration; After about 2 days I've managed to fix that and get back to being able to boot, at least. I am still stuck with no acceleration and my usual disgust for GUI configuration.

I have been using Linux for many years, have always been a Debian fan, and am comfortable working in command line. I have been trying (and hating these exact type of problems that feel like a half-ass python GUI is to blame) since the very beginning of Ubuntu almost a decade ago. I'm doing all I can to not denounce it as rubbish after every seeing every single install (mine, friends, coworkers) eventually fall apart in some magical way like this. Please help.

EDIT: After deleting lock files, the only difference I observe is the "package" icon being replaced by a "green light" icon:

Please Remove all lock files by running this in Terminal:

sudo rm /var/lib/dpkg/lock
sudo rm /var/lib/apt/lists/lock

You will need to be connected to the internet.


How to configure ccsm from the command line or a script? THE GENERAL PROBLEM:
I wish to change some settings of ccsm from the command line, or more precisely a script. I imagine there will be some arcane combination of gsettings or gconftool that does what I want and I'd be grateful to be pointed at where it is documented.

THE SPECIFIC PROBLEM:
The "new" (not so new any more) "feature" (ahem) that windows become maximized when I move them to near the edges of the screen drives me bananas. I have learnt I can disable that with this sequence:

run ccsm, then:

window management | grid | corners /edges | set all to "none"

I'd like to wrap this stuff up in a script that I can run automatically whenever I configure a new machine, instead of having to go clickety-click every time.

Go to a machine where you have set up a working configuration, and copy the file ~/.config/dconf/user to a USB stick or whatever.

Now go to the client machine.  Rename ~/.config/dconf/user to ~/.config/dconf/user-2016-06-16, and paste the config file from your computer that's set up the way you want it into the same place on the new machine.

If it doesn't work or messes something up, just copy the backed up file back to it's original place, over-writing the new config file.


Enter GPG passphrase with Zenity GUI enviroment I am working about a Zenity GUI based GPG application. But I have a problem with that. GPG ask passphrase for encryption in terminal with this command gpg -c $FILE. However users must enter their passwords in Zenity box. Is there any helper program (like SUDO_ASKPASS variable) for Zenity?

How can I use zenity --password with above expression? Thanks.

I haven't figured out how to do this with pure Zenity, but if you just want the user to input the password in a GUI box, add the following line to the file ~/.gnupg/gpg.conf (create it if it does not exist already):

use-agent

gpg -q --batch --passphrase=$(zenity --password) --decrypt


How to export SMS and contacts from cell phone to ubuntu I am trying to export my text messages and my contacts from a cell phone(an Adroid Samsung Galaxy mini and a Sony Ericsson w810i) to my ubuntu laptop.

Firstly I tried using Wammu and I was easily able to export my text messages from the Sony Ericsson W810i(not android phone).

When it comes to the Android Samsung I cannot even retrieve the messages let alone export them, however I can retrieve every calls and only the contacts that are saved in SIM card.

I also tried with Xgnokii which for some reason cannot start up as well as gMobileMedia which states that my phone is not supported.

I also tried with gnome-phone-manager but what I get is

thanos@thanos-laptop:~$ gnome-phone-manager

** (gnome-phone-manager:14036): CRITICAL **: bluetooth_chooser_button_set_property: assertion `bluetooth_verify_address (g_value_get_string (value)) || g_value_get_string (value) == NULL' failed
** Message: New connection device is empty (not changed)
** Message: New connection device is empty (not changed)
** Message: No device!
** Message: Exiting connect thread

I also tried other ports, but no phone can be found.

The only way to see my messages is via the android application airdroid, but I am not able to save my messages and contacts in my PC.

Is there a way to save my text messages and contacts in my PC?

to export from android, search the google store for "contact export". this will save your contacts in csv, vcf, pdf to your phone. you then copy from phone to pc via any means you prefer: wifi, blue, usb.


How do I Install GTK+ 3.0? How can I install GTK+ 3.0 and use that instead of GTK+ 2.24?

To use gtk2 or gtk3 apps you don't need to install anything. But, if you want to develop (or even just compile) apps this is what you're looking for:

sudo apt-get install libgtk-3-dev

If you already have an older version of GTK and you want to upgrade it then you can do the following:
sudo add-apt-repository ppa:gnome3-team/gnome3-staging
sudo add-apt-repository ppa:gnome3-team/gnome3
sudo apt update
sudo apt dist-upgrade


Ubuntu 18.04 USB mouse does not work after boot from a powered off state: can't read configurations, error -71 I have a newly installed version of Ubuntu 18.04 dual booted with Windows 10.  Setup went great and I've had no issues using Ubuntu.  However, when I turn on my computer and boot into Linux, my mouse pointer will not move.  I have a mouse that lights up when it is powered on and when it is not working I noticed the lights are off.  It seems that it isn't even getting power when this happens.  To fix this, I just turn the computer off and back on again then the mouse has power and everything is fine. When I boot into Windows 10, the mouse always works. It has become a common enough occurrence that I have power cycle again, after turning it on initially, on a daily basis just to get the mouse working.

I have a Razor Naga USB mouse.  The keyboard (also USB) doesn't seem to be effected.  The mouse is using the USB in the back of the computer (as opposed to a USB hub or additional port on the keyboard).

Has anyone had this issue?  How would I even go about troubleshooting this?  I'm not familiar with investigating system level failures (like USB drivers for example) in Linux.

Update: dmesg output:

[    1.792881] [drm] Finished loading DMC firmware i915/skl_dmc_ver1_26.bin (v1.26)
[    1.797053] usb 1-8: New USB device found, idVendor=0d8c, idProduct=0012
[    1.797054] usb 1-8: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[    1.797055] usb 1-8: Product: USB Audio Device
[    1.797056] usb 1-8: Manufacturer: C-Media Electronics Inc.
[    1.928008] usb 1-9: new full-speed USB device number 5 using xhci_hcd
[    2.061261] [drm] failed to retrieve link info, disabling eDP
[    2.064752] [drm] Initialized i915 1.6.0 20171023 for 0000:00:02.0 on minor 1
[    2.077201] usb 1-9: unable to read config index 0 descriptor/all
[    2.077203] usb 1-9: can't read configurations, error -71
[    2.204069] usb 1-9: new full-speed USB device number 6 using xhci_hcd
[    2.256394] checking generic (d1000000 300000) vs hw (b0000000 10000000)
[    2.256447] i915 0000:00:02.0: fb1: inteldrmfb frame buffer device
[    2.354338] usb 1-9: string descriptor 0 read error: -71
[    2.354342] usb 1-9: New USB device found, idVendor=1532, idProduct=001f
[    2.354343] usb 1-9: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[    2.355456] usb 1-9: can't set config #1, error -71
[    2.480295] usb 1-14: new full-speed USB device number 7 using xhci_hcd
[    2.629969] usb 1-14: New USB device found, idVendor=1532, idProduct=021e
[    2.629984] usb 1-14: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[    2.629985] usb 1-14: Product: Razer Ornata Chroma
[    2.629986] usb 1-14: Manufacturer: Razer

After I disconnect and reconnect the mouse:

[ 1436.941950] usb 1-9: USB disconnect, device number 6
[ 1446.504530] usb 1-9: new full-speed USB device number 8 using xhci_hcd
[ 1446.654938] usb 1-9: New USB device found, idVendor=1532, idProduct=001f
[ 1446.654941] usb 1-9: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 1446.654944] usb 1-9: Product: Razer Naga Epic
[ 1446.654946] usb 1-9: Manufacturer: Razer
[ 1446.656777] input: Razer Razer Naga Epic as /devices/pci0000:00/0000:00:14.0/usb1/1-9/1-9:1.0/0003:1532:001F.0006/input/input28
[ 1446.657065] hid-generic 0003:1532:001F.0006: input,hidraw5: USB HID v1.11 Mouse [Razer Razer Naga Epic] on usb-0000:00:14.0-9/input0
[ 1446.657984] input: Razer Razer Naga Epic as /devices/pci0000:00/0000:00:14.0/usb1/1-9/1-9:1.1/0003:1532:001F.0007/input/input29
[ 1446.716997] hid-generic 0003:1532:001F.0007: input,hidraw6: USB HID v1.11 Keyboard [Razer Razer Naga Epic] on usb-0000:00:14.0-9/input1

Using this command:

strings /usr/src/linux-headers-4.15.0-38-generic/include/uapi/asm-generic/errno.h

I found what error code -71 is: EPROTO     71  /* Protocol error */

But I still don't know what this really means... and how to fix it.

This removes the mouse. If you run the above command by mistake, run this: sudo modprobe -a psmouse

you can try this  : sudo modprobe -r psmouse


Formatted Ubuntu partition & now grub says "error: no such partition" - can't enter windows I had installed Ubuntu (current version: 11.xx) alongside Windows Vista. Now I formatted the Ubuntu partition & merged it with another partition (without thinking, obviously).

Now, when I restart the computer, GRUB probably tries to find the old partition (which does no longer exist) and says:

error: no such partition.
grub rescue>

Now I dont know what to do (I'm a total beginner). I tried to re-install Ubuntu on the newly formatted partition but this won't work, because after removing the install-usb (which I am said to do during installation) I find the above error-message again.

I guess I need some way to reconfigure grub OR to reinstall grub/ubuntu (on the newly formatted partition) OR to reinstall the windows boot manager (without reinstall. Windows), but I have no idea how to do either of these things.

GRUB, as installed by Ubuntu, won't work without access to the Ubuntu partition. The easiest solution is to reinstall windows bootloader. You should start your computer with the windows installation disk, select the repair option, select the command prompt repair. Type:

Bootrec.exe

You can install Ubuntu afterwards.

You should reinstall your Grub2.

Please refer to this guide Reinstalling Grub2, which explains very well how to do it.


How to add a Skype indicator? I've installed Skype, but the icon is not shown at the top panel (tray). As "tray-whitelist" was removed from dconf, I can't add icon by myself.

I had the same problem, installing the following package fixed it for me:

sudo apt-get install sni-qt:i386

I also had problems installing Skype from skype.com. I had tried to install the Ubuntu 12.04 multiarch version that seemed to be the closest they had to the one I was running which was Ubuntu 13.04 on a x86_64 (64 bit) machine. Had problems with both the sound and video and my 13.04 was a clean and recent install.

I then completely uninstalled that version and took the version from canonical.com and have now managed to successfully use Skype.


How do I find out the name of the SSID I'm connected to from the command line? Neither iwconfig nor iwlist seem to be able to do this for me.

iwgetid provides the ssid

iwgetid -r gives just the name.

In a Bash script try something like myssid=$(iwgetid -r) to put it in a variable

simply use this command to get only the ssid "NAME"
  $ sudo iw dev wlan0 info | grep ssid | awk '{print $2}'

Where wlan0 is the interface for your Wi-Fi card. Check it in ifconfig or iwconfig.
The output is only the "ssid name" of the network you connected...


How to prevent apt-get/aptitude keeping a cache I have installed Apt-Cacher NG to provide a cache of packages for several machines. I therefore see no point in having aptitude/apt-get keeping their own (second) cache in /var/cache/apt/archives. I realise I can empty this cache with sudo apt-get clean, but is there some way of configuring apt-get to automatically clean the cache when an install has completed?

According to the documentation you can add a config file to /etc/apt/apt.conf.d/ named no-cache containing Dir::Cache ""; and Dir::Cache::archives ""; according to manual of apt.conf. There is a bug report raising issues with this method, and I don't recommend it.

There is one remaining method according to this tutorial:

echo 'DPkg::Post-Invoke {"/bin/rm -f /var/cache/apt/archives/*.deb || true";};' | sudo tee /etc/apt/apt.conf.d/clean

This will carry out an rm command just before apt quits.

I think that what you are looking for is:

/etc/apt/apt.conf.d$ cat 04autoclean
APT::Clean-Installed "true";
/etc/apt/apt.conf.d$


Convert NTFS TO FAT file system How I change NTFS file system to FAT or MS-DOS file system without losing my data using Linux Commands?

You can't. While converting FAT => NTFS is possible under Windows, converting the other way around is not. As a general rule, changing the file system means formatting your drive and loosing all your data. There is no way around this. In fact, that's precisely what formatting means (edited for brevity):

  Disk formatting is the process of preparing a [...] hard disk drive for initial use. In some cases, the formatting operation may also create one or more new file systems. [...] The third part of the process, usually termed "high-level formatting" most often refers to the process of generating a new file system.

So, changing a file system is formatting and formatting deletes your data. Now, it is actually possible to restore the data lost when formatting a drive. In general, when a drive is formatted, the data is not actually overwritten. It will still be stored on the hard drive but in a way that is not accessible without the use of special tools. This is really not something you want to do unless you have formatted by mistake and need to recover your data.

If your objective is to change the filesystem of one of your drives, you should just copy all your data somewhere else, then format, and then copy the data back. You can use mkdosfs as suggested by Dhaval Simaria to create the new file system.

Finally, you should note that there is very rarely, if ever, a reason to use FAT32 today. NTFS is better in pretty much all ways.

You will see something like */dev/sda1, */dev/sda2, etc. Select the drive which you wish to convert. Now lets format it with:
mkdosfs -F 32 -I /dev/sdc1
Where is the command to "select the drive you wish to format"


Sync specific folder between two Ubuntu machines when connected to the same LAN I have two Ubuntu machines, a laptop and a desktop.
What I wish to do is, to create a folder in both machines at paths 'path1' and 'path2'.
I want to set up sync between the two folders whenever they are connected to the same local area network (Desktop through Ethernet and Laptop through WLAN). So for example, if I create a file path1/x, it will also appear in path2 as path2/x.

Is there a way I can get this done? [It's ok if deletion sync doesn't work and I have to manually delete a file from both directories simultaneously]

[Answering my own question as I found a nice way to do this]

Use unison tool developed by Benjamin Pierce at U Penn.

Let us assume you have two directories,

/home/user/Documents/dirA/ and /home/user/Documents/dirB/

To synchronize these two, you may use:

~$unison -ui text /home/user/Documents/dirA/ /home/user/Documents/dirB/

In output, unison will display each and every directory and file that is different in the two directories you have asked to sync. It will recommend to additively synchronize (replicate missing file in both locations) on the initial run, then create and maintain a synchronization tree on your machine, and on subsequent runs it will implement true synchronization (i.e., if you delete a file from .../dirA, it will get deleted from .../dirB as well. You can also compare each and every change and optionally choose to forward or reverse synchronize between the two directories.

Optionally, to launch graphical interface, simply remove the -ui text option from your command, although I find the cli simpler and faster to use.

More on this: Unison tutorial at Unison user documentation.

Check out this tutorial on how to sync folders using rsync.

Cheers


Ubuntu not connecting to wireless I have Ubuntu 12.04 installed on my dell laptop for couple of months(didn't want it but my company forced it).  Rescently I am having some issues in connecting to some wireless networks. So far I have been able to connect to any wireless network. But at present I am not able to connect to my new home wireless , however with same laptop I am able to connect to office wireless and my friends wireless.The wireless is detected by Ubuntu and is present in the list of connection but can't connect, if I click it it is instantly removed not even asking for password. i am able to connect to my home wireless through my iPhone which means that there is no issue with my home wireless connection setup.
Even if I use the iPhone as hotspot still not able to connect via Ubuntu

Request some help.

You do not have an Atheros wireless card, so the ath9k.conf file is ineffective. Since the problem is only with your new home wireless, I suspect it's a configuration problem in the router.

First, check the settings in the router. WPA2-AES is preferred; not any WPA and WPA2 mixed mode and certainly not TKIP. Second, if your router is capable of N speeds, I have better luck with a channel width of 20 MHz in the 2.4 GHz band instead of automatic 20/40 MHz. I also have better luck with a fixed channel, either 1, 6 or 11, rather than automatic channel selection.

Make sure the router is set to automatic B, G, N  and, if it's capable, AC speeds, not locked to N and certainly not locked to AC since the Intel wireless device you have is not AC capable.

After making these changes, reboot the router.

Is the Wireless turned on? Can you run this script:

echo "options ath9k nohwcrypt=1" | sudo tee -a /etc/modprobe.d/ath9k.conf
sudo modprobe -rfv ath9k
sudo modprobe -v ath9k


How do I set up xrdp session that reuses an existing session? I have been trying to set up a RDP terminal server on precise using xrdp and have been having significant trouble getting a working configuration. When a user logs on, I need it to connect to that users existing session if it exists, otherwise starting a new session, and any started session must start LXDE. What changes to the default configuration do I need to make in order for this to work?

I had this same problem, and I just found an easy solution.  I originally just installed xrdp using the standard proceedure:

apt-get install xrdp

After that, its all about your xrdp.ini file, which is located here:

/etc/xrdp/xrdp.ini

To open and edit the xrdp's configuration file use:

sudo nano /etc/xrdp/xrdp.ini

by default the first xrdp session handling script looks like this:

[xrdp1]
name=sesman-vnc
lib=libvnc.so
username=ask
password=ask
ip=127.0.0.1
port=-1

The important line is port=-1, this makes xrdp always look for a free port to connect.  If you set a fixed port here, the xrdp will always go back and connect to the same session.  I changed mine so it looks like this:

[xrdp1]
name=customsessionname
lib=libvnc.so
username=myusername
password=ask
ip=127.0.0.1
port=5912

Thats it, I think you could get away with just changing the port=-1 to port=5912.  My xrdp always re-connects to existing session always using the same port.

This UbuntuForum thread looks useful - I havent tested this myself - however I've copied the solution given here to complete this answer.

RealVNC setup

1. Uninstallation of the default Ubuntu VNC server (Vino):

Go to: System --> Administration --> Synaptic Package Manager
Search for the "Vino" package, Mark For Removal, Apply.

2. Installation of TightVNC and XRDP:

While you are using Synaptic Package Manager, seacrh for "tightvnc" package (be careful, not "xtightvnc") and Mark For Installation. Likewise, search for the "xrdp" package and Mark also For Installation. Apply.
PS: if you want, you may discard any other "vnc" package that you don't need!

3. Configuration of XRDP (Optional)

Open a terminal and type the three following commands:

 cd /etc/xrdp
 cp xrdp.ini xrdp.ini.bak
 sudo gedit /etc/xrdp/xrdp.ini

Remove Xrdp2-Xrdp6 sections, leave only the Xrdp1 section. Your xrdp.ini should look like this:

[globals]
bitmap_cache=yes
bitmap_compression=yes
port=3389
crypt_level=low
channel_code=1

[xrdp1]
name=RDP_To_TightVNC
lib=libvnc.so
username=ask
password=ask
ip=127.0.0.1
port=-1

4. Connecting

Restart the system and you are ready to connect!

To connect from another Ubuntu machine, use: Applications --> Internet --> Terminal Server Client, type the IP of your Ubuntu VNC machine, use RDPv5 or RDP, click Connect!

To connect from a Windows-based machine, use: Start --> Run --> mstsc, type the IP of your Ubuntu VNC machine, click Connect.

When connected, use your Ubuntu user account credentials (u/n and p/w) and remotely login to your desktop.


How can I install iBroadcast Media Sync Lite? Background
My computer had a major error and would not allow me to recover/reinstall Windows so I gave up and installed Ubuntu 16 to have a working computer.

I have some understanding of Linux but I do not consider myself proficient enough.

I need a step by step guide for installing a program, iBroadcast Media Sync Lite, that I want to use on my computer. But using other guides have been completely unclear or I have failed completely.

The program I am trying to install is here:
https://github.com/iBroadcastMediaServices/MediaSyncLiteLinux

I have tried to install this, but as far as I know it has failed.

I would appreciate any assistance available.

These instructions are roughly based on the official readme, but with specific details and an additional step (step III) that I found was necessary to build successfully. I've tested them on Ubuntu 16.04 LTS.

I. Install prerequisites.

First install Git (to download the software), the tools to build the software, and the libraries used by the software:

sudo apt update
sudo apt install git build-essential libgtk-3-dev libcurl4-openssl-dev openssl libssl-dev libjansson-dev

Choose a place to build the software. The traditional place is /usr/local/src, which you can allow administrators (members of the sudo group) to read and write files in:

sudo chgrp sudo /usr/local/src
sudo chmod g+sw /usr/local/src

If you're building it somewhere else then you can adjust the following commands accordingly.

II. Download the source code.

cd /usr/local/src
git clone https://github.com/iBroadcastMediaServices/MediaSyncLiteLinux.git

Now you have a MediaSyncLiteLinux directory that contains the source code. The source code includes two files called Makefile, one in the top-level directory and the other in src. (Actually there are more than just those two, but those are the ones we care about.)

III. Patch the source code to link against libcrypto instead of libssl.

Currently, to build iBroadcast Media Sync Lite in Ubuntu 16.04, it is necessary to modify the Makefile in src. This is because it links against libssl but needs libcrypto instead. Future versions of the software (which you, or future readers, would obtain automatically by running the git command above) may not require this.

If you skip this step, currently you would get this error during the subsequent make step (step IV). The error message will look slightly different if you're using the 32-bit version of Ubuntu.

/usr/bin/ld: tools.o: undefined reference to symbol 'MD5@@OPENSSL_1.0.0'
//lib/x86_64-linux-gnu/libcrypto.so.1.0.0: error adding symbols: DSO missing from command line

That message means you must link against libcrypto.

Go to the src subdirectory of MediaSyncLiteLinux, back up the file, and open the file in a text editor. These instructions use the nano editor, but you can use whatever text editor you like. (Not a word processor though--the files must remain plain text.)

cd MediaSyncLiteLinux/src
cp Makefile Makefile.orig
nano -w Makefile

In the text editor, find the line that says:

LDFLAGS = `pkg-config --libs gtk+-3.0 libcurl libssl` -ljansson -lpthread -rdynamic

Change libssl to libcrypto, so now it says:

LDFLAGS = `pkg-config --libs gtk+-3.0 libcurl libcrypto` -ljansson -lpthread -rdynamic

Future versions of the software may have this line differ in other ways. You should only make this specific change to it. For example, if there are other libraries listed, don't remove them.

Everything in OpenSSL that this program needs seems to be provided by libcrypto, but in theory a future version might need libssl too. If so, you should see error messages about this when you try to build it--probably mentioning libssl.so, much as the error message shown above mentioned libcrypto.so. Other newly required libraries may be indicated similarly (if you're lucky).

Ctrl+X exits nano, and you will be prompted to save.

IV. Build and install the software.

Go to the top-level MediaSyncLiteLinux directory that was created by git clone. After following step III above, cd .. will achieve this (because you were in MediaSyncLiteLinux/src). Or you can run:

cd /usr/local/src/MediaSyncLiteLinux

Now to build it just run:

make

You're running make in the directory that contains the top-level Makefile. This is not the one you edited, though that one will automatically get used during the build too.

You will see warnings like warning: ‘gtk_widget_override_color’ is deprecated [-Wdeprecated-declarations]. That is okay. If there are errors, then that will have to be investigated. If not, then you can proceed to install it:

sudo make install

This will install iBroadcast Media Sync Lite in /usr/local.

Note that, while I suggest you install it, installation is actually optional. As the readme says, you have the option of just always running the mediasynclite executable that was created in the top-level MediaSyncLiteLinux directory when you ran make.

V. Run it and see if it works.

The mediasynclite command was installed to /usr/local/bin. Since that directory is part of users' $PATH by default, you can now run that command (from anywhere).

mediasynclite

You should probably run it from the directory where you keep your music. When you run it you'll have to log in to your iBroadcast account. This is what it looks like (after the initial splash screen) when I run it:

If you chose not to run sudo make install and want to run the compiled executable (from anywhere), you can run:

/usr/local/src/MediaSyncLiteLinux/mediasynclite

VI. Finding the Installed Files

You may someday want or need to find the files that were installed. When you run sudo make install it will tell you what files are being created. You may want to save that information.

As of the current version, they are:

The single binary executable file /usr/local/bin/mediasynclite.
The /usr/local/share/mediasynclite directory and its contents.

I mention this mainly because, as of now, uninstalling with sudo make uninstall is not supported. You can remove the files manually to uninstall. If you like, you could also use checkinstall instead of the sudo make install command given above, to make uninstallation easier. Or you can use it without installing it, by running the mediasynclite command in the top-level source directory.

Further Reading

Though it doesn't really tell you enough specific information to build this particular program if you don't have any experience compiling software from source code, CompilingEasyHowTo is a useful resource and may interest you.

Open any terminal

Run below commands

git clone https://github.com/iBroadcastMediaServices/MediaSyncLiteLinux
cd MediaSyncLiteLinux
make
sudo make install


Can I restore my files I deleted using BleachBit? I have deleted files from two disks using BlechBit 1.10 on Ubuntu 16.04.
Is there a possibility to restore all files?

BleachBit is made to securely delete files by overwriting them several times (or similar methods).

Your data is gone. Make a backup next time.

You may be able to do a System Restore and retrieve some files depending on the length of time and automatic restore point creation.


How to fix "W: Duplicate sources.list entry"? I keep getting this warning whenever I try to run sudo apt-get update.

W: Duplicate sources.list entry http://archive.ubuntu.com/ubuntu/ precise-updates/main i386 Packages (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_precise-updates_main_binary-i386_Packages)
W: You may want to run apt-get update to correct these problems

Below is the output from /etc/apt/sources.list file:

deb http://archive.ubuntu.com/ubuntu precise main restricted
deb-src http://archive.ubuntu.com/ubuntu precise main restricted

deb http://archive.ubuntu.com/ubuntu precise-updates main restricted
deb-src http://archive.ubuntu.com/ubuntu precise-updates main restricted

deb http://archive.ubuntu.com/ubuntu precise universe
deb-src http://archive.ubuntu.com/ubuntu precise universe
deb http://archive.ubuntu.com/ubuntu precise-updates universe
deb-src http://archive.ubuntu.com/ubuntu precise-updates universe

deb http://archive.ubuntu.com/ubuntu precise multiverse
deb-src http://archive.ubuntu.com/ubuntu precise multiverse
deb http://archive.ubuntu.com/ubuntu precise-updates multiverse
deb-src http://archive.ubuntu.com/ubuntu precise-updates multiverse

deb http://archive.ubuntu.com/ubuntu precise-security main restricted
deb-src http://archive.ubuntu.com/ubuntu precise-security main restricted
deb http://archive.ubuntu.com/ubuntu precise-security universe
deb-src http://archive.ubuntu.com/ubuntu precise-security universe
deb http://archive.ubuntu.com/ubuntu precise-security multiverse
deb-src http://archive.ubuntu.com/ubuntu precise-security multiverse

How do I fix it?

Your sources.list really has duplicate entries.

First Let's see the correct form of a repository line or source line:

The correct format of repository source line is

<type of repository>  <location>  <dist-name> <components>

For example, a repo line can be like this one

  deb http://archive.ubuntu.com/ubuntu precise main

Here, it means, the repository is for binary packages, which are hosted in http://archive.ubuntu.com/ubuntu and this repository is for Ubuntu precise (12.04) and this repository contains the main (software which are officially supported by Canonical) component.

Type: The type can be deb and deb-src. deb means a binary repository where deb-src means a source repository
Location: http://archive.ubuntu.com/ubuntu location of the repository.
Dist-name: The distribution name of Ubuntu release. For Ubuntu 12.04 it is precise, for 11.10 it is oneiric.
You can visit the Ubuntu Wiki to view an updated list of Ubuntu releases and their code names.
Component: It can be main, universe, multiverse and restricted. These words indicates the level of supports for the packages and the licensing status.

See this page for more information.

Please take note that, you can add one or more component in a line, so "main", "universe", "restricted" and "multiverse" can be in a single line. Also note, Though you add more than one component in a single line, APT system considers them as separate line containing only one component.

So, If your sources.list have a line like this

deb http://archive.ubuntu.com/ubuntu precise universe

Then it can't have another line like the below (which your files have)

deb http://archive.ubuntu.com/ubuntu precise main universe

which is equivalent of these two lines

deb http://archive.ubuntu.com/ubuntu precise main
deb http://archive.ubuntu.com/ubuntu precise universe

Because, you are duplicating universe twice, so there will be an error for that duplicate. An error will be given for each duplicate found.

Solution:

After analyzing your sources.list file, I found that, It is a basic one which is supplied by Ubuntu by default. You can build a default file following the procedure:

Open a terminal and first rename the existing sources.list file to sources.list.bak file. (we can safely remove that, but caution is good).

 sudo mv /etc/apt/sources.list /etc/apt/sources.list.bak

Then open software-properties-gtk to build a new one. Type the below command in a terminal or in dash command prompt with pressing Alt+F2

software-properties-gtk

Note, for Ubuntu version 11.10 or earlier you have to use gksu before the software-properties-gtk command
After the window is open,

Select all four categories in Ubuntu Software tab
Select  precise-security, precise-updates and precise-backports category in Updates tab.
Select Canonical partner and Independent category from Other software tab.

That's it. You have now a default sources.list file without error. Compare this file with the previous one, if you want.

Update to deal with sources.list.d dir's files

Sometimes a duplicate entry can be in a file in the /etc/apt/sources.list.d directory, which is also used by APT. So, you should look at that directory and see if there is any duplicate in those files. It is not necessary for duplicates being in the same file.

Example case:

A user had this error message showing while doing sudo apt-get update.

W: Duplicate sources.list entry http://dl.google.com/linux/chrome/deb/ stable/main amd64 Packages (/var/lib/apt/lists/dl.google.com_linux_chrome_deb_dists_stable_main_binary-amd64_Packages)
W: Duplicate sources.list entry http://dl.google.com/linux/chrome/deb/ stable/main i386 Packages (/var/lib/apt/lists/dl.google.com_linux_chrome_deb_dists_stable_main_binary-i386_Packages)
W: You may want to run apt-get update to correct these problems

But there was no entry with http://dl.google.com in the main /etc/apt/sources.list file. Looking at the /etc/apt/sources.list.d/ directory we found these files:

output of ls /etc/apt/sources.list.d/:

aims-sagemath-precise.list
aims-sagemath-precise.list.save
dropbox.list
dropbox.list.save
fossfreedom-packagefixes-precise.list
fossfreedom-packagefixes-precise.list.save
google-chrome.list
google-chrome.list.save
google.list
google.list.save
sagemath-monolithic-precise.list
sagemath-monolithic-precise.list.save

The files google-chrome.list and google.list were good candidates for containing duplicates. So, checking the contents of both files was necessary.

Output of cat /etc/apt/sources.list.d/google-chrome.list:

deb http://dl.google.com/linux/chrome/deb/ stable main

and of cat /etc/apt/sources.list.d/google.list

deb http://dl.google.com/linux/chrome/deb/ stable main

So, there was a duplicate entries in the sources of Apt. Since google-chrome.list only contain a single apt line and it was also listed in google.list file we can safely remove this file with the command

sudo rm /etc/apt/sources.list.d/google-chrome.list

Then the problem was solved.

S="/etc/apt/sources.list" ;
S2="$S ${S}.d/*.list" ;
grep -b "^deb\`cat $S2 |
    grep -i "^deb[[:space:]]http" |
    sort |
    uniq -dc |
    sed -e 's;[[:space:]]\\+[[:digit:]]\\+[[:space:]]\\+deb\\(.\\+$\\);\\1;g'\`$" $S2

* Line breaks inserted for readability.


How can I use tab completion in the 'Run a command' box? Possible Duplicate:
  Getting completion feature with Alt+F2 in Unity?

I finally upgraded to Ubuntu 11.04 and so far, I am liking the experience.

The only thing I have a problem with, is:

While in the execute dialog, I can't complete the path with Tab like I could do in 10.10

Is anybody having any fix for this?

Couldn't find any solution to this.. as a result, got used to with the default Unity behavior :-/

Well, Natty is different and making something different may result in bugs.
Crashes might happen. For the top bar a restart (re-log-in) usually helps.
I didn't have many problems with Unity.


intel wireless ac 9560 - HARD BLOCKED - failed to load firmware chunk Just bought my new computer and already got big problems. This isn't a promising start.

After installing Ubuntu, I have problems with the Intel Wireless AC 9560 adapter. Made some research

> rfkill list all
0: ideapad_wlan: Wireless LAN
Soft blocked: no
Hard blocked: yes

> dmesg | grep -e wl -e iwl
[...] islwifi ... enabling device (0000 -> 0002)
[...] islwifi ... loaded firmware version 43.95eb4e97.0 op_mode iwlmvm
[...] islwifi ... Detected Intel(R) Dual Band Wireless AC 9560, REV=0x354
[...] islwifi ... Failed to load firmware chunk!
[...] islwifi ... ...
[...] islwifi ... ...
[...] islwifi ... Could not load the [0] uCode section
[...] islwifi ... Failed to start INIT ucode: -110
[...] islwifi ... ...

I downloaded the firmware iwlwifi-9000-pu-b0-jf-b0-33.ucode and put in the /lib/firmware and rebooted but nothing.

Have you got any idea on how to fix it?
I don't have an ethernet at disposal, so I am offline and can download things from other computers and move it through a usb drive.

Have you tried newer kernel, like 5.2?

See https://bugzilla.kernel.org/show_bug.cgi?id=203891


apt update throws signature error in Ubuntu 20.04 container on arm I am trying to build Raspberry Pi docker images but I am always having the same error, similar to this one, this one and this one.
While running the command apt update as root in a arm32v7/ubuntu:20.04 (or just ubuntu:latest), I get the following output:
root@273d63597ce6:/# apt update
Get:1 http://ports.ubuntu.com/ubuntu-ports focal InRelease [265 kB]
Get:2 http://ports.ubuntu.com/ubuntu-ports focal-updates InRelease [111 kB]
Get:3 http://ports.ubuntu.com/ubuntu-ports focal-backports InRelease [98.3 kB]
Get:4 http://ports.ubuntu.com/ubuntu-ports focal-security InRelease [107 kB]
Err:1 http://ports.ubuntu.com/ubuntu-ports focal InRelease
  At least one invalid signature was encountered.
Err:2 http://ports.ubuntu.com/ubuntu-ports focal-updates InRelease
  At least one invalid signature was encountered.
Err:3 http://ports.ubuntu.com/ubuntu-ports focal-backports InRelease
  At least one invalid signature was encountered.
Err:4 http://ports.ubuntu.com/ubuntu-ports focal-security InRelease
  At least one invalid signature was encountered.
Reading package lists... Done
W: GPG error: http://ports.ubuntu.com/ubuntu-ports focal InRelease: At least one invalid signature was encountered.
E: The repository 'http://ports.ubuntu.com/ubuntu-ports focal InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: http://ports.ubuntu.com/ubuntu-ports focal-updates InRelease: At least one invalid signature was encountered.
E: The repository 'http://ports.ubuntu.com/ubuntu-ports focal-updates InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: http://ports.ubuntu.com/ubuntu-ports focal-backports InRelease: At least one invalid signature was encountered.
E: The repository 'http://ports.ubuntu.com/ubuntu-ports focal-backports InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: http://ports.ubuntu.com/ubuntu-ports focal-security InRelease: At least one invalid signature was encountered.
E: The repository 'http://ports.ubuntu.com/ubuntu-ports focal-security InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

I have tried the suggested solutions of cleaning apt, cleaning docker and removing/recreating /var/lib/apt/lists without success. The SD card is 32G and the OS is a fresh install. df shows 26G free.
Some more information:

This is happening on a fresh install of 2020-05-27-raspios-buster-lite-armhf on a raspberry pi 4 B
The same error happens on another Raspberry Pi 4 B running HypriotOS
The same command in the same image works fine on a raspberry pi 3 B that has Arch linux installed
The error does not happen if I use an older version of ubuntu (ubuntu:18.04, 16.04, 14.04)

The root cause of the problem is in libseccomp. The newer version fixes the problem, but it is not yet available in Debian's stable repos. There are two way to fix this problem:
Method 1
Start the container with --privileged. This bypasses docker's security measures, so it is not recommended. Or with --security-opt seccomp:unconfined as a little more secure.
docker run -it --security-opt seccomp:unconfined ubuntu:latest
Method 2
Upgrade libseccomp manually on the host system. Dowload version from unstable repos (I tested with 2.4.3-1) here.
Install the new version:
sudo dpkg -i libseccomp2_2.4.3-1+b1_armhf.deb
Note: The above methods solved the problems for systems based on Raspbian. The error was also happening on a Ubuntu 20.04 aarch64 system, for which @NeonLines' answer was able to help.

Upgrading to docker version 19.03.12 has resolved this issue for me.


wifi signal fluctuates and disconnects Version Of Ubuntu-14.04(64 bit)
Laptop Maker: Dell
Laptop Model: Inspiron 1525
wifi router: Intel Corporation PRO/Wireless 3945ABG [Golan] (32 bit)

wifi signal fluctuates and disconnects frequently. Please help me in resolving this issue.

1) Connect computer via Ethernet

2) run sudo apt-get update in terminal

3) restart the computer

4) run sudo apt-get upgrade && sudo apt-get dist-upgrade in terminal

5) restart computer

Did this fix the problem?


Ubuntu One directory location on Windows Would it be appropriate to ask why Ubuntu One for Windows stopped using the HOME environment variable between v2 and v3? I'm talking about software design philosophy, security considerations, why it's such a high priority to deny us flexibility in setting up our Ubuntu One sync directory the way we want, etc. Not a support question, just curious. I'm not looking for opinions or speculation, I have those already -- just the software design philosophy for that sort of decision.

I was using HOME as a way to fool Ubuntu One into using a directory on a more appropriate drive than USERPROFILE, and that's not working in v3.

I could point out that Microsoft provides a very easy way to change the location of My Documents so it is outside of the USERPROFILE, e.g. on drive D:, and when this happens Ubuntu One is unable to monitor any folders there. This means that one of the directory trees on Windows that the user is by design allowed to use is being denied by Ubuntu One, so an answer like "best practice says USERPROFILE is the best place for the user to put files" is incorrect, at least when "My Documents" is somewhere else.

The short answer is: it's dangerous to allow that, and it only worked by accident.

We had a few reports of users who had HOME set accidentally (because of other software) and had unexpected results because of it, and we were not testing it at all.

Also, currently Ubuntu One doesn't do any checks to see if you are syncing folders in a removable device. If that was the case and the device would be unmounted, you would experience sudden and complete data loss.

One of the coming features we have in our roadmap is supporting syncing arbitrary folders, inside or outside the user's profile, in a proper, secure and consistent way.

If you want, I can try to give you a personalized build that supports HOME, but you have to keep in mind that it will be untested, and I can't guarantee it will not do completely evil things to your data.

I just installed ubuntu folder synchronization on windows. I run into the same problems as Agmenor. Sorry, but from a user perspective it seems to be a pretty strange design decision you took there. It least on windows.

All my project files reside on a subdirectory somewhere on drive D in a well structured directory tree. I would like to synchronize a remote folder provided by someone else with a local directory residing somewhere on drive D. This should be a pretty normal use case. Though synchronization of remote folders to my local hard disk is limited to "C:\Dokumente und Einstellungen\Administrator\Lokale Einstellungen\Anwendungsdaten\xdg\ubuntuone\shares\ProjectName (SomeUserName, 4e23470f-7214-4ffa-c9db-9dd028c1b035)". (The exact folder name has been changed in this text for data security reasons.) And there seems to be no way to change this. First, I am not working as administrator but as a local user. It is okay that the Ubuntu software runs as an administrator, nevertheless it should deal with user accounts accordingly. Second, I do not want to access important document somewhere deep in the directory tree. This isn't very intuitive and users will get problems with long file paths: Only about 80 characters remain to be used for files and directories, because most Windows APIs only support paths up to 254 characters and a lot of software will have trouble with larger paths. And third I do not want to have important documents been stored in an application settings folder. This increases user profiles dramatically and prevents them from proper synchronization with servers. Data should reside in areas of the file system that are dedicated to data.

All in all it seems a bit strange to lock the user into his home directory to avoid problems with removable media because for applications under Windows it is pretty easy to detect if a file resides on a removable media or on a fixed drive. I personally love Ubuntu but the service you provide here is not usable for me. It may work well in very special use cases but not the typical use cases that arise in daily use. Please think about these use cases and address these problems: I would love to work with Ubuntu in the future!


Need wired/wireless atheros driver for AR9285 and AR8152 How can I install atheros drivers to my Toshiba laptop (64bit), manually?

I need AR9285 wireless adapter, and AR8152(v1.1) wired, fast ethernet.

I cannot connect my UberStudent1.0 (linux OS, Ubuntu10.04,equiv.) to the net. I have on the laptop Mint8 which connects well and able to download any drivers. Please, would you kindly show me how to install them if they are not .deb formats. Tarballs, zip,etc, still give me a hard time to work with.

You might need to install additional wireless drivers, this can be difficult without a network connection.

I recommend downloading the AMD64 .deb directly from this page and then copy them onto a USB key or CD-R and back onto your laptop. Then install it by double clicking on it and following the instructions in the Software Center, then you'll probably need to reboot. Your wireless card should work at that point.

After that install linux-backports-modules-wireless-maverick-generic so that you'll have that package installed so you'll get upgrades.

sudo apt-get install linux-backports-modules-wireless-maverick-generic

check this for wireless driver! I had the same problem before and I've found the solution!
 for install drivers you can simply go to System > Administration > Additional Drivers, ubuntu will detect drivers you need


winetricks can't install mfc42 I'm trying to have a Windows program (Janome Customizer) run with wine.
I have an "out of the box" Ubuntu 64bits 12.04 install, and just ran Software Center to update all packages.

Installation of Customizer went OK, then I run the program, a window appear, but nothing happens when I click a button. So I run the program with what I found in the shortcut installed by wine:

john@mylaptop:~$ env WINEPREFIX="/home/john/.wine" wine "C:\\windows\\command\\start.exe" /Unix "/home/john/.wine/dosdevices/c:/users/Public/Desktop/JANOME Customizer.lnk"

I get two warnings:

fixme:exec:SHELL_execute flags ignored: 0x00000100
fixme:exec:SHELL_execute flags ignored: 0x00004100

The Customizer window appear, and when I click a button this error is printed:

err:module:import_dll Library MFC42.DLL (which is needed by L"C:\\\\Program Files (x86)\\\\janome\\\\Customizer 10000 Plus\\\\MC9500\\\\MkStitch.dll") not found
err:module:import_dll Library MkStitch.dll (which is needed by L"C:\\\\Program Files (x86)\\\\janome\\\\Customizer 10000 Plus\\\\MC9500\\\\EasyImport95.exe") not found
err:module:LdrInitializeThunk Main exe initialization for L"C:\\\\Program Files (x86)\\\\janome\\\\Customizer 10000 Plus\\\\MC9500\\\\EasyImport95.exe" failed, status c0000135

So I googled for this error and tried to install mfc42 with winetricks, but I get the error:

john@mylaptop:~$ winetricks mfc42
Executing w_do_call mfc42
Executing load_mfc42
Executing mkdir -p /home/john/.cache/winetricks/vcrun6
Downloading
http://download.microsoft.com/download/vc60pro/update/1/w9xnt4/en-us/vc6redistsetup_enu.exe
to /home/john/.cache/winetricks/vcrun6
--2012-07-28 08:58:50--
http://download.microsoft.com/download/vc60pro/update/1/w9xnt4/en-us/vc6redistsetup_enu.exe
Resolving download.microsoft.com (download.microsoft.com)... 158.255.97.16,
158.255.97.65
Connecting to download.microsoft.com
(download.microsoft.com)|158.255.97.16|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2012-07-28 08:58:51 ERROR 404: Not Found.

------------------------------------------------------
Downloading
http://download.microsoft.com/download/vc60pro/update/1/w9xnt4/en-us/vc6redistsetup_enu.exe
failed
------------------------------------------------------

I tried to manually install mfc42 with other google results, to no avail. I would prefer to use winetricks. If I can't do it with winetricks, manual install belongs to another question.

Just to be sure, I tried booting on a live CD (USB key, actually), with Ubuntu 12.04 32bits. Installed wine through Software Center, but then running winetricks mfc42 yields the same error.

Interestingly, on another computer which I use daily, plugged into the same internet router, installing mfc42 works:

11:35:45 ~>winetricks mfc42
p11-kit: couldn't load module: /usr/lib/i386-linux-gnu/pkcs11/gnome-keyring-pkcs11.so: /usr/lib/i386-linux-gnu/pkcs11/gnome-keyring-pkcs11.so: cannot open shared object file: No such file or directory
Executing /usr/bin/cabextract -q /home/jrouquie/.cache/winetricks/vcredist.exe -d /home/jrouquie/.wine/dosdevices/c:/windows/system32 -F mfc42u.dll
Using native,builtin override for following DLLs: msvcrt
Executing early_wine regedit c:\winetrickstmp\override-dll.reg
Install of mfc42 done
winetricks done.

11:36:29 ~>winetricks mfc42
prerequisite vcrun6 already installed, skipping
Install of mfc42 done
winetricks done.

11:46:00 ~>

Thanks for any help installing mfc42.

Adding the Wine PPA from: http://www.winehq.org/download/ubuntu solved the problem for me.

sudo add-apt-repository  ppa:ubuntu-wine/ppa
sudo apt-get update && sudo apt-get upgrade
winetricks  mfc42

Running wine on Ubuntu 14.10. Found that wine explorer would run, but some "3rd party" programs would not, in my case it was femm42, a finite element analysis program for magnetics. In this case, the missing dll was mfc90.dll, but this doesn't really matter. Just try to locate your particular missing dll on the internet and download it. Next, examine any particular dll within the wine/windows application to uncover its location. I found that the dll's showed up at four locations, not just under system32. After copying the missing file to all such locations and updating the Ubuntu database, femm42 worked. NOTE: I'm running 64 bit, which required the four locations. It appears that 32 bit systems may only require copying to two of these locations.


Dual boot Windows 8 and Ubuntu UEFI! Can't load windows 8 anymore I have a samsung laptop with windows 8 single language pre installed and since it was bugging so much I decided to dual boot with ubuntu following this guide : http://www.linuxbsdos.com/2013/03/12/dual-boot-windows-8-and-ubuntu-12-04-in-uefi-mode/

I was able to install ubuntu, and could load both from ubuntu boot loader. I had an issue where in my BIOS, in my boot priority ALL entries were gone except ubuntu. Then second issue, I couldn't load windows boot manager even after following the guide. So i tried playing with the easyBCD and I screwed up by deleting all entries in windows boot manager. Now, even on ubuntu boot loader, I can't load windows. On the ubuntu boot loader i see about 5-8 entries, 3-4 of them from ubuntu and the rest is some *x64.efi and recovery boots. I tried all of them and couldn't load windows. Either File is not found or when i go in windows boot manager, no operating system detected. I don't know what to do, I can't have access to my windows 8 any help please? Note that i could boot windows 8 from ubuntu loader by pressing enter on some **x64.efi but couldn't since I played with easyBCD.
Here is a paste of boot repair i just did http://paste.ubuntu.com/5623621/

Try re-booting with the live-CD (USB) from your installed Ubuntu distro.
Don't change the partition table that exists on your harddisk. Don't wipe it out!!! Keep it.
Reinstall Ubuntu - use exactly the same partitions that you used the first time to install Ubuntu in.
During this install choose to install the GRUBbootloader in the Masterbootrecord of your harddisk. This will overwrite the Windows bootloader.
Reboot. Grub should be able to see Windows.

First, you should be aware that recent Samsung laptops have a known EFI bug that can brick the computer, requiring it to be returned to Samsung for repair. This bug can be triggered in any OS, including Windows. Thus, it's best to completely wipe the hard disk and re-install both Windows and Linux in BIOS mode. That's extremely awkward, though, and there have been some recent Linux kernel patches that make it unlikely that the bug will be triggered in Linux -- if you're running the relevant code. Unfortunately, I don't happen to know precisely which kernels have this fix, so I'm not sure which kernels are safe and which ones aren't. In the absence of that information, you should run the latest kernel available and hope for the best or reconfigure everything to boot in BIOS mode. I'll proceed with the assumption that you're running a safe kernel and are willing to take the risk of bricking your computer from Windows.

Based on the Boot Info Script output you've posted, the GRUB 2 entry entitled "Windows UEFI bkpbootmgfw.efi" should work; however, GRUB 2 is extremely finicky about chainloading to other EFI boot loaders. Sometimes an entry that should work doesn't work, or will work only on some computers. Therefore, I recommend you try the following:

Launch Boot Repair.
Click "Advanced Options."
Select the "Main Options" tab.
Select "Restore EFI Backups". The "Backup and Rename EFI Files" option should automatically uncheck. If it doesn't, uncheck it yourself.
Click Apply.
In your regular Debian installation (not an emergency/live disc), download the Debian-package version of my rEFInd boot manager.
Install the rEFInd package.
Reboot. Instead of GRUB, rEFInd should appear. It should let you boot Windows, GRUB (which should appear with an Ubuntu icon, and chainload to Linux), or Linux (which will probably appear as one or more penguin icons).

Assuming this all goes smoothly, you can then customize rEFInd in various ways. Chances are you'll have some redundant entries in rEFInd's menu, for instance; or you may want to tweak its appearance or change its options. The rEFInd documentation describes how to do this.


Unable to connect to wired DHCP connection via my PC? Hi As I upgrade my pc to ubuntu 11.10 I can't connect to the wired connection ! It doesn't even find my Device MAC address !!What can I do ?

ifconfig -a

eth0      Link encap:Ethernet  HWaddr ff:ff:ff:ff:ff:ff
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:44 Base address:0x2000

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:6647 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6647 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:1333687 (1.3 MB)  TX bytes:1333687 (1.3 MB)

the answer of etc/network/interfaces

auto lo
iface lo inet loopback

sudo lshw -class network

 *-network
       description: Ethernet interface
       product: RTL8111/8168B PCI Express Gigabit Ethernet controller
       vendor: Realtek Semiconductor Co., Ltd.
       physical id: 0
       bus info: pci@0000:04:00.0
       logical name: eth0
       version: 02
       serial: ff:ff:ff:ff:ff:ff
       size: 1Gbit/s
       capacity: 1Gbit/s
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress msix vpd bus_master cap_list rom ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=full firmware=N/A latency=0 link=no multicast=yes port=MII speed=1Gbit/s
       resources: irq:44 ioport:c000(size=256) memory:cff20000-cff20fff memory:cff00000-cff0ffff memory:cff10000-cff1ffff

 lspci

00:00.0 Host bridge: Intel Corporation 4 Series Chipset DRAM Controller (rev 03)
00:01.0 PCI bridge: Intel Corporation 4 Series Chipset PCI Express Root Port (rev 03)
00:1a.0 USB Controller: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #4
00:1a.1 USB Controller: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #5
00:1a.2 USB Controller: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #6
00:1a.7 USB Controller: Intel Corporation 82801JI (ICH10 Family) USB2 EHCI Controller #2
00:1b.0 Audio device: Intel Corporation 82801JI (ICH10 Family) HD Audio Controller
00:1c.0 PCI bridge: Intel Corporation 82801JI (ICH10 Family) PCI Express Root Port 1
00:1c.4 PCI bridge: Intel Corporation 82801JI (ICH10 Family) PCI Express Root Port 5
00:1c.5 PCI bridge: Intel Corporation 82801JI (ICH10 Family) PCI Express Root Port 6
00:1d.0 USB Controller: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #1
00:1d.1 USB Controller: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #2
00:1d.2 USB Controller: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #3
00:1d.7 USB Controller: Intel Corporation 82801JI (ICH10 Family) USB2 EHCI Controller #1
00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev 90)
00:1f.0 ISA bridge: Intel Corporation 82801JIB (ICH10) LPC Interface Controller
00:1f.2 IDE interface: Intel Corporation 82801JI (ICH10 Family) 4 port SATA IDE Controller #1
00:1f.3 SMBus: Intel Corporation 82801JI (ICH10 Family) SMBus Controller
00:1f.5 IDE interface: Intel Corporation 82801JI (ICH10 Family) 2 port SATA IDE Controller #2
01:00.0 VGA compatible controller: nVidia Corporation G92 [GeForce 9600 GSO] (rev a2)
03:00.0 IDE interface: JMicron Technology Corp. JMB368 IDE controller
04:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 02)
05:00.0 Memory controller: Conexant Systems, Inc. Device 2d00 (rev 01)

uname -a
Linux mahdiar-EP45-UD3L 3.0.0-15-generic #26-Ubuntu SMP Fri Jan 20 17:23:00 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

The kernel incorrectly matches this NIC with the r8169 kernel module.  This is shown by the lshw trace where it shows that the NIC has been disabled.
According to this article, the NIC should be associated with the r8168 kernel module.  With the incorrect kernel module you will either get slow speeds or no connection what-so-ever.
According to Launchpad - this is also a recognised bug with Oneiric - however, it looks like it has been resolved for 12.04 since Precise uses a newer kernel (v3.2)

hardware issues
First, let's rule out a NIC hardware failure - NICs can go bad (the firmware/ROM) - an indication of this is the fact that the MAC address is recognised as FF:FF:FF:FF:FF
If you last had a working NIC with Natty (or previous Ubuntu version) - then boot your PC with a LiveUSB/LiveCD.
Test your wired connection - rerun sudo lshw -class network.  Look for the MAC address.  Also look to see if it still says disabled.
If it still fails to connect via a live usb/cd with the version of ubuntu it last worked with then you have a strong indication of hardware failure.

potential software solutions
Once you have ruled out hardware issues, then lets concentrate on possible software solutions.
For the solutions below you will still need a valid internet connection...
If you have a spare NIC card that is not of this model I would insert this into your PC and connect to the internet via a wired connection.  If you can connect via wireless - do so.  Otherwise, you may need to move your hard-drive into another computer to do the following and then transfer it back to your original PC.
FIRST - BACKUP YOUR SYSTEM with a good backup tool such as Clonezilla
Suggested Fix 1
According to the launchpad bug report, this is potentially fixed if you enable the proposed repository in software sources and install the package linux-backports-modules-3.0.0
Suggested Fix 2
You may be able to download the Precise kernel (v3.2) and install this.
From the mainline kernel area of launchpad:
Download the amd64 headers.deb,  headers_all.deb and the image_amd64.deb files
then install the kernel using the syntax:
sudo dpkg -i [package_name].deb

Suggested Fix 3
This is something you may be able to resolve by downloading the realtek driver and compiling it yourself.
Download the Linux source - at the time of writing this it is v8.028.00
Unpack the tarball :
tar vjxf r8168*.tar.bz2

Change to the directory:
cd r8168-8*

Compile:
sudo ./autorun.sh

You can check whether the driver is loaded by using following commands.
lsmod | grep r8168
ifconfig -a

If there is a device name, ethX, shown on the monitor, the linux
driver is loaded. Then, you can use the following command to activate
the ethX.
ifconfig ethX up

Finally, blacklist the r8169 driver add the following to /etc/modprobe.d/blacklist.conf
#blacklist r8169 driver
blacklist r8169

Potential workarounds
A similar bug-report mentioning odd-MAC addresses for the r8169 kernel module on older kernels gave a couple of suggested workarounds.
work around 1
Once booted stop and start the kernel module:
sudo rmmod r8169 && sudo modprobe r8169

work around 2
Boot from your Natty live CD - run ifconfig -a and record the MAC address for eth0.
Boot into oneiric. Examine your udev persistent rules and map the correct MAC address to eth0
sudo cp /etc/udev/rules.d/70-persistent-net.rules /
sudo nano /etc/udev/rules.d/70-persistent-net.rules

change the MAC address.  If in doubt - please add to your question the contents of your rules file.

HWaddr ff:ff:ff:ff:ff:ff

Really? Is this your real MAC Address or you are spoofing ??
Change your MAC Address from Broadcast address to something else(Spoof another address):

sudo ifconfig eth0 hw ether xx:xx:xx:xx:xx:xx
sudo service networking restart

Place the new MAC Address instead of xx:xx:xx:xx:xx:xx


gnome-terminal - restoring of config for profiles Where are the profiles for gnome-terminal stored on the filesystem?

I recently restored my home folder from backup on a new ubuntu installation, but the profiles for gnome-terminal were not restored.
I've still got access to the root of the filesystem from my previous ubuntu installation, and would like to pull the profiles out of that from wherever they are stored?

This is similar to Where are Gnome-Terminal profiles stored in the filesystem?

However the solution to that specifies using gconf-editor, which I've tried but which only allows me to modify the current setup.

I've determined that my desired profiles live in /.gconf/apps/gnome-terminal/

However the version of gnome-settings that I'm running (3.32.1) uses dconf rather than gconf to store the settings (dconf inconveniently stores to disk in a binary file @ ~/.config/dconf/user

gnome-settings is supposed to migrate over automatically if there's nothing in the new settings (according to @egmont at Seriously, dconf, gconf, gsettings... How do I save my terminal settings?)

So first step is to backup dconf:
cp ~/.config/dconf/user ~/.config/dconf/user.backup-date +%Y-%m-%d``

Then verify that /org/terminal/legacy/profiles/ doesn't actually contain anything, using dconf-editor (might need an install)

Then we can reset with:
dconf reset -f /org/gnome/terminal/legacy/

Will see if that fixes it for me...

... nope, I had to manually inspect the old .gconf xml files to copy over each field of the profile.

1 - To get started, press Ctrl + Alt + F1 from your desktop.
2 - Then login with your username and password

$ sudo rm -r .gnome2 .gconf .gconfd .metacity
$ sudo shutdown -r

next time dont backup before trying to reset


What is the difference between /etc/init/ and /etc/init.d/? What is the difference between /etc/init/ and /etc/init.d/?

More generally, what meaning does the .d suffix convey to a directory?

/etc/init.d contains scripts used by the System V init tools (SysVinit). This is the traditional service management package for Linux, containing the init program (the first process that is run when the kernel has finished initializing¹) as well as some infrastructure to start and stop services and configure them. Specifically, files in /etc/init.d are shell scripts that respond to start, stop, restart, and (when supported) reload commands to manage a particular service. These scripts can be invoked directly or (most commonly) via some other trigger (typically the presence of a symbolic link in /etc/rc?.d/).

/etc/init contains configuration files used by Upstart. Upstart is a young service management package championed by Ubuntu. Files in /etc/init are configuration files telling Upstart how and when to start, stop, reload the configuration, or query the status of a service. As of lucid, Ubuntu is transitioning from SysVinit to Upstart, which explains why many services come with SysVinit scripts even though Upstart configuration files are preferred. In fact, the SysVinit scripts are processed by a compatibility layer in Upstart.

.d in directory names typically indicates a directory containing many configuration files or scripts for a particular situation (e.g. /etc/apt/sources.list.d contains files that are concatenated to make a virtual sources.list; /etc/network/if-up.d contains scripts that are executed when a network interface is activated). This structure is usually used when each entry in the directory is provided by a different source, so that each package can deposit its own plug-in without having to parse a single configuration file to reference itself. In this case, it just happens that “init” is a logical name for the directory, SysVinit came first and used init.d, and Upstart used plain init for a directory with a similar purpose (it would have been more “mainstream”, and perhaps less arrogant, if they'd used /etc/upstart.d instead).

¹ not counting initrd

As you point out, the ".d" nomenclature is puzzling and strange, and doesn't really have any place in any modern system -- you'll notice that most modern services have tended to drop it.

The reason the directory is /etc/init and not /etc/upstart is because Upstart is the project name, the actual installed binary is still /sbin/init thus it would not make sense for its configuration to have a name that didn't match the binary.


Disable usb mass storage I want to disable usb mass storage on Ubuntu desktop 10.04, 11.04 and 11.10.

As security policy to avoid data leakage. But in case of emergency there easy way getting usb mass storage back.

Blacklist the usb_storage module by adding blacklist usb_storage to /etc/modprobe.d/blacklist.conf.

To load the module manually, run sudo modprobe usb_storage.

Just rename storage to storage-old:

mv /lib/modules/3.2.0-35-generic-pae/kernel/drivers/usb/storage /lib/modules/3.2.0-35-generic-pae/kernel/drivers/usb/storage-old

You must do so when the kernel version updated


How do I install the latest Python 2.7.X or 3.X on Ubuntu? I want to install the latest Python tarball on Ubuntu, downloaded from http://python.org/download/.

Is this is a correct way to install?

./configure
make
make install

If not, how do I do that?

First, install some dependencies:

sudo apt-get install build-essential checkinstall
sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev

Then download using the following command:

version=2.7.13
cd ~/Downloads/
wget https://www.python.org/ftp/python/$version/Python-$version.tgz

Extract and go to the directory:

tar -xvf Python-$version.tgz
cd Python-$version

Now, install using the command you just tried, using checkinstall instead to make it easier to uninstall if needed:

./configure
make
sudo checkinstall

Change version to whichever version you need (version=2.7.1 or version=3.6.0, for example).

Mostly a mirror of this answer with a tweaked intro

I would recommend pyenv. It automates the build process aside from installing the header dependencies (see below). You can build and install a new (or old) version of Python by simply saying pyenv install 3.6.0. Everything runs as your user, so you don't have to worry about messing up the Python used by Ubuntu itself.

As opposed to some of the apt-repo-based options (e.g. deadsnakes), it will generally work same day of a release after a pyenv update because you don't need to wait for someone else to package it. See all the versions you can install with pyenv install --list

Install pyenv

Install tools and headers needed to build CPythons (exotic Pythons like PyPy or Jython may have other dependencies). Git is used by pyenv, plus it also enables builds/installs of source branches, so you could install whatever 3.8 is right now, i.e. the master branch of CPython fresh off GitHub:

sudo apt-get install -y git
sudo apt-get install -y build-essential libbz2-dev libssl-dev libreadline-dev \
                        libffi-dev libsqlite3-dev tk-dev

# optional scientific package headers (for Numpy, Matplotlib, SciPy, etc.)
sudo apt-get install -y libpng-dev libfreetype6-dev

Run the installer script (installs pyenv and some very useful pyenv plugins by the original author; see here for more)

curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash

Add init lines to your ~/.profile or ~/.bashrc (it mentions it at the end of the install script):

export PATH="~/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"

Restart your shell (close & open or exec $SHELL) or reload the profile script. (with e.g. source ~/.bashrc)

Done!

Setting up an environment

To not touch the system Python (generally a bad idea; OS-level services might be relying on some specific library versions, etc.) make your own environment, it's easy! Even better, no sudo, for it or pip installs!

Install your preferred Python version (this will download the source and build it for your user, no input required)

pyenv install 3.6.0

Make it a virtualenv so you can make others later if you want

pyenv virtualenv 3.6.0 general

Make it globally active (for your user)

pyenv global general

Do what you want to with the Python/pip, etc. It's yours.

If you want to clean out your libraries later, you could delete the virtualenv (pyenv uninstall general) or make a new one (pyenv virtualenv 3.6.0 other_proj). You can also have environments active per-directory: pyenv local other_proj will drop a .python-version file into your current folder and any time you invoke Python or pip-installed Python utilities from it or under it, they will be shimmed by pyenv.

Troubleshooting

bash: pyenv: command not found, fish: Unknown command 'pyenv'

Check your $PATH, there should be one entry that ends in something like .pyenv/bin. If it's missing make sure you followed #3 AND #4 (restart your shell) under Install pyenv above.

pyenv: no such command 'virtualenv'

If you didn't use the installer script, you likely only installed the root pyenv package. See pyenv-virtualenv for instructions to add the plugin
If you used the installer script, check if it shows up with pyenv commands.


Gparted - resizing boot partition I want to install Windows 7 on a computer which has Ubuntu 13.10. When Ubuntu was installed on this computer, its boot partition received all available hard disk space(except for the part given to swap).

Now, whenever I am trying to shrink the area occupied by boot, GParted blocks most of the menu options (including resizing).
So, why can't I resize boot? Also, is there a tutorial about working with GParted from tty or pts?(everything I found so far uses the GUI menus exclusively, which may get very frustrating after a while).

I've tried using a Live CD (by burning the downloaded Ubuntu iso on a dvd), so I've changed ROM to boot from ODD as the first option, but the Live CD still doesn't show up, and Ubuntu boots as usual(this part was more like a secondary point).

I think Avinash Raj answered most of this question in the comments, but I'll go ahead and write an answer just to square it off.

In your screen shot Gparted has locked the partitions of the drive (sda) because you are using the partition sda1 (/) to run Ubuntu and Gparted.

To edit the partitions on sda you will need to boot a live cd. When you do this the partitions will not be locked and Gparted will allow you to resize them.

You will have to right click the linux-swap partition and select swap-off to move that partition when using the live cd.

As far as booting the Live cd goes, try pressing: Esc, F1, F2, ..., F12, Del. when the computer is starting. Just run your finger from Esc to F12 then Del (delete). That's the lazy way of doing it. It usually brings up the boot selection screen for me. The alternative is reading the boot screen or the manual for the computer.

Do not resize your partitions. You won't be able to install Windows and dual-boot with Ubuntu.

You should delete all your partitions including the extended partition with that huge swap space.

You can download Ultimate Boot CD and burn it on a regular CD. It is a small 580MB iso image. This is the direct link for download.

After you burn the UBCD iso image, you can reboot computer with the UBCD in tray, and then you can select from the menu /HDD/Partition Management section. Use Gparted or Cute Partition Manager to completely delete all your partitions from your hard drive. Next you can save your empty partition table, exit Gparted or Cute Partition Manager, take out UBCD from tray, reboot and poweroff your computer.

And next you can start by installing Windows first using your Windows DVD. Windows DVD has its own partitioning tool, and you can use it to allocate some space from your hard disk for windows system (C: drive), and maybe create another NTFS partition to keep your windows files (D: drive).

After you finish installing Windows, you can choose to reinstall Ubuntu using your Ubuntu DVD. Choose the third option given by Ubuntu installer Something else, and when you get to the partition table, you can allocate space for your Ubuntu root partition, and do not worry about swap space, Ubuntu installer will automatically create the swap space too. Just don't forget to choose your mount point (which is usually root /) before you press next to start installing Ubuntu.

You can use half the space from your HDD for Windows, creating 2 equal size NTFS partitions, and the other half for Ubuntu. Or you can create just one primary partition for Windows (up to 50-80GB space), and after you finish installing Windows, you can use Gparted tool from UBCD to create a large extended partition using the rest of your disk space with many logical drives (2 or more NTFS drives, and also 2 or more Linux ext4 logical drives for Ubuntu).


error: Cannot autolaunch D-Bus without X11 $DISPLAY I urgently need to reset Compiz to its default settings because my desktop doesn't show the Dash or menu bar.

When I type:

dconf reset -f /org/compiz/

It says:

error: Cannot autolaunch D-Bus without X11 $DISPLAY

Usage:
  dconf reset [-f] PATH

Reset a key or a dir. -f is required for dirs.

Arguments:
   PATH          Either a KEY or DIR
   KEY           A key path (starting, but not ending with '/')
   DIR           A directory path (starting and ending with '/')

What to do next?

Best regards

export DISPLAY=:0.0

if you see

Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified

Error: Can't open display: :0.0

then

xhost +

You could replace your current instance of compiz with the following command from a tty.

DISPLAY=:0 compiz --replace

You can probably also do:

DISPLAY=:0 dconf reset -f /org/compiz/


Ubuntu 16.04 and three monitors - doesn't work I connected my Lenovo T460 through the Ultra Docking station with 3 Monitors (LG Flatron E2210) via VGA, HDMI and DP. With Win7 I got them all to run rather quickly (having the laptop-monitor turned off, only the three external ones running), but as you probably can guess, Win7 is only my secondary OS.

My primary is Ubuntu 16.04 and it ran smoothly with 2 external monitors and I was very hopeful about adding the third. But now the monitors work quite fine when it comes to the bootloader, where I choose between Linux and Win7. This shows on all screens. Right after though, they turn off, and only one shows the password screen. After that they usually either turn off completely, not showing anything but black or take turns showing something for a few moments and then they all turn black.

I would REALLY love to have my setup run under Ubuntu, as that's my "productive setup" software-wise.

My tech specs are

Lenovo T460
Ultra Docking station
DVI --> HDMI cable
DVI --> VGA cable
DVI --> DP cable
Graphics: Intel HD Graphics 520
RAM: 16GB
CPU: i5-6300 @2.40 GHz

I hope someone could help me here..... thanks so much!

PS: I looked through the forums already but could not find anything that seemed to be helpful to me - keep in mind, I'm kinda new to all this here ;-) Thanks!

I had similar symptoms with totally different hardware setup. Two out of three screens would go black but not always. I changed graphics drivers from default open source to latest proprietary nVidia drivers. Now I have built in laptop monitor plus two external monitors working. It seems like this might be a driver related problem.


No audio with newest model HP Spectre x360 (4101-dx) I dual-booted Ubuntu 15.04 alongside Windows 10.  There is a known issue with the audio in linux on this computer: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1441852

The older models that came with windows 8 apparently had a fix: http://h30434.www3.hp.com/t5/Notebook-PC-Sound-and-Audio/HP-spectre-x360-on-linux/td-p/4980797

In summary, the fix was to edit /etc/default/grub and change the line
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash'" to

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_backlight=vendor acpi_osi='!Windows 2013' acpi_osi='!Windows 2012'", run update-grub, and reboot twice.  You then may/may not have to click audio icon, go to sound settings, and then double click audio device.

I followed these steps, and they do work.  The problem is...after I boot into 'Windows Boot Manager' (the only option to boot into windows 10 on grub), and then shut down or restart and boot into ubuntu, the sound device goes away.  Running update-grub and rebooting into ubuntu again will make the audio device return in the audio settings.  The changes to /etc/default/grub persist between all reboots.

Any ideas/advice/insight on how to ensure audio device remains present after booting in ubuntu after booting into windows 10?

i just recently ran into troubles using kali on the x360 4005 ubuntu ran fine with just secure boot off but for kali i had to make sure it was in legacy mode and i had to choose the EFI boot after that from the USB the ubuntu dvd worked fine but kali gave a nothing but black on the dvd i had to use a usb stick for that after you enable secure boot off you have to enable legacy mode on but your grub should have been loaded off the ubuntu media and should say ubuntu at the end of it...and that should always have the ubuntu selection and windows boot in the grub selection...i would say make sure your ubuntu grub install is in your media and its up to date which on 15 it should be...if you see the splash menu on startup with media in it should be the same splash with the media out once you install..otherwise you might have a broken install maybe recompile the media and retry...


Unmet dependencies for gcc-5-multilib and libc6-dev-x32 when trying to install Steam in 16.10 Below are the results of trying to install Steam in 16.10.

sudo apt-get install steam
[sudo] password for micah:
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 gcc-5-multilib : Depends: libc6-dev-i386 (>= 2.11) but it is not going to be installed
 libc6-dev-x32 : Depends: libc6-dev-i386 (= 2.23-0ubuntu5) but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

How do I solve these unmet dependencies?

Steam has two i386 architecture unmet dependency packages depending on GNU C Library: 32-bit development libraries for AMD64 (libc6-dev-i386). To correct the unmet dependencies, open the terminal and type:

sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get -f install
sudo apt-get install steam

Try running this command:

apt-get --fix-broken install

This attempts to fix broken dependencies. (--fix-broken is the same as -f.)


How do I install Huawei E5372 USB dongle on 12.04 I just got a new USB modem huawei E5372, can someone please put me through or point me to the right direction.

Thanks in advance

The following worked for me

sudo apt-get install usb_modeswitch

Make sure the huawei dongle is in the right mode with lsusb, should be device-id 1506 (if your unfamiliar with this read some info about internet sticks+linux+usb_modeswitch)

Now doing ifconfig should show you an interface wwan0, this is your dongle. You don't need to dial in or anything, just simply request an IP-address with:

sudo ip link set wwan0 up

Possibly you also have to call dhclient but for me the above was enough.

sudo dhclient wwan0


How do I move all files from one folder to another using the command line? I would like to know how could I move all files from a folder to another folder with a command line.

Let's say I'm in my Downloads folder and there are a 100 files that I would like to move to my Videos folder, without having to write all the files name.

Open a terminal and execute this command:

mv  -v ~/Downloads/* ~/Videos/

It will move all the files and folders from Downloads folder to Videos folder.

To move all files, but not folders:

If you are interested in moving all files (but not folders) from Downloads folder to Videos folder, use this command

find ~/Downloads/ -type f -print0 | xargs -0 mv -t ~/Videos

To move only files from the Download folders, but not from sub-folders:

If you want to move all files from the Downloads folder, but not any files within folders in the Download folder, use this command:

find ~/Downloads/ -maxdepth 1 -type f -print0 | xargs -0 mv -t ~/Videos

here, -maxdepth option specifies how deep find should try, 1 means, only the directory specified in the find command. You can try using 2, 3 also to test.

See  the Ubuntu find manpage for a detailed explanation

Just wanted to add one more answer. If you are already in the folder you want to move files out of, you can do this:

mv * ~/Videos


Building xar source error: no libcrypto? I am building xar from source (https://github.com/mackyle/xar). It complains that I don't have OpenSSL, but I have it (my system have the openssl package installed and I have libcrypto.so.1.1.1 file in my lib directory).

Below are error messages from ./configure command when building xar:

...
checking for OpenSSL_add_all_ciphers in -lcrypto... no
configure: error: Cannot build without libcrypto (OpenSSL)
...

What's the problem with my openssl libraries?

There is a fix for this now, it only requires some small changes. You can read about it in the Github issue.

Here's what you need to do:
In configure.ac, line 332 is:

AC_CHECK_LIB([crypto], [OpenSSL_add_all_ciphers], , [have_libcrypto="0"])

Replace it with:

AC_CHECK_LIB([crypto], [OPENSSL_init_crypto], , [have_libcrypto="0"])

Note that the only change is to the second part in brackets. You can see an example of this change here.

Then run ./autogen.sh. After that you can continue install with make and sudo make install.

To be able to build there are additional *-dev packages needed. Probably libssl-dev in this case.


Installing Ubuntu with USB stick I tried to install Ubuntu with an usb stick. I used unetbootin. Everytime I tried it, there was an error:

"invalid or corrupt kernel"

I tried with several sticks. What could be the problem?

Greetings from Germany
Michael

If you used that stick to deploy other distrib,
try to clean older install files on the USB stick before applying the ISO (
I personally got problem with old files of previous installation made by Unetbootin).

To install from a USB stick, just:

Download Rufus
Run Rufus and select your USB stick as the device
Click Start
Once Rufus is done, reboot to BIOS on the computer you wish to install on
Change the boot order to USB first
Plug in your USB if it is not still plugged in and cold reboot your computer
The computer should boot straight to Ubuntu, from which you can install as if from a disk

I have tried this process and it worked for me. Also, be sure to make sure your checksums match for your iso.