How do I install different (upgrade or downgrade) PHP version in still supported Ubuntu release? I am trying to update to install PHP 5.5, 5.6 or 7.0 in Ubuntu 12.04/14.04/16.04 LTS, and I can only get PHP 5.3.10 for Ubuntu 12.04, PHP 5.5.9 for Ubuntu 14.04 or PHP 7.0.4 for Ubuntu 16.04 using official repositories (using apt-get).

I'm not really sure how to do a manual update – as I need:

to play around with the new(est) PHP features
to install older PHP version due support in the software

You could use a PPA to stay up-to-date with PHP or install previous version of PHP (f.e. PHP 5.6 on Ubuntu 16.04 LTS).

The most widely used repositories come from Ondřej Surý, the Debian PHP maintainer:

ppa:ondrej/php  (for PHP 5.6/7.0/7.1 co-installable versions, PHP 5.5 is no longer supported)

The php5 compat packages:

ppa:ondrej/php5-compat  (for dummy php5 to satisfy dependencies in the old packages)

(Click here for instructions on using PPAs.)

PHP PPAs previously contained Apache 2.4 update.  This is no longer a case, you need to add separate Apache 2.4 repository:

ppa:ondrej/apache2  (for Apache 2.4)

If you want use these PPAs, do this:

ppa:ondrej/php  (for PHP 5.6/7.0/7.1)

sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install php7.1   # for PHP 7.1
sudo apt-get install php7.0   # for PHP 7.0
sudo apt-get install php5.6   # for PHP 5.6

To switch between installed versions use

sudo update-alternatives --config php

Then you must set Apache to work with right version:

sudo a2dismod php7.1         # unload the current version
sudo a2enmod  php5.6         # load the version you need
sudo service apache2 restart # restart webserver to apply

ppa:ondrej/php5-compat  (for php5 compat)

sudo add-apt-repository ppa:ondrej/php
sudo add-apt-repository ppa:ondrej/php5-compat
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install php5 # this will pull php5.6 package

If you don't have add-apt-repository binary do the following:

sudo apt-get install python-software-properties

Precautions:

Are PPA's safe to add to my system and what are some "red flags" to watch out for?
Each version of PHP has its own set of modules and php.ini.

PHP 5.4

Prepackaged latest PHP 5.4 now resides in separate PPA:
ppa:ondrej/php5-oldstable

Please be aware that PHP 5.4 has reached its end of life on 3. September 2015 and it doesn't receive any security updates.  It's recommended to migrate to at least PHP 5.6 that will receive security updated till 31. December 2018.

It will take some time for PHP 5.4 packages to make their way into Ubuntu, as there are an awful lot of dependency checks to do. Ubuntu 12.04 is now in beta so I doubt they'll upgrade it to PHP 5.4 (although I have no official or inside knowledge of this) -- it probably won't appear until Ubuntu 12.10 in October this year. If you want it sooner than that, you'll either have to find a third-party package or learn to build it yourself from the source code.


How to install pip for python 3 in ubuntu 12.04 LTS I am trying to install the Pillow module for python 3.3, but for that  I need to install pip.
Every time that I install pip it installs for python 2.7, any help?

2018 Update: This is still attracting upvotes which worries me.

12.04 has been unsupported for about a year now. The best way you can install pip3 is by upgrading to a newer, supported version of Ubuntu. You have 3 LTS versions to pick from.

While on more modern versions of Ubuntu you could just sudo apt-get install python3-pip (and then use pip3), a Python 3 copy of pip was never packaged for 12.04.

Therefore you need to follow the more old fashioned install route with easy_install:

sudo apt-get install python3-setuptools
sudo easy_install3 pip

Now, there is every chance that this will clash with Python 2's pip and override /usr/bin/pip, because it will install a python3 based /usr/local/bin/pip which is also in Ubuntu 12.04's $PATH.

It shouldn't overwrite it so as long as you know that, it might be acceptable. However it might be best to start investigating the happy world of virtualenv as this answer suggests.

Alternatively you could rename the easy-installed python3 version of pip:

sudo mv /usr/local/bin/pip /usr/local/bin/pip-3

Then you can confirm your existing pip is still python2.7 based:

pip --version

It is not available in older package manager versions.
Upgrade your package manager version using sudo apt update && sudo apt upgrade -y and it works perfectly fine.


Ubuntu 20.04 and 20.10, /etc/securetty: No such file or directory Just updated to 20.04 final release, and I'm seeing these messages in /var/log/auth.log...
May 14 06:29:52 Satellite-E55 gdm-password]: pam_unix(gdm-password:auth): Couldn't open /etc/securetty: No such file or directory
May 14 07:40:14 Satellite-E55 su: pam_unix(su:auth): Couldn't open /etc/securetty: No such file or directory

I looked back at a 19.10 VM, and /etc/securetty was there. All my 20.04 systems are missing this file. Two 20.04 installations are upgrades, and one installation is a fresh install VM.
What's up with this file missing in 20.04? Should I restore a copy from 19.10?
Update #1:
The same problem occurs in 20.10, in both upgrades and fresh installs.

Here's a copy of /etc/securetty from a 19.10 desktop installation. Only tested for a couple of minutes, but so far /var/log/auth.log is quiet.
When placed into /etc the file should look like this:
-rw-r--r-- 1 root root 4.1K May 14 10:31 securetty

Here are the /etc/securetty contents:
# /etc/securetty: list of terminals on which root is allowed to login.
# See securetty(5) and login(1).

console

# Local X displays (allows empty passwords with pam_unix's nullok_secure)
:0
:0.0
:0.1
:1
:1.0
:1.1
:2
:2.0
:2.1
:3
:3.0
:3.1
#...

# ==========================================================
#
# TTYs sorted by major number according to Documentation/devices.txt
#
# ==========================================================

# Virtual consoles
tty1
tty2
tty3
tty4
tty5
tty6
tty7
tty8
tty9
tty10
tty11
tty12
tty13
tty14
tty15
tty16
tty17
tty18
tty19
tty20
tty21
tty22
tty23
tty24
tty25
tty26
tty27
tty28
tty29
tty30
tty31
tty32
tty33
tty34
tty35
tty36
tty37
tty38
tty39
tty40
tty41
tty42
tty43
tty44
tty45
tty46
tty47
tty48
tty49
tty50
tty51
tty52
tty53
tty54
tty55
tty56
tty57
tty58
tty59
tty60
tty61
tty62
tty63

# UART serial ports
ttyS0
ttyS1
ttyS2
ttyS3
ttyS4
ttyS5
#...ttyS191

# Serial Mux devices    (Linux/PA-RISC only)
ttyB0
ttyB1
#...

# Chase serial card
ttyH0
ttyH1
#...

# Cyclades serial cards
ttyC0
ttyC1
#...ttyC31

# Digiboard serial cards
ttyD0
ttyD1
#...

# Stallion serial cards
ttyE0
ttyE1
#...ttyE255

# Specialix serial cards
ttyX0
ttyX1
#...

# Comtrol Rocketport serial cards
ttyR0
ttyR1
#...

# SDL RISCom serial cards
ttyL0
ttyL1
#...

# Hayes ESP serial card
ttyP0
ttyP1
#...

# Computone IntelliPort II serial card
ttyF0
ttyF1
#...ttyF255

# Specialix IO8+ serial card
ttyW0
ttyW1
#...

# Comtrol VS-1000 serial controller
ttyV0
ttyV1
#...

# ISI serial card
ttyM0
ttyM1
#...

# Technology Concepts serial card
ttyT0
ttyT1
#...

# Specialix RIO serial card
ttySR0
ttySR1
#...ttySR511

# Chase Research AT/PCI-Fast serial card
ttyCH0
ttyCH1
#...ttyCH63

# Moxa Intellio serial card
ttyMX0
ttyMX1
#...ttyMX127

# SmartIO serial card
ttySI0
ttySI1
#...

# USB dongles
ttyUSB0
ttyUSB1
ttyUSB2
#...

# LinkUp Systems L72xx UARTs
ttyLU0
ttyLU1
ttyLU2
ttyLU3

# StrongARM builtin serial ports
ttySA0
ttySA1
ttySA2

# SCI serial port (SuperH) ports and SC26xx serial ports
ttySC0
ttySC1
ttySC2
ttySC3
ttySC4
ttySC5
ttySC6
ttySC7
ttySC8
ttySC9

# ARM "AMBA" serial ports
ttyAM0
ttyAM1
ttyAM2
ttyAM3
ttyAM4
ttyAM5
ttyAM6
ttyAM7
ttyAM8
ttyAM9
ttyAM10
ttyAM11
ttyAM12
ttyAM13
ttyAM14
ttyAM15

# Embedded ARM AMBA PL011 ports (e.g. emulated by QEMU)
ttyAMA0
ttyAMA1
ttyAMA2
ttyAMA3

# DataBooster serial ports
ttyDB0
ttyDB1
ttyDB2
ttyDB3
ttyDB4
ttyDB5
ttyDB6
ttyDB7

# SGI Altix console ports
ttySG0

# Motorola i.MX ports
ttySMX0
ttySMX1
ttySMX2

# Marvell MPSC ports
ttyMM0
ttyMM1

# PPC CPM (SCC or SMC) ports
ttyCPM0
ttyCPM1
ttyCPM2
ttyCPM3
ttyCPM4
ttyCPM5

# Altix serial cards
ttyIOC0
ttyIOC1
#...ttyIOC31

# NEC VR4100 series SIU
ttyVR0

# NEC VR4100 series SSIU
ttyVR1

# Altix ioc4 serial cards
ttyIOC84
ttyIOC85
#...ttyIOC115

# Altix ioc3 serial cards
ttySIOC0
ttySIOC1
#...ttySIOC31

# PPC PSC ports
ttyPSC0
ttyPSC1
ttyPSC2
ttyPSC3
ttyPSC4
ttyPSC5

# ATMEL serial ports
ttyAT0
ttyAT1
#...ttyAT15

# Hilscher netX serial port
ttyNX0
ttyNX1
#...ttyNX15

# Xilinx uartlite - port
ttyUL0
ttyUL1
ttyUL2
ttyUL3

# Xen virtual console - port 0
xvc0

# pmac_zilog - port
ttyPZ0
ttyPZ1
ttyPZ2
ttyPZ3

# TX39/49 serial port
ttyTX0
ttyTX1
ttyTX2
ttyTX3
ttyTX4
ttyTX5
ttyTX6
ttyTX7

# SC26xx serial ports (see SCI serial ports (SuperH))

# MAX3100 serial ports
ttyMAX0
ttyMAX1
ttyMAX2
ttyMAX3

# OMAP serial ports
ttyO0
ttyO1
ttyO2
ttyO3

# User space serial ports
ttyU0
ttyU1

# A2232 serial card
ttyY0
ttyY1

# IBM 3270 terminal Unix tty access
3270/tty1
3270/tty2
#...

# IBM iSeries/pSeries virtual console
hvc0
hvc1
#...
#IBM pSeries console ports
hvsi0
hvsi1
hvsi2

# Equinox SST multi-port serial boards
ttyEQ0
ttyEQ1
#...ttyEQ1027

# ==========================================================
#
# Not in Documentation/Devices.txt
#
# ==========================================================

