Kernel panic: "Machine check: processor context corrupt" after install I am new to Linux and I am having issues after installing Ubuntu. I have tried multiple versions and all seem to give me the same issue. The Ubuntu Live CD worked and I used it to install Ubuntu alongside Windows 7. I got the following error after installing Ubuntu.

Kernel panic: "Machine check: processor context corrupt"

System specs:

x58 motherboard
12GB RAM
Core i7 processor
2 Nvidia GTX 580 video cards in SLI configuration

Try running the memory tester from the install CD or GRUB menu(if you have one listed there). If there are no problems, visit your BIOS config system and enter the CPU features submenu. Disable SpeedStep, TurboMode, CxE, Virtualization, HT technology, QPI controller setting, and link fast mode. Keep resetting each until the system fails to boot, and leave it as such.

Refer to http://www.evga.com/support/manuals/files/132-BL-E758.pdf for BIOS manual

Was your system a assembled one or the ready-made CPU. The reason is the mother board chip-set is not matching the processor. Win7 will run fine as it is adaptable to the lower chip-set drivers to the next phase of processors and the mother board can also show no resistance to work in that case.

Ubuntu is Linux based as you know and is more secured because of the restriction that it should have the predefined set of chip-set drivers of the OEM recommendation for that security,which is mandatory for running. Try changing your mother board to the latest available chip-set that can suite to Intel i7. I had the same problem and tried many options. finally understood that from the AMD (mine is phenom II X2 555 black processor) that this processor requires a chip-set above AMD 760G while i was using 740G and win7 works for me very fine. now i changed new mother board to 760G chip set and every thing is fine and my performance also increased. YOur processor is recommended to have intel 1115 with Q77 or Z77 chip set and u r using X58 please look the review once again in the intel website and take decision


How can I find my User ID (UID) from terminal? The title says it all. What command I need to run from a terminal to find my user ID (UID)?

There are a couple of ways:

Using the id command you can get the real and effective user and group IDs.

id -u <username>

If no username is supplied to id, it will default to the current user.
Using the enviroment variable.

echo $UID


How can I copy files from damaged external HDD? My external HDD is not detected in Windows Editions. But it is working well in Ubuntu.
The problem is, some of the tracks are damaged, so while browsing through the HDD, the 'Nautilus' stops working. I could not copy those files too.
What is the command line arguments should I use to skip the damaged file and copy healthy files.

If you're unable to copy file by file, use ddrescue to copy the entire partition block by block. ddrescue will just copy the good blocks, leaving the space in the image file where the bad blocks were.

General usage is like this:

sudo ddrescue -n /dev/sda1 sda1.img sda1.log
sudo ddrescue -r3 /dev/sda1 sda1.img sda1.log

This will copy the entire partition /dev/sda1 to an image file sda1.img. This should be done from a different partition which has enough room for the entire partition image.

The second command will attempt to read from the bad blocks again and fill in the blanks.

Then you can mount the img file and do what you want with the files on them:

sudo mount sda1.img -o loop /mnt; nautilus /mnt

More info:

http://wiki.lunarsoft.net/wiki/Data_Recovery#ddrescue

http://www.gnu.org/software/ddrescue/manual/ddrescue_manual.html

If you know the exact files/directories you want to copy, you could try to run this from the terminal:

cp /media/name-of-hdd/folder-files-to-copy ~/Desktop/


How do I find the version of bash I am running? (learning bash)
I was trying to check the bash version so I typed /bin/bash -v.

That outputted a whole lot of text to the screen (contents of .bashrc, and other files sourced from it).

Could I have screwed up something (like overwriting some config files/setting incorrect environment variables etc.) due to that command?

I also can't find documentation on what the -v switch is for.

The -v parameter for bash stands for verbose, and instructs bash to print out as much information as possible about what it is doing. On startup, it will print out all the configuration it is reading in.

To print out the version information for bash, use bash --version.

If you are on Windows and, instead, want to know what version of Git Bash you're running, it is part of Git for Windows.
So the Git Bash version is:

git --version

  git version 2.23.0.windows.1

On my same machine when I run:

echo $BASH_VERSION

  4.4.23(1)-release

To update to the latest version, generally you will want to download and install the latest version of git for Windows as per FAQ.  Settings/customizations should be preserved if installed in the appropriate configuration folders.


Can't delete/edit files on my pendrive I'm trying to delete the .Trash-1000 from my pen drive, but with

sudo rm -rf .Trash-1000/

I got

rm: cannot remove `.Trash-1000/expunged/2660089871/apps.log': Read-only file system

(one line of this for each file within .Trash-1000/)

I found this similar question, but I still got the same result after running:

sudo mount -o remount,rw '/media/SGTL MSCN'
sudo rm -rf .Trash-1000

So, any idea how to remove this folder (or its content)?

By the way, I need to remove it because I'm using the pen drive to test a software, and there's a file there that should not be found in the pen drive.

--update

I thought it was corrupted, like Allan pointed, but the same just happened to another new pen drive I plugged here.. After use it on VMWare (in a new OS that still don't have a name), and go back to Ubuntu, I can no more edit it's files, nither make a filesystem check or format it.

If I were to guess it sounds to me like your Pendrive is corrupted.
the simple solution is to back-up and reformat however if you want to find out if it is really corrupted or not which could be a sign of a failing flash drive use fsck

first back-up your pendrive/card then find out what mount point its under eg. /dev/sdb , /dev/sdc etc.

You can find this information in disk utility under the heading Device:

in the screen shot it is /dev/sdb1

You can then modify these commands and run each

sudo umount /media/disk

sudo fsck -favVr /dev/sdb1

Alternatively you can click "check file system" after unmounting the drive in disk utility

Edit:

I have found another solution to this problem the steps are as follows

Mount the USB Drive you are having the problem with
Open Disk Utility as root open a terminal and enter gksu palimpsest
Unmount the Drive and remove
Plug it back in

Hopefully this will work if all else has failed

chmod +rx .Trash-1000 -R
rm -rf .Trash-1000

This should hopefully fix your issue, I had the problem few days back where even if I owned folder I couldn't delete content cause folder was not executable -R if u have recursive folders

Hope that does it for you


Changes to exfat partition do not persist I have a SD card exfat formatted, I can mount it and write on it: delete files, copy files on it, I can see the change applied, the LED on the card reader blinks when writing, but if I unmount and remount the card, all my changes are gone! The SD card has the same content as before.

An idea as to why it happens and how I can fix it?

I have exfat-fuse 1.1.0-2 (also tried 1.2.2 from sources) on Ubuntu 15.10.

I have exactly the same issue with my micro-sd card!

I believe your SD-card is defected and you should get a new one.

I used mine in my Raspberry as main boot/root drive. At some point after a few months, I noticed that movies and episodes that got added to my Couchpotato and Sickrage, got deleted from the list again, as if they were never there.
After a while I found out that no matter what I wrote to the sd, I would initially see the file with the ls command, but as soon as I rebooted, al changes were rolled back.
I also tried cleaning the entire card in Windows, remove all partitions and create a new one. I got no errors what so ever, but after the change a scan of the card revealed the original partition layout.

I just got a new card.

EDIT: Ok, just tested my card again and copied everything for you to see. Check this out.

First I'll show my SD-card with fdisk and will mount one partition.

pi@RasPI / $ sudo fdisk -l /dev/sdd

Disk /dev/sdd: 16.0 GB, 16021192704 bytes
4 heads, 16 sectors/track, 488928 cylinders, total 31291392 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00002483

   Device Boot      Start         End      Blocks   Id  System
/dev/sdd1            2048     1673828      835890+   e  W95 FAT16 (LBA)
/dev/sdd2         1679360    31225855    14773248   85  Linux extended
/dev/sdd3        31225856    31291391       32768   83  Linux
/dev/sdd5         1687552     2736127      524288   83  Linux
/dev/sdd6         2744320     2867199       61440    c  W95 FAT32 (LBA)
/dev/sdd7         2875392    31225855    14175232   83  Linux
pi@RasPI / $ sudo mount /dev/sdd7 /sd

Lets see what's on it

pi@RasPI / $ ls /sd
bin  boot  dev  etc  home  lib  lost+found  media  mnt  opt  proc  root  run  sbin  selinux  srv  sys  tmp  usr  var

Now I'm going to delete the home folder on the card and copy some text file from my own home folder onto the card.

pi@RasPI / $ sudo rm -R /sd/home
pi@RasPI / $ sudo cp /home/pi/autoexec.sh /sd

So now let's look for the obvious:

pi@RasPI / $ ls /sd
autoexec.sh  bin  boot  dev  etc  lib  lost+found  media  mnt  opt  proc  root  run  sbin  selinux  srv  sys  tmp  usr  var

Well, home is gone and my script file is visible.

Now I'm going to umount the drive, then re-mount the drive and then check the content

pi@RasPI / $ sudo umount /sd
pi@RasPI / $ sudo mount /dev/sdd7 /sd
pi@RasPI / $ ls /sd
bin  boot  dev  etc  home  lib  lost+found  media  mnt  opt  proc  root  run  sbin  selinux  srv  sys  tmp  usr  var

Well dress me up and call me Sally! The file is gone and my home folder re-appeared! Really, I tried tons of things to erase this bad-ass, but nothing sticks. After all I tried I even got some files off of it I actually forgot to salvage earlier.

It's really weird, but I can't think of anything but a corrupted card.


Ubuntu 13.04 doesn't show confirmation dialog for shutdown After I updated to 13.04, Ubuntu immediately shuts down without confirmation when I press the power button. Also, it doesn't ask for confirmation if I select an otion from the top-right gear menu.
I tried setting the flag org.gnome.gnome-session.logout-prompt to true in dconf-editor and I set the power button action to "Interactive" in Tweak Tool.

I finally found the solution!
Apparently the setting of /org/gnome/gnome-session/logout-prompt is ignored in newer Ubuntu versions, the right key was /apps/indicator-session/suppress-logout-restart-shutdown.
So to fix this, do dconf write /apps/indicator-session/suppress-logout-restart-shutdown false in terminal. It should take effect immediately without restart.
It seems that sometimes this value is set to „true“ by upgrade or third party applications.

In ubuntu 13.04 i find this is working, so please open a terminal and type or better copy and paste the row below then press enter:

dconf write /org/gnome/gnome-session/logout-prompt false


Wifi not working after upgrading from 12.04 to 13.10 I went through loads of posts looking for an answer to my WiFi problems but can't seem to fix it.

I had Ubuntu 12.04 installed and WiFi worked fine with no issues whatsoever but then I upgraded to 13.10 it has stopped working.

It shows the available networks but I can't connect to any of them it just does that animation thing then stops working.

Update

Heres the link to pastebin: http://pastebin.com/GyMMEYhv

And heres what wifi card i have and driver

lspci:

01:00.2 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 0a)
        Subsystem: Hewlett-Packard Company Device [103c:18de]
        Kernel driver in use: r8169
02:00.0 Network controller [0280]: Ralink corp. RT3290 Wireless 802.11n 1T/1R PCIe [1814:3290]
        Subsystem: Hewlett-Packard Company Device [103c:18ec]
        Kernel driver in use: rt2800pci

I had same issue and it became to work after this: go to Settings -> Software & Updates -> Additional Drivers and turn off Wireless LAN Controller (select Do Not Use Device -> Apply)  and then turn on it again. During this process I was connected to internet via ethernet wire


Port 20 and 21 not open To run a wordpress website on Amazon EC2, I am using bitnami machine image.

To change the website, I need to set up a ftp server. I set up vsftpd using the following vsftpd.conf

listen=YES
anonymous_enable=YES
local_enable=YES
dirmessage_enable=YES
use_localtime=YES
xferlog_enable=YES
connect_from_port_20=YES
ftpd_banner=Welcome to blah FTP service.
chroot_local_user=YES
chroot_local_user=YES
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd.chroot_list
secure_chroot_dir=/var/run/vsftpd/empty
pam_service_name=vsftpd
rsa_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
listen=YES
listen_address=127.0.0.1
write_enable=YES
local_enable=YES
anonymous_enable=NO
local_umask=022
userlist_enable=YES
userlist_deny=NO
userlist_file=/etc/vsftpd.allowed_users
seccomp_sandbox=NO

pasv_enable=YES
pasv_min_port=1024
pasv_max_port=1048
pasv_address=52.14.106.23

allow_writeable_chroot=YES

The problem is that, port 20 and port 1024 - 1048 are not even open.

bitnami@ip-172-31-25-7:~$ netstat -lntu
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN
tcp        0      0 127.0.0.1:21            0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN
tcp6       0      0 :::80                   :::*                    LISTEN
tcp6       0      0 :::22                   :::*                    LISTEN
tcp6       0      0 :::443                  :::*                    LISTEN
udp        0      0 0.0.0.0:50528           0.0.0.0:*
udp        0      0 0.0.0.0:68              0.0.0.0:*
udp6       0      0 :::43109                :::*

bitnami@ip-172-31-25-7:~$ nc -zv 127.0.0.1 20
nc: connect to 127.0.0.1 port 20 (tcp) failed: Connection refused

Any ftp connection attempt was rejected.

What should I do?

You should create a "security group" where you specify that you open ports 20, 21 and range 1024-1048. Then you should add a security group to your EC2 Instance.

You can find security groups in AWS EC2 console on the left in the section "Network & Security".

Your config file appears good.
Check the ports on your firewall.
Enable the ports via the firewall.
Check your machine and make sure you do not have any other ftp software installed as it can cause conflicts.


getting setgid:Operation not permitted error while running 'su' command - Ubuntu 12.04 I am logged in with imp user. And when I am trying to login via root user on terminal:

impuser@machine:~$ su - root

it gives:

setgid:Operation not permitted

any idea,How to resolve this issue?

Ubuntu only allows sudo to increase privilege level, not su (unlike other distros). To get a root shell, try this:

sudo su

If "impuser" is allowed to get root ( that means that he is not excluded from sudo rights in the /etc/sudoers file ) Just press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, run the command below.

sudo su


ntfsfix error: Volume is corrupt. You should run chkdsk. After ntfsresize I have recently used ntfsresize to resize my ntfs drive.

I then got an error saying:

Error mounting /dev/sda1 at /media/<user>/Win10: Command-line `mount -t "ntfs" -o "uhelper=udisks2,nodev,nosuid,uid=1000,gid=1000" "/dev/sda1" "/media/<user>/Win10"' exited with non-zero exit status 13: Failed to load runlist for $MFT/$DATA.
highest_vcn = 0xaa4a, last_vcn - 1 = 0x2387f
Failed to load $MFT: Input/output error
Failed to mount '/dev/sda1': Input/output error
NTFS is either inconsistent, or there is a hardware fault, or it's a
SoftRAID/FakeRAID hardware. In the first case run chkdsk /f on Windows
then reboot into Windows twice. The usage of the /f parameter is very
important! If the device is a SoftRAID/FakeRAID then first activate
it and mount a different device under the /dev/mapper/ directory, (e.g.
/dev/mapper/nvidia_eahaabcc1). Please see the 'dmraid' documentation
for more details.

