What is the correct way to completely remove an application? I've searched the net for such information and found different command lines, like these ones:

sudo apt-get remove application
sudo apt-get remove application*

sudo apt-get remove --purge application
sudo apt-get remove --purge application*

sudo apt-get purge application
sudo apt-get purge application*

So, what is the correct way? Is it necessary to use that "*"?

After that, I also found these commands:

sudo updatedb
sudo locate application
sudo rm -rf (file/folder name)

apt-get remove packagename

will remove the binaries, but not the configuration or data files of the package packagename. It will also leave dependencies installed with it on installation time untouched.
apt-get purge packagename or apt-get remove --purge packagename

will remove about everything regarding the package packagename, but not the dependencies installed with it on installation. Both commands are equivalent.

Particularly useful when you want to 'start all over' with an application because you messed up the configuration. However, it does not remove configuration or data files residing in users home directories, usually in hidden folders there. There is no easy way to get those removed as well.
apt-get autoremove

removes orphaned packages, i.e. installed packages that used to be installed as an dependency, but aren't any longer. Use this after removing a package which had installed dependencies you're no longer interested in.
aptitude remove packagename or aptitude purge packagename (likewise)

will also attempt to remove other packages which were required by packagename on but are not required by any remaining packages. Note that aptitude only remembers dependency information for packages that it has installed.

And many more exist. Lower-level dpkg-commands can be used (advanced), or GUI tools like Muon, Synaptic, Software Center, etc. There's no single 'correct way' of removing applications or performing other tasks interacting with your package management.

The list you found are just examples. Make sure you understand the meanings and try out what it wants to do before accepting the action (you need to press Y before it actually performs the actions as proposed).

The asterisk version in the question is probably wrong; apt-get accepts a regular expression and not a glob pattern as the shell. So what happens with

sudo apt-get remove application*

is the following:

The shell tries to expand application* looking at the files in the current directory. If (as is normally the case) it finds nothing, it returns the glob pattern unaltered (supposing bash with default behavior here --- zsh will error out).
apt-get will remove the packages whose name contains a string that satisfies the regular expression application*, that is, applicatio followed by an arbitrary number of n: applicatio, application, applicationn, libapplicatio, etc.
To see how this can be dangerous, try (without root for double safety) apt-get -s remove "wine*" (-s will simulate the thing instead of doing it) --- it will say is going to remove all packages that has "win" in their name and the dependant, almost the entire system...

Probably, the command that was meant is really

 sudo apt-get remove "^application.*"

(note the quotes and the dot) which will remove all packages whose name starts with application.

These commands,

sudo updatedb                  # <-- updates the locate database (index). harmless
sudo locate application        # <-- locates the file 'application'. harmless
sudo rm -rf (file/folder name) # <-- removes files/dirs recursively. dangerous.

are completely outside the scope of the package management. Do not remove files belonging to packages without using the package manager! It will get confused and is the wrong way to do things.

If you don't know to which package a file belongs, try this:

dpkg -S /path/to/file

To remove everything regarding the package package name like data and configuration, but not the dependencies installed with it on installation use:
apt-get remove --purge packagename


How to show only hidden files in Terminal? I have a directory that contains thousands of files, some of them are hidden.

The command ls -a list all files, including hidden ones, but I need just to list hidden files.

What command should I use?

The command :

ls -ld .?*

Will only list hidden files .

Explain :

 -l     use a long listing format

 -d, --directory
              list  directory entries instead of contents, and do not derefer‐
              ence symbolic links

.?* will only state hidden files

You can use the command
ls -pa | grep -v /

Explanation of flags:

-p will append "/" indicator to directories
-a will list hidden files
grep -v / commands will return the lines that do not contain a slash.


What is the difference between fglrx* and fglrx? Is there a difference between fglrx* and fglrx?

What is the meaning of * if added??

I did use the following steps because I was not sure whether I've had a graphic driver or not. So I wanted to activate a driver...

ATI/AMD proprietary FGLRX graphics install fails, how can I resolve the problem?

Then many problems occured - like changes of the quality of the desktop environment - and I wanted to know if they happened because of the difference of *?

I am a new Ubuntu 12.04 user. Was it wrong to have purged fglrx*? I also get this error each time I boot Ubuntu since then:

  The disk drive for /dev/mapper/cryptswap1 is not ready yet or not present

I would be really glad if someone could help me out!

The * is a "wildcard" character, it basically means "any number of characters".

For example, let's say you have three packages/programs installed called fglrx and fgrlx-updates, and fglrx-amdcccle. If you only want to remove fglrx, you will use apt-get remove fglrx. If you want to remove all three of them, you'll have to do apt-get remove fglrx fglrx-updates fglrx-amdcccle. However, an easier way would be to do apt-get remove fglrx*, which means remove all packages that start with fglrx.

In the steps of the link you provided, the person mentioned sudo apt-get --purge remove fglrx*. This is to ensure that you remove all packages related to fglrx, so you can start all over and install only the needed packages. So to answer your question, yes, that command removed your ATI graphics drivers, and made Ubuntu use the open source drivers, that's why the quality of the desktop environment changed.

I suggest you now run the command sudo apt-get --purge remove fglrx*, then sudo apt-get autoremove, then restart, then use the Additional Drivers to install, then reboot.


Getting error while using Youtube-dl when I started downloading youtude-dl the following error is being displayed. What should I do?

wanderer@wanderer-HP-Pavilion-15-Notebook-PC:~$ youtube-dl -f '(mp4) [height<480]' -- zfaISdylg7c
[youtube] zfaISdylg7c: Downloading webpage
[youtube] zfaISdylg7c: Downloading video info webpage
[youtube] zfaISdylg7c: Extracting video information
[youtube] zfaISdylg7c: Downloading js player en_US-vflV3n15C
ERROR: Signature extraction failed: Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/youtube_dl/extractor/youtube.py", line 1057, in _decrypt_signature
    video_id, player_url, s
  File "/usr/local/lib/python2.7/dist-packages/youtube_dl/extractor/youtube.py", line 971, in _extract_signature_function
    errnote='Download of %s failed' % player_url)
  File "/usr/local/lib/python2.7/dist-packages/youtube_dl/extractor/common.py", line 529, in _download_webpage
    res = self._download_webpage_handle(url_or_request, video_id, note, errnote, fatal, encoding=encoding, data=data, headers=headers, query=query)
  File "/usr/local/lib/python2.7/dist-packages/youtube_dl/extractor/common.py", line 436, in _download_webpage_handle
    urlh = self._request_webpage(url_or_request, video_id, note, errnote, fatal, data=data, headers=headers, query=query)
  File "/usr/local/lib/python2.7/dist-packages/youtube_dl/extractor/common.py", line 416, in _request_webpage
    return self._downloader.urlopen(url_or_request)
  File "/usr/local/lib/python2.7/dist-packages/youtube_dl/YoutubeDL.py", line 2001, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "/usr/lib/python2.7/urllib2.py", line 421, in open
    protocol = req.get_type()
  File "/usr/lib/python2.7/urllib2.py", line 283, in get_type
    raise ValueError, "unknown url type: %s" % self.__original
ValueError: unknown url type: /yts/jsbin/player-en_US-vflV3n15C/base.js
 (caused by ValueError(u'unknown url type: /yts/jsbin/player-en_US-vflV3n15C/base.js',)); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see  https://yt-dl.org/update  on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.

I had the same problem even when I removed and reinstalled youtube-dl according to the above given fix. The solution came only when I run synaptic, found the package 'python' right-clicked on it and installed the recommended packages.


16.04 intel HD 520 thinkpad problem I just bought a thinkpad t460s and installed a fresh version of ubuntu 16.04. I'm using chrome and i get a very annoying flicker at some pages and youtube, and I also tryed to play a game and the frame rate was poor and there were some obvious graphical issues. Do you know what  would be the best way to have optimal drivers for this setup? I could even downgrade to a previous version. Also, I'm very new to linux, so if you can help me and tell me what commands to put in the terminal according to the solution I would be very grateful. Thank you a lot!

antonio@sampi:~$ lspci -k | grep -EA2 'VGA|3D'
00:02.0 VGA compatible controller: Intel Corporation Sky Lake Integrated Graphics (rev 07)
    Subsystem: Lenovo Skylake Integrated Graphics
    Kernel driver in use: i915_bpo

If you have an AMD GPU in your laptop then this problem can't be solved until the release of Ubuntu 16.04.1 on July 21st. Since Ubuntu 16.04 doesn't support the propriety AMD driver "fglrx". And this is a GPU driver problem.

On the other hand, if you have an nVidia GPU inside. Just go to System Settings -> Software and Updates -> Additional Drivers. Then check the driver of your GPU and install it.


Sharing internet connection over Bluetooth from Desktop to Android What I have is these

Desktop PC without a wifi adapter
Bluetooth dongle
Android phone

What I want is

Sharing the internet connection on Desktop with the phone.

Although it has been asked on the forum but it was for Nokia phones. Kindly tell me what to do stepwise as I am quite new to Ubuntu.

There is an option in the Windows smartphones since 5.1 edition of Windows mobile, that allows you to use your Desktop or laptop's Internet via USB, but can't able to find this option in Android (without wifi), of course you can use via wifi, but I am looking for similar sort of option either blue-tooth or USB means.

It is possible I believe so. Lets see , I am looking forward, fingers crossed. :)


ssh refusing connection with message "no hostkey alg" My SSH connections worked well, but from last week SSH from my laptop to my board refusing connection. I can make a SSH connection from the board to laptop, but not vice-versa. I tried that with my user and root user and had same issue.

My Laptop is an Ubuntu 12.10 and my board is a Debian 6.

Here is the verbose output of SSH:

danialbehzadi@danial-HP:~$ ssh -v 192.168.1.2
OpenSSH_5.2p1, OpenSSL 1.0.1c 10 May 2012
debug1: Reading configuration data /usr/local/etc/ssh_config
debug1: Connecting to 192.168.1.2 [192.168.1.2] port 22.
debug1: Connection established.
debug1: identity file /home/danialbehzadi/.ssh/identity type -1
debug1: identity file /home/danialbehzadi/.ssh/id_rsa type 1
debug1: identity file /home/danialbehzadi/.ssh/id_dsa type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.0p1 Debian-4
debug1: match: OpenSSH_6.0p1 Debian-4 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.2
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 none
debug1: kex: client->server aes128-ctr hmac-md5 none
no hostkey alg

I made new rsa and dsa keys on the board and it went OK:

~# ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key
~# ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key

[root@server ~]# ls -la /etc/ssh/ssh_host_*

-rw-------. 1 root root      668 Jun 25 00:03 /etc/ssh/ssh_host_dsa_key
-rw-r--r--. 1 root root      609 Jun 25 00:03 /etc/ssh/ssh_host_dsa_key.pub
-rw-r-----. 1 root ssh_keys  227 Dec 14  2018 /etc/ssh/ssh_host_ecdsa_key
-rw-r--r--. 1 root root      162 Dec 14  2018 /etc/ssh/ssh_host_ecdsa_key.pub
-rw-r-----. 1 root ssh_keys  387 Dec 14  2018 /etc/ssh/ssh_host_ed25519_key
-rw-r--r--. 1 root root       82 Dec 14  2018 /etc/ssh/ssh_host_ed25519_key.pub
-rw-------. 1 root root      963 Apr 18  2011 /etc/ssh/ssh_host_key
-rw-r--r--. 1 root root      627 Apr 18  2011 /etc/ssh/ssh_host_key.pub
-rw-------. 1 root root     1679 Jun 25 00:02 /etc/ssh/ssh_host_rsa_key
-rw-r--r--. 1 root root      401 Jun 25 00:02 /etc/ssh/ssh_host_rsa_key.pub