# Embedded Freescale i.MX ports
ttymxc0
ttymxc1
ttymxc2
ttymxc3
ttymxc4
ttymxc5

# LXC (Linux Containers)
lxc/console
lxc/tty1
lxc/tty2
lxc/tty3
lxc/tty4

# Serial Console for MIPS Swarm
duart0
duart1

# s390 and s390x ports in LPAR mode
ttysclp0

# ODROID XU4 serial console
ttySAC0
ttySAC1
ttySAC2
ttySAC3

The error is correct its not a typo my friend .
The issue is ubuntu is gradually shifting towards snap because of which it has implimented the securetty file in /snap/core/9804/etc/securetty rather then usual /etc/securetty .
Whereas debian haven't change the kernel code according to that so its just a matter of replacing the locattion of securetty in pam_unit file .
I dont know how to do that but if someone knows about that please let us know . I am sure that would solver this bug


Is Ubuntu LTS based on Debian Unstable or Testing? I've read that Ubuntu (ie 15.10) takes its code from Debian unstable. So where does the code for Ubuntu LTS come from? Is it also from unstable or more from the testing branch?

I'd like to move from Debian to Ubuntu server with LTS so I don't have to do yearly upgrades and instead hold off for 2-3 years. I know Debian 8 now offers LTS, but a few of the packages can be a bit behind.

It's true technically that Ubuntu LTS is based on a snapshot of Debian Testing whereas other Ubuntu releases are based on Debian Unstable.

However, this is a simplistic way of looking at it.  It mustn't be forgotten that Debian Stable, too, comes originally from Debian Unstable, and Debian Stable is a very polished final product - so the fact that something spent time in Debian Unstable earlier in its life cycle is not an indication of its quality in the final release.  After Ubuntu branches off the packages it imports from Debian, Ubuntu and Debian then independently continue the process of fixing and tracking bugs and getting packages ready for release, following their own separate processes and timelines.

In the case of Ubuntu LTS, it branches off from Debian at a later stage in Debian's process: once Debian's branched it off into Debian Testing - implying Ubuntu will benefit from more of Debian's own testing and bug fixing prior to the point at which Ubuntu's process starts.  The primary way in which Ubuntu will benefit is reduced effort getting the packages ready for release.  Ubuntu has different release goals and requirements to Debian which indicates that an Ubuntu LTS won't necessarily be equivalent to a Debian Stable.

Another thing to consider is the distinction Ubuntu makes between packages it supports officially (eg main/restricted) and packages it provides only "community support" for (eg universe/multiverse).  The packages in the latter will be modified relatively little after the import from Debian.

And lastly, there are quite a few packages in Ubuntu that are not sourced from Debian at all, for commercial or licensing reasons or because they are Ubuntu specific.

LTS takes it code from Debian Testing. If you are running a server I would stick with Ubuntu 14.04 LTS until 16.04 LTS comes out. I probably won't switch to 16.04 LTS when it first comes out on my server.

I switched to ubuntu because of issues finding the latest packages with debian. How Ubuntu uses PPAs is awesome to say the least.


Find (and reinstall) packages with corrupted files (without breaking anything) I usually prefer to fix a Linux system than to reinstall from scratch. My computers have seen many distribution upgrades and a list of PPAs or third-party repositories. APT usually makes sure that everything works in the end. However, the fact that the package manager thinks that all required packages are 'installed' does not guarantee that all the files are present on the file system.

Such a such situation may occur if you have to work-around dependency problems with dpkg --force-*. One could also reproduce such a situation by deleting a file from /usr as root.

Is there a simple way to verify whether all files belonging to an installed package are present?

If a such a problem package is found, aptitude reinstall fixes the problem.

From the debsums man page:

apt-get install --reinstall $(dpkg -S $(debsums -c) | cut -d : -f 1 | sort -u)
       Reinstalls packages with changed files.

I just ran this on my system because the disk content was randomly corrupted while I was experimenting with a beta OS.  Here's what I did (and it seems to have worked well):

First, I installed 'debsums' and ran it to see if I had any corrupt files on my system:

$ sudo apt-get install debsums
$ sudo debsums_init
$ sudo debsums -cs
/usr/share/bash-completion/completions/ssh
/usr/share/icons/hicolor/scalable/actions/cheese-take-photo.svg
/usr/share/gnome/help/gnumeric/C/files-textopen.xml
/usr/share/dbus-1/services/indicator-sound.service
/lib/modules/3.11.0-12-generic/kernel/drivers/mtd/ubi/ubi.ko

As you can see, I have five corrupt files so I need to reinstall them.  This is how I found which packages contain the corrupt files:

$ sudo debsums -c | xargs -rd '\n' -- dpkg -S | cut -d : -f 1 | sort -u
bash-completion
cheese-common
gnumeric-doc
indicator-sound
linux-image-extra-3.11.0-12-generic

Then I repaired the corruption by reinstalling the damaged packages:

$ xargs -rd '\n' -a <(sudo debsums -c | xargs -rd '\n' -- dpkg -S | cut -d : -f 1 | sort -u) -- sudo apt-get install -f --reinstall --
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
  linux-image-generic
Use 'apt-get autoremove' to remove it.
0 upgraded, 0 newly installed, 5 reinstalled, 0 to remove and 0 not upgraded.
Need to get 43.9 MB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu/ saucy/main bash-completion all 1:2.0-1ubuntu3 [173 kB]
Get:2 http://us.archive.ubuntu.com/ubuntu/ saucy/main cheese-common all 3.8.3-0ubuntu1 [2,929 kB]
Get:3 http://us.archive.ubuntu.com/ubuntu/ saucy/universe gnumeric-doc all 1.12.6-1 [7,295 kB]
Get:4 http://us.archive.ubuntu.com/ubuntu/ saucy/main linux-image-extra-3.11.0-12-generic i386 3.11.0-12.19 [33.5 MB]
Get:5 http://us.archive.ubuntu.com/ubuntu/ saucy/main indicator-sound i386 12.10.2+13.10.20131011-0ubuntu1 [55.7 kB]
Fetched 43.9 MB in 10min 23s (70.4 kB/s)
(Reading database ... 174913 files and directories currently installed.)
Preparing to replace bash-completion 1:2.0-1ubuntu3 (using .../bash-completion_1%3a2.0-1ubuntu3_all.deb) ...
Unpacking replacement bash-completion ...
Preparing to replace cheese-common 3.8.3-0ubuntu1 (using .../cheese-common_3.8.3-0ubuntu1_all.deb) ...
Unpacking replacement cheese-common ...
Preparing to replace gnumeric-doc 1.12.6-1 (using .../gnumeric-doc_1.12.6-1_all.deb) ...
Unpacking replacement gnumeric-doc ...
Preparing to replace linux-image-extra-3.11.0-12-generic 3.11.0-12.19 (using .../linux-image-extra-3.11.0-12-generic_3.11.0-12.19_i386.deb) ...
Unpacking replacement linux-image-extra-3.11.0-12-generic ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 3.11.0-12-generic /boot/vmlinuz-3.11.0-12-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 3.11.0-12-generic /boot/vmlinuz-3.11.0-12-generic
Preparing to replace indicator-sound 12.10.2+13.10.20131011-0ubuntu1 (using .../indicator-sound_12.10.2+13.10.20131011-0ubuntu1_i386.deb) ...
Unpacking replacement indicator-sound ...
Processing triggers for man-db ...
Processing triggers for libglib2.0-0:i386 ...
No such key 'auto-launch' in schema 'com.ubuntu.update-notifier' as specified in override file '/usr/share/glib-2.0/schemas/20_xubuntu-default-settings.gschema.override'; ignoring override for this key.
Processing triggers for hicolor-icon-theme ...
Setting up bash-completion (1:2.0-1ubuntu3) ...
Setting up cheese-common (3.8.3-0ubuntu1) ...
Setting up gnumeric-doc (1.12.6-1) ...
Setting up linux-image-extra-3.11.0-12-generic (3.11.0-12.19) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)
Not updating initrd symbolic links since we are being updated/reinstalled
(3.11.0-12.19 was configured last, according to dpkg)
Not updating image symbolic links since we are being updated/reinstalled
(3.11.0-12.19 was configured last, according to dpkg)
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 3.11.0-12-generic /boot/vmlinuz-3.11.0-12-generic
run-parts: executing /etc/kernel/postinst.d/dkms 3.11.0-12-generic /boot/vmlinuz-3.11.0-12-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.11.0-12-generic /boot/vmlinuz-3.11.0-12-generic
update-initramfs: Generating /boot/initrd.img-3.11.0-12-generic
run-parts: executing /etc/kernel/postinst.d/pm-utils 3.11.0-12-generic /boot/vmlinuz-3.11.0-12-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 3.11.0-12-generic /boot/vmlinuz-3.11.0-12-generic
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 3.11.0-12-generic /boot/vmlinuz-3.11.0-12-generic
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.11.0-14-generic
Found initrd image: /boot/initrd.img-3.11.0-14-generic
Found linux image: /boot/vmlinuz-3.11.0-12-generic
Found initrd image: /boot/initrd.img-3.11.0-12-generic
Found memtest86+ image: /boot/memtest86+.bin
Found Windows 7 (loader) on /dev/sda1
done
Setting up indicator-sound (12.10.2+13.10.20131011-0ubuntu1) ...

Finally, I checked to make sure that no corrupt files remain:

$ sudo debsums -c

There was no output from this command, which means that no errors were found.  :-)

One final note: you should also check your packages' config files to make sure they're OK.  This can be more difficult because config files often change, and the changes are legitimate, so you'll need to manually inspect each changed config file to determine whether or not it's actually corrupt.  This is how you get a list of changed config files:

$ sudo debsums -as
debsums: changed file /etc/gnome/defaults.list (from desktop-file-utils package)
debsums: changed file /etc/default/rcS (from initscripts package)
debsums: changed file /etc/subuid (from login package)
debsums: changed file /etc/subgid (from login package)
debsums: changed file /etc/sudoers (from sudo package)

Using the dpkg program along with some Bash scripting should be able to this for you. The only caveat would be if someone replace "clean" versions of the files with "malicious" ones. For that you would need to get valid MD5 checksums from a pristine package. Anyways, here is the shell code to achieve what you want:

#!/bin/sh
PACKAGE_NAME="xterm"
for i in `sudo dpkg -L ${PACKAGE_NAME}`
do
    if ! [ -e $i ]; then
            echo "$i is a missing file in the $PACKAGE_NAME package."
    fi
done

The script would only print out if a file or directory that was defined in the package was missing. Also you would need to replace the 'PACKAGE_NAME' variable with the package that you would want to inspect. Hope this helps.


How do I set an environment variable at boot time (via a script)? I'd like to set a couple of environment variables (at boot time) on an Ubuntu machine (10.04), but I want to create their value via a script, much like:

export THE_ENV_VAR=$(script_to_execute_and_use_stdout_from)

The reason I want to do this is that the commands used to set the environment variables take long time to execute (10s or so), so that's why I only want to do it once after boot. Anyway, currently I solved this by caching the result of the command at boot time, so that subsequent calls will go fast, thus not using env. variables at all.

I've tried setting in /etc/environment, but that only copies rhs verbatim

I've tried executing a script in /etc/init.d/ at startup, but that does not seem to work.