when trying to mount it.

I then used ntfsfix to try and fix it but it gave the error:

Mounting volume... Failed to load runlist for $MFT/$DATA.
highest_vcn = 0xaa4a, last_vcn - 1 = 0x2387f
Failed to load $MFT: Input/output error
FAILED
Attempting to correct errors... Failed to load runlist for $MFT/$DATA.
highest_vcn = 0xaa4a, last_vcn - 1 = 0x2387f
Failed to load $MFT: Input/output error
FAILED
Failed to startup volume: Input/output error
Checking for self-located MFT segment... OK
Failed to load runlist for $MFT/$DATA.
highest_vcn = 0xaa4a, last_vcn - 1 = 0x2387f
Failed to load $MFT: Input/output error
Volume is corrupt. You should run chkdsk.

You need to boot into Windows, or use a different computer with Windows if it's an external drive. Windows should automatically detect that there's an issue and have a pop-up asking if you would like to check the disk for errors, so just press yes and you should be good.

If you're planning on using the drive on Linux more than Windows, I strongly suggest that you use ext4, as it works much better than NTFS in Linux, as I have learned the hard way.

BTW, according to the manpages:

  ntfsfix is NOT a Linux version of chkdsk. It only repairs some fundamental NTFS inconsistencies, resets the NTFS journal file and schedules an NTFS consistency check for the first boot into Windows.

mount -t ntfs -o ro /dev/sda1 /media/ashu/Shared\ Drive/


Headset microphone not working, Acer Aspire ES1-572, Ubuntu 20.04 When plugging in a headset via the headphone jack, my laptop sends sound to the speakers but does not pick up any sound from the microphone.
I tried to modify /etc/modprobe.d/sound-fixup.conf by adding
options snd-hda-intel position fix=1
options snd-hda-intel model=aspire-headset-mic

Afterwards I got the option to select between headset and headphones once I plug in my headset, but no sound is detected. I also tried many other settings from this list: https://www.kernel.org/doc/html/latest/sound/hd-audio/models.html
dell-headset-multi and dell-headset-dock gave me similar options to select from when plugging in the headset, but still without sound. All other settings seemed to not work at all.
I also tried my luck with hdajackretask, but I really can't wrap my head around what each setting does and blindly copying things that worked for other people has not worked for me.
Alsa infromation with plugged in headset: http://alsa-project.org/db/?f=8edf11436c3372bcefbc92e020fc87beff178e3d
I would be very thankful for any help!

Have you tried putting your code in /alsa-base.conf?
Have you tried checking all your sound card pins viA hdajackretask specifically configuring port 0x19 to microphone?


Firefox unresponsive due to lock files, how do I remove them? As my laptop hard rive was knackered I was adivsed to use ubuntu, it set-up perfectly. But i tried downloading Google Chrome and Flash Player because I couldnt watch any videos and now Firefox has become unresponsive.
It says

Firefox is already running but it is not responding. To open a new window, you must first close the exisitng firefox process or restart your system.

I tried restarting but that hasn't worked.
Ubuntu also asked me if i wanted to do a update which I did, could this be a problem also.
When I try to delete the files, it tells me the following:

The link ''lock'' is broken. move it to the rubbish bin.
This link cannot be used, because it's target '127.0.1.1;+1885'' doesn't exist

Killing the process does not work either.

Open the file manager and press Ctrl+H to see hidden files. GO into .mozilla->firefox and there should be one folder in there, possibly with a very weird name. Now, go into that folder and delete the files lock and .parentlock to allow Firefox to access its SQlite database.

Then go for any newer version of Firefox by these commands.......After connecting it to internet try these commands.....

1.sudo apt-get install firefox(for firefox)

2.sudo apt-get install chromium-browser(for chrome)

3.sudo apt-get install flash-player(for flash player)


Battery life on Zenbook UX51 Ubuntu 12.10 My battery life is 2h30m in my Ubuntu 12.10 but in Windows I had 7h00
I installed jupiter, nothing changed. What can I do?

Use powertop to check what is draining the battery. Install bumblebee and make sure that the GPU is off (/proc/acpi/bbswitch).


Problems with "+" in grep I'm trying to write a grep command to find lines like the below in a large text file:

<div class="node_thumbnail" data-type="file" name="GOPR0036.MP4_frame000001.jpg" data="813334c25191468c9f1c57afc99fde60" aid="133948" rel="/Files/ToolTipView?fileId=813334c25191468c9f1c57afc99fde60&pageNo=1&NoCache=101016083044" rev="topMiddle">

but the + symbol seems to be causing problems in the below commands:

 grep 'data=[a-z,0-9,\"]' file

Lots of hits

 grep 'data=[a-z,0-9,\"]+' file

No hits

If you want + to mean "one or more of the preceding atom", then you have to do one of:

Use -E (Extended Regular Expressions) (or -P, PCRE):

grep -E 'data=[a-z,0-9,\"]+' file

Escape + so that is treated specially in the Basic Regular Expressions used by default in grep:

grep 'data=[a-z,0-9,"]\+' file

Another option is to use egrep:

egrep 'data=[a-z,0-9,\"]+' file

egrep is bundled with grep, it is just a wrapper for grep:

#!/bin/sh
exec grep -E "$@"

this is good for interactive use. However in scripts I would use grep -E.


How to upgrade kde plasma in kubuntu 14.10? I'm using kubutu 14.10 plasma 5 . Its plasma version is 5.1 but I'd like to upgrade to 5.4 and newer versions. How can I do that ? Should I wait for updates or there is any ppa to do that ?

Thanks

You may already be using the latest plasma version.  It looks like KDE is versioning things differently now, and kde is at 5.4, plasma is at 5.1, and the applications are either 4.11 or 4.12.  See this webpage for an explanation: blog post on kde's new versioning

Also check out the main kde.org page, and see what the latest releases are at kde announcements


Mount drive through command line (as if I clicked on it in nautilus) I'm writing a backup script in which I need to mount a drive in the media bay of my laptop.

I know that I can get the job done by messing with fstab and the mount command. Perhaps that's the easiest way. Anyway, I'm interested in the following:

Initially the media bay drive is unmounted.
I click on the drive in the side-panel in a nautilus window and the drive is mounted.
I can access it at /media/baydrive.

My question:

Is there an easy way of performing step 2 from the command line? I.e., mount the drive to /media/<device name> without messing with fstab.

Try udisks --mount <device name>

To mount by partition label, you can do

udisks --mount /dev/disk/by-label/baydrive