make sure file ssh_host_* mode is 644 and 600 like this


How to clone only some directories from a git repository? For example, I want to download PCL 3d_rec_framework.
This is the git repository of PCL: https://github.com/PointCloudLibrary/pcl.git
How can I download this directory?
https://github.com/PointCloudLibrary/pcl/tree/master/apps
I tried this, but it didn't work:
sam@sam:~/code/pcl_standalone$ git clone https://github.com/PointCloudLibrary/pcl/tree/master/apps/3d_rec_framework
Cloning into '3d_rec_framework'...
error: The requested URL returned error: 403 while accessing https://github.com/PointCloudLibrary/pcl/tree/master/apps/3d_rec_framework/info/refs
fatal: HTTP request failed
sam@sam:~/code/pcl_standalone$

I don't want to download git of PCL and remove all other directories that I don't want.
How do I download just a single directory?

dobey's answer is no longer the case since git v1.7.  You can now checkout certain folders from a repository.  The full instructions are found here.

git init <repo>
cd <repo>
git remote add -f origin <url>

git config core.sparseCheckout true

echo "some/dir/" >> .git/info/sparse-checkout
echo "another/sub/tree" >> .git/info/sparse-checkout

This tells git which directories you want to checkout. Then you can pull just those directories

git pull origin master

CHANGE tree/master/ to trunk/
SIMPLE :
svn export https://github.com/REPONAME/examples/trunk/lite/examples/

Like for your
svn export https://github.com/PointCloudLibrary/pcl/trunk/apps

To Install svn UBUNTU:https://linuxtechlab.com/simple-guide-to-install-svn-on-ubuntu/
Windows: https://tortoisesvn.net/downloads.html


How to set session-wide environment variables and PATH? I have seen other people on the Internet also having this problem but the solutions have been non-conclusive, so I wanted to bring it to attention again.

According to this page in Ubuntu wiki:
https://help.ubuntu.com/community/EnvironmentVariables
the recommended way to set session-wide environment variables is to modify ~/.pam_environment.

Here is what my goal is:

I want to create an environment variable ANDROID_HOME that would have a path to a certain location in my home folder as a value.
I want to add two folders to the PATH.

Here is what I did. The ~/.pam_environment file was non-existent, so I created it and added the following lines to it:

ANDROID_HOME=${HOME}/Android/Sdk
PATH DEFAULT=${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools

Logged out and logged back in.

The result is not expected. I opened terminal and echoed $ANDROID_HOME and that's what I got:

${HOME}/Android/Sdk

Looks like the ${HOME} is not replaced with my home folder path. Why is that so?

Observe cd-ing to $ANDROID_HOME (the Android/Sdk actually exists in my home folder):

anvar@crazymachine:~$ cd $ANDROID_HOME
bash: cd: ${HOME}/Android/Sdk: No such file or directory

Also echoing $PATH gave me this:

/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:${HOME}/Android/Sdk/tools:${HOME}/Android/Sdk/platform-tools

Why are the variables not substituted with their values like would be logical to assume, especially when the example in the aformentioned site gave such an impression that variables can be used inside the values?

What is the right way to set session-wide environment variables that also GUI programs have access to?

The example in the wiki, for setting session variables via ~/.pam_environment, states in a note:

The syntax used for modifying PATH, which syntax differs from script files, is required for variable expansion to work.

Hence your first row should look like:

ANDROID_HOME DEFAULT=${HOME}/Android/Sdk

I think you may need an export HOME after setting up the path variable (in ~/.bashrc we do)


Disable GeForce 540m; Use only Intel integrated After fighting Nvidia optimus too long, I've decided to give up and try to just get 3d working, using any way.  I've tried out Fedora 15, which actually worked for my computer -- nice 3d graphics, recognised my intel card and used the driver.  I'm trying to install the intel graphics on a 11.04 alienware M11x.  First step I figured would be disabling nvidia, but using sudo echo "blacklist nouveau" > /etc/modprobe.d/blacklist-nvidia.conf says permission is denied (Yes, I definitely used sudo).  Any suggestions how to do this?

System: Alienware M11x R3
[8gb ram, Intel Core i5-2537M 1.4GHz (2.3GHz Turbo Mode, 3MB Cache), NVIDIA GeForce GT540 graphics with 1.0GB Video Memory and Optimus]

You cannot disable the Nvidia card by default, it's hardwired to the Intel CPU. You had 3D issues because the card could not be used, but the drivers were still loaded, preventing the Mesa OpenGL module from being loaded. This breaks graphical effects, 3D capabilities and such. Uninstalling the nvidia driver reverts this behavior.

Your sudo echo command failed because of Redirect the output using `sudo`

Optimus is not supported by nVidia for Linux. For a longer explanation and possible workarounds, see Is a NVIDIA GeForce with Optimus Technology supported by Ubuntu?

First type sudo su in the terminal, then everything you write will be in sudo mode.
And then type echo "blacklist nouveau" >> /etc/modprobe.d/blackist.conf


Alt+Left Click , how to remove shortcut I have Ubuntu and GNOME 3 and when I do Alt+Left-click it grabs the current window. How do I stop this from happening, as I need this shortcut in Blender which I update often so changing it inside Blender is not logical.

In your Compiz Config Settings Manager click on "Move Window" plugin. Click on the very first mouse shortcut (it should be <ALT>Button1) and Disable it.

Try using Xubuntu instead. I struggled a bunch with this, and was pointed toward Xubuntu because its interface steals from apps less, and is more customizable.


Error while trying installation using sudo apt-get install I'm getting this error while using sudo apt-get install command

E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it

How do I  solve it?

This should be used as last resort. If you use this carelessly you can end up with a broken system. Please try the other answers first before doing this.

You can delete the lock file with the following command:

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

You may also need to delete the lock file in the cache directory

sudo rm /var/cache/apt/archives/lock
sudo rm /var/lib/dpkg/lock

After then, updates the package lists :

sudo apt-get update

Source

You can try to reconfigure all unpacked but unconfigured packages by typing the following into a terminal :

sudo dpkg reconfigure -a


Unable to launch matlab I am using Ubuntu 16.04, I have succesfully installed matlab 2010b without any error. The same sofware had worked with Ubuntu 14.04, but with 16.04 it says:
error while loading shared libraries: libXp.so.6: cannot open shared object file: No such file or directory

I also tried yum and apt-get to install libxp.so.6 but it shoewd errors, which I have attached with screenshots.

Running yum repolist all
tells "0" , which means there are no repositories, please help to add required repository to install libxp.s0.6

That file is not available anymore on Xenial and other Ubuntu versions more recent than Trusty (also in Wily is not present).

Since Matlab is a proprietary software you should report the error to their developers, so that they can update the package and make it compatible with the new versions of Ubuntu and Debian.

In the meanwhile you can probably manually install an old version for Trusty, but probably it will also break other packages and dependencies in your system.

EDIT: The Matlab version that you are using is 2010b, so many things have changes since then. I strongly suggest that you use a recent version of the program (maybe 2016a, since we are here), in order to maintain compatibility with the systems you are using. In details, that version R2010b supports officially only Ubuntu 9.10 and 10.04.

Try following solution

sudo vim /etc/apt/sources.list

append this line to sources list:

deb http://security.ubuntu.com/ubuntu precise-security main

Then again on terminal run following commands

sudo apt update
sudo apt install libxp6

Source: http://shengweihou.com/wordpress/?p=232


Is there a way to disable the Run command dialog in KDE? How can i if possible disable the Run command dialog?. It keeps appearing even if i don't press the Key combination. ( I have disabled the Key combination ALT+f2)

Disable it as in prevent it from ever running again, EVER.

You can disable the Run Command dialog by creating an custom definition  in the file kdeglobal.

You can find the kdeglobals file under your home dir.

#cd  /your-home-dir/.kde/share/config

#vim kdeglobals

Add the entry like

[KDE Action Restrictions][$i]
run_command=false

Here is the help link for kde system admin

Im running KDE at this momemnt, so cant tell you the exact steps,

you can find keyboard shortcuts menu in kde control center,

KDE Control Center -> Accessibility -> Keyboard Shortcuts ...

Try if you have can disable it from there.


How to Install PHP Extension Crypto in Ubuntu 14.04 I am new to ubuntu. I am trying to install php 7.0 in my ubuntu 14.04

I have installed PHP using below commands.

sudo add-apt-repository ppa:ondrej/php
sudo apt-get install php7.0
sudo apt-get install php7.0-mysql

I was able to successfully install php and working fine. Now I want install some custom module in it but I am unable to do it.

I was able to do it in centos 7 using below commands.

wget https://pecl.php.net/get/crypto-0.3.1.tgz
tar -zxvf crypto-0.3.1.tgz
cd crypto-0.3.1/
phpize
./configure
make
sudo make install

And edit PHP ini like below

nano /etc/php.ini

and add line in php.ini file like this

extension=crypto.so

I am able to phpize, configure, make and install but even I edit php.ini file located in

/etc/php/7.0/apache2/php.ini

but its still not showing module when I run php -m

let me know if I am missing something in it.

Thanks

From the github page of the package:

  Linux

  Before starting with installation of this extensions, the OpenSSL library has to be installed. It is defaultly installed on the most Linux distributions. The minimal version of OpenSSL that is supported is 0.9.8 but it is recommended to have installed version 1.0.1+ to use all features.

  Of course PHP has to be installed too. The minimal version that is supported is 5.3 as the extension uses namespaces. Currently PHP also needs to be compiled with OpenSSL extension (--with-openssl). This dependency will be removed in the future.


How to install PHP 5.2.x on ubuntu 14.04? I want to run a version specific code on php 5.2.x which I have tried by many ways but not got any successful attempt.

Please let me know that how I can install PHP 5.2 on ubuntu 14.04

Install PHP 5.2.17 on Ubuntu 14.04

Based on:

http://www.rasyid.net/2014/10/07/using-multiple-php-inside-one-ubuntu-machine/

Add PostgreSQL Apt Repository (provides postgresql-server-dev-9.4)

apt-get install -y wget
echo "deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main" > /etc/apt/sources.list.d/pgdg.list
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -

Install dependencies

apt-get update
apt-get install -y gcc make build-essential \
    libxml2-dev libcurl4-openssl-dev libpcre3-dev libbz2-dev libjpeg-    dev \
    libpng12-dev libfreetype6-dev libt1-dev libmcrypt-dev libmhash-dev \
    freetds-dev libmysqlclient-dev unixodbc-dev postgresql-server-dev-9.4 \
    libxslt1-dev

Required to prevent an issue when compiling freetype support

mkdir -pv /usr/include/freetype2/freetype
ln -sf /usr/include/freetype2/freetype.h /usr/include/freetype2/freetype/freetype.h

Download PHP sources

wget -c -t 3 -O ./php-5.2.17.tar.gz http://museum.php.net/php5/php-5.2.17.tar.gz
tar xvfz php-5.2.17.tar.gz
cd php-5.2.17

Patch PHP

wget -c -t 3 -O ./libxml29_compat.patch https://mail.gnome.org/archives/xml/2012-August/txtbgxGXAvz4N.txt
patch -p0 -b < libxml29_compat.patch

wget -c -t 3 -O ./debian_patches_disable_SSLv2_for_openssl_1_0_0.patch https://bugs.php.net/patch-display.php\?bug_id\=54736\&patch\=debian_patches_disable_SSLv2_for_openssl_1_0_0.patch\&revision=1305414559\&download\=1
patch -p1 -b < debian_patches_disable_SSLv2_for_openssl_1_0_0.patch

wget -c -t 3 -O - http://php-fpm.org/downloads/php-5.2.17-fpm-0.5.14.diff.gz | gunzip > ./php-5.2.17-fpm-0.5.14.patch
patch -p1 < php-5.2.17-fpm-0.5.14.patch

Compile and install

./configure \
    --prefix=/usr/share/php52 \
    --datadir=/usr/share/php52 \
    --mandir=/usr/share/man \
    --bindir=/usr/bin/php52 \
    --with-libdir=lib/x86_64-linux-gnu \
    --includedir=/usr/include \
    --with-config-file-path=$PHP_HOME/etc \
    --with-config-file-scan-dir=$PHP_HOME/etc/conf.d \
    --disable-debug \
    --with-regex=php \
    --disable-rpath \
    --disable-static \
    --disable-posix \
    --with-pic \
    --with-layout=GNU \
    --with-pear=/usr/share/php \
    --enable-calendar \
    --enable-sysvsem \
    --enable-sysvshm \
    --enable-sysvmsg \
    --enable-bcmath \
    --with-bz2 \
    --enable-ctype \
    --without-gdbm \
    --with-iconv \
    --enable-exif \
    --enable-ftp \
    --enable-cli \
    --with-gettext \
    --enable-mbstring \
    --with-pcre-regex \
    --enable-shmop \
    --enable-sockets \
    --enable-wddx \
    --enable-fastcgi \
    --enable-force-cgi-redirect \
    --enable-fpm \
    --with-mcrypt \
    --with-zlib \
    --enable-pdo \
    --with-curl \
    --enable-inline-optimization \
    --enable-xml \
    --enable-pcntl \
    --enable-mbregex \
    --with-mhash \
    --with-xsl \
    --enable-zip \
    --with-gd \
    --with-pdo-mysql \
    --with-jpeg-dir=/usr/lib \
    --with-png-dir=/usr/lib \
    --with-mysql \
    --with-openssl \
    --with-mysqli \
    --with-kerberos \
    --enable-dbase \
    --with-mysqli=/usr/bin/mysql_config \
    --enable-gd-native-ttf \
    --with-t1lib=/usr \
    --with-freetype-dir=/usr \
    --with-ldap \
    --with-kerberos=/usr \
    --with-unixODBC=shared,/usr \
    --with-imap-ssl \
    --with-mssql \
    --without-sqlite \
    --with-sqlite \
    --without-pdo-sqlite \
    --with-pgsql \
    --with-pdo-pgsql \
    --enable-soap \
    --with-pdo-sqlite

make
make install

You can make Ubuntu 14.04 (Trusty Tahr) use the packages from Ubuntu 9.10 (Karmic Koala) to easily install PHP 5.2. This is how I installed PHP 5.2.10 on Ubuntu 14.04.3.

Step 1

Create a file karmic.list in /etc/apt/sources.list.d/ and add the following:

deb http://old-releases.ubuntu.com/ubuntu/ karmic main restricted
deb-src http://old-releases.ubuntu.com/ubuntu/ karmic main restricted

deb http://old-releases.ubuntu.com/ubuntu/ karmic-updates main restricted
deb-src http://old-releases.ubuntu.com/ubuntu/ karmic-updates main restricted

deb http://old-releases.ubuntu.com/ubuntu/ karmic universe
deb-src http://old-releases.ubuntu.com/ubuntu/ karmic universe
deb http://old-releases.ubuntu.com/ubuntu/ karmic-updates universe
deb-src http://old-releases.ubuntu.com/ubuntu/ karmic-updates universe

deb http://old-releases.ubuntu.com/ubuntu/ karmic multiverse
deb-src http://old-releases.ubuntu.com/ubuntu/ karmic multiverse
deb http://old-releases.ubuntu.com/ubuntu/ karmic-updates multiverse
deb-src http://old-releases.ubuntu.com/ubuntu/ karmic-updates multiverse

deb http://old-releases.ubuntu.com/ubuntu karmic-security main restricted
deb-src http://old-releases.ubuntu.com/ubuntu karmic-security main restricted
deb http://old-releases.ubuntu.com/ubuntu karmic-security universe
deb-src http://old-releases.ubuntu.com/ubuntu karmic-security universe
deb http://old-releases.ubuntu.com/ubuntu karmic-security multiverse
deb-src http://old-releases.ubuntu.com/ubuntu karmic-security multiverse

Step 2

Then, create another file php5_2 in /etc/apt/preferences.d/ with the following:

Package: apache2*
Pin: release a=karmic
Pin-Priority: 991

Package: php5
Pin: release a=karmic
Pin-Priority: 991

Package: libapache2-mod-php5
Pin: release a=karmic
Pin-Priority: 991

Package: libapache2-mod-php5filter
Pin: release a=karmic
Pin-Priority: 991

Package: php-pear
Pin: release a=karmic
Pin-Priority: 991

Package: php5-cgi
Pin: release a=karmic
Pin-Priority: 991

Package: php5-cli
Pin: release a=karmic
Pin-Priority: 991

Package: php5-common
Pin: release a=karmic
Pin-Priority: 991

Package: php5-curl
Pin: release a=karmic
Pin-Priority: 991

Package: php5-dbg
Pin: release a=karmic
Pin-Priority: 991

Package: php5-dev
Pin: release a=karmic
Pin-Priority: 991

Package: php5-gd
Pin: release a=karmic
Pin-Priority: 991

Package: php5-gmp
Pin: release a=karmic
Pin-Priority: 991

Package: php5-mhash
Pin: release a=karmic
Pin-Priority: 991

Package: php5-mysql
Pin: release a=karmic
Pin-Priority: 991

Package: php5-odbc
Pin: release a=karmic
Pin-Priority: 991

Package: php5-pgsql
Pin: release a=karmic
Pin-Priority: 991

Package: php5-pspell
Pin: release a=karmic
Pin-Priority: 991

Package: php5-recode
Pin: release a=karmic
Pin-Priority: 991

Package: php5-snmp
Pin: release a=karmic
Pin-Priority: 991

Package: php5-sqlite
Pin: release a=karmic
Pin-Priority: 991

Package: php5-sybase
Pin: release a=karmic
Pin-Priority: 991

Package: php5-tidy
Pin: release a=karmic
Pin-Priority: 991

Package: php5-xmlrpc
Pin: release a=karmic
Pin-Priority: 991

Package: php5-xsl
Pin: release a=karmic
Pin-Priority: 991

Step 3

Then, run sudo apt-get update and finally, install them by using the following (example):

sudo apt-get install apache2 libapache2-mod-php5 php-pear php5-curl php5-dbg php5-mhash php5-mysql php5-tidy php5-xmlrpc php5-xsl

p/s: You could add other php extensions in the install command above, but only the ones defined in the php5_2 preference file, otherwise it will install the wrong version.


Clean Install of 18.04 Boots to Grub Prompt I'm stuck at a grub prompt since installing Ubuntu 18.04. I have tried all the things I can find online but I'm stumped.

It was a clean install of Ubuntu 18.04 started from a USB stick. I had 17.10 installed but selected to overwrite my old installation during the new install. I also have a Windows 10 partition as I dual boot.

The install happened fine, but now when I boot my machine I end up at the grub> prompt.

If I type exit Ubuntu boots with no problems.

If I manually select the drive with Windows on from my BIOS it loads with no problems.

I tried using the grub-rescue disk tool but it says it can't run because it's not in EFI mode.

An output of the diagnostics from this shows:

=================== Suggested repair
The default repair of the Boot-Repair utility would purge (in order to fix packages) and reinstall the grub-efi-amd64-signed of nvme0n1p7, using the following options:        nvme0n1p1/boot/efi,
Additional repair would be performed: unhide-bootmenu-10s   fix-windows-boot use-standard-efi-file

I've tried installing grub using this:

sudo grub-install --efi-directory=/dev/nvme0n1p1/

But I get an error:

Installing for i386-pc platform.
grub-install: error: install device is not specified.

It's a nvmie drive. I'm a bit stumped. Any ideas of what else I can try?

I was able to solve mine (though I was using EFI and not legacy) by booting from the install thumb drive, selecting rescue mode, and re-installing grub on /dev/sda.

My solution was EASY!
I simply rebooted with EFI only, then it passed for me to do a clean reinstallation of Ubuntu.
Regards


Configure connection sharing with specific IP Address Edit - a more concise version of the question:

When using connection sharing, I want network manager to use the 192.168.254 subnet instead of the 10.42.0 subnet. Is this possible?

Background:

I need to share my wireless internet connection (on an Ubuntu laptop) with a RasPi connected to the laptop by ethernet.

Everything works fine by configuring eth0 as "Shared to Other Computers" (documented in many places, for example here).

Using this setup, my IP address when connected to the RasPi is 10.42.0.1. The RasPi picks up another address in that subnet. Everything works great!

Because of how the RasPi is configured (to work with several other systems), I want eth0 to use 192.168.254.1. If I configure eth0 to manually use 192.168.254.1:

the RasPi connects to my laptop and I am able to ssh into it. However, although I still see a valid wlan0 configuration when running ifconfig, I'm unable to access the internet (presumably my laptop is trying to use eth0 instead of wlan0).

I'm looking for a way to either:

a) Still use wlan0 to access the internet when eth0 is manually configured

b) Force eth0 to use a specific IP address when configured with "Shared to Other Computers"

I'm trying to set up simple instructions for other users, so if possible I'd like to avoid any manual iptables-type setups.

In versions before 1.4.2, 10.42.0.x is hard-coded into NetworkManager. Forget about GUI-based solution or wait until the bug/feature request is fixed. Or fix it yourself for all of us. Or at least vote the bug on launchpad for faster resolution.

Either upgrade to Ubuntu 17.04, with version 1.4.4, or use the following command from Thomas Haller to set the host IP and class.

nmcli connection modify $CONNECTION_ID +ipv4.addresses 192.168.5.1/24

where $CONNECTION_ID if found via nmcli connection show. Afterwards, verify with nmcli connection show $CONNECTION_ID.

Your configuration has a fundamental problem. Your gateway is set to the same IP address as your local IP address.

A graphic:
Raspi: connect to 10.0.0.5
Raspi: not in my subnet, send to gateway
Raspi receives request again and responds with the same message.

Your question is a bit confusing, but it seems that your laptop should have an IP like 192.168.254.2

You will also need to set up Network Address Translation on the laptop.

I think it would be better if you bridged the two interfaces, so the raspi will effectively use your laptop's wifi to communicate. On your laptop, do:

sudo -i

This makes you root.

apt-get update
apt-get install bridge-utils
brctl addbr br0
brctl addif br0 wlan0
brctl addif br0 eth0
ifconfig br0 10.42.0.1
ifconfig br0 netmask 255.0.0.0
ifconfig br0 up

Ctrl-D to exit root

On raspi(connected to eth0):

sudo ifconfig eth0 10.42.0.2
sudo ifconfig eth0 netmask 255.0.0.0
sudo ifconfig eth0 up
echo 'nameserver 8.8.8.8'>/etc/resolv.conf
ping 10.42.0.1
ping 8.8.8.8
ping fb.com

The final three commands will show you what type of network access you have:

If only the first passes: local network
If up to the second passes: Internet access
If all pass: Internet access with DNS