Ideas?

Put that in ~/.bash_profile or ~/.bashrc

gedit ~/.bashrc

Use .bash_profile if you need to use those variable with non-interactive shells (scripts) and ~/.bashrc if you are setting your variables in a shell.

If that does not work, we need more details, in particular what variables are you setting and for what purpose ?

Put your commands into /etc/rc.local. Make sure to read the comments at the head.


nvcc not found, but only when using sudo I can't get ANYTHING working on linux. I'm trying to compile CudaMiner. Output of sudo make:

ypt-jane.o `test -f 'scrypt-jane.cpp' || echo './'`scrypt-jane.cpp
mv -f .deps/cudaminer-scrypt-jane.Tpo .deps/cudaminer-scrypt-jane.Po
nvcc -g -O2 -Xptxas "-abi=no -v" -arch=compute_10 --maxrregcount=64 --ptxas-options=-v -I./compat/jansson -o salsa_kernel.o -c salsa_kernel.cu
/bin/bash: nvcc: command not found
make[2]: *** [salsa_kernel.o] Error 127
make[2]: Leaving directory `/var/progs/CudaMiner'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/var/progs/CudaMiner'
make: *** [all] Error 2

So, kind of interesting. Output of nvcc:

nvcc fatal   : No input files specified; use option --help for more information

Whereas the output of sudo nvcc:

sudo: nvcc: command not found

I have identical exports listed in ~/.bashrc AND /etc/bash.bashrc. (Nvcc is located in: /usr/local/cuda-5.0/bin/nvcc)

I also tried changing the current path, to no avail:

$ sudo bash -c 'echo $PATH'
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
$ PATH=$PATH:/usr/local/cuda-5.0/bin/nvcc
$ sudo bash -c 'echo $PATH'
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

Thanks in advance!

So apparently, nvcc is not on the PATH when you run it with sudo. You can confirm this with:

sudo bash -c 'echo $PATH'

The easiest solution is to call sudo with the absolute path of nvcc:

sudo $(which nvcc)

When running commands without absolute path like nvcc, sudo uses the value of the secure_path configuration in /etc/sudoers as the PATH, for example in my system:

Defaults        secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

So even if you set PATH in one of the startup files that the shell normally sources, it won't work. If you want to make sudo nvcc work temporarily, just to get your build working, I think you have two options:

Edit the installer script and change the lines with sudo nvcc to sudo /path/to/nvcc
Create a symlink to nvcc in one of the directories listed in secure_path, like this: sudo ln -s /path/to/nvcc /sbin/nvcc

UPDATE

If you have a hard time finding the path of nvcc, you can try these commands, in this order (they get slower and slower), until you find a match:

which nvcc
find /usr/local/cuda-5.0 -name nvcc
find /usr/local/ -name nvcc
find /opt -name nvcc
find / -name nvcc

The cause might be a read-only folder. In my case the 'Make' file that calls nvcc was in a read-only folder. Changing the folder permission settings solved my problem.


What will happen to my Ubuntu/Windows set up upon upgrade to Windows 10? Microsoft is offering free upgrades to Windows 10 for certain users. Currently I am running a Ubuntu/ Windows 8.1 dual boot set up on my laptop.

I rarely boot into Windows but just to keep up to date with what is going on there I would like to keep it. What can I expect when opting to upgrade to Windows 10? My suspicion is that the least it will do is make sure there is the Windows boot loader installed and there is only one option to boot.

With Win 10 being released today I wonder if anyone has gone through the upgrade path and would like to share his findings? What can I expect to happen?

I can't see what can affect Ubuntu even if it's installed with wubi by upgrading windows.
Even if your grub is overwritten by the windows bootloader you can easily restore it with boot-repair.


"debconf: DbDriver "config": config.dat is locked by another process: Resource temporarily unavailable" while installing packages I'm trying to install the flashybrid but when I enter the apt-get install flashybrid command, I get this error:

root@user-desktop:/home/user# apt-get install flashybrid
Reading package lists... Done
Building dependency tree
Reading state information... Done
flashybrid is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0B of additional disk space will be used.
debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable
Setting up flashybrid (0.15+nmu2) ...
debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable
dpkg: error processing flashybrid (--configure):
subprocess post-installation script returned error exit status 1
Errors were encountered while processing:
flashybrid
E: Sub-process /usr/bin/dpkg returned an error code (1)

I also tried this one to find what is already using that file:

root@user-desktop:/home/user# lsof | grep /var/cache/debconf/config.dat
lsof: WARNING: can't stat() fuse.gvfs-fuse-daemon file system /home/user/.gvfs
Output information may be incomplete.
dpkg-prec 4672 root 4rW REG 8,6 39658 1697827 /var/cache/debconf/config.dat

But I don't know how to fix this.

A solution to this locking problem is detailed in the wiki:

sudo fuser -v /var/cache/debconf/config.dat

Will show you what process is holding the lock:

                     USER        PID ACCESS COMMAND
/var/cache/debconf/config.dat:
                     root      18210 F.... dpkg-preconfigu

Then you simply need to note down the PID and kill it like so:

sudo kill PID
sudo kill -9 PID  # if the first doesn't work

There is a process still running blocking debconf. You should wait until it finish. Or find out how it got stuck, since in some cases it will be try to ask you a question but since you don't have a scope to see it. If you wait sometime and things doesn't change you may need to reboot the system, or terminate the process.

sudo kill 4672

or

sudo killall dpkg-prec

This will assure you that your database will not get damaged and will prevent further problems.


How to open Nautilus (File Manager) preferences? Please could you tell me where can I find the File Manager Preferences
in Ubuntu ... (now for 16:04 LTS).

The menu bar has disappeared from Nautilus, as also have the resize handles and the top-bar right-click menu (except for 'Close').  The window gets a little smaller every time I open it, it's gradually disappearing and I can't presently correct it.

I'm using Gnome not Unity, so the fixes for unity don't work.

I would have preferred to add these observations as comments, but I still have too few reputations to do that, so have to ask a new copy of the same question instead.

On Ubuntu 17.10.1, the top left corner of the screen next to Activities, you'll find Files with a drop-down arrow:

Click on Files, then in the list that appears, click on Preferences.

I am using 16.04, finally I solved it.
You should install the software namely 'nautils-actions'(in synaptic), then in tweak tool enable application menu in top bar.
Finally, you will reach there:


Boot manager is showing \Ubuntu\winboot\wubildr.mbr is missing or contains error Possible Duplicate:
  Installing Ubuntu on a Pre-Installed UEFI Supported Windows 8 system

I have installed Ubuntu 12.10 version using windows installer option along with windows 8. After selecting Ubuntu during boot option, boot manager is showing the below error message.

"The os couldn't be loaded because the file \Ubuntu\winboot\wubildr.mbr is missing or contains error"

Kindly help me to fix this issue.

I had the exact same problem on an HP Pavilion G6-2240sa preloaded with Windows8.  It turned out that for some reason that key files on the DVD I burned on the same machine were not recognized at boot time. The solution in the end was to create a USB stick boot drive  by downloading the data from the Ubuntu site and creating the bootable drive using the software site recommended by the Ubuntu site  "How to create a bootable USB stick on Windows".  Do not just copy the files to the USB drive.  I also had to edit the BIOS to look for the bootable USB drive before booting from the internal hard disk. If you would like more details with a blow-by-blow account see here

Did you install Windows after Ubuntu,if that so then use boot repair https://help.ubuntu.com/community/Boot-Repair . this is a really great tool. You just have to boot ubuntu through live cd and select try ubuntu and follow instruction given in above link.


Audacity will no longer launch When trying to launch Audacity, I get the following error:

Audacity could not find a place to store temporary files.
Please enter an appropriate directory in the preferences dialog.

No files or folder have been moved.
I have purged Audacity, deleted any files, etc manually and
re-installed

In terminal:

pst007x@pst007x-Serval-Professional:~$ audacity

(process:16390): GLib-GObject-WARNING **: Attempt to add property GnomeProgram::sm-connect after class was initialised

(process:16390): GLib-GObject-WARNING **: Attempt to add property GnomeProgram::show-crash-dialog after class was initialised

(process:16390): GLib-GObject-WARNING **: Attempt to add property GnomeProgram::display after class was initialised

(process:16390): GLib-GObject-WARNING **: Attempt to add property GnomeProgram::default-icon after class was initialised

** (Audacity:16390): WARNING **: Owner of /tmp/orbit-pst007x is not the current user

Segmentation fault
pst007x@pst007x-Serval-Professional:~$

I have not changed any users or added any additional users.
All privaleges, etc are default.

Ubuntu 13.10 64bit (all updates applied)

ADDITIONAL:

I can open as gksu audacity

So it looks like privileges is an issue somewhere. I have checked all privileges and all seems ok, but clearly not....

I tried changing the Directory in Preferences to a directory in my home folder:

/home/pst007x/Music/audacity_temp/

but when starting again (not in root) same error...

Any ideas what files could be lacking privileges?

After changing the Directory, when running I get this:

pst007x@pst007x-Serval-Professional:~$ audacity

(process:28364): GLib-GObject-WARNING **: Attempt to add property GnomeProgram::sm-connect after class was initialised

(process:28364): GLib-GObject-WARNING **: Attempt to add property GnomeProgram::show-crash-dialog after class was initialised

(process:28364): GLib-GObject-WARNING **: Attempt to add property GnomeProgram::display after class was initialised

(process:28364): GLib-GObject-WARNING **: Attempt to add property GnomeProgram::default-icon after class was initialised
Segmentation fault
pst007x@pst007x-Serval-Professional:~$

I checked installed files using Synaptic Package Manager, then checked permissions:

pst007x@pst007x-Serval-Professional:~$ sudo chmod -R 777 /usr
[sudo] password for pst007x:
pst007x@pst007x-Serval-Professional:~$ audacity

(process:31026): GLib-GObject-WARNING **: Attempt to add property GnomeProgram::sm-connect after class was initialised

(process:31026): GLib-GObject-WARNING **: Attempt to add property GnomeProgram::show-crash-dialog after class was initialised

(process:31026): GLib-GObject-WARNING **: Attempt to add property GnomeProgram::display after class was initialised

(process:31026): GLib-GObject-WARNING **: Attempt to add property GnomeProgram::default-icon after class was initialised
Segmentation fault
pst007x@pst007x-Serval-Professional:~$

EDIT.
After the above, I rebooted and was no longer able to login. So I did a fresh install. Not a bad thing since the original install on the this system was 10.10. Working ok after fresh install.

Thank you for taking the time to post answers and suggestions..

I am using Audacity v2.0.3 on Linux Mint 16 which is a derivative of Ubuntu 13.10 and was having the same problem.

When Audacity starts up, it looks for a temporary directory to store its temporary files, namely

/var/tmp/audacity-${USER}

where ${USER} has the value of the login username, and the USER environmental variable is usually correctly set during the login process.

To be sure, one can always do

echo ${USER}

to see if it is set and set to the appropriate value.

So the very simple solution is

mkdir /var/tmp/audacity-${USER}

and for privacy, if desired and if your umask is other than 0007,

chmod 0700 /var/tmp/audacity-${USER}

or you could do it in one go with

mkdir -m 0700 /var/tmp/audacity-${USER}

Obviously the user has to have write permission on /var/tmp, otherwise this will need to be done by root who will also have to change the user and group ownership of the created directory to the appropriate user and group.

Why audacity does not create this directory for its-self is a question which should be directed at the writers of the audacity, because popping up a dialog to say that some unamed directory for temporary storage does not exist and then segfaulting is an extremely bad user experience.

The suggestion that one should re-install an operating from scratch just to solve the problem of a missing directory is an unacceptable answer.

Not really an answer, but a solution, because, I was no longer able to reboot after altering permissions, I decided on a fresh install.

So I booted in on a live disk, made backups, and reinstalled the OS.

Turned out to be the easiest solution, very easy to restore most settings, just by copying over the appropriate backed-up files into the new system.


How to install Chromium without snap? I just discovered that chromium will only be released as a snap package.

How can I continue to get chromium, without snap? Is this possible without building from source?

Notes:

Please let's keep to the question as stated - not "what do you have against snap?"
I'm not asking how to remove snap (I realize that would break Ubuntu)... just how to use chromium as it is now, a deb.

Update

No, this is not a duplicate of that linked question. I don't need to know "why it's a snap". I want to know how to use it without snap.

Right now there is building from source, and some random PPA mentioned below. I hope someone can advise us of trustworthy alternatives.

You can use Chromium from the Debian buster repository.
For example, if your Ubuntu release is eoan (19.10):

Remove Ubuntu chromium packages:
 sudo apt remove chromium-browser chromium-browser-l10n chromium-codecs-ffmpeg-extra

Add Debian buster repository. Create a file /etc/apt/sources.list.d/debian.list with the following content:
 deb http://deb.debian.org/debian buster main
 deb http://deb.debian.org/debian buster-updates main
 deb http://deb.debian.org/debian-security buster/updates main

Add the Debian signing keys:
 sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys DCC9EFBF77E11517
 sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 648ACFD622F3D138
 sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys AA8E81B4331F7F50
 sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 112695A0E562B32A

Configure apt pinning. Create a file /etc/apt/preferences.d/chromium.pref with the following content:
 # Note: 2 blank lines are required between entries
 Package: *
 Pin: release a=eoan
 Pin-Priority: 500

 Package: *
 Pin: origin "ftp.debian.org"
 Pin-Priority: 300

 # Pattern includes 'chromium', 'chromium-browser' and similarly
 # named dependencies:
 Package: chromium*
 Pin: origin "ftp.debian.org"
 Pin-Priority: 700

Install Chromium again
 sudo apt update
 sudo apt install chromium

This should install the latest chromium from the debian-security repository and look like this:
$ sudo apt install chromium
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  chromium-common chromium-sandbox libjpeg62-turbo libminizip1 libre2-5
Suggested packages:
  chromium-l10n chromium-shell chromium-driver
The following NEW packages will be installed:
  chromium chromium-common chromium-sandbox libjpeg62-turbo libminizip1 libre2-5
0 upgraded, 6 newly installed, 0 to remove and 9 not upgraded.
Need to get 56,6 MB of archives.
After this operation, 202 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://de.archive.ubuntu.com/ubuntu eoan/universe amd64 libminizip1 amd64 1.1-8build1 [20,2 kB]
Get:2 http://ftp.de.debian.org/debian buster/main amd64 libjpeg62-turbo amd64 1:1.5.2-2+b1 [134 kB]
Get:3 http://de.archive.ubuntu.com/ubuntu eoan/universe amd64 libre2-5 amd64 20190801+dfsg-1 [162 kB]
Get:4 http://ftp.de.debian.org/debian-security buster/updates/main amd64 chromium-common amd64 79.0.3945.130-1~deb10u1 [257 kB]
Get:5 http://ftp.de.debian.org/debian-security buster/updates/main amd64 chromium amd64 79.0.3945.130-1~deb10u1 [55,9 MB]
Get:6 http://ftp.de.debian.org/debian-security buster/updates/main amd64 chromium-sandbox amd64 79.0.3945.130-1~deb10u1 [141 kB]

As you can see, only Chromium related packages are fetched from the Debian repository, but all others like libminizip1 still come from your Ubuntu repository.

Without getting into the why, what you're asking for is someone, somewhere to maintain the deb of Chromium. There is a time and resource commitment to do that work, providing the build for you. There's a couple of options.

You specified a way of getting Chromium without building from source. So you're after binary packages which are not packaged as a snap. One option is to get the builds from the upstream Chromium project themselves via https://www.chromium.org/getting-involved/download-chromium

Another would be to use an older release of Ubuntu - such as Ubuntu 18.04 LTS - which still ships a binary deb of Chromium. At the time of writing 18.04 has Chromium 79 - the same as the version in 16.04, and is the latest.


What is the bash equivalent of DOS's pause command? I need a pause on a shell script to show a warning before continuing.
For instance, on DOS it goes like this:

doit.bat:

[...]
echo 'Are you sure? Press Ctrl-C to abort, enter to continue.'
pause
[...]

How can I do this on bash?
For the moment a sleep command seems to do the trick and is simple enough but is not exactly the idea:

doit.sh

[...]
echo 'Are you sure? Press Ctrl-C to abort.'
sleep 3
[...]

something along the lines of

echo -n "prompt"  #'-n' means do not add \n to end of string
read              # No arg means dump next line of input

echo "press enter to continue"
read unusedVariable
echo "running these 3 lines in .sh file, this echo will never be seen, unless you have a really slow computer"

place these 3 lines in a .sh file and run it


Is there an Intelligent Personal Assistant available in Ubuntu? I am new to Ubuntu and I was wondering if there was an IPA like Cortana or Siri in the software center.

Jasper is great software and open source, you can build your own assistant by appending some apps / technologies or use software defaults, most of developers use on raspberry PI  to build their own system like Amazon echo, you can chose your suitable installation from Here.

Use your own google account to build an Actions On Google Project, which lets you access it. Come Herehttps://console.actions.google.com


Cannot install ia32-lib package I have several programs that reuquire 32 bit packages (pointing to the ia32-lib package). However, when I try to install it, this happens.

spirit@ubuntu:~$ sudo apt-get install ia32-libs
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 ia32-libs : Depends: ia32-libs-multiarch but it is not installable
E: Unable to correct problems, you have held broken packages.

No big whoop, packages die all the time. I tried a month later however and I still got this error, trying to install the specific package produces this error.

spirit@ubuntu:~$ sudo apt-get install ia32-libs-multiarch
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package ia32-libs-multiarch is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'ia32-libs-multiarch' has no installation candidate

I am no Linux whizz-kid, but this seems to be that the package doesn't exist. I searched for Skype in the software centre (I was told this installs the 32-bit packages) and it does not appear in the software centre, and the downloadable from their website produces an error about - funnily enough - no 32-bit packages.

Anyone who helps me will get a medal from the gods with the weight of a thousand planets. Just don't wear it for god's sake.

Sounds like installing through WUBI did not correctly detect the available foreign architectures. As tumbleweed suggested printing the foreign architectures probably returns nothing. Add i386 as a foreign architecture, update the apt cache, then install the 32 bit libs.

sudo dpkg --add-architecture i386 && sudo apt-get update && sudo apt-get install ia32-libs

If you are having this problem, it's most likely you are on Precise 64-bit with Amazon EC2. They have fixed this for Ubuntu 12.10.


Setting PATH variable in /etc/environment vs .profile Where is the preferred place to set the PATH envvar?

~/.profile or /etc/environment?

What is the case when PATH is set in both places?
Is the end result a concatenation of both values set in those two places?

Summary:

If you want to add a path (e.g. /your/additional/path) to your PATH variable for your current user only and not for all users of your computer, you normally put it at the end of ~/.profile like in one of those two examples:

PATH="/your/additional/path:$PATH"
PATH="$PATH:/your/additional/path"

Note that the path priorities are descending from left to right, so the first path has the highest priority. If you add your path on the left of $PATH, it will have the highest priority and executables in that location will override all others. If you add your path on the right, it will have the lowest priority and executables from the other locations will be preferred.
However, if you need to set that environment variable for all users, I would still not recommend touching /etc/environment but creating a file with the file name ending in .sh in /etc/profile.d/. The /etc/profile script and all scripts in /etc/profile.d are the global equivalent of each user's personal ~/.profile and executed as regular shell scripts by all shells during their initialization.

More detail:

/etc/environment is a system-wide configuration file, which means it is used by all users. It is owned by root though, so you need to be an admin user and use sudo to modify it.
~/.profile is one of your own user's personal shell initialization scripts. Every user has one and can edit their file without affecting others.
/etc/profile and /etc/profile.d/*.sh are the global initialization scripts that are equivalent to ~/.profile for each user. The global scripts get executed before the user-specific scripts though; and the main /etc/profile executes all the *.sh scripts in /etc/profile.d/ just before it exits.

The /etc/environment file normally contains only this line:

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"

It sets the PATH variable for all users on the system to this default value, which should not be changed in a major way. At least you should not remove any of the important paths like /bin, /sbin, /usr/bin and /usr/sbin from it.

This file is read as one of the first configuration files by every shell of every user. Note that it is not a shell script. It is just a configuration file that gets parsed somehow and that may only contain environment variable assignments!
The ~/.profile file can contain many things, by default it contains amongst other stuff a check whether a ~/bin directory exists and adds that to the user's existing PATH variable, like this (on older Ubuntu releases prior to 16.04 -- which adds it unconditionally -- and on 18.04, which also adds "~/.local/bin"):

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

You see that the old value of PATH gets reused here and the new path is only appended to the beginning instead of overwriting everything. When you manually want to add new paths, you should also always keep the old $PATH value somewhere in the new string.

This initialization script is read only by the shells of the user to which it belongs, but there's another condition:

# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.

So if you use the default Bash shell, you should make sure that you don't have a ~/.bash_profile or ~/.bash_login if you want the changes in ~/.profile to have an effect for your user.

For a full understanding on Environment Variables see:
https://help.ubuntu.com/community/EnvironmentVariables

Related question: difference between bash.bashrc and /etc/environment file

Check your /etc/environment file. It should contain only literal path i.e it should not contain something like "$PATH=$PATH:<any_path_you_want_to_add>".

That will cause an error into your system and make you stuck in the login loop.


How do I minimize stuff to the System Tray? In 13.04, How do I make applications (specifically, pidgin, nicotine+, lifeograph, evolution etc..and more) to the indicator area as icons? I need them to be running but need to clear the space in the Launcher.

In 12.10, I had briefly used AllTray. It crashed every time I used it and I did not understand the menu options it presented and what they did. Also the icons it minimized to were having white background, which stood out ugly in the grey ubuntu toolbar.

I had also heard of Devilspie but could not operate it as it seemed too complicated, with lot of options. Would help if there is some reading material available for the setup.

I would like to start these applications minimized to the indicator area at startup itself and keep running in the background.

Is there any software to specifically help me do that, or any documentation or help on how to do that using the two I have mentioned, would be appreciated.

Kdocker can minimize any application to the system tray.

I use it with a keyboard shortcut Super+S

I suppose AllTray is the magic word here... I think that little bugger did get all my programs to the tray, inspite of crashing everytime....

Any takers on the Devilspie usage guide?


how to stop mysql server with root How can i stop mysql server (installed using binary installation under /usr/local/mysql)?

When i go in /usr/local/mysql/bin and execute command

mysqld stop i get following error message :

[ERROR] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!
[ERROR] Aborting
[Note] mysqld: Shutdown complete

and i can still see process for mysql server.

same happens when i try to do it with mysqld in /etc/init.d.

Assuming that you are running an up-to-date Ubuntu and you are already root, as you mentioned, the command is:

service mysql stop

or

/etc/init.d/mysql stop

Because of your installation, you should try this:

sudo -u mysql /usr/local/mysql/bin/mysqld stop

try the following:

quit;

this worked for me...then i just got the msg: "bye". then it was showing again to enter a comand as the USER@user>, not as MYSQL>. Help this works!


Ubuntu saying file does not exist when it does? I am trying to access a file with this script:

cd /home/rust/servers/rust1/
screen -X -S old_rust quit
screen -dmS old_rust wine ./rust_server.exe -batchmode -cfg "./config.cfg" -port 28015 -maxplayers 75 -datadir "serverdata/"

Whenever I run the script, I get this error

rust@direct:~$ /home/rust/servers/rust1/start.sh
: No such file or directoryart.sh: line 1: cd: /home/rust/servers/rust1/

The directory /home/rust/servers/rust1/ does exist and you can cd to it in ssh.

Any help would be appreciated.

No such file or directoryart.sh

Since the script you're trying to call is start.sh, you have a typo somewhere

As I can see you don't delimit your commands. You should delimit your commands with semicolon (;) or double ampersand (&&). The difference between the two is that when you delimit your commands with &&, then the next command only run if previous succeed, while ; delimited commands run anyway.

So, you probably should write something like this:

cd /home/rust/servers/rust1/ && screen -X -S old_rust quit && \
    screen -dmS old_rust wine ./rust_server.exe -batchmode \
        -cfg "./config.cfg" -port 28015 -maxplayers 75 -datadir "serverdata/"


Nautilus not generating thumbnails in 13.10 Like the title says, Nautilus is not generating thumbnails for any file types (pictures, documents, pdf, etc) after a clean install of 13.10.  I have checked the preferences and it is set to always generate thumbnails.

Help please!

I solved the problem by deleting whole folder thumbnails in ~/.cache and remaking it.

Disable preview in nautilus by opening home folder, Edit-> Preferences-> Preview.
sudo rm ~/.cache/thumbnails
Empty trash can
mkdir ~/.cache/thumbnails
Reboot
Enable preview, again home folder, Edit-> Preferences-> Preview.

Done.

It is easy!

open terminal and copy and paste:

sudo chmod 777 -R ~/.cache/thumbnails

Ready!


How do I remove all files that match a pattern? When I revert in Mercurial, it leaves several .orig files. I would like to be able to run a command to remove all of them.
I have found some sources that say to run:
rm **/*.orig

But that gives me the message:
rm: cannot remove `**/*.orig': No such file or directory

I have also tried these commands:
rm -rv *.orig
rm -R *\.orig

Use the find command (with care!)

find . -name '*.orig' #-delete

I've commented out the delete command but once you're happy with what it's matching, just remove the # from the line and it should delete all those files.

The below is what I would normally do

find ./ -name "*.orig" | xargs rm -r

It's a good idea to check what files you'll be deleting first by checking the xargs. The below will print out the files you've found.

find ./ -name "*.orig" | xargs

If you notice a file that's been found that you don't want to delete either tweak your initial find or add a grep -v step, which will omit a match, ie

find ./ -name "*.orig" | grep -v "somefiletokeep.orig" | xargs rm -r


Having trouble setting up Synergy (via Quicksynergy) Synergy is an app that allows two or more computers to share a keyboard and mouse.  I have both Synergy and QuickSynergy (the GUI for synergy) installed from the repositories on two computers. One, my "main" box, is running Ubuntu 11.10.  Sitting above it on a shelf is an older laptop running Lubuntu 11.10.  I have watched a couple of youtube videos which attept to walk one through the setup process but so far I have not found one that can help me. I have the required applications installed on both machines and they are connected via my wireless router.  I need to know exactly what to input (and where) on each machine in order to sync my mouse, keyboard, and clipboard between the two.

Here's a Synergy user guide and a sample configuration file. If you prefer to configure it with a GUI rather than a config file, try the 1.4.5 beta at Synergy's download page.

You can install the Synergy from a package repository for Ubuntu.

$ wget -q -O - http://archive.getdeb.net/getdeb-archive.key | sudo apt-key add -
$ sudo sh -c 'echo "deb http://archive.getdeb.net/ubuntu trusty-getdeb apps" >> /etc/apt/sources.list.d/getdeb.list'
$ sudo apt-get update
$ sudo apt-get install synergy

Once you have installed the package, you can run synergyc for the client, synergys for the server and synergy for an administration GUI. The administration GUI allows you to configure and run your machine as a server or as a client.

You may find several tutorials in the internet to use synergy in your Ubuntu.


Why isn't Steam available in Ubuntu's software center? I have a newly installed 12.04 64bit Ubuntu machine!
fully updated.

I couldn't find steam in software center.
looking for the steam 64bit client.

I've desktop also with 12.04 64bit, which has the steam client in the software center. well at least when I installed it.

did someone remove steam from the software center?

If you're using a 64-bit version of ubuntu you wont see steam in the official repos. Only the 32-bit version is officially supported. I had to get the .deb from steam's web site.

I followed the steps on the linked page below to add the repository.

I had the exact same symptoms as the OP.

Steam still not showing in Software Center though.

I am now logged in to Steam and downloading Half-Life, which I purchased Years ago.
Nice to see some continuity in account purchases!

Instructions to add the Steam PPA

Since Steam is no longer in the Ubuntu repositories it will never show up in Software Center. I find it preferable to have the Software Update maintain the local packages in as current a state as possible.  This is why I linked the page above.  Yes it takes a few terminal commands.

  Our packages are signed by "Valve Software LLC " You can add this key to your package manager with:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys B05498B7

  Setup repository with:

sudo sh -c 'echo "deb http://repo.steampowered.com/steam/ precise steam" >> /etc/apt/sources.list.d/steam.list'

Now just

sudo apt-get install steam

The first command allows your system to verify that the package is digitally signed by Valve.  The second adds the Valve repository so apt-get can use it.  The third actually installs Steam.

I didn't want to search for the proper way to manually install the .deb package and this way allows me to keep steam updated with the rest of my system.


Ubuntu 14.04 keeps freezing and does not take any inputs GF108M [GeForce GT 635M] Nvidia Graphics card, and have ubuntu 14.04 os. Every 10 minutes or so it freezes. Alt+Ctrl+F2 and Alt+Ctrl+F7 is my temporary solution. What do I do to fix this?

lspci -k | egrep 'VGA|3D' -A2 gives the following output:

00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor Graphics Controller (rev 09)
Subsystem: ASUSTeK Computer Inc. Device 1447

Kernel driver in use: i915

01:00.0 VGA compatible controller: NVIDIA Corporation GF108M [GeForce GT 635M] (rev a1)
    Subsystem: ASUSTeK Computer Inc. Device 1447
    Kernel driver in use: nvidia

Well, re-installing the latest driver would the first step of course. First try using the Software & Updates to install the latest proprietary and preferably tested driver.

Open the Ubuntu Software Center, move your mouse to the top, from the Edit menu, choose Software Sources . Click on Additional Drivers tab, wait for it to load the information and choose the latest proprietary for the NVIDIA. For me (GeForce GT 730) at this time it shows:

Using NVIDIA binary driver - version 346.59 from nvidia-346 (proprietary, tested)

Click on Apply and wait for it to install it. If your screen keeps crashing during this process, then you won't have a choice other than trying to install it from terminal.

just fire up a terminal , and run the following. I hope it will work.
step 1.setup xorgs edgers ppa.

  sudo apt-add-repository ppa:xorg-edgers/ppa and then sudo apt-get
  update sudo apt-get upgrade && sudo apt-get dist-upgrade

step 2.now run the following

  sudo apt-get install bumblebee bumblebee-nvidia primus nvidia-349

you can substitute 349 with whatever new version it has now.

step 3.add current user to bumblebee security group.

  sudo adduser bumblebee $USER

just do this and reboot after installation, recheck whether the problem exists or not.


Ubuntu Server - Is something wrong with the 32 Bit version of it? I want to set up my very first server (yay) and I chose Ubuntu Server 14.04.3 LTS (Trusty Tahr) for it because I have used it a little as Desktop software.

I'm using an old PC for this Server with an 32 Bit (AMD86) architecture.

I'm a bit confused about the Ubuntu versions. The website says that the LTS version is 64 bit only even tho I was able to locate a 32 bit version of this version in the 14.04 release notes. (see images)

claims 64 bit only: www.ubuntu.com/download/server
provides both 32 and 64 bitwww.releases.ubuntu.com/14.04/

Why does the one page says that there's only a 64 bit version of it?

Is something wrong with the 32 Bit version?
Should I be aware of something special?

I hope that you guys can help me. Thank you

There is nothing wrong with Ubuntu 14.04.3 32-bit server.

You can download it by clicking "Alternative downloads...".

The 64-bit version of Ubuntu Server is recommended and it is commonly used. That is why the primary link leads to the 64-bit version.

Maybe they're only going to support the 64-bit LTS version till 2019? I don't know.. doesn't sound particularly likely. AFAIK the 64-bit one will handle memory above 4Gb better but, other than that, there's little practical difference in day to day use.


My keyboard symbols layout changed My keyboard symbols layout changed. I think this happened after I install some updates.
For example when I type:

-
- appears /

_ appears ?

= appears )

And this happens with all my characters.
I have already tried a lot of things nothing seams to work.

just like any laptop there is usually a key that makes the keyboard characters change or makes new characters appeared I were you I would go through your keys and see if anything works if not see if Ubuntu already has answered another question like this or look it up online.


Can't connect to Wifi from recovery mode in Ubuntu I made all steps: wrote my key and ssid to /etc/network/interfaces, turn wlp3s0 up, and using iwconfig tryed to connect, by using command "iwconfig wlp3s0 essid name key s:password", but its always error:"SET failed on device wlp3s0; Invalid argument."  I couldn't do it not from recovery mode cause I'm accidentally deleted "etc/share" folder, so if you know, please help!

These links helped me with a similar issue:
https://ubuntuforums.org/showthread.php?t=2164398

https://linoxide.com/linux-how-to/connect-wifi-terminal-ubuntu-16-04/

"iwconfig" for WEP.
"key s:password" is used if your password is in ASCII.
If your password is in HEX, you use "key password".

Also, "wpasupplicant" for WPA.

Hope you are well!


lightdm-gtk-greeter-ubuntu "crashes" after installing KDE4.10 I have a weird problem, which I didn't found anything on the internet about.

I installed KDE4.10 (from kubuntu-ppa/backports) a week ago, and it changed the loginscreen. After there was something weird with my sound (doesn't matter anymore) I uninstalled kubuntu-desktop, rebooted and then i just got  mountall: connection to plymouth disconnected. After installing kubuntu-desktop again. The problem was gone, but I had again this KDE-like loginscreen.

Later I figured out, that i can change the greeter in

  /etc/lightdm/lightdm.conf

from greeter-session=lightdm-kde-greeter to  greeter-session=lightdm-gtk-greeter-ubuntu but this brings back the old problem which can be seen in the picture i linked above.

Does anyone know how i can fix this? I would like to have the standard-loginscreen again.

the greeter session that worked in my case is:

  greeter-session=unity-greeter

Maybe you want to try that.

maybe u must reinstall kdm or lightdm so the configuration comeback to default again . And i hope this help u.

Open terminal : sudo dpkg-reconfigure lightdm ,

select u want bro, lightdm, kdm or gdm

If you want using boot screen ubuntu just remve package plymouth-theme-kubuntu-logo and plymouth-theme-kubuntu-text then reinstall plymouth-theme-ubuntu-logo plymouth-theme-ubuntu-text.


Does anyone have Titanfall up and running on Ubuntu yet? Seems like Ubuntu is the best OS but the lack of big games is unfortunate. Does anyone got a walkthrough on getting Titanfall specifically up and running on Ubuntu with an Nvidia card?

It will most probably not work

Like many games, Titanfall was programed for Windows. While someone has tried and succeeded to install with Wine he wasn't able to start it. The situation might have improved since then... or not.

Setting up and configuring wine for a game isn't for the faint at heart. It's much easier using PlayOnLinux, but I think this won't matter much in this case.

Personal Note

I play games on Linux all the time, but I stick to the stuff Steam supporting under Linux. For the rest I keep a Windows 7 installation around.

download wine, it allows you to run all windows binaries i.e programs games,you can download wine through Ubuntu Software Center. Or you can play this game on Play on Linux also available in software center.

or visit wine HQ for more details


Creating an image of the installed version along with all changes and apps installed Well my requirement is little different from other question related to image  creation.
I need to do is-

Scenario : I've Ubunut Mate 18.04 installed with over dozen tweaks/changes to make it suitable to my needs and over it I've many programs installed (VS code, node etc.)

Requirement: I need to make an image (bootable) from this OS that has my changes and installed programs in it. Let's call it MyOs.iso (assuming w'll make an iso).

Purpose: If I try out other distros/flavors and install them in my system, I could any day install from my MyOs.iso and have my system ready considering I need to get back.

It would be icing on the cake, if we can find an option to make this iso a) with the data
b) without the data
This would further help me in using my iso as - restore point and for changing my laptop as well.
My purpose can be fulfilled by creating a restore point, if the other version I try can be installed on the entire system (without making a side by side installation) but keeping the restore point intact.

Even I'm looking for the same.. there is a software in windows name norton gost, think it will work for Linux system too.. just browse for Norton Gost software and give it a try..


Will the new version be using the improved unity shell or gnome3? Possible Duplicate:
  Will Gnome 3 be in 11.10?

Will the new version be using the improved unity shell or gnome3? If it's using unity, can I still install gnome3 on it???

Ubuntu 11.10 will be using Unity, which now works with Gnome 3. Gnome Shell, which is the "default shell of Gnome 3" will also be available. In other words, Gnome 3 can be styled in various ways. Gnome-Shell is the default of the Gnome Developers, while Ubuntu chooses to use the Unity Shell by default.

Ubuntu 11.10 will be similar to Ubuntu 11.04, only with some slight modifications.

Gnome shell Dektop will not be available in 11.10 as was there in 11.04 as a roll back feature. Instead they are planning to ship a 2D version of Unity for slower graphics cards, instead of a 3D one.

And Pitivi is not being a part of the distro CD. anyway Pitivi was useless for me!

Reference: Wikipedia


Problem installing Ubuntu 14.04 alongside windows 8 I'm trying to install Ubuntu in my Dell Vostro 3546, which already has Windows 8 on it. I have a 320GB HDD with 2GB RAM.

I am using a bootable USB drive to this. All goes well for the first part. I choose my language, connect to WiFi and select the option to install third party software and updates. Then there is the option about whether to install Ubuntu alongside Windows 8 or something else.

Whenever I choose the "install alongside" option and press continue, the installation exits to a black screen showing the following text:

wait-for-state stop/waiting
* Stopping rsync daemon rsync
* speech-dispatcher disabled; edit /etc/default/speech-dispatcher
* Asking all remaining processes to terminate ...

How should I proceed?

In my installation of Ubuntu 12.10 alongside Win 8, I ended up
having to create the partitions for Ubuntu from the Windows side
using 'Disk Management'. If your 320GB HD is all utilized for Windows
you will need to do this as well. Set up at least 2 partitions, one for /
and a swap partition, formatting as FAT32.
  Now when you begin the Ubuntu install, there are now empty partitions
that can be chosen as the drive to install Ubuntu into (/)and the swap
partition. Ubuntu will look for drives and after found you can simply
answer questions to tell where install takes place and filesystem to
set up (I used ext4). Hope this helps Craig

I have experienced same problem, while I was trying to install Ubuntu 14.0 alongside with Windows 7

wait-for-state stop/waiting
* Stopping rsync daemon rsync
* speech-dispatcher disabled; edit /etc/default/speech-dispatcher
* Asking all remaining processes to terminate ...

Tried to leave unallocated or free space next to the C: drive, further proceeded with the Ubuntu installation as dual boot. It now worked fine.


How to install VirtualBox from command line? I am a newbie. For some reasons, I need to install Virtualbox. I see that I can easily install it using the Software Center, but I trust most the apt-get install way, because I find it safer, less buggy, and it helps me accommodate more with the Terminal.

So, my question is the following: is there a way to install VirtualBox using the command line? I would prefer something easy, like apt-get install not unzipping, archiving, etc, because I still don't know how to do these in the Terminal.

Open a terminal and execute:

sudo apt-get install virtualbox

which should work.

Once you have installed it you probably want to install guest additions in the guest OS.

Also you probably want the extension pack which you can get from here:

https://www.virtualbox.org/wiki/Downloads

Make sure you get the correct version.

As of Xenial 16.04, you can also get the extension pack from the Canonical repositories. Go to the terminal and execute:

sudo apt install virtualbox-ext-pack

Therefore, as of Xenial 16.04, you should be able to get virtualbox and the extension pack by typing the following:

sudo apt install virtualbox virtualbox-ext-pack

Following the instructions on your screen.

To install the user interface to manage your virtual boxes use this command

sudo apt install virtualbox-qt

My Ubuntu-15.04 cloud images are missing the virtualbox package from the included sources.  Kostanos' method works, but since virtualbox is a meta-package with multiple versions depending on the release you are running you may need to specify a particular version.

Here is a script that checks for an installation candidate, installs the repo if there isnt one, then updates the package lists and installs it for you.  As noted in his answer, be sure to change "vivid" to your release name.

#!/bin/bash
if [ $(dpkg-query -W -f='${Status}' virtualbox 2>/dev/null | grep -c "ok installed") -eq 0 ];
  then
    if [ $(apt-cache search virtualbox | grep virtualbox) ];
      then
        apt-get install -y virtualbox
      else
        apt-add-repository "deb http://download.virtualbox.org/virtualbox/debian vivid contrib"
        wget -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | apt-key add -
        apt-get update
        apt-get install -y virtualbox-5.0
    fi
fi

I had to write this for a Mythos project automation so I thought I would share.

Thanks.


How can you change the user icon in sddm I want sddm to display the user icon from ~/.face.icon (~/.face) like the kickoff application launcher does and not just the generic user icon.

Is that possible?

If you want sddm to display the user icon from ~/.face, all you need to do is change the permissions of ~/.face. (Your question indicates that you have the symlink ~/.face.icon already.) Your steps would be:

chmod 666 ~/.face

or

chmod o+rw ~/.face

To see the effect immediately, you can restart sddm:

sudo systemctl restart sddm.service

I ran that last command from an ssh session while the computer was on the login screen. After changing the file permissions and restarting ssdm, the correct icon was displayed for the user.


What's the difference between login as user and changing users using su through root? When you have a server of some sort you can access it through, e.g., ssh user1@ip and you can also do ssh root@ip to go to your root user with su priveleges and then go to su user1. In my thinking both those ways should lead me to the same user environment(in this case, "user1"), but in my actual experience it does not, cause in ssh user1@ip there's things installed that in su user1 there isn't.

Why is that?

SSH starts a login shell. su, by default does not.

In particular, this means that the ~/.profile (or similar file) for that user is not sourced. So changes made in ~/.profile won't take effect. It might also be the case that:

even if you start a login shell, different changes were made in root's ~/.profile, which might pollute the user's environment.

/etc/profile and /etc/profile.d/* may apply settings differently for different users (not by default, though)

there might be different settings for different users in SSH configuration.
PAM configuration is different. For example, /etc/pam.d/ssh has:

session    required     pam_env.so user_readenv=1 envfile=/etc/default/locale

whereas /etc/pam.d/su has:

session       required   pam_env.so readenv=1 envfile=/etc/default/locale

This means SSH loads ~/.pam_environment, but su doesn't. This is a big one, since ~/.pam_environment is the shell-independent place for environment variables, and it is applied if you login from the GUI, the TTY or SSH.

To start a login shell, run either of:

su - <username>
sudo -iu <username>

Example:

# su muru -c 'sh -c "echo $HOME $PATH"'
/home/muru /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
# su - muru -c 'sh -c "echo $HOME $PATH"'
/home/muru /home/muru/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
# sudo -iu muru sh -c 'echo $HOME $PATH'
/home/muru /home/muru/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
# sudo -u muru sh -c 'echo $HOME $PATH'
/root /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
# ssh muru@localhost 'echo $HOME $PATH'
/home/muru /home/muru/devel/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games

Even with SSH, if you run a command instead of starting a shell, a login shell won't be run (note the absence of ~/bin in the SSH test, which is present in su - and sudo -i). To get the true result, I will run my shell as a login shell:

# ssh muru@localhost '$SHELL -ilc "echo \$HOME \$PATH"'
/home/muru /home/muru/bin:/home/muru/devel/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games

This is also why sudo su and sudo -s are crappy ways of getting a root shell. Both these ways are polluted by the environment.

Related:

Unix & Linux: su vs sudo -s vs sudo -i vs sudo bash

By and large it's mainly a strategic difference.

If you're logged in as a super user, you can change anything all the time ... ie - there's no protection against catastrophic mistakes, you'd have to temporarily change to some other user for safety.

Whereas: if you're logged in with limited privileges, you avoid some risk of catastrophic mistakes, because you have to intentionally shift to su root for temporary access to that power, but now you have the default fall-back position to a safe user.

The difference is therefore really strategic, not technical.


Accidentally removed /bin. How do I restore it? I was working on a directory named bin. After I was finished, because of the ownership of bin and some files within it I accidentally ran:

sudo rm -r /bin

Instead of:

sudo rm -r bin

It seems that my hands used to add a / in front of everything I type.

How can I restore my /bin directory?

I want the same files that belong to my Ubuntu, I don't like to copy and paste them from a live disk or another running system.

Is it possible?

Well, most trivial and important utilities are installed in /bin, and now you lost access to all of them. In fact, if you reboot, your system will not be able to boot-up anymore.

Anyway, we are going to fix the issue and make /bin's contents as close as is possible to where it was. The only difference would be some symbolic links which we will fix too.

How?

First, we should chroot into your broken system, but with a minor difference! After that we will get a list of installed packages on your system which have any installed file in /bin directory, then we are going to only download the needed packages and extract the necessary files into /bin. Then we'll be done.

For example, after chroot, we can get a list of packages which have installed files in /bin using:

dpkg --search /bin | cut -f1 -d: | tr ',' '\n'

And we can also use:

dpkg --listfiles PACKAGE-NAME | grep "^/bin/" # or awk '$0 ~ "^/bin/

to list installed files by these packages in /bin.

Then we simply create a list of all packages that are necessary to us, then download them and extract them to /bin with something like:

xargs apt download < list-packages
dpkg-deb -x PACKAGE .
mv ./bin/* /bin

However we must use a script to check all installed packages on our system, because doing it manually is just madness.

So I wrote a script which does everything we need. It finds all necessary packages for us to restore /bin, shows us the name of each package and their related files that belongs to /bin. Here is a screenshot:

At the end we choose to reinstall all packages or only download and extract the necessary files to /bin (which is the recommended option):

You can grab a copy of this script or download it directly.

Lets start

chroot

Boot your system with a live disk which has same architecture as your installed Ubuntu, open a terminal and get root access:

sudo -i

Mount your root file system (for me it's /dev/sda1):

mount /dev/sda1 /mnt

We will need connectivity to the Internet, so copy resolv.conf from live Ubuntu to your mounted root partition:

cp /etc/resolv.conf /mnt/etc/resolv.conf

Now copy the script to somewhere on the mounted partition, e.g:

cp /media/ubuntu/usb/restore-bin.sh /mnt/restore-bin.sh

or you can download it using wget, etc. like:

wget https://git.io/v9fRm -O /mnt/restore-bin.sh

Mount other necessary paths:

mount --bind /dev /mnt/dev
mount --bind /sys /mnt/sys
mount -t proc /proc /mnt/proc

And here is the minor difference: how can we chroot to a broken system when there is no /bin directory in there? Which shell should we run?

So create a temporary bin directory. e.g: named bintmp within your broken system root:

mkdir /mnt/bintmp

Then bind the live /bin into that:

mount --bind /bin /mnt/bintmp

Chroot into the system while setting the /bintmp/bash as your login shell:

chroot /mnt /bintmp/bash

Export the /bintmp as your PATH environment variable:

export PATH=/bintmp:$PATH

Give the script the executable bit:

chmod +x restore-bin.sh

Run the script:

./restore-bin.sh

Wait for the search to be completed then answer the question we saw in the screenshot. It will start to restore the /bin and we are almost done.

After it's done, use CTRL+D to get out of chroot environment and unmount the mounted paths:

umount -R /mnt

Reboot the system.

Restoring the links within /bin

Now almost all of files within /bin directory are back, except around 5 symbolic links which are managed by update-alternatives.

In your running system, run:

sudo update-alternatives --all

It asks you some questions; you can simply press ENTER to accept them all.

And now we are done.

Some additions to this excellent answer, after I encountered this issue (along with deleting /boot, /etc, /lib and /lib64):

chroot requires /lib and /lib64 to be present; otherwise you will get the following error:
failed to run command ‘/bin/bash’: No such file or directory
I copied these from the LiveCD OS and didn't have any problems restoring. YMMV depending on the packages you have installed on the system
I cannot edit the answer referenced above, but there is a typo:
cp /etc/resolv.conf /mnt/etc/resolv.cof
should be
cp /etc/resolv.conf /mnt/etc/resolv.conf
/boot can easily be restored using grub tools. See here.
As this answer recommends, apt install --reinstall <package> is a great way to restore missing files in /bin, /lib and /lib64.

Some packages that required reinstallation: libaio1, mysql-server, openvpn, vsftpd

Note to self:
rm -rf folder /* is not the same as rm -rf folder/*


How can I tell if my system was booted as EFI/UEFI or BIOS? How do I determine whether a particular running Ubuntu system was booted using EFI/UEFI, or BIOS?

The easiest way is to check to see if /sys/firmware/efi exists.  It does not appear if you booted using traditional BIOS.
#!/bin/bash
[ -d /sys/firmware/efi ] && echo UEFI || echo BIOS

Python code to check if system is booted with UEFI or ROM BIOS:

import os,sys
def main():
    if(os.path.exists("/sys/firmware/efi")):
        print"\n\n System is booted with uefi!"
    else:
        print"\n\n System is booted with rom bios"
main()
sys.exit(0)


Menu items greyed out I installed Gnome 3.10 on Ubuntu 13.10. Just to try it. Later I decided to remove it and go beck to Unity. It took me a while to remove Gnome. After that I experience some issues:

in some apps global menu items are greyed out (all the menu item in Gimp, messaging indicator items, ...) I cannot click any of these items, but keyboard shortcut is working (for example - cannot click "Save" but CTRL+S works)
I have two network indicators in unity panel
in session menu there is a red circle in front of my username

Any ideas...???

I'm having the same problem, but I did not go through the installing/uninstalling GNOME 3.10. I think it just came with the regular ubuntu update. This unity-panel/global menu is such a headache, I don't know why the can't get it right.

Anyway, this works for me for GIMP:
* open a terminal and run: $ killall -HUP unity-panel-service

This will reset the menu and the greyed out items will then be available. However when you start GIMP again, it's back to the greyed out menus, thus you need to killall again.

Hope this helps
-H

Same problem for me and I found a solution (LibreOffice is concerned too):

sudo apt-get remove indicator-appmenu

Source : https://bugs.launchpad.net/ubuntu/+source/unity-gtk-module/+bug/1263205


Problems with internet connection and mouse cursor Ubuntu 14.04 Hi I know there are some other questions concerning similar themes, but I cannot get a answer to my problems. I´ve searched all around the internet and cannot find an answer. I recently installed Ubuntu 14.04 64bit to my Lenovo thinkpad T400. As soon as the installation finishes and I restart the computer, the internet connection fails. The ethernet connection doesnt even appear. So I am not able to connect to the internet. The other problem is with the mouse cursor. At the beginning it appears but freezes and afterwards it simply disappears. Ive tried the solution with the displays but in my case it doesn´t appear a second display. I also tried typing sudo modprobe -r psmouse
sudo modprobe psmouse into the terminal but no success. And also typing other things into the terminal. I don´t know if simply my computer is too old for ubuntu 14.04 64 bits.
Thank you very much for your help!

For the Wi-Fi problem you have a link here:http://ubuntuforums.org/showthread.php?t=2220169

But for the mouse cursor you have one link here:http://jiakaizhang.com/fix-frozen-after-login-in-ubuntu-14-04/

And another one here:https://unix.stackexchange.com/questions/136555/ubuntu-14-04-mouse-pointer-does-not-move


How do I completely remove Evolution? The looping of Evolution factories slow the system to sudden and lengthy halts. When I access the System  Monitor I can stop the individual processes that cause the problem. These processes are as follows;

evolution-source-registry

notably,
    evolution-addressbook-factory

Once evolution-addressbook-factory is stopped the processes are eventually replaced by similarly named processes, but the looping stops. When I connect to Thunderbird it slows substantially. Initially I used evolution mail when running Ubuntu 12.10 but removed it and have been using Thunderbird.

My laptop specs are:
Ubuntu 13.04 32-bit
2.0 GHz (dual core, both cores at 2.0 GHz)
1GB RAM
After carrying out the recommended procedures for complete removal I recieved a cache read error after removing evolution from the package manager entirely. Re-downloading the packages in the package manager enabled email recognition and produced the error seen in the screenshot.

Removing is too messy (because a lot of other packages depend on it even if they don't use its functionality), but disabling is relatively straightforward.

Ideally this should be done using dpkg-divert (but that has a problem with diverting to the same file), to not confuse apt/dpkg when you upgrade your system.

cd /usr/share/dbus-1/services
# This part create a copy of your original files
sudo cp org.gnome.evolution.dataserver.AddressBook.service org.gnome.evolution.dataserver.AddressBook.service.backup
sudo cp org.gnome.evolution.dataserver.Calendar.service org.gnome.evolution.dataserver.Calendar.service.backup
sudo cp org.gnome.evolution.dataserver.Sources.service org.gnome.evolution.dataserver.Sources.service.backup
sudo cp org.gnome.evolution.dataserver.UserPrompter.service org.gnome.evolution.dataserver.UserPrompter.service.backup

# This part does the trick
sudo ln -snf /dev/null org.gnome.evolution.dataserver.AddressBook.service
sudo ln -snf /dev/null org.gnome.evolution.dataserver.Calendar.service
sudo ln -snf /dev/null org.gnome.evolution.dataserver.Sources.service
sudo ln -snf /dev/null org.gnome.evolution.dataserver.UserPrompter.service

If we just delete the file or use any empty file the next update/upgrade will put them back. So we're using a symlink to an empty file (/dev/null is a special empty file, it stays empty even if you write something into it).

Here you find an article about what /dev/null is.

apt-get has a --purge option to completly remove a package.

In a terminal :

sudo apt-get remove --purge evolution
sudo apt-get autoclean

The autoclean option will make a clean in the package stocked on your system. So if you have multiple versions of a package apt-get will only keep the last one.


How do I sudo a command in a script without being asked for a password? I want to turn my system on automatically every day. So I use the below code in my Python script, but sudo asks me for a password every time:

os.system('sudo sh -c "echo date \'+%s\' -d \'+ \
       24 hours\' > /sys/class/rtc/rtc0/wakealarm"')

How can I run this script without sudo asking for the password every time?

Please note: Any method which involves putting your login password in plain text, in a command or in a file, is insecure and should NOT be used!

The correct way to do it to setup sudo such that only the one specific command you need, i.e. echo date... > rtc..., is allowed to run WITHOUT needing the password.

Step 1. Create a shell script with just that command

Open up gedit (or your favorite editor), and create the script e.g. pydatertc.sh
Insert only this line, and save it to, e.g. your home directory:
echo date \'+%s\' -d \'+ 24 hours\' > /sys/class/rtc/rtc0/wakealarm
Quit the editor, and from the terminal, make the script executable and change its ownership to root, otherwise another user with access to your system could possibly edit it and execute whatever commands they want as root without needing your password:
sudo chown root:root /home/username/pydatertc.sh
sudo chmod 700 /home/username/pydatertc.sh

Step 2. Set up sudo to allow pydatertc.sh to execute without requiring a password

Type sudo visudo at the terminal to open the sudo permissions (sudoers) file
Around line 25, you'll see this line: %sudo   ALL=(ALL:ALL) ALL
Below that line, insert the following line, where username is your username:
username  ALL=(ALL) NOPASSWD: /home/username/pydatertc.sh
Exit the editor (Ctrl+X if nano)

Step 3. Modify your python script to call pydatertc.sh

Change the line to:
os.system('sudo /home/username/pydatertc.sh')

Now your script should run without requiring a password AND without compromising the security of your account, your data or your system!

Alternative only for wakealarm (not for general use!):

In this specific case only, since the /sys/class/rtc/rtc0/wakealarm file only controls the wake-up alarm for the system and is otherwise harmless, another alternative to avoid the password is either to take ownership of that file with chown (if you are the only user setting the alarm), or make it world-writeable with chmod +666; in that case, simply remove the sudo from your Python call, leaving sh -c "...." intact.

export MY_SUDO_PASS="user_password_here"

To test if it's working type:

echo $MY_SUDO_PASS
> user_password_here

To run "sudo apt-get update", and accept password from environment variables what we created before:

echo $MY_SUDO_PASS | sudo -S apt-get update

Run from python (example changing directory ownership recursively to username_here):

python
>> import subprocess
>> subprocess.call('echo $MY_SUDO_PASS | sudo -S chown -R username_here /home/username_here/folder_to_change_ownership_recursivley', shell=True)

echo $MY_SUDO_PASS get's password -S switch catching it and passing the password to sudo


Simple image viewer that is using trash rather than permanently deleting files? I tried gpicview, nomacs, mirage and viewnior - all are permanently deleting images (there is a prompt) rather than using trash.

I would prefer moving to trash without confirmation. Moving to trash after confirmation also would be better than not using trash.

Is it some strange design tradition of not using trash on Linux? Is it maybe some system-wide setting?

gThumb, available from package with this name is able to use Ubuntu trash folder (out of the box, without changing any settings).

It is also possible to stop confirmation before moving to trash using Edit | Preferences - tag General, section Other.

Eye of GNOME is also able to use trash and it is enabled by default, but it is impossible to pernamently disable confirmation before moving file to trash. It resides in package eog.

gwenview also technically fits but is unusable due to horrible effects and animations, without option for disabling them (according to http://kde-bugs-dist.kde.narkive.com/YHb61htK/bug-289213-make-crossfade-animation-optional it should be possible once Ubuntu package is updated). Also, selecting "install plugins" results in installation of programs spamming start menu.

The illusion of a "trash bin" is created by the file manager, e.g. Nautilus. It is just a normal directory somewhere in your home. For Nautilus, I think, it's ~/.local/share/Trash. The Linux kernel itself doesn't know about the trash bin.

However, as there are quite a few file managers for Linux (I can name Nautilus, Nemo, Dolphin, Caja and PCManFM from memory, but there certainly are more than just those), it is near to impossible to create a program which moves items to the trash of the current file manager compatible with all file managers out there.

So I think you'll have a hard time finding a program fit for your needs. And if you don't find anything, you could get the source code of your favorite image display software and patch it so it will move images to PCManFM's (or another one if you don't use LXDE's default FM) trash.


Run MySQL Workbench as standard user I've installed mysql-server and mysql-workbench packets. Everything seems to work fine, but when I try to connect to a database through mysql-workbench I can't, except if I start mysql-workbench via cli with the command

sudo mysql-workbench

I checked other posts that said that this behaviour depends on the different type of authentication given to the mysql root user (auth_socket), but also if I change the authentication for the root user to mysql_native_pasword, I'm able to connect to the database server only if I start Workbench as super user.

On Linux, for installations performed using a MySQL repository or RPM packages, the MySQL server mysqld should be started by the local mysql operating system user. Starting by another operating system user is not supported by the init scripts that are included as part of the MySQL repositories.

On Unix (or Linux for installations performed using tar.gz packages) , the MySQL server mysqld can be started and run by any user. However, you should avoid running the server as the Unix root user for security reasons. To change mysqld to run as a normal unprivileged Unix user user_name, you must do the following:

Stop the server if it is running (use mysqladmin shutdown).
Change the database directories and files so that user_name has privileges to read and write files in them (you might need to do this as the Unix root user):

shell> chown -R user_name /path/to/mysql/datadir

If you do not do this, the server will not be able to access databases or tables when it runs as user_name.

If directories or files within the MySQL data directory are symbolic links, chown -R might not follow symbolic links for you. If it does not, you will also need to follow those links and change the directories and files they point to.

Start the server as user user_name. Another alternative is to start mysqld as the Unix root user and use the --user=user_name option. mysqld starts, then switches to run as the Unix user user_name before accepting any connections.

To start the server as the given user automatically at system startup time, specify the user name by adding a user option to the [mysqld] group of the /etc/my.cnf option file or the my.cnf option file in the server's data directory. For example:

[mysqld]
user=user_name

If your Unix machine itself is not secured, you should assign passwords to the MySQL root account in the grant tables. Otherwise, any user with a login account on that machine can run the mysql client with a --user=root option and perform any operation. (It is a good idea to assign passwords to MySQL accounts in any case, but especially so when other login accounts exist on the server host.)

Text comes from https://dev.mysql.com/doc/refman/8.0/en/changing-mysql-user.html. I'm not sure if this is referring to MySQL users or Ubuntu users. I hope this at least helps

you have to login to mysql and grant permission for the standard user

mysql> select * from mysql.user;

this will list users,

Follow this post to Set Privileges

How to Grant All Privileges on a Database in MySQL


trying to overwrite '/usr/bin/opencv_haartraining', which is also in package libopencv2.3-bin 2.3.1+svn6514+branch23-12~oneiric After installing some packages and libraries I have an error on Package Manager, I can't run any update because it says:

  The package system is broken If you are using third party repositories
  then disable them, since they are a common source of problems. Now run
  the following command in a terminal: apt-get install -f

I've tried to do what it says and it returns me:

jara@jara-Aspire-5738:~$ sudo apt-get install -f
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
libcaca-dev libopencv2.3-bin nite-dev python-bluez ps-engine libslang2-dev
python-sphinx ros-electric-geometry-tutorials
ros-electric-geometry-visualization python-matplotlib libzzip-dev
ros-electric-orocos-kinematics-dynamics ros-electric-physics-ode
libbluetooth-dev libaudiofile-dev libassimp2 libnetpbm10-dev
ros-electric-laser-pipeline python-epydoc ros-electric-geometry-experimental
libasound2-dev evtest python-matplotlib-data libyaml-dev ros-electric-bullet
ros-electric-executive-smach ros-electric-documentation libgl2ps0
libncurses5-dev ros-electric-robot-model texlive-fonts-recommended
python-lxml libwxgtk2.8-dev daemontools libxxf86vm-dev libqhull-dev
libavahi-client-dev ros-electric-geometry libgl2ps-dev libcurl4-openssl-dev
assimp-dev libusb-1.0-0-dev libopencv2.3 ros-electric-diagnostics-monitors
libsdl1.2-dev libjs-underscore libsdl-image1.2 tipa libusb-dev libtinfo-dev
python-tz python-sip libfltk1.1 libesd0 libfreeimage-dev
ros-electric-visualization x11proto-xf86vidmode-dev python-docutils
libvtk5.6 ros-electric-assimp x11proto-scrnsaver-dev libnetcdf-dev
libidn11-dev libeigen3-dev joystick libhdf5-serial-1.8.4
ros-electric-joystick-drivers texlive-fonts-recommended-doc esound-common
libesd0-dev tcl8.5-dev ros-electric-multimaster-experimental ros-electric-rx
libaudio-dev ros-electric-ros-tutorials libwxbase2.8-dev
ros-electric-visualization-common python-sip-dev
ros-electric-visualization-tutorials libfltk1.1-dev libpulse-dev libnetpbm10
python-markupsafe openni-dev tk8.5-dev wx2.8-headers freeglut3-dev
libavahi-common-dev python-roman python-jinja2
ros-electric-robot-model-visualization libxss-dev libqhull5 libaa1-dev
ros-electric-eigen freeglut3 ros-electric-executive-smach-visualization
ros-electric-common-tutorials ros-electric-robot-model-tutorials libnetcdf6
libjs-sphinxdoc python-pyparsing libaudiofile0
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
libcv-dev
The following NEW packages will be installed
libcv-dev
0 upgraded, 1 newly installed, 0 to remove and 4 not upgraded.
2 not fully installed or removed.
Need to get 0 B/3,114 kB of archives.
After this operation, 11.1 MB of additional disk space will be used.
Do you want to continue [Y/n]? y
(Reading database ... 261801 files and directories currently installed.)
Unpacking libcv-dev (from .../libcv-dev_2.1.0-7build1_amd64.deb) ...
dpkg: error processing /var/cache/apt/archives/libcv-dev_2.1.0-7build1_amd64.deb
(--           unpack):
trying to overwrite '/usr/bin/opencv_haartraining', which is also in package
libopencv2.3-bin 2.3.1+svn6514+branch23-12~oneiric
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Errors were encountered while processing:
/var/cache/apt/archives/libcv-dev_2.1.0-7build1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

I've tried everything people recommend on internet like:

sudo apt-get clean
sudo apt-get autoremove
sudo apt-get update
sudo apt-get upgrade
sudo apt-get -f install

Also I've tried to install the synaptic manager but it doesn't let me install anything..

As you can see nothing works so I'm desperate!

I'm using ubuntu 11.10, 64 bits

Thanks!!

http://www.iasptk.com/ubuntu-fix-broken-package-best-solution

After trying

sudo dpkg --configure -a

and

sudo apt-get install -f

the problem of a broken package still exist the solution is to edit the dpkg status file manually.

sudo nano /var/lib/dpkg/status

(you can use vim instead of nano)

Locate the corrupt package, and remove the whole block of information about it and save the file.

Replace the /var/lib/dpkg/status files with the same file from another working system running the same OS version. This worked for me.


Update information is outdated 16.04 New to Ubuntu, and recently updated to 16.04 (yes, yes, I probably should have waited being new and all).

Generally it's working well...but I'm having some update problems. The dreaded red triangle in the upper righthand corner. I've tried doing some searching on my own, but to no avail. When I tried updating through the software update, I get the following notice.

W: http://dl.google.com/linux/chrome/deb/dists/stable/Release.gpg: Signature by key 4CCA1EAF950CEE4AB83976DCA040830F7FAC5991 uses weak digest algorithm (SHA1),
W: There is no public key available for the following key IDs:
1397BC53640DB551,
W: The repository 'http://ppa.launchpad.net/conscioususer/polly-daily/ubuntu xenial Release' does not have a Release file,
W: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.,
W: See apt-secure(8) manpage for repository creation and user configuration details.,
E: Failed to fetch http://ppa.launchpad.net/conscioususer/polly-daily/ubuntu/dists/xenial/main/source/Sources  404  Not Found,
E: Failed to fetch http:// ppa.launchpad.net/conscioususer/polly-daily/ubuntu/dists/xenial/main/binary-amd64/Packages  404  Not Found,
E: Failed to fetch http:// ppa.launchpad.net/conscioususer/polly-daily/ubuntu/dists/xenial/main/binary-i386/Packages  404  Not Found,
E: Some index files failed to download. They have been ignored, or old ones used instead.

Now, I'm not an idiot, and have checked around to see if I could find the problem myself, but nothing seems to be posted for this problem in 16.04. Can anyone help?

Basically you have a lot of sources that don't have proper keys anymore .. you will need to either remove these  sources or get new keys for them.

Go to Start--settings--Software & Updates and click on the Other Software tab

then find the things on that list that say there is no key or 404 not found and uncheck them ... once done close the window and it will ask you to reload ... it should reload without errors .. if there are still errors .. you may need to remove more sources

first goto this directory:
cd /etc/apt/sources.list.d/

and then remove the file associated with google chrome:
sudo rm google-chrome.list

This will definitely work. Keep smiling,
If in this directory there are another files that associated with other applications that you removed already then remove them also.