You can alternatively mount the drive, it will then appear at the side panel.. you can right click that shortcut on the side panel and lock it on the launcher.. now you will be able to simply single click that icon to mount the drive without any command, startup script or opening nautilus.


Compilation Help on Ubuntu 13.10 I have recently gotten into programming this is a small C code I started on.

I am using Ubuntu 13.10.

int main(int argc, char *argv[])

{

    puts("Hello world.");

    return 0;
}

Whenever I try to compile it using

gcc exl.c -o exl1
cc exl.c -o exl1

or anything like that i just keep getting

gcc: error: exl.c: No such file or directory
gcc: fatal error: No input files
compilation terminated.

I have no Idea what to do any help would be greatly appreciated.

P.S. I have already done

sudo apt-get install build-essential
sudo apt-get update build-essential
sudo apt-get upgrade build-essential

You need to run gcc in a directory where your C code is stored, so first use:

cd /home/your-user-name/path-to-program-dir

and then run gcc. To make sure that you have to C file in same directory use

ls *.c

which will show you all the C files in current directory. If you are not sure in which directory your code is stored then you may want to use

find

If you use gedit then after saving c file use ctrl-M. It will open terminal in your program directory.


How can I prevent auto-mounting of a partition in fstab? Previously, I prevented auto-mounting of a particular partition at boot by the following line in /etc/fstab

UUID=<alphanumeric> /media/windowsHDD ntfs user,noauto 0 0

At some point in the last year, this failed, and the partition was automatically mounted on boot. I attempted the following, which also failed.

/dev/sda1 /media/windowsHDD ntfs user,noauto 0 0

Thinking that perhaps I was bitten by this bug, I removed user, but that also failed.

UUID=<alphanumeric> /media/windowsHDD ntfs noauto 0 0

Is there a way to prevent auto-mounting in fstab?

In order to avoid this issue make sure of 2 things:

The partition is not mounted in /media
The the name of the target
mount directory is different than the partition label value

Check entry in /etc/fstab:

user@raspberrypi:/ $ cat /etc/fstab
/dev/sda1     /media/st1       ntfs-3g noauto,rw         0       0

Check the label of the partition:

user@raspberrypi:/ $ sudo ntfslabel -f /dev/sda1
st1

Since the name of target mount directory (/media/st1) equals the partition label (st1), the partition will continue to mount automatically despite the noauto parameter in /etc/fstab.

Let's do something to avoid the automatic mount. Create a new directory in /mnt:

user@raspberrypi:/ $ sudo mkdir /mnt/testdir

Edit the /etc/fstab entry:

/dev/sda1     /mnt/testdir       ntfs-3g auto,rw         0       0

Finally change the label of the partition and reboot:

user@raspberrypi:/ $ sudo ntfslabel /dev/sda1 "new_label"

user@raspberrypi:/ $ sudo reboot

The partition shouldn't be mounted automatically anymore.

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

/dev/sdaX /media/external-noauto ext4 user,noauto 0 0

Or you can use PySDM

Make sure you replace X with your device ID.


How to disable suspend with command line or config file? I want to disable suspend because my VPS goes into suspend and I cannot access it.

How I can do that?

On Ubuntu 16.04 LTS, I successfully used the following to disable suspend:

sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target

And this to re-enable it:

sudo systemctl unmask sleep.target suspend.target hibernate.target hybrid-sleep.target

You can use gconf-editor

install that with

sudo apt-get install gconf-editor

and then look at

/apps/gnome-power-manager/timeout

Try setting sleep_computer_ac to 0

maybe help


How do I copy files that need root access with scp? I have an Ubuntu server to which I am connecting using SSH.

I need to upload files from my machine into /var/www/ on the server, the files in /var/www/ are owned by root.

Using PuTTY, after I log in, I have to type sudo su and my password first in order to be able to modify files in /var/www/.

But when I am copying files using WinSCP , I can't create create/modify files in /var/www/, because the user I'm connecting with does not have permissions on files in /var/www/ and I can't say sudo su as I do in case of an ssh session.

Do you know how i could deal with this ?

If I was working on my local machine, I would call gksudo nautilus but in this case I only have terminal access to the machine.

You're right, there is no sudo when working with scp. A workaround is to use scp to upload files to a directory where your user has permissions to create files, then log in via ssh and use sudo to move/copy files to their final destination.

scp -r folder/ user@server.tld:/some/folder/you/dont/need/sudo
ssh user@server.tld
 $ sudo mv /some/folder /some/folder/requiring/perms
# YOU MAY NEED TO CHANGE THE OWNER like:
# sudo chown -R user:user folder

Another solution would be to change permissions/ownership of the directories you uploading the files to, so your non-privileged user is able to write to those directories.

Generally, working in the root account should be an exception, not a rule - the way you phrasing your question makes me think maybe you're abusing it a bit, which in turn leads to problems with permissions - under normal circumstances you don't need super-admin privileges to access your own files.

Technically, you can configure Ubuntu to allow remote login directly as root, but this feature is disabled for a reason, so I would strongly advice you against doing that.

An older question, I know, but times change and so do some techniques.  Just in case someone is still looking for a streamlined way to accomplish this.

Assumptions

Your user on the server is a sudoers.
You are running Windows 10.
The files in /var/www should belong to user:group www-data:www-data

Concept

The concept is to combine remote commands over ssh and scp file transfersers without relying on GUIs such as PuTTy or WinSCP.  These commands can be run either from a Command Prompt or PowerShell.  There are five main tasks to permorm:

Environment setup
Transfer files to server
Set remote file permissions
Transfer between remote folders
Cleanup

Tasks 3-5 can be performed in a single step.  If you plan to do this often, leaving the environment setup will allow you to omit tasks 1 and 5.

Environment Setup

You may or may not already have folder you can use as a temporary repository for the transfer.  If not, you can run:

ssh user@server.tld "mkdir ~/wwwtemp"

Depending on your server's settings, you may or may not be prompted for user's password/passphrase to authenticate the ssh session.

Once the session is authenticated, the mkdir ~/wwwtemp command will execute then the ssh session will terminate, and you will be back at your prompt (Command Prompt or PowerShell).

Transfer Files to Server

The next thing to do is to transfer the files from the local Windows machine to the Ubuntu server using scp like so:

scp -R local\path user@server.tld:~/wwwtemp/

Depending on your server's authentication method, you may or not need to enter a password/passphrase.

Permissions and Final Destination of Files

Once the file transfer has completed, you can run a series of commands over ssh like thusly:

ssh -t user@server.tld "sudo chown -R www-data:www-data ~/wwwtemp  && sudo mv -R ~/wwwtemp/* /var/www/ && sudo rmdir ~/wwwtemp"

Again, depending on the authentication method of your server you may or may not be prompted for a password/passphrase.  Regardless of your authentication method, sudo will prompt you for user's password.  Unless, of course you have disable requirement for password when user runs chown mv and rmdir. See this question for guidance on how to do that.

This step covers tasks 3-5:

sudo chown -R www-data:www-data ~/wwwtemp recursively sets the desired file permissions on the files you just uploaded.
sudo mv -R ~/wwwtemp/* /var/www/ recursively moves the contents of the temporary repository to its final destination.
sudo rmdir ~/wwwtemp removes the temporary repository.  It is necessary to use sudo here since we changed the directory owner in task 3.

Of course, && separates each command.  The commands will be performed in sequence.  If you plan to keep the repository wwwtemp, you can omit the final command in the sequence.

Notes

You can omit && sudo rmdir ~/wwwtemp from the end of the final ssh command string if you would like to continue using the temporary repository in future.  Doing so also means that you can omit the first ssh command each time you desire to transfer files to your server in this manner.


How do I update my own application in the software center? Some applications use web services to provide services to users (especially Unity lenses). Things with APIs that might change, or things that might be updated. So what happens when someone submits a Reddit Lens and then a week later it breaks and it needs to be updated?

Is there a process where I as an application author can update my application in the software center independent of the Ubuntu release cycle?

Definitely. If you are an app author who has submitted an application to the Software Centre through the My Apps web interface on the Ubuntu App Developer Site, you can distribute updates following this easy process:

Updating your app in the Software Centre

Probably try to update in Github, Its will support all Linux.

Not specially Ubuntu.
 -

You will get more response and
   2.you will reduce your app bug also. so more advantages.


World of Warcraft under primus/crossover getting Direct3D9 is not available without opengl I'm running Ubuntu 12.10 64bit and having issues using primus (due to nvidia optimus) to run World of Warcraft in Crossover..

I'm getting the following:

steorra@perpetual:~$ primusrun /opt/cxoffice/bin/wine --bottle "World of Warcraft" --cx-app "Wow.exe"
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
Xlib:  extension "NV-GLX" missing on display ":0".
Direct3D9 is not available without OpenGL.
Direct3D9 is not available without OpenGL.
Direct3D9 is not available without OpenGL.

I've tried installing the Runtime Libraries for Direct3d9 under the relevant crossover bottle to no avail.  Help?

First of all, it's possible that your drivers aren't completely installed.
Try running this if you use Nvidia cards ( 32bit, as wine uses 32bit libraries ):

sudo apt-get install nvidia-glx

And this one if you use AMD/ATI cards:

sudo apt-get install fglrx-glx

You might want to re-install / update your drivers, too. You can follow one of these guides:

Nvidia driver doesn't work in 12.10

Nvidia drivers on Ubuntu 12.10

Also try running: LD_LIBRARY_PATH=/usr/lib32/nvidia-current ~/.wine/path/to/your/game

If none of these does work, try running game with -dx9single.

Hope it helps.

after install nvidia or ati driver
edit .../World of Warcraft/WTF/Config.wtf and change

SET gxApi "D3D9"

to

SET gxApi "OpenGL"


Ubuntu upgrade from 16.04 to 18.04 in AWS EC2 My AWS EC2 instance is running on Ubuntu 16.04. But recently I got an email from AWS that Canonical - the company that provides the support of Ubuntu 16.04 LTS - will stop its support on April 30, 2021.
So should I upgrade my instance to Ubuntu 18.04 or let my server run on 16.04. Will this upgrade affect my software and customers?
A little confused, please help!

So should I upgrade this to Ubuntu 18.04

No. NEVER EVER upgrade a cloud instance. NEVER. Remember: ssh access is the only access you have. If that breaks your instance is gone and you depend on backups and a new instance to get back up running. It is not worth the risk.

or let my server run in 16.04.

Yes. And is is not a server, it is a cloud instance.

You have 2 disks, and if you do not fix your instance by separating system and personal files.
So ...

a system disk holding 16.04
a personal disk holding all your data.

The correct procedure:

detach your personal partition from the 16.04 instance
create a copy of your personal disk
create a new instance using 18.04 or 20.04
attach the copy to this new instance
boot and fix issues regarding software you have installed. Apache is normally not a problem. MySQL in 20.04 will have issues: 20.04 uses MySQL 8 so things changed. You can however install 5.6/5.7 if you want and use that.

Just because you try to separate your personal files on a dedicate volume doesn't mean you haven't added packages, changed configurations, or made other alterations to to the OS volume that will be lost with the accepted answer. Sometimes these are easy to restore, other times, not so much.
In this situation, you can make snapshots of your volumes and use them to spin up a new instance. From this instance you attempt the upgrade. If the upgrade runs into issues you still have your original 16.04 instance available and the snapshots to try again.


Reboot / shutdown log On a 12.04 server, I have random reboot issues with my dedicated server, that I can only resolve through ssh.
Sometimes (usually after applying important security updates), I issue a reboot through ssh. The server becomes inaccessible (apache, ssh) but still responds to ping.

Most services seem to have shut down, but there server didn't reboot. In those situations, I have to request a manual reboot through the web interface (basically, they just cur the power).

And sometimes, it isn't enough. The server restarts, but again, no http, no SSH. I have to do a second manual reboot.
After that, I can issue many reboot through SSH, with no config change, and the server will work. Until next time.

I am under the impression that this "reboot" issue only appears when I haven't rebooted for some time (several days/weeks).

How can I investigate this issue ?

I have tried looking at kernel.log

The last failed ssh reboot was around 15:10
The manual reboot was at 15:32.

Jun 22 16:20:52 server1 kernel: [579427.072541] UDP: bad checksum. From 71.6.135.131:40000 to 37.187.100.21:161 ulen 51
Jun 23 15:10:19 server1 kernel: Kernel logging (proc) stopped.
Jun 23 15:32:05 server1 kernel: imklog 5.8.6, log source = /proc/kmsg started.
Jun 23 15:32:05 server1 kernel: [    0.000000] Initializing cgroup subsys cpuset
Jun 23 15:32:05 server1 kernel: [    0.000000] Initializing cgroup subsys cpu
Jun 23 15:32:05 server1 kernel: [    0.000000] Linux version 3.2.0-64-generic (buildd@kissel) (gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) ) #97-Ubuntu SMP Wed Jun 4 22:04:21 UTC 2014 (Ubuntu 3.2.0-64.97-generic 3.2.59)
Jun 23 15:32:05 server1 kernel: [    0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-3.2.0-64-generic root=/dev/sda1 ro
Jun 23 15:32:05 server1 kernel: [    0.000000] KERNEL supported cpus:
Jun 23 15:32:05 server1 kernel: [    0.000000]   Intel GenuineIntel
Jun 23 15:32:05 server1 kernel: [    0.000000]   AMD AuthenticAMD
Jun 23 15:32:05 server1 kernel: [    0.000000]   Centaur CentaurHauls
Jun 23 15:32:05 server1 kernel: [    0.000000] Disabled fast string operations

Try update your system or your services.

apt-get update

apt-get upgrade

do-release-upgrade


Ubuntu implementation of Windows "Previous Versions" tab? I have implemented a FreeNAS solution and setup SMB sharing.  I have also setup regular snapshots.  I was pleased to find that Windows was able to see these snapshots in it's "Previous Versions" tab:

From this tab, I can restore versions of files for as many revisions as the server has.  Great!  But I'm having a devil of a time finding this functionality in Ubuntu land.
How do I restore previous revisions of files as stored on a remote SMB share, analogously to the Windows "Previous Versions" tab?
(I'm currently using Ubuntu 16.04, if that helps guide your response.)

You get this feature with GNOME Files (Nautilus) if you enable GNOME Backup (Déjà-Dup). You may need to install the nautilus-dejadup extension which isn't installed by default in all Linux distributions. After setting this up, you can right-click on files in nautilus and you'll get a list of all dates for that specific file. It doesn't work too well with folders, however. It works great for files!

I'm unaware of any file manager for Linux with support for previous file versions like Windows Explorer.

However, since FreeNAS is based on a Unix-like operating sytstem you could simply expose the snapshot location to the network. How to do that is, of course, off topic here.


Unable to install libpq-dev in ubuntu 16.04 I am try to install libpq-dev in ubuntu 16.04 and it come with this problem:

The following packages have unmet dependencies:
 libpq-dev : Depends: krb5-multidev but it is not going to be installed

E: Unable to correct problems, you have held broken packages.

So I try to install krb5-multidev by using command sudo apt-get install krb5-multidev but i got this error :

krb5-multidev : Depends: libkrb5-3 (= 1.13.2+dfsg-5) but 1.13.2+dfsg-5ubuntu2 is to be installed
Depends: libk5crypto3 (= 1.13.2+dfsg-5) but 1.13.2+dfsg-5ubuntu2 is to be installed
Depends: libgssapi-krb5-2 (= 1.13.2+dfsg-5) but 1.13.2+dfsg-5ubuntu2 is to be installed
E: Unable to correct problems, you have held broken packages.

It look like that it got conflict with the ubuntu package
So can anyone help me to solve this problem please !!!

Please try these commands, starting with cleaning the temp files, configure all unpacked but un-configured packages, then fix broken package dependencies, update, and install libpq:

sudo apt-get clean
sudo dpkg --configure -a
sudo apt-get -f install
sudo apt-get update
sudo apt-get install libpq-dev


What is the difference between Hibernate and Suspend Logout, Restart and Shutdown are all self explanatory to me.

What are the differences between Suspend and Hibernate on the shutdown menu?

Suspend does not turn off your computer. It puts the computer and all peripherals on a low power consumption mode. If the battery runs out or the computer turns off for some reason, the current session and unsaved changes will be lost.

Hibernate saves the state of your computer to the hard disk and completely powers off. When resuming, the saved state is restored to RAM.

Try this command:

pm-suspend-hybrid

Hybrid-suspend is the process where the system does everything it needs to hibernate, but suspends instead of shutting down. This means that your computer can wake up quicker than for normal hibernation if you do not run out of power, and you can resume even if you run out of power.


LibXp.so.6 missing 15.10 Im trying to install a canon printer driver on 15.10. I know this worked on an older distribution, but now the installation fails:

$ sudo dpkg -i o1512een_linux_CQueDEB_v2010_64.deb
Selecting previously unselected package cque-en.
(Reading database ... 255576 files and directories currently installed.)
Preparing to unpack o1512een_linux_CQueDEB_v2010_64.deb ...
Unpacking cque-en (2.0-10) ...
Setting up cque-en (2.0-10) ...
Running CQue setup from /opt/cel
/opt/cel/bin/setup: error while loading shared libraries: libXp.so.6: cannot open shared object file: No such file or directory

Was libXp.so.6 removed recently? Is there a way to make this install?

Edit: It's not available in the official package sources anymore

This might not be a perfect or ideal solution, but if you download the .deb for the previous ubuntu release (15.04), it seems to install just fine on 15.10. A program that depended on it started working immediately after I installed it.

http://packages.ubuntu.com/vivid/amd64/libxp6/download

The output posted indicates what the problem is:

libXp.so.6: cannot open shared object file: No such file or directory

This tells you that you do not have such library installed in your system.

The solution to your problem is to install the missing library as follow:

 sudo apt-get install libXp

After installing the missing library you can install your driver.


16.04 Ubuntu server Screen flickers, unavailable to use the System I freshly installed Ubuntu server 16.04, and after trying to boot into it, the screen flickers in random colours(nothing else is shown). It won't boot far enough for SSH to be reachable. Does anyone know what I should do to fix this?
My hardware + settings are:

GPU: Nvidia gtx 560 ti
Processor: i7-2600k
Bios mode for booting
On-board video card for graphics(because I want to utilise the GPU for
other things).

Can anyone shed some light on this?
Thanks in advance

It seems that the old hardware needed a nomodeset.

To edit existing system to add nomodeset follow these steps

Press shift after Bios splash.
Select which kernel to boot and press e.
find the line which contains linux /boot etc
add nomodeset at the end
CTRL + X to reboot and the problem was solved

Somehow shift didn't do anything for me, but it made it possible to boot once with 'nomodeset' and then I set it myself in /boot/grub/grub.cfg


Netbeans desktop shortcut file not working in Unity launcher, Exec command works in term I've been having trouble with the Netbeans desktop file generated by the netbeans install script. The file in question, as found in the /usr/share/applications folder, is very simple:

[Desktop Entry]
Encoding=UTF-8
Name=NetBeans IDE 8.0
Comment=The Smarter Way to Code
Exec=/bin/sh "/usr/local/netbeans-8.0/bin/netbeans"
Icon=/usr/local/netbeans-8.0/nb/netbeans.png
Categories=Application;Development;Java;IDE
Version=1.0
Type=Application
Terminal=0

The netbeans application itself runs perfectly fine if I run it from a terminal using /usr/local/netbeans-8.0/bin/netbeans. Am I missing something here? I can't figure out how to get the error output if I run it by double-click or from the launcher. There are no errors on the terminal run. Any ideas?

Edit: The netbeans file is executable.

try without  /bin/sh

Exec=/usr/local/netbeans-8.0/bin/netbeans

Right click on the desktop, create a launcher, then add: "/usr/share/applications/netbeans-8.2.desktop" as the command, and give it a meaningful title. You'll get an untrusted application warning the first time you run it; choose Mark Executable.

Happy coding.


Why is the Edit button greyed out in Network Manager? Since 2 days ago I can't edit any connections using network manager, because the "edit" button is greyed out. I tried doing a normal restart of the service to no avail.

Any suggestions?

One quick work-around is to invoke the connection editor manually from the command line:

nm-connection-editor

You'll get the same familiar edit screen.  Worked for me.

u might need to unlock it, there might be an unlock button somweher in that window, if u cant find it try maximising the window and look for it, happened to me once :)


Run commands on system startup I need some help with running commands on system startup.

So, I need these two commands to be executed every time I start my machine, due a problem with my Realtek driver (doesn't really matter):

sudo ifconfig myCode up
sudo service network-manager restart

How do I manage that to work?

I'm getting confused with sudo command and not knowing when will I enter my password or will the script even be run. Sorry for my low knowledge of Ubuntu system.

Thank you for your time!

Add ifconfig myCode up & service network-manager restart at the end of the /etc/rc.local before "exit 0"


TOR browser doesn't work I downloaded the tor browser from Ubuntu Software Center but it doesn't work, and shows this message:

but when I downloaded it from the tor website then it worked.

That's not how it's supposed to be. You only download the Tor Browser from their official website (torproject.org).

From its looks it seems that you're using Micah Lee's Tor Browser Launcher, which you also shouldn't download from the Software Center, rather use,

sudo add-apt-repository ppa:micahflee/ppa
sudo apt-get update
sudo apt-get install torbrowser-launcher

In any case, to solve your problem use this command:

gpg --homedir "$HOME/.local/share/torbrowser/gnupg_homedir/" --refresh-keys --keyserver pgp.mit.edu

That should fix your problem.


Getting MTP enabled devices to work with Ubuntu? Since Ubuntu 13.04 storage access to external devices via MTP is supposed to work out of the box via a GVFS-MTP module.

  While this question is about the Galaxy Nexus, other Android devices as well as Windows Phones and MTP enabled media players are also supported.

  For troubleshooting see this anwser.

I am having quite a bit of problems getting file-transfers working over MTP with the Galaxy Nexus. I am using Kubuntu 11.10 64-bit, and this is what I have done and the results I get:

Added rule for device in /etc/udev/rules.d/51-android.rules. The rule is the following and works for adb:

SUBSYSTEMS=="usb", ATTRS{idVendor}=="04e8", ATTRS{idProduct}=="6860", MODE="0666", OWNER="leob" #Galaxy Nexus

Restarted udev (and computer just to make sure).

Adb works, and all methods for reading from the device via MTP seems to work (I have tried mounting with mtpfs, gmtp and using the mtp-tools package directly). When I try to write to the device however, nothing I have tried works.

As an example, running mtp-newfolder test_dir 0 0 gives the following output:

libmtp version: 1.1.0
Device 0 (VID=04e8 and PID=6860) is a Samsung GT-P7510/Galaxy Tab 10.1.
Folder creation failed.
ERROR: Could not close session!

If I run mtp-folders after a failed mtp-newfolder without re-plugging the device, I get the following output:

Attempting to connect device(s)
Device 0 (VID=04e8 and PID=6860) is a Samsung GT-P7510/Galaxy Tab 10.1.
PTP_ERROR_IO: failed to open session, trying again after resetting USB interface
LIBMTP libusb: Attempt to reset device
mtp-folders: Successfully connected
Friendly name: (NULL)
Error 1: Get Storage information failed.
Error 2: PTP Layer error 02fe: get_all_metadata_fast(): could not get proplist of all    objects.
Error 2: (Look this up in ptp.h for an explanation.)
Error 2: PTP Layer error 02fe: get_handles_recursively(): could not get object handles.
Error 2: (Look this up in ptp.h for an explanation.)
LIBMTP_Get_Storage()
: Resource temporarily unavailable
OK.

Accompanied by the following in dmesg:

[ 1000.912082] usb 2-4: reset high speed USB device number 7 using ehci_hcd
[ 1001.045877] usb 2-4: usbfs: process 3166 (mtp-folders) did not claim interface 0 before use

Does anyone have any idea about what to do?

EDIT:

I also tried the PTP mode. Again, reading works fine, but I cannot write anything to the device.

Since Ubuntu 13.04, storage access to external devices via MTP works out of the box via a GVFS-MTP module.

Related question: Are there any plans to improve mtp support on future Ubuntu releases?

For troubleshooting, see this answer.

For me, it was a problem of not having the latest libmtp files on my system. So I fixed the problem and made this write-up to help others.

Summary of the link: There was a bug in the libmtp bundled with older Ubuntu releases. This bug was already fixed in the latest source of libmtp.

Just a small workaround, connect your ICS based phone with good old MASS STORAGE http://forum.xda-developers.com/showthread.php?t=1556367

adb install UMS1.0.apk


ps does not work after upgrading to 14.04 (/usr/bin/dpkgd/ps: error while loading shared libraries) I recently upgraded from Ubuntu 12.04 to 14.04, now on starting my terminal and running ps throws the following error :

  /usr/bin/dpkgd/ps: error while loading shared libraries: libproc-3.2.8.so: cannot open shared object file: No such file or directory

How can this be resolved?

When I update 12.04 to 14.04, the same problem. Finally solve it by following command.

sudo apt-get install procps
ln -s /bin/ps /usr/bin/ps


How to restart every 30 minutes automatically? I would like to schedule a restart of my Ubuntu every 30 minutes. Is there any command or a graphical way to do it?

The best way to do this will depend on why you want Ubuntu to restart every half hour.
So I recommend editing your question to explain why you wish to do this.
Rebooting every 30 minutes, and warning users before each reboot:
Assuming people might be using the machine, either locally or remotely, it's best to avoid restarting Ubuntu from under them without any warning. Therefore, rather than scheduling the reboot command, I recommend scheduling the shutdown command so it warns the user.
To schedule a shutdown every half hour with a warning 5 minutes before, add this to /etc/crontab:
#minute hour    mday    month   wday    user    command
*/30    *       *       *       *       root    shutdown -r +5