How do I create a new file in a folder owned by root? Specifically, I want to add a file to /etc/X11/xorg.conf.d I want to add a new file to /etc/X11/xorg.conf.d as seen at the bottom of this page, but I can't as it's owned by root user. How to?

EDIT: I managed it using the information on this page:

First, create the file, using the editor of your choice. Store it in a user directory, something in or under $HOME Check it to be sure it says what you think it says, and does what you want. Then, and only then:

sudo cp yourfile /etc/X11/xorg.conf.d/50-mouse-acceleration.conf

if you simply want to change owner of a file you can use chown command
as here it is told the usage is simply sudo chmod root filename


Desktop broken: no launcher and no windows Today my laptop (Lenovo thinkpad t530) stopped booting at 'checking battery state' or a similar message. Loging-in to the regular console (alt-ctrl-f1) was possible, and I figured maybe it is some messed up driver thing.
So I reinstalled the nvidia-current drivers (apt-get install -reinstall).

This fixed the problem, however now after login in I see my desktop, but no launcher!
Furthermore if I start an application (ctrl-alt-t does work) I cannot move the application around (i.e. there is no real window, just the application itself) nor can I use atl-tab to switch applications.
Basicly I cannot work anymore because it is impossible to switch applications!

I tried a million things (unity-reset.py script, installing nvidia-experimental drivers, reinstalling the unity package), but nothing seems to fix this.

EDIT:

Ok, so I have sort of a solution now:
I uninstalled all Nvidia drivers (I remembered these cause problems in the past).
However this brought back the problem that the GUI won't boot beyond the test message  'checking battery state'. Choosing in the boot menu to boot an older kernel (3.5.0-19-generic instead of 3.5.0-21-generic) solved that problem.

So there are really two questions left though:

Why won't my system boot up properly all of a sudden (without picking an older kernel)?
Why does the GUI not work properly with the nvidia drivers (AFAIK my laptop has an Nvidia Optimus Graphics NVS 5400M videocard).

I sort of had the exact problem with Unity after I installed nVidia drivers in 12.10.
I installed nVidia driver, rebooted and had a very low resolution and no Unity.

A friend of mine (an Ubuntu expert!) fixed it for me. He uninstalled the nvidia drivers. (I guess this would help) the he installed Nouveau and everything was fine.

I hope it helps :-)


Routing 2 ISPs to 2 different networks Ok, so here is my scenario.  eth0 and eth3 point to 2 different ISPs, eth1 is an internal network say on 192.1.1.0 and eth2 is on another network say 10.1.1.0.

I want each network to be on their own internet connection.

I'm using IPtables to route eth1 to eth0 and eth2 to eth3 so each network has a physical connection to their own internet.  The problem is routing.  I can't assign 2 default gateways.. one to eth0 and one to eth3.  Right now I only have a default gateway on eth0.  My 192.1.1.0 network has internet access, eth1 talks to eth0 which has a default gateway to the internet.  My 10.1.1.0 network does not have internet, eth2 is either talking to eth3 which has no default gateway OR eth2 is trying to talk to eth0 which is forbidden by my iptables.  How can I go about adding 2 default gateways or go about solving this problem?

Sounds like he wants to route lan1 via wan1 and lan2 via wan2.

Get a cisco router <- much easier to implement.


Cannot Install Ubuntu I have tried many times to install Ubuntu, each time that I do I get an error stating that,
Cannot install into C:\Ubuntu.
There is another file or directory with this name.
Please remove it before continuing.

Without knowing for sure, it sounds like you're attempting a Wubi installation.

If you are trying to install Wubi to the folder C:\Ubuntu, but that folder already exists and has files in it, the installer won't let you continue.  You need to delete that folder (and all its contents).

Open up your C:\ drive (open My Computer, double click on the C: icon.  It may make you click Show folder contents before displaying the folders).  Right click on the Ubuntu folder and select move to trash.   Alternately, you could rename it in case there are important files in there you don't want to lose.  (right click -> rename -> choose new name).

Here's a Wubi guide

I experienced the same issue when i using Wubi.exe application in Edububtu DVD, this happened to me because i cancel first time it start installing, then i did a permanent delete ofbi files on C:/Ubuntu. After that even the Ubuntu file not existing in the C: directory,  Wubi.exe starts shows the Error "Previous Installation find C:/ubuntu".

I googled for Wubi.exe for My ubuntu version and I downloaded Wubi.exe for Edubuntu 14.2 from http://releases.ubuntu.com/precise/wubi.exe .When i started to install it prompted me with uninstall option of previous. I did that and again installed Wubi.exe From DVD.. It worked...