You don't actually have to add the fist line, which is a comment. I've included it for clarity--something like it is there already.

This will schedule the system to go down for reboot (-r) five minutes after (+5) the command runs. It runs every at every half hour mark (*/30). See man cron and man 5 crontab.
Change +5 to something else to change how long users have after being warned of reboots.
0,30 under minute will also work, if you prefer that. (Similarly, if it were every 20 minutes, you could write */20 or 0,20,40.)
Make sure /sbin is in the PATH variable specified near the top of /etc/crontab. Otherwise, shutdown (under command) will have to be invoked as /sbin/shutdown.

The command will always run on the half-hour mark, if the machine is up and running at that time. This will cause the shutdowns to be announced every half hour and performed at 5 minutes and 35 minutes past the hour.

One benefit here is that an administrator can cancel the just-announced shutdown with sudo shutdown -c.
If the computer is down during the specific times when the scheduled command is to be run, it will not run. If that's not adequate to your needs, you'll have to schedule your reboots differently. (This is not specific to the use of shutdown but would apply equally if you were scheduling reboot.) In that case, please edit your question to explain your specific needs. (I'd recommend anacron for this, but your time intervals are far too short.)

Making it easier for administrators to prevent automatic reboots from happening at all:
You might want to set this up so that it's easy for an administrator to suspend all automatically scheduled reboots:
#minute hour    mday    month   wday    user    command
*/30    *       *       *       *       root    [ -e /etc/noautoreboot ] || shutdown -r +5

This schedules reboots the same way--every half hour, with five minutes warning--except that it will not schedule a reboot if a file called noautoreboot exists in /etc.

This control file can be created by an administrator with:
  sudo touch /etc/noautoreboot

It can be deleted with:
  sudo rm /etc/noautoreboot

Note that it's whether or not the file exists, not what it contains, that matters.

If the reboot is scheduled and users are warned, then the file is created, the (immediately upcoming) reboot will still occur.

How does this work? It uses a short-circuit-evaluated or operator (||) as shorthand for:

If /etc/noautoreboot doesn't exist, run shutdown -r +5.

This answer explains how short-circuit and and or operators can perform if-then logic. For a brief, intuitive and highly informal explanation, you can read the command this way:

/etc/noautoreboot exists! Or, run shutdown -r +5.

See man [ to see how the test itself is performed.

Use cron to schedule a job every 30 minutes.  Point that job at a shell script that simply has

reboot

in it.

Since cron runs as root, you shouldn't need to do anything special in terms of permissions.

Update

Yes I do, in fact I never on any of my systems allow user based crontabs (There are better ways of allowing users to do user level scheduled tasks) cron was designed from the very beginning purely for system automation and not for users to schedule ordinary tasks.  Things such as log rotations (which still happens today)

Reboot MUST be run as root to work correctly, the alternative is to set it's sticky bit, so that when run as a regular user it actually executes as root and works as expected, but in doing that your then opening your server up to allowing regular users to reboot it at will.

You could even possibly automate a call to SUDO, but I need to dig into that one, not sure if you can automate the need for a password with SUDO (I don't use it often, i prefer to just drop straight to a root shell using SU)

If you set it up in system wide crontab then everything is run as root, so my statement is accurate (I just neglected to mention that the system wide one should be used)

As for your question "Why Wrap it in a script?" well, why not?  If the OP puts it in a shell script, then at some point in the future needs to add to it, he simply adds to the script, instead of having to open crontab locate the job, remove it, replace it with a shell script, then write a script with the old + new in.

Over 20 years as a Sys Admin / Developer working with systems as far back as Ultrix / Solaris and even VAX has taught me one major point.

If you can make it easier at the beginning, then it remains easy for it's life time.

I really don't get this "Minimalistic" attitude that a lot of modern day sys admins have, where doing as little as possible is the key to success.  Most servers these days are easily 20 times+ more powerful than anything I ever started out on, and this kind of scenario (Wrapping in shell scripts) was recommended practice then, so there's really no argument for not doing it now.

Unless you really want to go hardcore Unix/Linux, in which case tag it all onto the cron entry, and pipe everything together the way it ought to be done :-)

However, I do digress, and also understand that many guys these days a thrown in at the deep end and told to make things work, as such they lack the time (and usually the inclination) to sit down and learn about new techniques (or old in this case) or even want to play with this stuff outside of work.

I personally, have a single server among the ones I run that's dedicated purely for me to play around on, so I can test things like this... which is better A or B, so it's not without reason that I advise on any of this.


Internet conection problem when updating Ubuntu 12.04 to 14.04 Server Upgraded my server's software from Ubuntu 12.04 to Ubuntu 14.04 and now the server cannot access the internet.

I can ping devices on my LAN, including my modem. When I try to ping any site on the internet (8.8.8.8 for example), I get 100% packet loss. I feel like this may be a DNS issue from what I've been reading. I've added the following line to /etc/network/interfaces :

dns-nameservers 8.8.8.8 8.8.4.4

with no success.

Relevant outupt of ifconfig :

eth0     Link encap:Ethernet  HWaddr 64:31:50:1f:88:72
          inet addr:192.168.0.222  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::6631:50ff:fe1f:8872/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:575229 errors:0 dropped:55 overruns:0 frame:0
          TX packets:10313 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:35490659 (35.4 MB)  TX bytes:898607 (898.6 KB)

output of route -n:

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.0.1     0.0.0.0         UG    0      0        0 eth0
192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0

Content of /etc/network/interfaces file :

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static

address 192.168.0.222
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
gateway 192.168.0.1
dns-nameservers 8.8.8.8 8.8.4.4

output of tracepath 8.8.8.8 :

1?: [LOCALHOST]                                         pmtu 1500
1:  192.168.0.1                                           0.446ms
1:  192.168.0.1                                           0.444ms
2:  no reply`
3:  no reply`
//continues with no reply until interrupted

Looks like an unusual one this...

Firstly I sincerely doubt that DNS is involved, though if you are using 8.8.8.8 et al for your DNS then DNS will fail because you can't reach those servers.

Firstly it can't be your LAN configuration because you can ping your local gateway, so traffic to and from it works.

The biggest hint is the double listing of your gateway in the trace. Your gateway should only be shown once, and this hints at a loop at your gateway - but all your other systems work fine, and according to what you write, it's only the local system that changed.

The only thing that I can remotely think of is if you had an iptables rule roughly like this:

iptables -t nat -D POSTROUTING ! -d 192.168.0.0/24 -j SNAT --to-source 1.2.3.4

Where 1.2.3.4 is some bogus or possibly previously valid IP address that no longer works.

This would let local traffic work but anything going out beyond the local network would break because replies would go to the wrong place. Your gateway may block traffic like that because it is in essence 'spoofed' traffic.

I think you would get a good hint to the issue with some traffic inspection at your gateway if it is at all possible.

If you can't do that - quite understandable - then maybe set up another Linux box on your network and make it the default gateway for this faulty system, and then you can inspect the traffic it is generating. This is assuming that the fault is on the upgraded system. If you configured that 2nd Linux box to ip_forward and make it's gateway the 192.168.0.1 device you might also see more useful info to help nail down the cause.

Will be interesting to see what it was when you finally get it sorted.

I had exactly the same situation - no internet connection, no ping to outside, no ping from router to the box. But a working SSH connection from another workstation in the same LAN.
The cause was the router who was blocking the new box as it had the same IP as the replaced old box, but a different MAC address.
As soon as I changed the IP everything worked.


nvidia-smi stops working after reboot ununtu 18.04 I have Ubuntu 18.04 installed on ASUS laptop with GEFORCE 940MX GPU card. I have tried everything using proprietary drivers or using NVIDIA run file to install cuda drivers. Finally, I was able to install NVIDIA and CUDA drivers using cuda run file.
OpenGL and NVIDIA-X-config were not installed during this installation.
Also, secure boot is disabled prior to installation.

Now, nvidia-smi works after this installation, but whenever I reboot system it gives error:
"NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running."

It will be really helpful if experts can comment how to overcome this issue.
Thanks in advance

This is most probably the nvidia graphics compatibility problem, so you shouldn't use the .run installer. Use the driver from ubuntu graphics ppa, then download the .deb and install cuda-toolkit.


How to install Qualcomm Atheros AR9565 wireless drivers? I purchased an HP laptop with the Qualcomm Atheros AR9565 (QCWB335) wireless adapter. I understand that this adapter is currently not supported on Ubuntu 12.04 and there is no way to get wireless access.

I installed compat-wireless-3.6.6-1 ath9k driver and it didn't work, lshw -C network still showed *-network UNCLAIMED after reset.

How can I figure out when Ubuntu will have driver for AR9565? Is there a workaround to get wireless working somehow?

Here's one way to solve this. I myself had the same problem as mentioned here. I followed two posts on ubuntuforum by anoop-n2 and chili555, and kind of did a mix of things, which can be outlined as follows:

You need to have linux-headers-generic and build-essential installed, try

sudo apt-get install linux-headers-generic build-essential

which will turn out to be of the newest version if those are already there.

The following should be done in a terminal as root:

sudo -i
wget https://www.kernel.org/pub/linux/kernel/projects/backports/stable/v3.9-rc4/compat-drivers-3.9-rc4-2-s.tar.bz2
tar xvf compat-drivers-3.9-rc4-2-s.tar.bz2
cd compat-drivers-3.9-rc4-2-s/
./scripts/driver-select ath9k
make

Now this will probably give the following error:

error: redefinition of ‘kref_get_unless_zero’
include/linux/kref.h:47:32: note: previous definition of ‘kref_get_unless_zero’ was here

In this case, open the header file, and find the entire block of the function:

static inline int __must_check kref_get_unless_zero(struct kref *kref)
{
    return atomic_add_unless(&kref->refcount, 1, 0);
}

Next comment out the entire block of the function using line comment (put // in front of each line) or block comment in c as,

/*static inline int __must_check kref_get_unless_zero(struct kref *kref)
{
    return atomic_add_unless(&kref->refcount, 1, 0);
}*/

then type the following commands one by one:

make
make install

Then load the driver using

modprobe ath9k

or reboot the system. Afterwards the wifi should be working.

Qualcomm Atheros QCA8172 on Lenovo G505 - Ubuntu 13.04 works perfectly on Lenovo G505 - make sure you do a clean install of Ubuntu 13.04 vs a 're-install'. Wi-Fi/LAN keyboard mouse everything works perfectly.

I'd spent all day looking for drivers, but the ones included in ubuntu 13.04 already support Qualcomm Atheros QCA8172 network driver card. Cheers


Live USB won't boot properly on Asus EEE PC 1201HAB For some reason, I never get an X session going. I see a bunch of startup text messages, then it just stops. I checked the Xorg.0.log and it looks like there's some issue with the vesa driver? I tried the 'nomodeset' boot option, that didn't help. Any help would be greatly appreciated.

Trying to manually "startx" results in these errors:

vesa: Ignoring device with a bound kernel driver
(EE) open /dev/fb0: No such file or directory
(EE) Screen(s) found, but none have a usable configuration.

Output of lspci | grep -i vga:

00:02.0 VGA compatible controller: Intel Corporation System Controller Hub (SCH Poulsbo) Graphics Controller (rev 07)

I heard this error has something to do with Linux kernel 3.0 and something about a kernel-based video driver?

do you see black screen after boot-up ?
If yes, then just login use command --> login <user-name>
Then it will ask for password, so enter your password.

And then you will see terminal. Now type startx.

And everything works well you will see the GUI.


clean up a memory stick I'm trying to create a bootable copy of Kubuntu on a memory stick using the Startup Disk Creator.  The trouble is that the memory stick seems to be incorrectly formatted.  The KDE Partition Manager indicates that /dev/sdb1 is there and occupies the whole disk, but when I try to check and repair the partition I get a message "There were errors while applying operations.  Aborted."

Does that mean that the memory stick is actually defective?  If it isn't, how can I get past this?

I've most often seen gparted used for partitioning & formatting, it's quite robust & should give you more detailed error messages than "there were errors." I wouldn't assume the usb were bad just yet.
You could use a terminal to check the drive's filesystem too (not really necessary just to repartition / reformat) with fsck /dev/sdb1 probably. It should be unmounted first (umount).
And sudo parted -l or sudo fdisk -l should say what filesystem type it has, fsck (and mount) can usually auto-detect the type, but you can pick the specific fsck.ext3 or fsck.vfat and use different options, if interested.

For creating a live usb I'd use a technique like described here on pendrivelinux.com or here on archlinux's wiki, or here:

See https://askubuntu.com/a/554834/129271
Cliff Notes:

Mount the usb
Install grub grub-install --force --no-floppy --boot-directory=/mnt/USB/boot /dev/sdx (replacing x with your actual USB device & /mnt/usb with mounted dir)
Put demo grub.cfg ( http://pendrivelinux.com/downloads/multibootlinux/grub.cfg ) in /mnt/USB/boot/grub and edit to match your iso's

I don't partition memory sticks. I fixed the not recognizing the memory stick problem this way. Using Startup Disk Creator to make a boot-able memory stick works OK as long as you don't try to Erase the memory stick. The memory stick looses its FAT32 table if you Erase, making it unrecognizable to the OS. I could not find an App on Ubuntu 15.04 to re-format a memory stick, so I re-formatted to FAT32 on a Windows 7 machine. It takes about ten seconds to do. I was able to create a boot-able memory stick once the FAT32 table was recreated. I am new to Ubuntu, so maybe there is some way under Ubuntu to format memory sticks, but I don't know the name of the App. I have a problem with trying to modify or add to the Ubuntu code.


Internet Timeouts with TP-Link TL-WN821N wireless usb stick - existing solutions dont work I'm running Ubuntu12.04 and I'm trying to get a TP-Link TL-WN821N to work. The solution from Internet Timeouts with TP-Link TL-WN821N v2 wireless usb stick didn't work for me. Neither has anything else...

I've installed rtl8192cu as per instructions I found elsewhere to no avail.

The symptoms I am experiencing are: When I plug in the device the PC can see and connect to wireless networks fine. The network I'm using has internet access and the signal strength is pretty strong. I can't ping and I can't browse the internet (timeout).

Any ideas? I'm not sure what the next step would be or what information would be useful at this point.

First of all, ensure you have the necessary prerequisites:

sudo apt-get install linux-headers-generic build-essential dkms git

Clone the updated driver with git:

git clone https://github.com/pvaret/rtl8192cu-fixes.git

Set it up as a DKMS module:

sudo dkms add ./rtl8192cu-fixes

Build and install the driver:

sudo dkms install 8192cu/1.9

Refresh the module list:

sudo depmod -a

Ensure the native (and broken) kernel driver is blacklisted:

sudo cp ./rtl8192cu-fixes/blacklist-native-rtl8192.conf /etc/modprobe.d/

Let's not take any chances. Instruct Ubuntu to load the new driver when it starts up.

echo 8192cu | sudo tee -a /etc/modules

Reboot.

You're done.

Thanks to P. Varet for this awesome fix.

I had the same problem and solved it by disabling the power management feature.
Just follow the troubleshooting section over here

Gilad


Does Ubuntu support Radeon HD 6750M or 6490M? Looking at a Samsung Series 7 laptop.. Anyone know if Ubuntu supports AMD Radeon HD 6490M or 6750M?

The question is not if Ubuntu supports your hardware or not, it is more if your hardware builder has made any drivers for your hardware to be usable in Linux.

The Radeon HD 6750 is officially supported by ATI's Catalyst drivers and the xserver-xorg-video-ati open source drivers.

The Radeon HD 6750M will work even tough you will find your self with a watermark on the right bottom corner of the screen saying your hardware is not supported. That can be fixed following some simple steps.

The Radeon HD 6490 or the 6490M are not officially supported by ATI's Catalyst drivers but the open source xserver-xorg-video-ati driver should work without a problem.

The xserver-xorg-video-ati open source driver will be installed by default once your card is detected, the performance in not au pair with the closed driver but really big improvements are done with each release so its definitely an option.

You can easily toogle between the open source xserver-xorg-video-ati driver and the closed driver by following these steps.

Yes and you have 3 main options for the ATI video cards under Ubuntu:

the radeon package, which is for the really old video card and only provide a basic support for 2D acceleration
the fglrx package from the official repository, which contains the official closed source driver for the latest ATI video card but is outdated compared to the third option
the official closed source driver from the AMD ATI website and this is your best option http://support.amd.com/us/gpudownload/Pages/index.aspx

for references and documentations you can follow this link http://wiki.cchtml.com/index.php/Main_Page


How to enable disable touchpad from double-clicking on its special area I have a laptop HP-Pavilion-g (1246-ef) running in dual boot Windows and Xubuntu. In Windows I can use its special area (a small dip) in the upper left corner of the touchpad to disable / enable on double click. A small red light is seen when disabled.

Can I activate this feature in Ubuntu? I do not want a workaround. I want a solution to get that working without scripts and commands.

(I am not talking about How to quickly enable/disable touchpad in Xubuntu - that I know.)

(A funny thing: when I disable the touchpad in Windows and then restart in Ubuntu the touchpad cannot be enabled and is not seen as disabled in Ubuntu. But if I shut down completely (shut down, not restart) and boot in Ubuntu, this setting is reset and the touchpad is active. But maybe this has not much to do with the above question)

(X)ubuntu 14.04 3.13.0-39-generic

NOTE that this question is aiming exclusively at using in X(ubuntu) the hardware option that the laptop has (that is the 'dip', that button), and NOT at finding a workaround, a terminal command or a software option to disable the touchpad.

You should report this as a bug. The best place to report this is the xserver-xorg-input-synaptics package (FreeDesktop Bugs). See this question for good bug reporting guidelines. You can also post the bug link here, and I will update its status periodically. I have placed a workaround down below in case you want to try an alternate solution. Please note that you will be reporting a bug to the FreeDesktop system. After logging in, choose report a bug. Report the bug against the Xorg package. When prompted for the component, make sure to select input/synaptics. Fill in any other specific information that is needed.

  Bug Tracker for ID NaN

  Status: Lookup Error 3
  Importance: Lookup Error 3
  Assigned To: Lookup Error 3

  (Link to Bug)

In a short answer, this is not possible because there are no Linux drivers that do this. (Report a bug to possibly get one!)

This touchpad works by having that dipped area be its own button. When it is double-tapped, the Windows driver says "Hey, I should disable/enable the touchpad!". It then sends the disable or enable message to the touchpad, settings its state.

When you reboot, power to the touchpad isn't lost. So, whatever state it was in is kept. When you fully shut down, power is lost, so the state is reset.

AFAIK, there is no method to do this with that dip, at least kernel-wise. You may be able to write your own driver, but that is beyond the scope of this question (and possibly even this site).

You may be able to do a little workaround, which goes like this:

First off, find your touchpad in xinput-list. Remeber the ID.
Save this into /usr/bin:

#!/bin/bash

if [ -e /tmp/mouse-disabled ]; then
  rm -f /tmp/mouse-disabled
  xinput enable [id]
else
  touch /tmp/mouse-disabled
  xinput disable [id]
fi;
Replace all instances with ID with your proper id.
Create a Keyboard Shortcut. Make this the program to be run, and assign any keybind you want. I used Win+Ctrl+T for a while.

(Sourced from most posts here and this post.)

Ok let me give you the exact closet solution to your question, since it seems there are not many touchpad tweak tools.

Commands to enable or disable touchpad:

Enable touchpad:

xinput --set-prop 'FSPPS/2 Sentelic FingerSensingPad' 'Device Enabled' 1

Disable touchpad:

xinput --set-prop 'FSPPS/2 Sentelic FingerSensingPad' 'Device Enabled' 0

The parameter 'FSPPS/2 Sentelic FingerSensingPad' is the device name for my touchpad.

You can find your own device name by using this command:

xinput --list

You want to install CCSM. Command:

sudo apt-get install compizconfig-settings-manager

Open it from the main menu.

Click on the 'commands' option

Input the disable touchpad command on the line you want and assign the key/button/edge binding you want to use to disable the touchpad.

That's the best workaround I can give right now. I'll see if I can find something better.


Batch rename directories? I have several directories with the format of the year, month, and day followed by a description of the event. For example: "2012 05 26 - EventA", "2012 05 26 - EventB". What I would like to do is rename all these directories so that the spaces between the numbers in the date are replaced with dashes. Thus, "2012 05 26 - EventA" becomes "2012-05-26 - EventA". I know I can do this one folder at a time with the mv command, but is there a way to do this in a batch process with wildcards somehow?

Try pyRenamer: http://www.webupd8.org/2010/01/pyrenamer-easy-mass-file-renaming-in.html

or similar: http://alternativeto.net/software/pyrenamer/?platform=linux&license=free

You cannot rename batch files using mv command. You need to write shell scripts, you can get the scripts by doing a google search or you can use the tools mentioned above.


Recovering from NFS file I used to have a NAS storage (STOREX NAS-351). After a firmware upgrade, the system is unresponsive and won't get connected to the network.

I extracted the hard drive, a Western Digital Caviar SE 500 GB, and put it into a USB external case.

I am unable to access is when I plug it into my windows system. However, from an Ubuntu machine, it shows under /dev/sdb

Still, I cannot mount it. I tried with NTFS and I receive errors. I tried running TestDisk and the file type is not recognized.

Anybody has an idea on how to approach this?

Frst you need to make disk image. I recommend you OF Clone or CloneZilla. Then you can use R-Studio for data recovering. R-Studio has also option for image disk. Before you start please check Windows disk manager if disk is detected. If disk make strange noises then is hardware problem.


Getting error with dpkg I recently upgrade my 14.04 server to 14.10 and I got this error message during the upgrade:

Setting up sysv-rc (2.88dsf-41ubuntu18) ...
info: Reordering boot system, log to /var/lib/insserv/run-20141030T2142.log
error: Something failed while migrating.

error: Unable to migrate to dependency based boot sequencing.

See http://wiki.debian.org/LSBInitScripts/DependencyBasedBoot for
more information about dependency based boot sequencing. To
reattempt the migration process run 'dpkg --configure sysv-rc'.

dpkg: error processing package sysv-rc (--configure):
 subprocess installed post-installation script returned error exit status 1

Whenever I install packages/use dpkg I get a very similar error. This never happened on 14.04.

EDIT: Added below is a log that might contain more information

info: Converting rc0.d/S* and rc6.d/S* to K*.
ls: cannot access S*: No such file or directory
ls: cannot access S*: No such file or directory
info: running insserv
insserv: warning: script 'wide-dhcpv6-client' missing LSB tags and overrides
insserv: warning: script 'bind9' missing LSB tags and overrides
insserv: There is a loop between service bind9 and apache2 if stopped
insserv:  loop involving service apache2 at depth 2
insserv:  loop involving service bind9 at depth 1
insserv:  loop involving service sendsigs at depth 4
insserv: exiting now without changing boot order!

I had the exact same problem, but in my case it was caused by the virtuoso-nepomuk script.

Instead of removing bind9 and apache, I would suggest just moving their scripts out of the /etc/init.d directory.  That should allow the process to complete, then you can do an apt-get install --reinstall ... on those packages after you're done updating to get their startup reconfigured properly.

Doing this on a Dell Precision M3800 laptop shipping with Ubuntu, I had to do the same for /etc/init.d/dell*.


Ubuntu 14.04 can't move files from phone storage to computer I have a HTC One m8, and when I plug it in it shows up in Files as "Android Phone". It shows my internal storage automatically, and at the top it says "Contains digital photos Shotwell". But the issue is, when I try to move a file from my phone's internal storage to a place on my computer (drag and dropping), I get an error and it doesn't work. It says there was an error copying it to file into /home/user/... And if I press show more details it says this: Error getting file: -6: Not Supported. Any help would be greatly appreciated, and I have seen others having this problem but no solution.

1) Close Shotwell

2) Open Nautilus

3) Select your source device from the left column

4) click File, then New Tab

5) Select your target directory from the left column

6) Go to the original tab. Select all the files you wish to move. right click on one of the highlighted files and choose cut.

7) Go to the target tab. Right click in an empty space in the folder and choose paste.

on the phone, go to settings>storage and then open the menu and select "usb commputer connection".set it to mtp, and try it and then see if setting it to ptp does anything. It seems like it is set to the original ptp type method, but not the compatibility version.


I moved files to NTFS and cant start GUI in ubuntu 14.10 The problem showed up when i moved folders with cache to my ntfs drive and made symbolic links to it (don't quite remember exact locations of them /var/cache , /var/tmp I guess also /home/roman/.cache and so on)

When i restarted the system it booted in terminal (didnt start desktop environment)
I thought that its becouse my ntfs drive is not mounting at the startup so i mounted it to the same place as it was mounting before used sudo mount /dev/sda1 /media/roman/R  (and i succeed because i entered to the folder cd /var/cache which i could not enter when it was not mounted)

Than i used startx command thought it going to start but it didnt !

Any suggestions to a noob user ?

You can't use NTFS for Unix system files and directories. NTFS has very different semantics of owner/permission; an awful lot of system files in /var/ depend on the exact unix semantics. Sadly, moving folders and file from /var destroyed the information of user/group/permissions...

The problem you have now is similar to this: How to recover after all files are deleted from /var folder? ; I suggest you follow the @Rinzwind answer.

Is your disk being mounted  on startup automatically? make sure the disk mounts itself by editing the entry in /etc/fstab. or try reconfiguring the package using

  sudo dpkg-reconfigure gdm

you may have to Install this package if system doesn't find it at all.

Good Luck.


How can I restart pulseaudio without having to logout? Sometimes the pulseaudio service stops and it doesn't restart itself when I open an audio file with banshee or totem.

How I can make pulseaudio start again without having to logout?

I solved my problem.

Check if any pulseaudio instance is running:

pulseaudio --check

It normally prints no output, just exit code. 0 means running.
Mine were not running, so I just advanced to step 3.
If any instance is running:

pulseaudio -k

Finally, start pulseaudio again as a daemon:

pulseaudio -D

Start banshee again and enjoy!

You would run this command to restart PulseAudio in Ubuntu 2020 releases:
systemctl --user restart pulseaudio


How to clear recently used files without using a terminal? How can I clear the recently used and viewed files without using terminal?

It depends on whether you're using Unity or the Classic desktop.

In Unity, the recent documents that you see in the Files lens are logged using Zeitgeist. If you don't want to use the terminal to remove these, or only want to remove a few of them, the best thing to do is install "Activity Journal" using the Software Center. Fire up the Activity Journal, and you'll see all your recently used apps and documents, grouped by day. If you right click a document and click "Delete item from Journal", Zeitgeist will forget that you used that document at that specific time. If you click "Delete all items with this URL", Zeitgeist will forget you ever used that document. If you want to delete everything, this terminal command (which others have already posted) will do the job:

rm ~/.local/share/zeitgeist/activity.sqlite
zeitgeist-daemon --replace

There's a Zeitgeist Global Privacy app in development which will make this easier, but unfortunately it's not released yet.

The Classic desktop (and the lists of recently used files in most applications' File menus) stores a record of your recently used documents in ~/.local/share/recently-used.xbel. You can just delete this file using the file manager or copy and paste the following code into a terminal:

rm ~/.local/share/recently-used.xbel

Hope that helps!

remove all children of xml file ~/.local/share/recently-used.xbel

<?xml version="1.0" encoding="UTF-8"?>
<xbel version="1.0"
      xmlns:bookmark="http://www.freedesktop.org/standards/desktop-bookmarks"
      xmlns:mime="http://www.freedesktop.org/standards/shared-mime-info"
/>

and

$ sudo chattr +i ~/.local/share/recently-used.xbel

to make it immutable. drop all event item in sqlite3 database and also make it immutable.

$ sqlite3 ~/.local/share/zeitgeist/activity.sqlite
sqlite> delete from event;
$ sudo chattr +i ~/.local/share/zeitgeist/activity.sqlite


How to enable ANY media playback I just installed 13.10 and now, cannot get ANY media --DVD nor CD-- to work. Have VLC installed, have PAROLE. Neither will play DVD.

Have run a plethora of sudo apt-get install programs. Started with sudo apt-get install libdvdread4...sudo /usr/share/doc/libdvdread4/install-css.sh. DVD still doesn't work.

System is HP 2000-210US. Tried to rip a CD to music file, it said it ripped it, have yet to find where it's at? (NO, it's NOT in the music file--where it should be).

*-disk
     description: ATA DISK
     product: ST980811AS
     Vendor: Seagate
     Physical I.D.  0.0.0.
     bus info:  scsi@0:0.0.0.
     logical name: /dev/sda
     version:   3.AL
     serial:   3LY0746D
     size:   74 Gib  (80Gb)
     capabilities  partitioned partitioned: dos
     configuration:  ansiversion=5 sectorsize=512 signature=0001ef03

*-cd-rom
     description:  DVD-RAM writer
     product:   CDDVDW TS-L633R
     vendor:  HP
     physical i.d.:   0.0.0.
     bus info:  scsi@1:0.0.0.
     logical name:  /dev/cdrom
     logical name:  /dev/sro
     version: 0400
     capabilities:  removable audio cd-r  cd-rw  dvd  dvd-r  dvd-ram
     configuration: ansiversion=5 status=ready
   *-medium
        physical i.d.  0
        logical name: /dev/cdrom

The readout above is result of requested operation. (

Do this to install restricted packages:

sudo apt-get install ubuntu-restricted-extras

Then do this for original DVD support:

sudo apt-get install libdvdread4
sudo /usr/share/doc/libdvdread4/install-css.sh

and this is the medibuntu repository:

sudo -E wget --output-document=/etc/apt/sources.list.d/medibuntu.list http://www.medibuntu.org/sources.list.d/$(lsb_release -cs).list && sudo apt-get --quiet update && sudo apt-get --yes --quiet --allow-unauthenticated install medibuntu-keyring && sudo apt-get --quiet update

sudo apt-get install app-install-data-medibuntu apport-hooks-medibuntu

I rarely get to do this. Here is the 'fix" I found for "DVD playback failure in 13.10". After going through a multitude of commands posted by others, seems all you have to do when installing the "libread4" pkg is to use sudo apt-get install libdvdcss2. Very simple, yes, so why all the B.S. concerning 'fixes". I'm NOT a self-professed 'geek", and it did take awhile to find my answer, but goes to show, not everyone here at this site knows what they're doing!!!(ain't that right, Doug?) Could someone tell me where to post this fix so that it can help others who have the same problem?

PS.  We should consider this thread "solved". And Doug, don't be such a whinner. Why Doug, can you dis someone here, but when I call you out, you gotta whine and block my posts? Just answer that one?


How do I disable the guest session from Lubuntu 14.04? I'm fairly new to Ubuntu and one issue that I have with it is that there is no simple, easy way (as far as I know and please tell me if you have found a better way) to set up fool-proof parental controls. What I did with Ubuntu is to disable the guest account, password protect the admin account, and install ProCon Latte Content Filter on all the basic user’s firefox web browsers and configure them accordingly.

I got a new computer and decided to put Lubuntu 14.04 on it. Works great. Only issue so far: I cannot figure out how to disable the guest session. I searched around, but all the documentation tells me to sudo edit a file that doesn’t exist in Lubuntu 14.04. What does exist are these:

advanced@Dimension5150:/usr/lib/lightdm$ ls

guest-session-auto.sh  lightdm-greeter-session  lightdm-guest-session

advanced@Dimension5150:/etc/lightdm$ ls

lightdm.conf.d            lightdm-gtk-greeter-ubuntu.conf
lightdm-gtk-greeter.conf  users.conf

So, could someone please tell me how to disable the guest session, or remove internet access (networking) from it?

Please see this page in the Ubuntu Desktop Guide. That solution works fine on Lubuntu too.

The instructions:

  If you prefer to not allow guest access to your computer, you can disable the Guest Session feature. To do so, press Ctrl+Alt+T to open a terminal window, and then run this command (it's one long command, even if it may be shown wrapped on the screen - copy and paste to get it right):

sudo sh -c 'printf "[SeatDefaults]\nallow-guest=false\n" >/usr/share/lightdm/lightdm.conf.d/50-no-guest.conf'

  The command creates a small configuration file. To re-enable Guest Session, simply remove that file:

sudo rm /usr/share/lightdm/lightdm.conf.d/50-no-guest.conf

Add this line:

allow-guest=false

to /etc/lightdm/lightdm.conf.d/20-lubuntu.conf. Save the file and reboot.


How to show hidden folders in File Manager (Nautilus) on Ubuntu? How do you show a hidden folder (whose name starts with .) in File Manager a.k.a. Nautilus on Ubuntu?  I am somewhat new to Ubuntu and can't seem to find the "view" menu.

Ubuntu 17.10 and earlier

Maximize the folder.

Go to the top menu -->View->Show hidden files:

Or by pressing ctrl + H.

For permanently showing hidden files, you can go to the Edit>Preferences menu item as shown below:

With the terminal you should:

cd /path-of-directory

ls -a

its really simple

In Ubuntu 18.04, show hidden files is here as shown in the image above...

Isn't it simple

Enjoy!


can't access MBR, GRUB2, freshly installed Ubuntu remains "hidden* (dualboot) -win 10 laptop

-created 160gb partition for ubuntu

-installed ubuntu 16.04 on that partition

-system reboots after installation

-win 10 boots up

-can't find my freshly installed ubuntu.

How can i access MBR or GRUB2 menu?
I have that UEFI thing. i think that's necessary to know.

If you're looking for a way to browse your partitions from within Windows, Windows can't read EXT partitions by default - but there's an application that enables viewing of the partitions. See:

https://superuser.com/questions/37512/how-to-read-ext4-partitions-on-windows

In case that you meant that you can't boot into Ubuntu - maybe you've done something wrong in the installation - where did you install the bootloader when asked? It should be on the root of the root of the hard drive, AFAIR.


Very poor performance on 19.10 fresh install New to Ubuntu and just installed 19.10 earlier today. I installed it using a USB drive and have it set up for dual boot. Windows and Ubuntu both start up fine with no problems.
During setup it was also incredibly slow, and I set the partition to have 100gb.
It would take several seconds for any input or action to happen. For example, Firefox would open fairly quickly but took several seconds before it registered me clicking on it

Eventually I also noticed that it would not let me connect to the internet through wifi.
I have 8gb ram on a 64bit AMD processor.

Did I do something wrong and what can I do to fix this? Here are my resources and disk
Smart data 1
Smart data 2

One consideration is the speed of the HD, which could impact if swap is in use.  Based on your model HD, it is a rotating disk, and as you use space further from the start, disk speed degrades.  Since you have your Linux partition after the majority of the space, you are using the slowest possible space on the drive.  This drive itself is pretty slow to begin with anyway.  To tell if swap space is being used, open a terminal window, and type "free".  You should get an output like the following (this is with 64GB of RAM):

$ free
              total        used        free      shared  buff/cache   available
Mem:       65881252    14549200    48598296      165048     2733756    50491124
Swap:       2097148           0     2097148

If a significant portion is used, then you may be swapping programs constantly, and this can certainly degrade your performance.
You also may want to specify what AMD processor you are using, as there are a wide range of processors at different speeds.

EDIT: original answer below is useless, feel free to downvote at your pleasure. But I learnt a lot from the comments it prompted, and other might be able to learn too. And on that basis think my answer should not be deleted - perhaps to provide as an indication of what is definitely UNLIKELY to help the OP and anyone with a similar problem on THAT version of ubuntu. Also, some users who come to this question might be in a situation where:

They have an older version of ubuntu, and
They don't know that "gparted will only show a swap partition. Newer versions of Ubuntu, if freshly installed, use a swapfile, and you can't see that in gparted." as pointed out in the comments.

I doubt that adding a swap partition will make a major improvement, but you do not seem to have one at the moment.

If you have the time to experiment while waiting for better answers then you may want to take 8gb off your "/" ("root") partition or the windows one, and make it a swap partition - there are plenty of guides online.


Moving files of specific type/extension from one directory to another? Have a large folder filled with a large collection of different files.Ideally, I want to shift all the different files into their respective folders; so jpg files into the jpg folder etc.

Original folder : unsorted_files
destination folder: jpgfolder
I tried

mv /home/tony/Desktop/unsorted_files/*.jpg /home/tony/Desktop/jpgfolder

But got an error "jpgfolder" is not  a directory"

Taking in account that 1) Q said "large collection ... of files" - the list of files might not all fit in one command line buffer (2,084,684 bytes on MY system); and 2) Filenames might contain funny characters ("My Stuff.jpg"); mv is not the best way. Using find, xargs, and the sure knowledge that filenames must NOT contain NUL bytes (or slashes):

find /home/tony/Desktop/unsorted_files/ -maxdepth 1 -type f -iname '*.jpg' -print0 | \
    xargs -0 --no-run-if-empty echo mv --target-directory=/home/tony/Desktop/jpgfolder

Once the echod commands look right, remove the echo, and let mv do the work.

If you have already done mv /home/tony/Desktop/unsorted_files/*.jpg /home/tony/Desktop/jpgfolder BEFORE you created the /home/tony/Desktop/jpgfolder, nothing has been lost, but you must, as other answers have said, mkdir -p /home/tony/Desktop/jpgfolder first.

As far as I know - corrections are welcome - mv does not actually move files, it renames them. So you are trying to rename all jpg files to a folder name.

I would try:

rsync /home/tony/Desktop/unsorted_files/*.jpg /home/tony/Desktop/jpgfolder


users disappear from options menu when given uids under 1000 I wanted to stop particular user names appearing in the list of names at the log in screen. I remembered reading that this could be achieved by changing the user id of the account to something less than 1000 (I think I made it 990). So I did this. That worked fine, but now when I wanted to change it back, the name is not appearing in the list of user accounts in the users and groups menu under administration.

How do I modify the phantom account?

You can change the userid with sudo usermod -u <new id> <username>.

Btw: to hide users from log in screen: How to hide users from the GDM login screen?

The gdm login  lists ubuntu login user with a UID >=1000

So set this UID less than 1000 for the user which you dont want to show in the login screen.

Goto System -> Administration -> Users and Groups

Click the user name, go to advanced settings, then change the "User ID" to a different number less than 1000.