Syntax for sending notification hint using gdbus or python's dbus module I'm trying to update a previous notification (which displays the screen's brightness after being changed using a progress bar) with gdbus, as notify-send does not support updating.

Previously I use a workaround by killing the previous notification, but it makes the notification disappear and then reappear, instead of smoothly updating the progress bar:

#!/bin/bash
for i in {0..100..10}
    do
        kill $(pgrep ^xfce4-notifyd$)
        notify-send "Brightness" -h int:value:$(xbacklight -get) -h string:synchronous:volume -i weather-clear -t 1
    done

I tried dbus-send, but no notification showed up even if I remove the hints part. After some googling, I found out gdbus and got it working, but only without hints.

Basically, this is where I've got so far with gdbus:

#!/bin/bash
gdbus call --session --dest org.freedesktop.Notifications \
--object-path /org/freedesktop/Notifications \
--method org.freedesktop.Notifications.Notify \
brightness \
42 \
notification-display-brightness-full \
"Message" "Body" [] \
"{'value':i, 'name':'value', 'value':'$(xbacklight -get)'}" "{'type':'string', 'name':'synchronous', 'value':'volume'}" \
1

However I'm stuck at this error:

Error parsing parameter 7 of type 'a{sv}': expected value:
  {'value':i, 'name':'value', 'value':'0.000000'}
           ^

Can anyone help me with the syntax for notification hints sent by gdbus?

I read somewhere that I can use some custom patched version of notify-send, however I don't like the idea of introducing unofficial binaries into my stable system.

Btw, I'm using xfce4-notifyd in xubuntu.

UPDATE:

I tried to be less pig-headed and I tried python's dbus module for the job. And again, I'm stuck at hints. It only worked if I remove the hints. Here's the new code:

#!/usr/bin/env python3
"""Creates a Notification pop-up bubble"""
import dbus
item              = "org.freedesktop.Notifications"
path              = "/org/freedesktop/Notifications"
interface         = "org.freedesktop.Notifications"
app_name          = "brightness"
id_num_to_replace = 0
icon              = "weather-clear"
title             = "Message"
text              = "Body"
actions_list      = ''
hint              = '"{'type':i, 'name':'value', 'value':'$(xbacklight -get)'}" "{'type':'string', 'name':'synchronous', 'value':'volume'}"'
time              = 5000   # Use seconds x 1000

bus = dbus.SessionBus()
notif = bus.get_object(item, path)
notify = dbus.Interface(notif, interface)
notify.Notify(app_name, id_num_to_replace, icon, title, text, actions_list, hint, time)

And the error:

File "/home/pygeek03/bin/brightness.py", line 13
 hint              = '"{'type':i, 'name':'value', 'value':'$(xbacklight -get)'}" "{'type':'string', 'name':'synchronous', 'value':'volume'}"'
                           ^
SyntaxError: invalid syntax

It's just invalid python syntax. What you do with the strings for hint does not make any sense. Try seeing matching quotes for example.

hint should be:

hint = {'type':'i', 'name':'value', 'value':int(os.system('xbacklight -get'))}


4 clicks to shut down Ubuntu - can we reduce this? Ubuntu 20.04 has decided we need 4 clicks to shut down:

Click top right of screen arrow-down
Expand "power off/logout" panel
Click "Power off"
Confirm you want to power off by choosing power off vs reboot etc

Let's cut out at least 2 clicks here... how?

UPDATE: This is a "Lounge PC" - operated by mouse (no power button within reach as the laptop is closed). We watch a film, we want to click to shutdown and not type commands.

You can easily make it 2 clicks:

Open Settings
Go to "Power"
Change the "Power button action" dropdown to "Power off"

Now click the physical power button on your device and then select power off from the prompt - that is 2 clicks (1 if you don't count pressing the power button as a click).

in terminal shutdown now do the trick for me


Weather from terminal I want to find the current weather of a particular city or my location from terminal. Is there any command-line weather app?

Simply enter the following in a terminal:

curl wttr.in

And will get your location from /etc/timezone. Otherwise curl wttr.in/your_location. For example, for Tehran:

curl wttr.in/tehran

Which gives you:

You can also compare two cities:

diff -Naur <(curl -s http://wttr.in/london ) <(curl -s http://wttr.in/new-york )

Source code of developer is available on Github.

Although accuweather curl solution is pretty good I needed something more informational, so I created simple bash script that pulls info for next 4 hrs from weather.com website. As in previous example you have to modify link for your location.

Example output:
$ ./getWeather.sh
Temperature for 1 AM : 65&deg;F and outside should be: Partly - Cloudy FEELS LIKE:   65&deg;
Temperature for 2 AM : 65deg;F and outside should be: Partly - Cloudy FEELS LIKE: 65deg;
Temperature for 3 AM : 63deg; and outside should be: Partly - Cloudy FEELS LIKE: 63deg;
Temperature for 4 AM : 62deg; and should be: Mostly - Clear FEELS LIKE: 62deg;

Full script is located at:
https://sites.google.com/site/wozoopalinux/home/wzbash001/get-weather-information-from-command-line-for-next-4-hrs


How to Live Streaming on YouTube? I'm looking for a way to stream to YouTube Live on my computer. I know there are various tools available for Windows, but I haven't found anything for Linux. I prefer not to use G+ Hangouts, but go right to actual streaming. Does anybody know of any tools for Linux that will stream to YouTube Live, or is there a Windows tool that works without any issues under WINE?

This is not gonna be easy, but we can do it. We will stream to Twitch.tv, which can stream to YouTube Live.

Here we go:

Preparing the libraries: Type these commands in Terminal.

sudo apt-get install ffmpeg
sudo apt-get install libx264-dev libavcodec-extra-53

The code required to stream: Open gedit/Text Editor and paste this code: http://shrib.com/ubuntu2twitch

Save the text file as twitch_stream.sh in your /home/ directory.

Obtaining a Twitch Streaming Key: Go to http://www.twitch.tv/broadcast/dashboard/streamkey and get your Streaming key. Open gedit/Text Editor and paste the key into it. Name this file as .twitch_key and save it in your /home/ directory, same as the twitch_stream.sh file.

Going live: Open Terminal and type this:

cd
cd /home/
chmod 755 twitch_stream.sh

If there are no errors, you'll see your screen on the Twitch Dashboard.

Streaming from Twitch to YouTube: Visit http://www.twitch.tv/settings/connections to setup your YouTube account and got to your live feed to share on YouTube. If Twitch does not allow live streaming to YouTube, why not add a screen to your YouTube feed to ask users to go to Twitch?

Please upvote if you think this helped you.

A big thank you to The Game Engine for the code.

UPDATE: Got it!!! There you go: http://sourceforge.net/projects/snowmix/ Install Snowmix first.

And then GStreamer: http://gstreamer.freedesktop.org/download/ Search on Ubuntu Software Center for the same.

Now read this guide and set it up. Voila, forget Twitch and stream to YouTube directly! http://sourceforge.net/p/snowmix/wiki/Snowmix%20and%20CDNs/

On Linux, there's a variety of apps like Smplayer, minitube among others but if you just like to download, try youtube-dl, a command line tool for downloading you tube videos. it's written in Python. Hope that helps a little.


Youtube doesn't work anymore in firefox (Ubuntu 14.04) Title says it all. Whenever I try to play a Youtube video I get the error messages:

  Your browser does not recognize any of the video formats available

It worked fine just before I installed the pipelight plugin. I am very confused and annoyed at this. My Youtube still works fine in chrome.

Any help is appreciated.

Install the ubuntu-restricted-extras package:

sudo apt-get install ubuntu-restricted-extras

From Wikipedia:

  Ubuntu Restricted Extras is a software package for the computer
  operating system Ubuntu that allows the user to install essential
  software which is not already included due to legal or copyright
  reasons.

  It is a meta-package that installs:

  Support for MP3 and unencrypted DVD playback
  Microsoft TrueType core fonts
  Adobe Flash plugin
  codecs for common audio and video files

I recently sent out an update on my personal Ubuntu support list so that people wouldn't feel stupid trying to overcome this difficulty.

The problem you are experiencing is actually not related to the version of Ubuntu.  Many of my friends who upgraded from 12.04 to 14.04 assumed that somehow broke you-tube or Firefox, but in fact it was just a matter of timing.  I know this for certain because their complaints came in at the same time that I was (and am) still using 12.04, and I was having the same problems.

In my case the ADOBE FLASH driver required to watch both Hulu and You-tube first stopped working under my installation of the "chromium" web browser, and then about a month later Firefox too suffered this change.  I was annoyed and several of my Ubuntu friends as well, so after one of them who is too proud to ask for my help took his laptop to Best Buy's Geek Squad and paid them $120 to re-install Firefox... which didn't even help, I decided to see what could be done, before anyone else tried something equally fruitless and expensive.

At that time what I did was to install the "Chrome-beta" web browser (not the original Chromium) and that somehow overcame the problem.  If I understand you correctly, the regular Chrome web browser also works, I'll alert my friends.

It is truly unfortunate for Ubuntu that this issue of timing has started the false rumor (which I've been hearing for weeks now) that upgrading to Ubuntu 14.04 somehow makes it impossible to watch Youtube videos.

**UPDATE December 21, 2014:  **
I've been wrestling with the idea of deleting this post.  It offends me that I received ANY down-votes from people simply because the BETA version of chrome I recommended was out of BETA not long after.

In any case, it seems that the Google Chrome browser worked better for me than the Google ChromIUM browser which was the only version listed in the software center.  It is possible that by this date, all browser work equally well but that's not what I continue to hear from frustrated Ubuntu users who turn to this site for help, which is why I'm choosing to update this answer instead of deleting it... for now.

Here is the link I last used to help a friend install the Google Chrome browser on their laptop and permit them to once again view videos.


Integrated Graphics Controller is not listed in Ubuntu 14.04 lspci | grep VGA gives me

lspci | grep VGA
01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Park [Mobility Radeon HD 5430/5450/5470]

It's not listing Intel HD graphics driver. I want to try hybrid graphics

Laptop: Dell Inspiron
Ubuntu: 14.04

The intel-linux-graphics-driver is probably the easiest way to install the correct intel linux graphics driver. This package is provided by intel's Open Source Technology Center

To summarize thier instructions:

Download the latest deb file from the downloads page.  The latest installer, intel-graphics-installer-linux-1.0.7 should work for Ubuntu 14.04. Install this package using:
sudo dpkg -i intel-linux-graphics-installer_1.0.7-0intel1_amd64.deb
In order to "trust" the Intel® Graphics Installer for Linux*, you will need to add keys to Ubuntu's software package manager ("apt"). Open a terminal, and execute these line:

wget --no-check-certificate https://download.01.org/gfx/RPM-GPG-KEY-ilg -O - | \
sudo apt-key add -

wget --no-check-certificate https://download.01.org/gfx/RPM-GPG-KEY-ilg-2 -O - | \
sudo apt-key add -

Once installed, you can find the Intel Graphics Installer for Linux* in your application dashboard. Just look for our logo, or begin typing 'Intel'. If you are a power user, you can open a terminal and execute: intel-linux-graphics-installer

Not sure which Dell Inspiron you are using, but I believe that my solution should work for all of them.


sudo apt update error: "Release file is not yet valid" I keep getting this error every time I try to sudo apt update:

Hit:1 ubuntu bionic InRelease
Ign:3 linux/chrome/deb stable InRelease
Get:2 /ubuntu bionic-updates InRelease [88.7 kB]
Get:5 /linux/chrome/deb stable Release [943 B]
Get:6 http://dl.google.com/linux/chrome/deb stable Release.gpg [819 B]
Get:4 http://us.archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]
Get:7 http://security.ubuntu.com/ubuntu bionic-security InRelease [83.2 kB]
Reading package lists... Done
E: Release file for http://dl.google.com/linux/chrome/deb/dists/stable/Release is not valid yet (invalid for another 2h 45min 28s). Updates for this repository will not be applied.
E: Release file for http://us.archive.ubuntu.com/ubuntu/dists/bionic-updates/InRelease is not valid yet (invalid for another 4h 34min 33s). Updates for this repository will not be applied.
E: Release file for http://us.archive.ubuntu.com/ubuntu/dists/bionic-backports/InRelease is not valid yet (invalid for another 1h 22min 16s). Updates for this repository will not be applied.
E: Release file for http://security.ubuntu.com/ubuntu/dists/bionic-security/InRelease is not valid yet (invalid for another 4h 32min 36s).

Updates for this repository will not be applied.

I've reset my timezone to UTC, but that didn't work.
I also found a different answer where they said I should try

sudo apt-get -o Acquire::Check-Valid-Until=false update

but that didn't work either.
I got the same error both times.

Run:

sudo hwclock --hctosys

This command gets the latest time from your Windows machine’s RTC and sets the system time to that.

Try running the following command
sudo systemctl restart ntp.service && ntpq -p
OR to edit manually, run
nano /etc/ntp.conf and add/edit the following lines:
server 0.ubuntu.pool.ntp.org

server 1.ubuntu.pool.ntp.org

server 2.ubuntu.pool.ntp.org

server 3.ubuntu.pool.ntp.org


Should I stick with Ubuntu 20.04 LTS and upgrade kernel to 5.8 or install Ubuntu 20.10 for Ryzen 4000 series? I have a Lenovo Ideapad with ryzen 4300U CPU. I have read that Ubuntu 20.04.1 LTS with kernel 5.4 LTS is not compatible with AMD ryzen 4000 series due to renoir integrated GPU.
Is it better to use Ubuntu 20.04.1 with upgraded kernel or AMD proprietary driver, or to use Ubuntu 20.10 with kernel 5.8 which the supports ryzen 4000 series?

I have Asus Zenbook 14 with Ryzen 7 4700U and I had problems with touchpad and screen brightness on Ubuntu 20.04.
Ubuntu 20.10 beta works without troubles, so I think that you should use newer versions of Ubuntu but Ubuntu 20.04 with upgraded kernel should work too.

I am using 20.10 on XMG core 15 amd (ryzen 7 4800 nvidia 1650ti). Things work nearly as expected, only it freezes sometimes (unpredictable, but often after it seems to get into powersaving mode) and often gets stuck during shutdown for some reason.


Add user that can read / write a root, www-data files How can I do that?
 I got user amira on my Ubuntu 11.4,  I want him to able to see / read / write a root user files such as /etc/* and apache files

The normal way to do this is to add that user to the sudoers file. You can do that this way:

Open a terminal and type

sudo su

After entering your admin password type

visudo

Using the arrow keys, navigate to the bottom of the sudoers file that is now displayed in the terminal
Just under the line that looks like:

root ALL=(ALL) ALL

Add

amira ALL=(ALL) ALL

Now press Ctrl+X and press Y when prompted to save

User amira can now use sudo to edit file, permissions and anything an admin user (like the one you used installing your Ubuntu) is capable of doing.

You should probably change the ownership of the relevant files and folders. For instance, if you have a website which files are in /var/www/amira, then you could set the files and folders to belong to www-data:amira. Then you would allow that group to edit files and add users to that group. The amira user would already have that group as its primary group. This is a much better approach than saying a user can edit all roots files since you can then limit which files are editable by who. If amira got hacked, then the website would be editable by the hacker, but your openssh-server would still be safe, for instance.


libcurl error when running Boinc I downloaded the latest versione of Boinc x64. When I run the manager, there is an error

./boincmgr: error while loading shared libraries: libcurl.so.4: cannot open shared object file: No such file or directory

It seems that you need to install the Ubuntu package libcurl3 to provide the shared object file (=library) that the command complains about missing. Install it either through the Software Center or by writing sudo apt-get install libcurl3 in a terminal window (it will ask for your password to be able to install the program onto the system).

Is there any particular reason that you have not installed the boinc package that comes with Ubuntu, by the way? If it were me, I would prefer to have updates coming in for a program that turns my computer into a work node that executes code that I can't really verify for myself. :-)

https://launchpad.net/~xapienz/+archive/ubuntu/curl34
sudo add-apt-repository ppa:xapienz/curl34
sudo apt-get update


How do I add Ubuntu option on the Windows Boot Manager menu? Currently i am on dual boot system.After repair Window7,windows boot manager can not show Ubuntu option on startup.when computer start,system directly opens Window7.my Window7 on C: and Ubuntu on D:.

You'll need to use the Boot-Repair tool. To do this

Download Boot-Repair from here.
Burn it on a USB stick or on a DVD. (Don't burn it on a CD/DVD if you have Windows 8)
Boot your computer with the disk.
Choose language and connect to internet if possible.
Try "Recommended Repair"
Reboot.

More throughout tutorial can be found here.


How to enable mod_rewrite in Apache? I just installed the LAMP stack on my Ubuntu system.

The redirection is not working for me. I don't know how to fix it. Can anyone help me?

To enable it the rewrite module, run "apache2 enable module rewrite":

sudo a2enmod rewrite

You need to restart the webserver to apply the changes:

sudo service apache2 restart

If you plan on using mod_rewrite in .htaccess files, you also need to enable the use of .htaccess files by changing AllowOverride None to AllowOverride FileInfo. For the default website, edit /etc/apache2/sites-available/default:

    <Directory /var/www/>
            Options Indexes FollowSymLinks MultiViews
            # changed from None to FileInfo
            AllowOverride FileInfo
            Order allow,deny
            allow from all
    </Directory>

After such a change, you need to restart Apache again.

Apache documentation on AllowOverride
Manual page of a2enmod

I dare to add a special answer (as a followup to the great answer above) regarding ubuntu 14.04 and .htaccess :

In 14.04, the name of the default configuration file is changed to 000-default.conf :

sudo gedit /etc/apache2/sites-available/000-default.conf

add the following to the end of the file :

<Directory "/var/www/html">
    AllowOverride All
</Directory>

For some reason, in Ubuntu 14.04 and apache2 the root is set to /www/html. If you want to change the webserver root back to good old /www, open 000-default.conf and change

DocumentRoot /var/www/html/

to

DocumentRoot /var/www/

and then off course it should be

<Directory "/var/www">
    AllowOverride All
</Directory>


Looping on login screen after installing new amd driver I have Ubuntu 14.04 and have it AMD driver installed. When it rebooted, it kept back to login screen even my password is correct. What is wrong? Do I have to reinstall the Ubuntu?

Actually I run it on Virtualbox

Make sure you have selected your Video output correctly and enabled 3d Hardware acceleration. Without that, I think it won't work properly. Also, try increasing your video memory for the OS in Virtualbox.


Shell: echo Multi character string Lets say I have strings like this:

/somefolder/andsubfolder/my_first_text.txt
/somefolder/andsubfolder/my_second_text.txt

and I want to create a loop to echo

my_first_text
my_second_text

After some research I found out that the cut command is not abled to do so. I think awk might be an option but I did not fully understand how to get it working properly on this example... so any help would be very appreciated.

I think that the simplest way is to use string operators. For example, if:

str="/somefolder/andsubfolder/my_first_text.txt"

then you can use somethink like:

str=${str##*/}
echo ${str%.txt}

But, you can still use cut with the help of rev (see man cut and man rev for more info):

echo $str | rev | cut -d/ -f1 | cut -d. -f 2- | rev

And the solution using awk is:

echo $str | awk -F/ '{print $NF}' | awk -F. '{$NF=""}1'

try this out shell script

#!/bin/bash

abc=/somefolder/andsubfolder/my_first_text.txt
my_file=$(echo $abc | awk -F/ '{print $4}')
echo "$my_file"

this will sure help you.


Unable to boot into ubuntu 13.04 My pc has ubuntu 13.04 alongside window 8. Last time I used my pc (in ubuntu) is 5 days ago and it was fine. Today I tried to boot into ubuntu but failed. Normal boot seems to stuck forever at the purple ubuntu screen with nothing on it. I also tried to select recovery mode in grub screen. What happened is the screen(command line) was flooded by this line

  udevd[360]: timeout: killing '/sbin/modprobe -bv pci:v000010DEd00000DC4sv000010DEsd0000085ABc03sc00i00' [339]

I also tried to run boot-repair in live-USB. Nothings worked. This is the paste log from the boot-repair.  >> http://paste.ubuntu.com/6133079/

Window 8 is still working. Any help is very appreciated. Also this is my first time posting on this I dunno what I need to tell.

I think you need a GPT partition to dual boot in windows 8. I changed mine back to NTFS and it won't boot into Ubuntu 13.04


How to resume release upgrade? I was upgrading from 13.04 to 13.10 via ssh (didn't use screen). My ssh connection was interrupted when do-release-upgrade script was about to remove obsolete packages. Now when I reconnect and run it it just says No new release found. How to finish upgrade process?

Run

sudo dpkg --configure -a

then:

sudo apt-get dist-upgrade

Finally run (probably not needed):

sudo apt-get upgrade

Can you check /etc/update-manager/release-upgrades and see if it's set to "prompt=never"?

I had an issue where an old server that I inherited wasn't picking up the fact that a new LTS release was available. That was how I fixed it.

Example:

$ sudo cat /etc/update-manager/release-upgrades
# Default behavior for the release upgrader.

[DEFAULT]
# Default prompting behavior, valid options:
#
#  never  - Never check for a new release.
#  normal - Check to see if a new release is available.  If more than one new
#           release is found, the release upgrader will attempt to upgrade to
#           the release that immediately succeeds the currently-running
#           release.
#  lts    - Check to see if a new LTS release is available.  The upgrader
#           will attempt to upgrade to the first LTS release available after
#           the currently-running one.  Note that this option should not be
#           used if the currently-running release is not itself an LTS
#           release, since in that case the upgrader won't be able to
#           determine if a newer release is available.
prompt=lts


Broadcom BCM4312 driver for Ubuntu 14/15? Today in class we found that after installing Ubuntu, the Wi-Fi doesn't work. The Wi-Fi LED stays orange (Blue means it works).

Where I can found the drivers?
What should I do in the CLI when we have the drivers?

Ubuntu's are: 14.4, 14.10, 15.4 & 15.10 (All have versions of x86 & x64)
Laptop is HP 6735s

WLAN Device is Broadcom bcm4312 [14e4:4315]

Thanks for attention.

Insert your Ubuntu instalation media(usually the USB flash drive)
Go to pool>main>d>dkms and copy the .deb file to a New Folder on your Desktop
Then go to pool>restricted>b and copy the .deb file to the same folder as dkms file(previous step)
Open a terminal and using cd command navigate to the New Folder
Run sudo dpkg -i dkms*.deb and sudo dpkg -i bcmwl*.deb and done, your driver should work now or after a reboot.


Is there a way to make bigger the characters of xterm? Is there a way to make bigger the characters of xterm? Where can I access the properties of xterm and change their configurations?

Thank you !

You can access the properties of xterm and change their configurations:
By holding down the Control key upon your keyboard and clicking upon the body of the window with either your left, right, or center mouse button.
So to change the the font size:
Press the Control key with one hand, and click the right mouse button.
A menu appears, with the following font alternatives:
Default (fontdefault)
     Set the font  to  the  default,  i.e.,  that given by the *VT100.font resource.
Unreadable (font1)
     Set   the   font   to   that  given  by  the *VT100.font1 resource.
Tiny (font2)
     Set  the  font  to   that   given   by   the *VT100.font2 resource.
Small (font3)
     Set   the   font   to   that  given  by  the *VT100.font3 resource.
 Medium (font4)
     Set  the  font  to   that   given   by   the *VT100.font4 resource.
Large (font5)
     Set   the   font   to   that  given  by  the *VT100.font5 resource.
Huge (font6)
     Set  the  font  to   that   given   by   the *VT100.font6 resource.

If you are using gnome-terminal

Ctrl+Shift++ to make text larger

Ctrl+- to make text smaller


How to clear browser's cache and cookies from terminal I want to clear my firefox cache and cookies from terminal.What can i do?

To clean the cookies from terminal you can use the following command:

rm ~/.mozilla/firefox/*.default/cookies.sqlite

To clean all the cache, you can use:

rm ~/.mozilla/firefox/*.default/*.sqlite ~/.mozilla/firefox/*default/sessionstore.js
rm -r ~/.cache/mozilla/firefox/*.default/*

But, better you can make a backup of these files if you want to restore them latter:

mkdir -p ~/.mozilla/firefox/backup ~/.cache/mozilla/firefox/backup
mv ~/.mozilla/firefox/*.default/*.sqlite  ~/.mozilla/firefox/backup
mv ~/.mozilla/firefox/*.default/sessionstore.js ~/.mozilla/firefox/backup
mv ~/.cache/mozilla/firefox/*.default/* ~/.cache/mozilla/firefox/backup

I at least found a proper solution:

first go to your home location

press ctrl+h

open folder .cache

open folder mozilla

open folder firefox

open the (anything).default folder

open the cache folder

delete all folders in this

then open Firefox

go to edit, preferences and delete all cache and cookies once

and i assure u the your problem will be solved


PATH variable resets with reboot Just as the title indicates my PATH variable resets after every reboot. I read that I have to edit my bashrc file's PATH variable, but I don't have anything there that suggests anything related to the PATH variable.

if you want to update the PATH only for your user, just edit your local bashrc

gedit ~/.bashrc

if you want to update the global PATH

gksudo gedit /etc/bash.bashrc

Environment variable settings that should affect just a particular user (rather than the system as a whole) should be set into:

~/.pam_environment # This file is specifically meant for setting a user's environment.

It is not a script file, but rather consists of assignment expressions, one per line.

PATH DEFAULT=${PATH}:~/MyPrograms

Note: Using .pam_environment requires a re-login in order to initialize the variables. Restarting just the terminal is not sufficient to be able to use the variables.

source: https://help.ubuntu.com/community/EnvironmentVariables#Session-wide_environment_variables


How can I install my Xbox 360 wired controller? I have tried the install instructions https://help.ubuntu.com/community/Xbox360Controller but I keep getting an error message at the point when I'm executing the Make file.

warlord@warlord-laptop:~/xpad$ make
make modules -C /usr/src/linux-headers-2.6.32-32-generic SUBDIRS=/home/warlord/xpad
make[1]: Entering directory `/usr/src/linux-headers-2.6.32-32-generic'
   CC [M]  /home/warlord/xpad/xpad.o
/home/warlord/xpad/xpad.c: In function ‘xpad_wireless_connect’:
/home/warlord/xpad/xpad.c:291: error: implicit declaration of function ‘info’
/home/warlord/xpad/xpad.c: In function ‘xpad_open’:
/home/warlord/xpad/xpad.c:382: error: ‘struct input_dev’ has no member named ‘private’
/home/warlord/xpad/xpad.c: In function ‘xpad_close’:
/home/warlord/xpad/xpad.c:408: error: ‘struct input_dev’ has no member named ‘private’
/home/warlord/xpad/xpad.c: In function ‘xpad_probe’:
/home/warlord/xpad/xpad.c:496: error: ‘struct input_dev’ has no member named ‘cdev’
/home/warlord/xpad/xpad.c:497: error: ‘struct input_dev’ has no member named ‘private’
make[2]: *** [/home/warlord/xpad/xpad.o] Error 1
make[1]: *** [_module_/home/warlord/xpad] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-2.6.32-32-generic'
make: *** [all] Error 2

Why is this happening? I've also tried xboxdrv, and the jscalibrator is no longer supported in Ubuntu 10.04 LTS. And i also used lsinput and it shows my gamepad correctly in event 10 but not in js0 or js1.

/dev/input/event10
   bustype : BUS_USB
   vendor  : 0x45e
   product : 0x28e
   version : 276
   name    : "Microsoft X-Box 360 pad"
   phys    : "usb-0000:00:1d.2-1/input0"
   bits ev : EV_SYN EV_KEY EV_ABS EV_FF

it is not necessary to install the controller in 10.04. it should just work, though not for games running wine that use the xinput interface i.e. many newer titles

I don't believe you can atm as the wireless Xbox 360 controller uses different protocols to standard bluetooth ones – and i don't think the protocol is out in the open yet either.

The USB based ones should work, however. From what i heaar, you don't need to compile drivers - it works out of the box. Have you tried it with any games?


Directory and File permissions I recently installed Ubuntu 12.10. I am the only user, and would like to be able to drag files from directory to directory.

1) How can I open up permission to do this?  Do I do this from root?

2) Is there a command that I can enter into the terminal?  If so, what would an example command be?

I am thinking it must be something like grant user r-w-x ability from the the closest file to root as possible (so that I have cascading capability throughout the rest of the files).

If I need to do this directory by directory I will, mainly I am used to being able to do pretty much whatever I wanted within a Windows environment. As time goes by, I realize doing this from the command line will be something that I will want to do. However, I did not realize the bit of time it is taking me to do some simple things. I am just wanting to get up to speed quickly.

What you are going to do is really stupid because it tears down basic security measures in the system. But it's your choice...

1) You could log into GUI as a root (but ubuntu doesn't have normal root user you can switch into), so i guess this is out.

2) You can add your user into root/admin/whatever group thus granting him most of the privileges you need. Command is usermod with some parameters...

3) You can set privileges on each file to rwx for everybody (which is really dangerous). The commad for this is something like chmod -R 777 run in the /.

But my opinion is that if you want to use linux system the "windows way", you'll be pretty disappointed. The thing here is linux is actually pretty comfortable to use, you just have to understand and obey few basic concepts which are different from what you are used to.

More reading on the file permissions: http://www.tuxfiles.org/linuxhelp/filepermissions.html

EDIT: I know what this can do with the OS. I know running any of these commands almost sure result in nonfunctional system. I warned the reader. I've written in because this is answer to his question, which he deserves. For me, writing just "stupid idea" is not an answer. :)


Re-enable working PPA's after ubuntu upgrade when I upgrade from 12.04 to 14.04 all my ppa's disabled. whats the best way to re-enable working ppa in trusty(14.04)? and i used y-ppa manager to re enable but y-ppa is not working in trusty.

worst upgrade I have gone through (13.10 to 14.04) [i386 version].  Upgrade portion before reboot went fine.  After it restarted, it broke grub, wouldn't boot.  Had to go through the following steps to rebuild grub from a 13.10 LiveCD;  This was in VirtualBox 4.3.10 r93012 VM.

sudo mount /dev/sda1 /mnt
sudo mount --bind /dev /mnt/dev && sudo mount --bind /dev/pts /mnt/dev/pts && sudo mount --bind /proc /mnt/proc && sudo mount --bind /sys /mnt/sys
sudo chroot /mnt
grub-install /dev/sda
grub-install --recheck /dev/sda
update-grub
exit && sudo umount /mnt/dev && sudo umount /mnt/dev/pts && sudo umount /mnt/proc && sudo umount /mnt/sys && sudo umount /mnt

then had to re-enable PPA's  through "Software and Updates">Other Software and clamtk's ppa can't be found.


Why won't my password work in gksu? There are other questions similar, but none have answers for this situation.

Any time I enter my pw into the terminal, it works fine.  But gsku thinks it's wrong.  I've tried several times, and typing very slowly.  I know I'm entering it correctly.  Any ideas?

Answers to questions:

The answer linked doesn't apply because the gksu properties are set correctly.
Resetting the pw didn't help.
I was referring to the 10-key pad.

tl;dr: Try using gksudo instead.
Explanation
gksu makes you enter the root password. By default, Ubuntu does not have a password for the root user. gksudo makes you enter the password for an ordinary user that happens to have superuser privileges.


How to change screen brightness on a Lenovo E46A? I am using lenovo E46A in window i was able to change screen brightness with the control (Fn) but now in ubuntu I can't change it the cursor shows but brightness doesn't change a bit ....So someone please help me .

This worked for me:

sudo apt-get install acpi

Go to system settings and click on screen.


Installing Windows 8 in Ubuntu I have a little issue, I got myself a little Zotac nano XS PC and I installed Ubuntu on it. Now what I would like to do is to give a try with Windows 8 w/o having to make an USB bootable or anything like that.

Is there a way to install Windows once Ubuntu is on the machine?

You will have to boot from Windows install media to install it on the hardware. You can install it in a VM without having to boot off any special media, but you won't be able to boot directly into it either. I wouldn't recommend trying to install Windows to real hardware, from within a VM though. It is very easy to break everything in that case.

Also, you will need to be aware that installing Windows after Ubuntu, will make it difficult to boot into Ubuntu, as it will overwrite the boot record on the primary drive. Also, Windows is very picky and tends to require that it be installed on the first drive, in case you were planning to install it on a second drive.

In all honesty, installing to a USB drive is very inexpensive, can be done on USB 2.0 (although obviously 3.0 is better), and has the additional benefit of sandboxing so you don't mess up your Ubuntu system with dual-boot or any of that nonsense.

The process of creating a Windows 8 live USB installation is very simple and can be done on a drive as small as 4 GB. For the purpose of testing, USB 2.0 should suffice. Hope this helped!


Inconsistent Sound Volume Ubuntu 20.04 I upgraded from 18 to Ubuntu 20.04 a few days ago. I listen to music through Google Play Music's website which I load in Firefox. I noticed that now Ubuntu has app specific volumes (cool). Since I stream shows and movies through Firefox I decided to crank the Firefox volume to the max and then fine-tune the volume on the website and with the system's master volume. The problem is that the sound for Firefox keeps resetting. In fact, it seems to reset with every Google Play song. I go from being able to hear my music to hearing silence. Why does this happen and can it be stopped?

For the moment, I'm leaving the Firefox volume to where it defaults and increasing the volume on the website.

Try adding or changing flat-volumes=no setting in pulseaudio's daemon.conf:
The "daemon.conf" can be found in the following paths:
User definitions:
~/.config/pulse/daemon.conf

~/.config/pulse/daemon.conf.d/*.conf

System definitions:
/etc/pulse/daemon.conf

/etc/pulse/daemon.conf.d/*.conf

About flat-volumes:
pulse-daemon.conf(5)

flat-volumes Enable 'flat' volumes, i.e. where possible let the sink volume equal the maximum of the volumes of the inputs connected to it. Takes a boolean argument, defaults to yes.

Pulseaudio Arch Wiki

flat-volumes scales the device-volume with the volume of the "loudest" application. For example, raising the VoIP call volume will raise the hardware volume and adjust the music-player volume so it stays where it was, without having to lower the volume of the music-player manually. Defaults to yes upstream, but to no within Arch.
Note: The default behavior upstream can sometimes be confusing and some applications, unaware of this feature, can set their volume to 100% at startup, potentially blowing your speakers or your ears. This is why Arch defaults to the classic (ALSA) behavior by setting this to no.

I had to uncomment flat-volumes = no and set the parameter to = yes. After rebooting the volume doesn't change now.


Trying to find files that contain only NULs, but getting some others The files I am trying to find/list are:

Any size (0 bytes accepted)
Consist only of ASCII NUL characters (0x00)
If there are any characters other than 0x00, the file shouldn't be listed.

The command I have now is:

grep -RLP '[^\x00]' .

Which works, but it also finds file which consists only of two bytes: 0xFF, 0xFE. Don't know why.

Is there any better command to find such files?

In short, what is happening here is that grep is trying to interpret your file as Unicode data. The sequence 0xFF, 0xFE is a Byte Order Marker for UTF-16.

(In my testing, even other sequences involving two 0xFF's or two 0xFE's etc. would still not match the '[^\x00]' regex, since even when trying to do UTF-8 these would be considered non-characters.)

Using a locale that doesn't use Unicode for character types should fix this, which you can accomplish by setting the LC_CTYPE environment variable. Use the C locale to force ASCII encoding (so no Unicode enabled):

LC_CTYPE=C grep -RLP '[^\x00]' .

UPDATE: As pointed out by @steeldriver, grep still acts on a line-by-line basis, so files containing NUL bytes and newlines will still match.

@DavidFoerster's solution using grep's -z does a good job of solving this problem, using the NUL bytes as separators does the trick.

Alternatively, I came up with a short Python 3 script (allzeroes.py) to check whether the file's contents are all zeroes:

#!/usr/bin/python3
import sys
assert len(sys.argv) == 2
with open(sys.argv[1], 'rb') as f:
    for block in iter(lambda: f.read(4096), b''):
        if any(block):
            sys.exit(1)

Which you can use in a find to locate all matches recursively:

$ find . -type f -exec allzeroes.py {} \; -print

I hope that helps.

You can use this PHP code for find all files with NULL contents.
<?php
$pattern = '';
$directory = new RecursiveDirectoryIterator("./");
$iterator = new RecursiveIteratorIterator($directory);
if ($pattern) {
    $regex = new RegexIterator($iterator, $pattern);
} else {
    $regex = $iterator;
}
foreach($regex as $file) {
    if (is_dir($file)) continue;
    $contens = file_get_contents($file);
    $contens = trim($contens);
    if (strlen($contens) == 0) {
        echo "$file\n";
    }
}


Suspend and hibernate don't work on a hp pavilion dv6 I just installed kubuntu 11.04 on my laptop which a hp pavilion dv6, and suspend/hibernate don't seem to work. More specifically, when I try to get out of sleep/hibernation mode, the computer does restart but the screen remains black while the fan starts and the computer gets hot. I have to reboot by pressing on the power button.

I was wondering whether anyone has come up with this problem and might have found a fix for it.

Thanks !

F
Edit : here are the files requested
/var/log/kern.log
http://paste.ubuntu.com/651863/

and /var/log/pm-suspend.log
http://paste.ubuntu.com/651865/

I used to observe exactly the same problem after I had updated 11.04 ubuntu to 2.6.38-10 kernel's version. The problem resolved when I switched back to 2.6.38-8 version.

Having struggled with this the whole weekend on my HP pavilion dv6, i finally found a solution! Trust me, I have tried every suggestion that can be found on google before this.

What I did was to reinstall windows, update BIOS (download file from HPs support pages), reinstall linux (Linux Mint 14 XFCE). Finally suspend to ram works perfectly!


Where can I get an application to work with my kml files? I have files in .kml format. In windows 7 I opened them with Google Earth, but Google earth for Linux wrongly determines the place of workout on map.

What application can I use to work with these files?

You can view them online with GPS Visualizer.  You load them directly with Viking GPS Analyser.

You can also convert them to GPX files using Viking or GPSBabel.  Both are available from the Ubuntu repos. See Viking GPS Documentation for details.

For even more possibilities, you can try OSGeoLive, a Xubuntu-based live DVD loaded with GIS software.


Issue with folder permission I created a bunch of files using the terminal. The file was assigned to the root and I am not able to edit them. Help! What am I missing? New to Ubuntu.

This should do the trick:

sudo chown $USER [filenames]

Note: $USER is literal, replace [filenames] with one or many file names or globs, for example:

sudo chown $USER *.md

You need to either change the permissions of those files, or change the owner.
To change the permissions use chmod, and to change the owner use chown

As a quick and dirty fix try sudo chmod 777 <filename>.

Using permission 777 is a bad idea as it gives every permission to every user.


Update Ubuntu 14.04 LTS to 14.04.2 LTS without any command well i was wondering why on each update we have to goto run to terminal and run commands like

sudo apt-get install --install-recommends xserver-xorg-lts-raring

OR

sudo apt-get update
sudo apt-get upgrade

OR

sudo apt-get install --install-recommends linux-generic-lts-utopic xserver-xorg-lts-utopic libgl1-mesa-glx-lts-utopic libegl1-mesa-drivers-lts-utopic

why it's so tricky always and why UBUNTU don't just give update to Software Updater.

i am using UBUNTU 12.04 LTS this time and i suddenly ran out of thought that i should upgrade my OS. And then the very next moment i was thinking by upgrading to new version all of my files on Desktop or any other repose and all of the Environments and other development things will be gone ?? will i loss my data because i am such kind of person who's desktop is always so important :p i always put my working projects on my desktop, i know it's a bad habit but i do it.

by the way point is there any safer way to do it and not messing with my desktop or document and download files and environmental variables and other stuff, without going into TERMINAL

hope you guys will come out of some nicer solution for me because I've already checked out following links.

How to do Ubuntu upgrade 14.04 to 14.04.2

How to Upgrade Ubuntu 12.04.2, 12.04.3 to 12.04.4, the next Hardware Enablement Stack?

Thanks.

EDIT

Software Updater says no updates for me

Software Updates Options

14.04.2 is only a version for the image release. The version of Ubuntu itself is still 14.04. The appended numbers on LTS versions are simply later image milestone releases, to differentiate them from the original installer images. If you've installed all the updates, then you have the same packages as are on the 14.04.2 image already. If you need the HWE updates, you can install them, though they are not necessarily required, depending on your hardware.

Try switching between

sudo apt-get update
sudo apt-get upgrade

First, type:

sudo apt-get update

Let the updates take place and then reboot.

Then, type:

sudo apt-get upgrade

Let the updates take place then reboot.

Just remember the updates need to be installed sequentially. You just can't go from one LTS to the next higher LTS.


How to change LCD brightness from command line (or via script)? To work around bug #1005495 (changing LCD brightness via hotkeys impossible), I'd like to have one command line query for increasing and one for reducing the brightness of my LCD. I could then map a hotkey to each one of this queries.

The problem is: I don't know how to increase and reduce the LCD brightness on the command line. Do you?

Open your terminal and type this

xrandr -q | grep " connected"

it will gives you the output as

LVDS1 connected 1680x1050+0+0 (normal left inverted right x axis y axis) 331mm x 207mm

There LVDS1 Stands for your display. So now you have to do as

xrandr --output LVDS1 --brightness 0.5

there 0.5 stands for brightness level and it ranges from 0.0 to 1.0 .
0.0 -> Full black .so you have to choose the required value of brightness .

This doesn't change brightness at a hardware level. From randr manual:

  --brightness brightness Multiply the gamma values on the crtc currently attached to the output to specified floating value. Useful for overly bright or overly dim outputs. However, this is a software only modification, if your hardware has support to actually change the brightness, you will probably prefer to use xbacklight.

Interactive ncurses-like UI using xbacklight

A poor man's ncurses. Hit h and it goes down 10%, hit l and it goes up 10%. Then show the current luminosity.

xback() (
  done=false;
  echo "less: h, more: l, quit: q"
  while ! $done; do
    read -rsn1 key
    if [ "$key" = h ]; then
      xbacklight -dec 10
    elif [ "$key" = l ]; then
      xbacklight -inc 10
    elif [ "$key" = q ]; then
      done=true
    fi
    printf "\r$(xbacklight -get) "
  done
)


Changing URL for PhpMyAdmin When I install phpmyadmin

apt-get install phpmyadmin

to access it I have to write the following address format

http://123.123.123.123/phpmyadmin

assuming that was the IP address of my server. But what if I want to use a subdomain, for instance

http://phpmyadmin.dbugger.com

How should I configure/modify the configuration files in Apache, so that it would work?

If you installed phpMyAdmin using apt-get, the files are usually installed into /usr/share/phpmyadmin. Hence, creating a new virtual host configuration and pointing the DocumentRoot directive to /usr/share/phpmyadmin should work.

Apache stores its per-site-configuration in /etc/apache2/sites-available.

Create /etc/apache2/sites-available/phpmyadmin.dbugger.com (as noted in the comments, if you're using Apache 2.4 on a later version of Ubuntu, a .conf extension is required for the name), then fill it up with the following contents:

<VirtualHost *:80>
    ServerName phpmyadmin.dbugger.com
    ServerAdmin webmaster@dbugger.com

    DocumentRoot /usr/share/phpmyadmin
    <Directory />
        Options FollowSymLinks
        DirectoryIndex index.php

        <IfModule mod_php5.c>
            AddType application/x-httpd-php .php
            php_flag magic_quotes_gpc Off
            php_flag track_vars On
            php_flag register_globals Off
            php_admin_flag allow_url_fopen Off
            php_value include_path .
            php_admin_value upload_tmp_dir /var/lib/phpmyadmin/tmp
            php_admin_value open_basedir /usr/share/phpmyadmin/:/etc/phpmyadmin/:/var/lib/phpmyadmin/
        </IfModule>
    </Directory>

    # Authorize for setup
    <Directory setup>
        <IfModule mod_authn_file.c>
            AuthType Basic
            AuthName "phpMyAdmin Setup"
            AuthUserFile /etc/phpmyadmin/htpasswd.setup
        </IfModule>

        Require valid-user
    </Directory>

    # Disallow web access to directories that don't need it
    <Directory libraries>
        Order Deny,Allow
        Deny from All
    </Directory>

    <Directory setup/lib>
        Order Deny,Allow
        Deny from All
    </Directory>
</VirtualHost>

Enable the virtual host:

sudo a2ensite phpmyadmin.dbugger.com

Then reload Apache:

sudo service apache2 reload

I don't think it matters. phpmyadmin connects to the database you tell it to, it has nothing to do with your websites or domain names. So if you have two subdomains that use different databases, just configure phpmyadmin to use the proper one. You can (manually) install several instances of phpmyadmin in /var/www in parallel and configure them diferently; just get the tar.gz and unpack under different names.


Setting up a collaboration website and can't seem to get the permissions right The end goal is the have a webpage that several people can work on in there spare time.  I made a directory /WEBSITE/public_html and want the main page to be here for several contributors to be able to access.  Made a user group called webadmin and added the users to the group.  then did chown -R mainuser:webadmin /WEBSITE
then I did chown -R mainuser:webadmin /WEBSITE/public_html.  I want to be able to SFTP to in the server and send the website I have to it.  I can sftp in but it will not allow me to send files there.  What am I missing?  I know this is a super noob question so thank you for you time and patients.

DrClaw

Make sure the directory permissions are correct:
http://www.techrepublic.com/article/linux-file-and-directory-permissions/

  Directory permissions

  Permissions for directories aren't exactly the same as they are for
  files. Here are some typical permissions required on directories:

Execute permission is required for a user to cd into a directory.
Read permission is required for a user to use a command such as ls to view the files contained in a directory.
Execute-only permission allows a user to access the files in a directory as long as the user knows the names of the files in the directory, and the user is allowed to read the files.
Write permission allows the user to create, delete, or modify any files or subdirectories, even if the file or subdirectory is owned by another user


Why ~/.bash_profile is not getting sourced when opening a terminal? Problem

I have an Ubuntu 11.04 Virtual Machine and I wanted to set up my Java development environment. I did as follows

sudo apt-get install openjdk-6-jdk
Added the following entries to ~/.bash_profile

export JAVA_HOME=/usr/lib/jvm/java-6-openjdk

export PATH=$PATH:$JAVA_HOME/bin

Save the changes and exit
Open up a terminal again and typed the following

echo $JAVA_HOME   (blank)
echo $PATH        (displayed, but not the JAVA_HOME value)

Nothing happened, like if the export of JAVA_HOME and it's addition to the PATH were never done.

Solution

I had to go to ~/.bashrc and add the following entry towards the end of file

#Source bash_profile to set JAVA_HOME and add it to the PATH because for some reason is not being picked up
. ~/.bash_profile

Questions

Why did I have to do that? I thought bash_profile, bash_login or profile in absence of those two get executed first before bashrc.
Was in this case my terminal a non-login shell?
If so, why when doing su after the terminal and putting the password it did not execute profile where I had also set the exports mentioned above?

~/.bash_profile is only sourced by bash when started in login mode. That is typically when you log in at the console (Ctrl+Alt+F1..F6), connect via ssh, or use sudo -i or su - to run commands as another user.
When you log in graphically, ~/.profile will be specifically sourced by the script that launches gnome-session (or whichever desktop environment you're using). So ~/.bash_profile is not sourced at all when you log in graphically.
When you open a terminal, the terminal starts bash in (non-login) interactive mode, which means it will source ~/.bashrc.
The right place for you to put these environment variables is in ~/.profile, and the effect should be apparent next time you log in.
Sourcing ~/.bash_profile from ~/.bashrc is the wrong solution. It's supposed to be the other way around; ~/.bash_profile should source ~/.bashrc.
See DotFiles for a more thorough explanation, including some history of why it is like it is.
(On a side note, when installing openjdk via apt, symlinks should be set up by the package, so that you don't really need to set JAVA_HOME or change PATH)

When you do sudo su the shell is not executed, instead of that try with sudo su - this will load ~/.bash_profile as source by default.


Can't update Google Chrome I updated Google Chrome from the Software Updater in Ubuntu 12.04, but it didn't actually update. "About Google Chrome " is still showing the previous release.

If you would like to keep you browser up to date, I think the easiest thing to do is to add the PPA. I will explain how to do this for both Chrome and Chromium. These two browsers are mostly the same, but you can check out the differences here.

Chrome

First you have to install the key. This can be done by opening Terminal and typing

wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -

Step two is to add the repository

sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'

Then you update and, if you haven't already, install Google Chrome

sudo apt-get update
sudo apt-get install google-chrome-stable

Chromium

Chromium is more straight forward. Just add the PPA, update, and install by typing this in Terminal:

sudo add-apt-repository ppa:a-v-shkop/chromium
sudo apt-get update
sudo apt-get install chromium-browser

Similar to H. Arponen's answer, my problem was caused by not closing down all instances of the previous version. However, mine was more different because I did not have any actual normal Chrome instances running, but I had a Chrome app running (Signal IM).

Versions:

Linux Mint 18 (based on Ubuntu 16.04)
Chrome 52/58
Installed via apt (apt-get)
Signal 0.38.2


12.10 Lexmark S605 insecure permissions error The S605 printer from lexmark is found and there is a provided option for the S600 Series when installing it. However, after the installation process it says it needs the program /usr/lib/cups/filter//usr/local/lexmark/v3/bin/printfilter.

Now i know, that the downloadable packages from lexmark contain this file in a debian package, so i could use it from there, but: What does the structure above mean? ...//usr/local/...

Are these two different locations? And has the file to be in both?

Thanks in advance, it's impressive how you guys actually know what you're doing (in contrary to mac or most windows users.)

Update: After installinge the packages from lexmark (which are for 12.04) it says at printer state: idle .../printfilter has insecure permissions (0100775/uid=0/gid=0).

Can i modify the printfilter? Do i need to set up an administrative group? I read a guide somewhere, but didn't follow it for some reason i forgot.

I don't believe /usr/lib/cups/filter//usr/local/lexmark/v3/bin/printfilter is intended as one directory - /usr/lib/cups/filter/ typically has no subdirs.

But apparently you managed to install the desired package and now you're getting the new insecure permissions error. I'm assuming this message gives the directory as /usr/local/lexmark/v3/bin/printfilter below.

What you need to do is change the ownership of /usr/local/lexmark/v3/bin/printfilter:

$ sudo chown -R root /usr/local/lexmark/v3/bin/printfilter

Changing the group shouldn't be neccessary but if you want to be on the safe side, also do

    $ sudo chgrp -R root /usr/local/lexmark/v3/bin/printfilter

However, you do need to have root as the owner of /usr/lib/cups/filter/, if it isn't, do the same for that directory:

$ sudo chown -R root /usr/lib/cups/filter/

...and when you're done with changeing the permissions, do a reboot or:

$ sudo /etc/init.d/cups restart

This might only work on newer versions of cups. To reset cups use "sudo service cups restart" without quotation marks.


Remmina refuses to scale the remote screen res to fit in smaller client screen Remote PC screen is cropped

Running remmina client 1.2.0-rcgit-29 (git rcgit-29)

Connected to remote Ubuntu desktop using VNC.

Remote desktop resolution is too high for client screen. There are no available or working option to scale the remote screen image to fit in the Remmina client window.

How do I fix this?

I had the same issue (same release). Upgrading to 1.3.4 did not work for me, same issue appeared.

The solution was to put scaling back to 100%. I am not sure this can be considered a solution, as 100% scaling for 4K makes everything tiny. But at least you can access your entire desktop.


Grid view at Ubuntu touch - How to use it? In article about content views is a part about a Grid view. But I didn't found anywhere how to use it. Do you knew something about it?
Tahnks for answer!

It is available in Qt Quick

http://qt-project.org/doc/qt-5.0/qtquick/qml-qtquick2-gridview.html

Here is the link to the tutorial. Sorry, can't give more info in the answer but the tutorial is good.

The link you posted links to a guideline on how to make an application with the Ubuntu design. There is an example, the photo viewer app, which uses the grid layout. But the Grid is not an app nor part of the Operating System.


Can I install a firewall interface without `menu`? I need an interface for ufw (uncomplicated firewall) that does not depend on "menu", which is outdated and messing with software updates/installations. I don't mind building from source but prefer a deb.

I found a deb on planet ubuntu that doesn't require menu :D! Solved. It is for a newer version of gufw.

Fortunately gufw  no longer requires menu.

Try Comodo firewall. Comodo's firewall claims to provide protection from viruses, malware, and hackers.