I can't connect to internet via ubuntu 14.04

Please get a temporary internet connection by ethernet, tethered or however is available. Open a terminal and do:

sudo apt-get update
sudo apt-get install linux-headers-generic build-essential git
git clone https://github.com/lwfinger/mt7630.git
cd mt7630
make
sudo make install
sudo modprobe rt2800pci

Your wireless should now be working.

If it does not work as expected, check. Are there any informative clues shown in the message log?

sudo modprobe rt2800pci
dmesg | grep rt2

Is this a laptop with a wireless switch or key combination? Is it set to enable wireless?

rfkill list all

Let's do some additional troubleshooting. Reboot and open a terminal and run:

sudo modprobe rt2800pci
rfkill list all > wifi.txt
dmesg >> wifi.txt
iwconfig  >>  wifi.txt
modinfo rt2800pci >>  wifi.txt

Find the file wifi.txt in your user directory and copy and paste it here: http://paste.ubuntu.com Give us the link in your reply.

EDIT: The version of rt2800pci in your pastebin is not the version that includes your 7630 device. If you have had an update to the linux image, re-compile:

cd ~/mt7630
make clean
make
sudo make install
sudo modprobe -r rt2800pci && sudo modprobe rt2800pci

Is it working now?


How to install Ubuntu on a hard drive with bad blocks?

After writing the digression below, it occurred to me that I should probably also mention why I wrote it.

Any form of sector write or read error on a drive should be viewed as a potential warning. The drive could be failing. Certainly if a drive is reporting as many as 500 bad blocks, I would dig deeper into this before installing anything on the drive.

As I mentioned below, you can use Ubuntu Disk Utility from a Live CD/USB to examine the drive's SMART attributes. If the drive only has few pending reads, you can fill the drive with zeros to force the sectors to be remapped and then do another Ubuntu install.

But watch the drive carefully for further signs of failure and don't save anything critical on it unless it is also backed up. If the drive continues to show sector errors, consider shopping for a replacement drive. Soon.

Just my opinion of course, for whatever it's worth.

These days it is hard to be certain what the phrase bad blocks actually means. In the pre-deluvian days of computing ... say 15 years or more ago ... it could refer to a list the operating system kept of sectors on a hard drive which the drive reported to be, well, bad.

All relatively recent drives now do this sort of tracking internally in their firmware and operating systems no longer need to track such things.

This Wikipedia article on Bad Sectors seems to be a reasonable overview. The key points being:

While the hard drive will automatically attempt to remap a bad sector, it typically only does this when a write fails. Read errors are reported to the OS and logged in the drive's S.M.A.R.T. data, but the sector is not remapped.
The standard way to force the drive to remap all bad sectors is to write to every byte on the drive. Typically one fills all the sectors with 0x00.
If a drive has reported one or more bad sectors, it is possible that the drive may be approaching failure. The drive's S.M.A.R.T. data should be examined, especially the following S.M.A.R.T. attributes
   0x05  Reallocated Sectors Count (How many sectors were remapped)
   0xC5  Current Pending Sector Count (How many sectors waiting to be remapped)

You can use an Ubuntu Live CD or USB to do these things.

After booting the Live CD/USB, open the Disk Utility application either with the GUI by searching for it with Dashor by running the command palimpsest & in a terminal. Select the disk in the left sidebar and then use the SMART Status function to retrieve and view the drive's S.M.A.R.T. attributes.

The  dd command command can be used from a terminal window in a Live CD/USB session to fill a drive with zeros. For example, the command below will write 0x00 to every sector on drive /dev/sda

sudo dd if=/dev/zero bs=1M of=/dev/sda

Of course, depending on the size of the drive this could take many hours to complete.

If you are curious, there are many more "tricks" one can use with dd. Have a look at the answers to this question on serverfault. I especially like this trick for periodically displaying the progress of a dd command.


Enable networking without the gnome-applet

You can use nmcli (part of NM) or cnetworkmanager

sudo apt-get install cnetworkmanager

to control NetworkManager from the commandline.

BTW: you can configure Monad to use a panel or such (but maybe that's not what you want).


Can not install libltdl-dev:i386 on ubuntu 14.04.1 x64

The deb package is corrupted. You can simply remove the corrupted package with sudo rm /var/cache/apt/archives/libltdl-dev_2.4.2-1.7ubuntu1_i386.deb and attempt to reinstall. The package you are looking for can be found here
and you can download and install it via the Software Center (or your favorite package installer) or after removing the offending package you can simply

sudo apt-get update
sudo apt-get install libltdl-dev


Install ubuntu alongside with pre-installed win10

I fix this problem by copy the /EFI/ubuntu/shim64.efi to repalce /EFI/Microsoft/Boot/bootmgfw.efi and /EFI/Boot/bootx64.efi.

And enabled secure boot.


Ubuntu 16.04 cross debootstrap - Emulating x86 on ARM64 platform

It generally is not a problem to run 32-bit binaries on a 64-bit kernel. A lot of people run multilib systems to get support for both.  (Hence, if you have noticed the lib, lib32 and lib64 directories in the filesystem.) However there are a few options, qemu generally runs an entire virtual machine, often from a hardfile.  Another option is a container such as systemd-nspawn.

This link shows a fairly good example/reference for at least one usage of debootstrap. (Note: systemd-nspawn pretty much also uses both debootstrap and a hardfile, but does not require virtualizing a full system).


How to fix "Cannot allocate memory" when reading very large files?

You can try:

echo 1 > /proc/sys/vm/overcommit_memory

as root.

Or you can try using a program that handles large files more efficiently (e.g. using mmap instead of read).

Or you can try adding more swap space.


Will it be possible to use a non-pae kernel in recent versions of Ubuntu?

As your searches may have showed, no non-PAE i386 kernels are available for Quantal -- in the official repositories, as a mainline build, or otherwise
Unless this changes, you will have to find a PPA (I know of none), or build the kernel yourself (which is not difficult at all)
If you need such a kernel right now, please post in the comments and I will try to provide a PPA with the latest 3.5.0-13 with PAE disabled.


Yes, kernel upgrades will still require rebooting.


I can send mails from shell with PHP, but I can't send from the PHP web page

Is it Drupal? Then you might take a look at this post: https://drupal.org/comment/2032080#comment-2032080

It might have to do with user permissions. Try adding the apache user to /etc/mail/virtusertable and rehashing the /etc/mail/virtusertable.db

Sendmail needs to be configured for it to work with the httpd server user.


How can I get the Ubuntu Installer to recognize that my system has windows 10 installed?

If you have installed Windows in Legacy Mode of your BIOS , then install Ubuntu also in Legacy mode by selecting the USB option under Legacy boot options or if you have installed Windows in UEFI mode of your BIOS then you have to install Ubuntu also in UEFI mode by selecting USB option under UEFI boot options.

After booting into any one of the BIOS Boot modes you should see that Ubuntu recognizes you already installed Windows partition and its corresponding version.

After that select the "Something Else" option and proceed your installation.


I ran into the exact same issue while trying to compile ANTs pulled from Github on Ubuntu 16.04. Here is what I tried that worked for me:

Remove cmake and cmake-curses-gui packages from Ubuntu: sudo apt remove --purge cmake.
Download CMake from https://cmake.org/download/; I downloaded version 3.11.4 to ~/Downloads.
Install CMake v3.11.4:

cd ~/Downloads
tar zxvf cmake-3.11.4.tar.gz
cd cmake-3.11.4
./bootstrap && make
sudo make install

Verify that I've installed CMake v3.11.4:

$ which cmake
/usr/local/bin/cmake
$ cmake --version
cmake version 3.11.4
CMake suite maintained and supported by Kitware (kitware.com/cmake).

To compile ANTs, I followed @steeldriver's comment and didn't use ccmake. Instead, I did this:

mkdir -p ~/bin/ants
cd ~/bin/ants
cmake ~/Github/ANTs
make

(I didn't set the environment variable DSuperBuild_ANTS_USE_GIT_PROTOCOL=OFF.)

ANTs just finished compiling and didn't give me the CMake 3.10.2 or higher is required. error anymore. Basically I got around this problem by not using ccmake at all. Hope this helps!


Full support for proxies was added with the 1.18.0 release of Juju.

From the release notes:

Support for proxies

Proxies can now be configured for the providers in the environments.yaml
file, or added to an existing environment using "juju set-env" The
configuration options are:

http-proxy
https-proxy
ftp-proxy
no-proxy

The protocol-specific options accept a URL. The "no-proxy" option
accepts a comma-separated list of host names or addresses.

The proxy options are exported in all hook execution contexts, and also
available in the shell through "juju ssh" or "juju run".

There are three additional proxy options specific for apt. These are set
to be the same as the non-apt proxy values, but can be overridden
independently:

apt-http-proxy
apt-https-proxy
apt-ftp-proxy

For example, with a squid-deb-proxy running on a laptop, you can specify
the apt-http-proxy to use it for the containers by specifying the host
machine’s network-bridge:

apt-http-proxy: http://10.0.3.1:8000

For the 2.0 release of Juju, there is no way to set the environment globally before a model is created, but you can create a config.yaml file, containing the following:

default-series: xenial
no-proxy: localhost
apt-http-proxy: http://<ip address>:<port>
apt-https-proxy: https://<ip address>:<port>
apt-ftp-proxy: ftp://<ip address>:<port>
http-proxy: http://<ip address>:<port>
https-proxy: https://<ip address>:<port>
ftp-proxy: ftp://<ip address>:<port>

You can then use the --config option to tell Juju to use this file (I store mine in ~/.juju/). For example, juju bootstrap localhost lxd-test --config=config.yaml.


Unable to install g++ compiler in Ubuntu 16.04

g++ is already the newest version

It seems You already Installed the latest version
Try:

sudo apt autoremove
sudo apt-get update
sudo apt-get upgrade


Why is there no option to install ubuntu alongside windows 10

You need unallocated space for that option to show.
If you do not have that you will need to shrink one of your partitions (to the size of the Ubuntu installation you want to use; at least a minimum of 30Gb).


How To Package Executable Terminal Commands

If you put this line:

#!/bin/bash

at the beginning of the text file, Ubuntu will know than is an executable file to be interpreted by bash. So your file would look something like this:

#!/bin/bash
sudo apt-get update

When the user double clicks the file, she/he will be asked if wants the executable to be run in a terminal.


I cant get the most basic sed command to execute on command line

Try this: sed 's/foo/bar/' textfile.

Quotes around the statement are good practice
s for substitute. It is the command you want to execute. foo is the search term bar the replacement.

There is a lot of information on sed online. Eg.: http://www.catonmat.net/blog/sed-one-liners-explained-part-one/


Launcher, menubar, toppanel and window borders disappeared in Ubuntu 16.04

I have stumbled upon the exact same issue! I upgraded from 14.04LTS to 16.04LTS about a month ago, and everything went very well. Recently, however, no dash or window border anymore!

I have tried, as suggested in several posts, to reset config:

dconf reset -f /org/compiz/
setsid unity

I tried to reinstall unity and compiz,

sudo apt-get autoremove --purge ubuntu-desktop compiz* unity*
sudo apt-get install ubuntu-desktop compiz unity

I have tried to remove config files from local user hidden dirs,

sudo service lightdm stop
rm ~/.config/dconf/user
rm -fr ~/.cache/compizconfig-1
rm -fr ~/.compiz
rm -fr ~/.Xauthority
rm -fr ~/.config/autostart
sudo service lightdm start

Similarly, I enabled the Unity plugin in CCSM but this is not permanent since, when re-opening CCSM, the Unity plugin appears unchecked, even when opened with admin. rights.

Sadly, all of these attempts failed in restoring dash and window borders. I guess this is an issue with compiz, the window manager, but I have no idea how to fix it. Any ideas welcome ;)


what does device node 'none' means in file system?

Usually you mount filesystems which are located on a block device = hard disk, USB stick, ...

Additionally there are some "virtual" file systems such as /proc or /sys which are for interaction with Linux kernel. These do not have any block device associated with them => none is displayed instead.

None is also displayed for tmpfs filesystem. Tmpfs uses RAM for storing temporary files, so there is again no block device associated.


Libreoffice 5.2. How to disable the new toolbar having only close button?

This is not a toolbar, this is the menubar and you can't remove it.
The problem is that this menubar is missing the menu-entries.
Here same issue:
https://ubuntuforums.org/showthread.php?t=2335910&page=2


How to enable japanese input in Ubuntu Mate 18.04?

On Ubuntu 18.04, the way to install Japanese input:

Go to system settings, select "Region & Language".
Go to "Manage Installed Language" and install Japanese through "Install/Remove Languages". (you might need to log out and login after installation).
After installation, inside "Region & Language" dialog, click "+" to add input sources. select "Japanese" > "Japanese (Mozc)".

That's it. You can select Japanese input on one of the button on top right menu.


How will Ubuntu partition HDD when installed alongside Windows 10?

If you select the Install Alongside Windows option during the Ubiquity install process, Ubuntu will use gparted to downsize the NTFS partition and create an Ext4 partition for /root automatically, whether you have a GPT partition table (normally found with Windows 10 UEFI installs), or an MBR partition table (normally found with upgrades from Windows 7 legacy installs). Ubiquity will not disturb any other partitions such as the EFI Boot or Recovery partitions created by Windows 10 during its install process.

However, Windows does not share well with others (and more on that shortly). You must disable the "Faststart" option within Windows (and, preferably, also delete %SYSTEMROOT%\hiberfil.sys by running powercfg.exe -h off from an elevated command prompt) before rebooting. Then, if you have Secure Boot in your BIOS, you have to go into the BIOS Setup to turn that off as well, before you start the Ubuntu install. Windows does not fully close the NTFS partition in its shutdown if faststart is on, and that's the Windows 10 default(!). If the partition is not fully closed, Ubiquity can't resize it.

Ever since 17.10, Ubiquity has not created a swap partition by default, instead using a swap file, as swap file speed issues have been resolved.

If you select Something else during the Ubiquity installer run, you can custom-assign the space allotted to NTFS and Linux, specify a Linux filesystem other than Ext4, or make other customizations. Since you can reallocate space later using a LiveUSB flashdrive with gparted, the Alongside Windows option is more popular, and is best left for folks who can't remember where their Linux training wheels are.

Please do consider that Linux reads (and writes) files in NTFS partitions, but Windows does not read files in Ext4, and the open source driver for Windows to access Extn partitions, ext2fsd, has left a trail of broken filesystems behind it. Microsoft does not like you using Linux apps to access files in NTFS, so you may wish to add a FAT32 partition if you have to work on files from both Windows and Linux.


Drivers Help: Intel AX200 in Dell XPS 15 9570 running Ubuntu 18.04

Refer to the answer for Intel wifi Support for AX200 (Cyclone Peak). You can either upgrade to 5.1 kernel which has native support for this device, or install the backport driver (to stay on 4.x kernel) according to the steps in https://wireless.wiki.kernel.org/en/users/drivers/iwlwifi/core_release.

If your system has Secure Boot enabled, it will prevent the backport driver from loading automatically (since it is unsigned). To resolve this, you can either sign the modules for the backport driver, or disable Secure Boot altogether. Both options are covered in the answers to Why do I get "Required key not available" when install 3rd party kernel modules or after a kernel upgrade?.


Upgrading to linux-image-2.6.32-30-generic failed

This should not cause any problem for  rebooting to current kernel or any other existing kernel versions. You should be able to see older working kernels while you are booting.


How can I prevent other users from accessing my home directory?

You can't do that. If you give sudo permission for user, he can execute any command or access any files on that system.
If you don't trust your user, give him restrictive sudo access to execute only a few commands by editing /etc/sudoers file.
Create a new group admins

Add lines to /etc/sudoers

%admins ALL =  <Full path to command 1>, <Full path to command 2>


How do I use Conky to monitor my mythtv backend?

Just a quick comment on the mythtv-status option, you can set the host option in /etc/default/mythtv-status in which case it will be remembered if mythtv-status is upgraded or reinstalled.

You can also set other options like turn on colour output and add other information to the output.


Well while I'm not really sure if this is what you want, you can get all the shell variables with the following commands:

set -o posix
set

Or if you want it in an easily scrollable way you can pipe it through less like the following:

( set -o posix ; set ) | less

This will provide, like @heemayl stated in his comment, all shell variables of which env is a subset .

As @Gunnar Hjalmarsson stated, you can find out more about environment variables here.


Does Ubuntu come with a zip file extracter?

The standard Ubuntu (Unity desktop) comes with an application called file-roller or Archive Manager.

You can open zip files simply by double-clicking on them in your Files explorer.


After last 14.04 package upgrade PC was slow, soundless and without brightness adjust (Inspiron - 5552)

I think you need an older kernel, which will not affect your packages. See How do I install an old kernel?


Stuck downgrading libssl on Ubuntu 16.04

You should follow https://packages.ubuntu.com/xenial/libssl-dev and download appropriate version and install using

  dpkg -i packagename

As you specified you are trying to get official version of libssl, Hope you can install from here. Below a image of different architecture are included.


Start

sudo service smbd start

Stop

sudo service smbd stop

Restart

sudo service smbd restart


Since i cannot comment i will do it like this,
Take a look at this:
I can't get grub menu to show up during boot


Chromium not remembering all tabs and running slow

I started having this problem after the switch to the Aura builds and haven't found a real answer yet. As a workaround, you can downgrade to Chromium from 13.10 by installing this package. Find the deb package to download at the bottom of the page, select the one for the architecture you're running.


If you simply moved the directory elsewhere (say /some/where), then move it back:

/some/where/sudo mv /some/where /usr/bin

(mv is /bin/mv, so no worries there.)


How do I recover ubuntu 12.04 after failed hardware update?

Stop worrying!
Apparently when you did a software update you saw this:

and then you accidentally pressed the Details button, so you saw something like this:

and that is absolutely no problem!  Don't worry, as long as you don't press the details button, you will not see any gobbledegook any more!

This is just what happens in the background when your computer does updates and some people (like me) actually like to see this happen when they do software updates!  ;-)


Thunderbird is prompting for a password because the saved password you have (if you have saved a password) doesn't match the password that is associated with your email account.

The password for reading and sending email is almost always the same.  If you recall the password you used for reading the mail, use that same password when Thunderbird prompts you for the sending email password.

If you don't recall the password, or it doesn't accept the password you typed in, you'll have to contact your Email provider and get the correct password.

Your email provider may not be able to tell you your current password.  But they will be able to change it to a new one of your choice.  Use the new password they give you for both reading and sending your emails.

By the way, if you are having a problems using Google that is a separate and unrelated issue.  You can create a separate question to fix your Google problem.


sh on ubuntu is a symlink to the dash shell, not bash. Dash does not support the longform --login, but it does support the shorthand form, -l (from man dash):

  -l               Make dash act as if it had been invoked as a login shell.

Replacing --login with -l in your command should fix your issue.

sudo -n -u contd sh -l -c ". <etc>

If you want to invoke bash instead of dash simply call bash instead of sh.

sudo -n -u contd bash --login -c ". <etc>


How do I make one network settings the default

In terminal, type nm-connection-editor, and select the desired primary ethernet connection profile, and set the priority to 1...


Problem is in adding a default gateway.

When use this connection only for resources on its network is checked your default gateway is 192.168.1.1. When use this connection only for resources on its network is unchecked your default gateway is 0.0.0.0

Also when you are connected to vpn resource witch is routed trough ppp0 interface is only one host 192.168.100.180

In first case you can manually add route to resource on vpn site

sudo ip route add xxx.xxx.xxx.xxx/yy dev ppp0

xxx.xxx.xxx.xxx - represent host/network

yy - represent network mask

example:

add route to host 192.168.100.181 trough ppp0

 sudo ip route add 192.168.100.181/32 dev ppp0

add route to network range 192.168.100.0 with mask 255.255.255.0 trough ppp0

 sudo ip route add 192.168.100.0/24 dev ppp0

This also can be done in Network Manager. On same places where is use this connection only for resources on its network you can add route.

In second scenario, when use this connection only for resources on its network is unchecked you add default route to eth0 interface. This will allow to access resources on internet

 sudo ip route add default via 192.168.1.1


Enabling Acceleration tab on VirtualBox Manager running on Ubuntu 12.04 (guest OS)

Try installing kernel compilated for guest os systems... on guest OS.... and install the feautures packs in Windows Host....

the support for

Enable VT-x/AMD-V

depend of the feautures in Host, and properly drivers.


It looks like a permissions issue. Right-click the file, and go to properties.

Go to the permissions tab, and check the checkbox to allow executing this file as a program. Click Close. Try to open it again.


Ubuntu 16.04 laggy UI using Google Chrome

I face similar behavior when using Google Chrome on Ubuntu with the Unity Desktop. It happens most often when I play a video on Youtube but also only when I have Chrome open.

Disabling Hardware Acceleration seems to fix the problem but it introduces Tearing so I couldn't work a round the problem.

I'm using Firefox again because Chrome seems to be just crap on Nvidia systems.


What do I need to do to backup&restore (copy) users when migrating from one Ubuntu Box to another?

BACKUP YOU HOME :

  tar cvpzf backup.tgz $HOME

TESTING BACKUP FILE

To test if your backup file has no errors try this command:

  tar tvzf /home/Backup.tgz

RESTORING YOUR SYSTEM in the new PC

  sudo tar xvzf /home/Backup.tgz -C /

You can do it the same with your package installed with this :

Here’s a simple tutorial on how to backup a list of all your installed repository applications, and restore them to another machine, perhaps even the same machine after a clean installation. This can save you an incredible amount of time, especially when this task must be repeated often.

First, from a computer with all the applications preinstalled, retrieve your installed package list and redirect the output to a file called packages.txt.  Save this package list somewhere so that you can use it for the restore process.

  sudo dpkg --get-selections >
  packages.txt

To restore all the applications from your list, you must follow a three step process very carefully.

  sudo dpkg --clear-selections

  sudo dpkg --set-selections <
  packages.txt

  sudo aptitude install

You will be prompted to install all the new applications in the list.
Another example of what this process allows you to do is create a baseline of all the applications after a clean installation of Ubuntu.  Let’s say you would like to remove any applications installed since the clean install, perform the exact same process, and any package not defined in that list will be removed.

  sudo dpkg --get-selections >
  clean-install-package-list.txt

  sudo dpkg --clear-selections

  sudo dpkg --set-selections <
  clean-install-package-list.txt

  sudo aptitude install

The very first command of “–clear-selections” marks all currently installed packages to the state “deinstall”.  When you restore the list of applications using “–set-selections”, only packages ommited from the list will remain in the “deinstall” state.  Aptitude will honor the deinstall state and remove the extra packages, leaving you only with packages from the list.


Solved!
TS2 works perfectly with osspd emulation.

To install we need to build proxy daemon from source:

cd /tmp
wget http://downloads.sourceforge.net/project/osspd/ossp-1.3.2.tar.gz
tar -zxvf ossp-1.3.2.tar.gz
cd ossp-1.3.2/
make
sudo make install

If you get an error like that

No package 'fuse' found
gcc -Wall   -o osspd osspd.c  -L. -lossp
osspd.c:14:27: fatal error: cuse_lowlevel.h: No such file or directory
compilation terminated.

Then you have to install libfuse-dev

sudo apt-get install libfuse-dev

Next, make up from downloaded source:

cd ossp-1.3.2/
make
sudo make install

Ready!

To enable that type in terminal

sudo /usr/local/sbin/osspd
sudo chmod o+rw /dev/dsp /dev/adsp /dev/cuse /dev/mixer

Found from here


I am using Edgy Eft (6.10). If I switch to 10.04, how will it affect performance?

With 2GB of RAM you should be just fine. Upgrading to a later version of Ubuntu shouldn't ever degrade performance (that's my opinion, not reality), and can be made to run fine on older hardware with a little tweaking. I run 10.04 and 10.10 on my laptop with 1GB RAM and a 1.2GHz 32-bit processor without problems.

There are certain applications (such as Gwibber) which I have heard have adverse impact on system performance. I don't use Gwibber and I have removed it from my desktop system. It runs on the laptop (idle, since I don't use it) without impact. I remember hearing complaints about Gwibber when 10.04 came out, but not so much since then- perhaps the issue has been resolved with an update.

If you go ahead and install 10.04 and notice a drop in performance relative to 6.10, I recommend firing up System Monitor and seeing if you can find an application hogging up resources.


if move from 12.04 to 14.04, will I have to reinstall mysql or apache?

In general it will work and if the upgrade process can do its thing it'll all work out. If there is a power outage though you will run into trouble...

You can plan for upgrade failure. As with ALL upgrades:

I would assume you would dump your database and create a copy of my.cnf. That's all there if for MySQL. If it does not run after the upgrade it probably is a setting that needs tweaking.

Same for Apache: I would assume you create a backup of your settings (/etc/apache2/) and your websites (might be /var/www/) and other settings. Copying the old settings file over the new one generally works when I do this.


ubuntu sdk ,run default app on ubuntu phone

The problem was solved changing the Comment in the desktop file. For further Information just add a comment


How do I troubleshoot sporadic HDMI failures?

a)

Have you tried to restart X?. You can do it from the terminal (switch using CTRL+ALt+F1) and writing:

/etc/init.d/gdm restart

or

service gdm restart

If this doesn't work you could try to unload/load the graphic card module from the kernel, but this can a little tricky as usually there are a couple of modules depending one on another. You can start typing lsmod in a terminal to see what modules you have loaded. You can force modules to unload using rmmod as root and load them again with modprobe.

b)

Have you looked at the system and X.org logs?. You can check them on System->Administration->System Logs or in /var/log/. The needed info is likely shown at the bottom of a dmesg command right after the problems happen.


What motherboards support managing secure boot with mokutil?

I can fully sympathise with the difficulties you have had, I spent months trying to find a complete guide to installing VirtualBox on a UEFI system with Secure Boot enabled and I wanted to keep Secure Boot enabled and of the few guides out there, I couldn't get any to work and mostly all of them advised to disable Secure Boot and I didn't want to an in any case its not possible to Disable Secure Boot on my system (Acer) and I believe the ASUS is the same int that you cant disable Secure Boot and you shouldn't have to. I also had some UEFI processor bug, it reported it at startup? once I removed Windows and installed Ubuntu, curious I thought since I never had any UEFI bug while Windows was installed and why should I it is a brand new laptop, I put it down to Microsoft and the manufacturer, trying to put people off migrating away from Windows, this so called bug didn't have any bearing on my Ubuntu or VirtualBox installation and never prevented my registering the MOK keys. I mean following other instructions I was never presented with any MOK screens after a reboot and at first thought it was the so called bug but it wasn't.   If I recall I reinstalled Windows and I updated my BIOS firmware and that was only to ensure I had the latest firmware as a precaution, before migrating to Ubuntu and I am sure the firmware update didn't make any difference and I kept seeing the UEFI bug on startup, but this so called bug has magically disappeared after Kernel updates.

The only difference for me is that I never use dual boot and the whole point of installing VirtualBox was that if I need to use Windows, I would have it installed in a guest virtual machine.  When I installed I was using VirtualBox 6.0 and my kernel version 4.18.0-25-generic and since I have upgraded up to 5.0.0-36-generic and Ubuntu 18.04.3 and I have also since upgraded VirtualBox to version 6.0.14 and I have never had to resign the modules, or had any issues, I think at some point possibly from v6.0.10 onwards I am told you don't have to sign the modules manually but I found it useful to know anyway.   Here is what I did:

Installing Oracle Virtualbox 6.0 on UEFI System with Secure Boot enabled

Instructons for 64 bit debian based linux distributions only, in this particular case I am using ubuntu 18.04.02 (bionic).

1.  Install Virtualbox from the Oracle repositories
(The advantage of installing from Oracle repositories is that Virtualbox automatically updates along with system updates).  Add the Oracle VirtualBox repository to your the list of repositories using this command:

sudo add-apt-repository "deb [arch=amd64] http://download.virtualbox.org/virtualbox/debian <dist> contrib"

replace <dist> in the above command with your distribution from the following:
 bionic     (18.04)
 artful     (17.10)
 zesty      (17.04)
 yakkety    (16.10
 xenial     (16.04)
 wily       (15.10)
 vivid      (15.04)
 utopic     (14.10)

So if your system is bionic (18.04) the command is:

sudo add-apt-repository "deb [arch=amd64] http://download.virtualbox.org/virtualbox/debian bionic contrib"

1.2  Download and register the OracleVirtualbox GPG keys by issuing the commands:
(GPG keys allow you to verify and communicate with the VirtualBox repository)

wget –q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add -
wget -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | sudo apt-key add –

2.  Signing the virtualbox modules and registering the MOK key

2.1.   Create the public and private keys by first running the following command to create a directory (folder) in your home drive to store the keys:

mkdir ~/keys

2.2 Now run the following command to generate the public and private keys

openssl req -new -x509 -newkey rsa:2048 -keyout ~keys/MOK.priv -outform DER -out ~keys/MOK.der -nodes -days 36500 -subj "/CN=\Vbox"

NB:  Mok keys using the above command are output to /keys/
run the command ls -al ~/keys/ to see the mok keys were generated successfully

2.3.  Sign the virtualbox modules with the public and private keys
(uname -r substututes your linux kernel version e.g. 4.18.0-25-generic) so you don't have to find it and add it into the command manually

sudo /usr/src/linux-headers-$(uname -r)/scripts/sign-file sha256 ~/keys/MOK.priv ~/keys/MOK.der $(modinfo -n vboxdrv)
sudo /usr/src/linux-headers-$(uname -r)/scripts/sign-file sha256 ~/keys/MOK.priv ~/keys/MOK.der $(modinfo -n vboxnetflt)
sudo /usr/src/linux-headers-$(uname -r)/scripts/sign-file sha256 ~/keys/MOK.priv ~/keys/MOK.der $(modinfo -n vboxnetadp)
sudo /usr/src/linux-headers-$(uname -r)/scripts/sign-file sha256 ~/keys/MOK.priv ~/keys/MOK.der $(modinfo -n vboxpci)

2.4.  Import the MOK’s (Machine Owner Keys) to Secure Boot.
(Note: The MOK Util will ask for a password)

sudo mokutil --import MOK.der

2.5. Reboot and follow instructions to Enroll MOK.

2.6. Confirm the MOK is enrolled. Type the following command in a terminal

$ cd ~/keys
$ mokutil --test-key MOK.der
MOK.der is already enrolled


Turned off a server and on restart got a mount error

If you are not using /var/linuxbackup then you should remove the line from /etc/fstab where the system is trying to mount that device. The entry would have the form: //url2storage /var/linuxbackup cifs ... You could boot into single user mode, fix /etc/fstab, then finish startup, and you should successfully complete the boot process.


Please take a look at chapter 29 of the documentation for the proprietary nvidia drivers. For only two displays nvidia seems to recommend using twinview with both displays connected to one card as this configuration seems to give you the best experience.

You can find the documentation when selecting to download the Linux driver from the official site. It is the README link in the additional information tab.

Or use the Unix related page instead and be sure to use the documentation that matches your driver version and architecture:
http://www.nvidia.com/object/unix.html


What is the correct way of ignoring a system script installed by a package when removing that package?

With the help of some other people, I found an answer in the Debian policy document, but this is only spelled out in the CRON Jobs section (opposed to a more generic section about such scripts.)

The concerned paragraph:

  The scripts or crontab entries in these directories should check if all necessary programs are installed before they try to execute them. Otherwise, problems will arise when a package was removed but not purged since configuration files are kept on the system in this situation.


What do I need to change so that the look of the sidebar (Ubuntu Dock) changes?

The Ubuntu Dock is actually a fork of the Dash to Dock extension, forked to remove configuration settings. If you want to customize the dock beyond what the Ubuntu developpers want to support, then you may want to disable Ubuntu Dock and install the Gnome Shell extension "Dash to Dock" instead. The "Dash to Dock" settings can be accessed by right-clicking the "All program" icon, or from "Tweaks", or from the Gnome Extensions website.

The "Dash to Dock" settings include a tab "Appearance". There, you can disable that the dock uses your current GNOME theme and customize the dash color and opacity.

Note that, internally, Ubuntu Dock uses the same settings as Dash To Dock. Changes you apply in the Dash to Dock configuration therefore will also affect Ubuntu Dock if you turn off Dash to Dock and turn on Ubuntu Dock.


Some commands from system menu of panels dissappeared

This is as a result of moving to application indicators, there is no longer a seperate left/right click for items, just left click.


Have you tried using "computername.local" instead of computername? I don't know about windows, but that's how i connect to my Ubuntu boxes on my LAN on VNC, SSH and other services.

Good luck!


Installing Ubuntu manually from command line (without installer)

Using debootstrap I can install system in image file with command:

debootstrap --arch i386 trusty /mnt/imagefile/ http://archive.ubuntu.com/ubuntu/

thx @muru


PostgreSQL default authentication method

The PostgreSQL doc says about ident in its list of auth methods:

  Ident authentication, which relies on an “Identification Protocol”
  (RFC 1413) service on the client's machine. (On local Unix-socket
  connections, this is treated as peer authentication.)

A rule like this in pg_hba.conf

local   all             postgres                                peer

means that if the connection comes from a Unix domain socket (TYPE column=local), and whatever is the database (database column=all), and if the user is postgres, then the authentication scheme to use is peer.

If ident was there instead of peer, that would not make any difference as per the comment above saying that they mean the same for local connections.

The other rules that point to peer in the pg_hba.conf from the question  have local in the leftmost column, so it applies to them as well.

TCP connections to localhost (127.0.0.1 or ::1) are not refered to in the pg_hba.conf as local, this value meaning exclusively Unix domain sockets. This is sometimes confusing because people often refer to TCP connections through localhost (127.0.0.1) as local connections too.

They are often configured by default to use a password, like this:

host    all             all             127.0.0.1/32            md5


I have the same monitor connected via DVI-to-HDMI cable:

Section "Monitor"
Identifier "DELL S2240L"
ModelName "DELL S2240L"
VendorName "DEL"
# Monitor Manufactured week 32 of 2014
# EDID version 1.3
# Digital Display
DisplaySize 480 270
Gamma 2.20
Option "DPMS" "true"
Horizsync 30-83
VertRefresh 56-76
# Maximum pixel clock is 170MHz
#Not giving standard mode: 1152x864, 75Hz
#Not giving standard mode: 1280x1024, 60Hz
#Not giving standard mode: 1920x1080, 60Hz

#Extension block found. Parsing...
Modeline    "Mode 13" 148.50 1920 2008 2052 2200 1080 1084 1089 1125 +hsync +vsync
Modeline    "Mode 0" 148.50 1920 2008 2052 2200 1080 1084 1089 1125 +hsync +vsync
Modeline    "Mode 1" 148.500 1920 2008 2052 2200 1080 1084 1089 1125 +hsync +vsync
Modeline    "Mode 2" 74.250 1920 2008 2052 2200 1080 1082 1087 1125 +hsync +vsync interlace
Modeline    "Mode 3" 74.250 1280 1390 1420 1650 720 725 730 750 +hsync +vsync
Modeline    "Mode 4" 27.027 720 736 798 858 480 489 495 525 -hsync -vsync
Modeline    "Mode 5" 27.027 720 736 798 858 480 489 495 525 -hsync -vsync
Modeline    "Mode 6" 27.027 1440 1478 1602 1716 480 484 487 525 -hsync -vsync interlace
Modeline    "Mode 7" 27.000 1440 1464 1590 1728 576 578 581 625 -hsync -vsync interlace
Modeline    "Mode 8" 25.200 640 656 752 800 480 490 492 525 -hsync -vsync
Modeline    "Mode 9" 74.250 1920 2448 2492 2640 1080 1082 1089 1125 +hsync +vsync interlace
Modeline    "Mode 10" 148.500 1920 2448 2492 2640 1080 1084 1089 1125 +hsync +vsync
Modeline    "Mode 11" 27.000 720 732 796 864 576 581 586 625 -hsync -vsync
Modeline    "Mode 12" 74.250 1280 1720 1760 1980 720 725 730 750 +hsync +vsync
Modeline    "Mode 14" 74.25 1920 2008 2052 2200 540 542 547 562 +hsync +vsync interlace
Modeline    "Mode 15" 74.25 1280 1390 1430 1650 720 725 730 750 +hsync +vsync
Modeline    "Mode 16" 27.00 720 736 798 858 480 489 495 525 -hsync -vsync
Option "PreferredMode" "Mode 13"
EndSection

You can download EDID file here.


Display glitches running ATI propietary driver under Ubuntu 12.10

I have the exact same problem with the exact same graphics card on a different set of hardware (non-apple).

It appears to be related to unity in combination with lightDM.
I installed KDM as a solution and let that one start unity.

I also noticed that the corruption disappears when you have autologin turned on.
If you log out and back in again, it behaves normally.

Update: The problem appears when you login to fast (for example with autologin).
So another workaround would be to changen /etc/lightdm/lightdm.conf and set the autologin-user-timeout to 1 or greater.


You could try using EaseUS partition manager to convert one of your primary partition to extended logical (by Mitch in reply to How to change primary partition to extended without formatting).

You would then shrink the logical partition, and create the partitions for your Ubuntu installation. For an Ubuntu installation you'll need at least one partition (ext4/ext3/ext2) for the root ( / ) partition (at least 5GB, at most 30GB). A swap partition of size equal to or up to 3 times the size of your RAM is recommended (if you're short on RAM).


In your question there is a missing hyphen in nvidia settings. Open the terminal and type the correct command which is:

sudo apt-get install nvidia-current nvidia-settings


full install on an existing dual boot system

Given a dual boot Ubuntu 16.04 and Windows 10 system there can be a serious problem upgrading 16.04 with 20.04 via a complete overwrite.
This answer has it that there can be a serious problem in some cases and this answer will describe a failure scenario. If there are success scenarios people can post them as alternative answers. A failure scenario is a useful answer because it will help people avoid problems. The fact that this, the first posted answer, appeared many days after the question was posed means this might be esoteric knowledge and therefore valuable to the community.
I used Startup Disk Creator to make a USB Flash drive installer of 20.04 from the ISO file. That program can automatically detect the ISO if it has been downloaded to the Downloads directory and it will automatically detect a USB Flash drive. Download the ISO and insert the Flash drive before starting the program.
I booted into the PC architecture setup program UEFI that people like to call BIOS and made it so that the USB Flash drive would be an early-in-sequence boot device. The 20.04 installation offers 4 options which I will describe as just install 20.04 for lack of a better name, install 20.04 along side 16.04, erase all operating systems and install, and something else. Looking into the something else option I was able to see that there were NTFS and ext4 partitions. I did not know how to direct the program so that 20.04 would overwrite the ext4 partitions and the dialog did not offer much guidance so I decided to go back to the menu option just install 20.04. Since I want 16.04 to be overwritten this seemed like the right choice.
After the installation the computer booted to a grub prompt. This is very user unfriendly and I considered this to be a failed attempt.
The internet has tutorials on initially setting up a dual boot system with Windows installed first and tutorials on initially setting up a dual boot system with Ubuntu installed first. It might be harder to find overwrite/upgrade tutorials for the Ubuntu side of such systems. Hopefully this answer serves as a small contribution towards an understanding of how to (or how not to) perpetually maintain a dual boot system with overwrite/upgrades.
Aside: I decided to abandon use of dual boot systems until it is easier to do overwrite/upgrades. Speculative: Another reason to avoid dual boot is that some Microsoft license enforcement checks the hardware on which it was first installed. After failing to upgrade via an overwrite on a dual boot drive I switched to single booting Windows only. I then found that one of my Microsoft licenses is newly invalid. It might be possible to correct this problem but it might not be worth the time and effort. I purchased a new license.


VGA Arbiter patch for the 4.4 linux kernel?

Check out OVMF, it has better support than using the VGA Arbiter patch.

OVMF brings UEFI support to virtual machines.

I currently do not have more detailed information' however, the OVMF keyword will enhance your searches.


Solved based on Shauna's link. Simply disallowed websites to use their own custom fonts.
Custom Fonts
Some websites have custom fonts, to disable them:

Click on the Firefox button and then select Options, and then again click Options. Or, on the menu bar, click on the Edit menu and select Preferences.

Select the Content panel. Under Fonts & Colors, click the Advanced... button.

In the window that opens, uncheck the box next to Allow pages to choose their own fonts, instead of my selections above.

Click OK to close the Fonts window. Click OK to close the Options window. Click Close to close the Preferences window. Close the Preferences window.


How do I create a backup image of an SD card?

Run mount | grep "/media/oneiric". This will show the sdcard device (/dev/sdXX). Then run:

sudo umount /media/oneiric
sudo dd if=/dev/sdXX of=~/sd-card-copy.img


On the computer VirtualBox is on:

Download the ISO to a safe place. Note that you do not want to select "Run With", but instead "Save as..."

Open VirtualBox.
Create a new VM for Ubuntu.

Enter Settings and go to the Disk menu.

Under SATA, add a new CD drive.

Select the ISO
Exit out, saving all settings.
Boot the VM.

???
Profit.


Problems installing ubuntu from a remastersys created ISO

You can try the DMDc installer, which created Frannoe for distribution:
http: //www.dmdcosillas.org

This installer is based on Remastersys. It is specific to the DMDc distributions DKDC and DxDC. If you want to use it in your distribution you will have to modify it and adapt it.


Windows 10 dual boot with Ubuntu 16.04.2 - dual boot disappeared

I have recently installed Ubuntu on a Lenevo laptop. If I reboot from Windows 10 I have to use F12 to get the grub boot menu.
When I reboot from Ubuntu I have the Windows 10 option in the grub boot menu.

So I have a workable solution to using my laptop as a dual boot even though the Ubuntu system is invisible during normal start-up. In my case it's even preferable as my children use the Windows 10 and don't need to go through the grub boot window.


How to update system python 2.7 to 3.x in Ubuntu 20.x after upgrade

Python alone will run python v2, to run Python 3 do the following:
python3 -V

If you get nothing try upgrading:
sudo apt update
sudo apt -y upgrade

Then install pip
sudo apt install -y python3-pip

Then check version again
python3 -V

If you want python to run Python 3, you can do that using this guide: How to make 'python' program command execute Python 3?


unable to see the desktop after installing 12.04 32bit in virtual box just logging into cmd interface

My personal favourite is virtual-box but that is just a mater of taste. Any one will do.

Are you sure you installed a desktop version? As far as I know only the server version comes with graphical interface disabled by default.

Login and type "startx" to start the window manager manually.


How to restore system default settings in ubuntu 16.04?

I recommend you to restore Ubuntu from live CD. Download the iso and reinstall Ubuntu. It is the fastest and best way to fix your problem. Othrewise you can run sudo apt install --reinstall ubuntu-desktop and sudo apt install unity. After these commands you might need to run unity on a terminal


Can't create a bootable ubuntu USB stick with ubuntu

You can try some alternative program to this preinstalled in Ubuntu like:

UNetBootIn
 - you can install him straight from this link,

or Live Usb Install from here.


Touchpad of Lenovo Ideapad S145-15IIL not detected in 18.04 and 19.10, Ubuntu and Kubuntu

I found out that they are working to add the proper drivers for this touchpad. Anyhow I managed to fix this problem by adding these lines to the kernel parameters:
i8042.nopnp=1 pci=nocrs

Once done, do
sudo update-grub

than restart the system.


Cannot use apt-get install due to missing libfftw3-long3

Ideally as you probably know packages should be installed by using the Software Center,  command line using apt-get or by using Synaptic. However I appreciate if all of these are complaining of a missing file you are in a quandary. There is a final choice:

This file can be manually downloaded by following these links:

Trusty Tahr amd64:

http://mirrors.kernel.org/ubuntu/pool/main/f/fftw3/libfftw3-long3_3.3.3-7ubuntu3_amd64.deb

Trusty Tahr i386:

http://mirrors.kernel.org/ubuntu/pool/main/f/fftw3/libfftw3-long3_3.3.3-7ubuntu3_i386.deb

Xenial Xerus amd64

http://mirrors.kernel.org/ubuntu/pool/main/f/fftw3/libfftw3-long3_3.3.4-2ubuntu1_amd64.deb

Xenial Xerus i386

http://mirrors.kernel.org/ubuntu/pool/main/f/fftw3/libfftw3-long3_3.3.4-2ubuntu1_i386.deb

And then installed using the following command line syntax:

sudo dpkg -i path_to_filename

And hopefully this will be enough to get you up and running :)

References:

Ubuntu Documentation: dpkg


Step-1
It was confirmed that Questioner @kihit0mi's Ubuntu installation has EFI boot loader through the following command:
$ ls /sys/firmware/efi/

Whose output was:
config_table  efivars  esrt  fw_platform_size  fw_vendor  runtime  runtime-map  systab  vars

Step-2
The following command did not yield any output:
$ sudo os-prober

Step-3
The following command was issued to generate GRUB menu:
$ sudo update-grub

System was rebooted and an attempt was made to reach GRUB menu through shift command. But it was observed that instead of reaching GRUB menu, it ended up on login screen of Ubuntu!
Step-4
To reach windows login screen, only way was through BIOS setup screen. System was rebooted, and reached BIOS setup screen by pressing del key. It was observed that there were three boot loaders present which are listed as follows:
Ubuntu
Windows Boot Manager and
EFI PXE.

After setting up Windows Boot Manager to top priority, Windows-10 was logged on successfully!
Step-5
Login to Windows 10. Press the Windows + R keys, type msinfo32.exe in Run dialog box, and then press Enter to open System Infomation window. In the right pane of System Summary, you should see the BIOS MODE line. If the value of BIOS MODE is Legacy, then Windows is booted in legacy mode. If the value of BIOS MODE is UEFI, then Windows is booted in UEFI mode. Questioner @kihit0mi confirmed that the BIOS mode line contained only UEFI. That was really good!
Step-6
Next, the Firmware BIOS was updated to the latest Version. Refer How to Check Your Current BIOS Version and upadate it.
The following command was given again to generate GRUB menu:
$ sudo update-grub

System was rebooted and an attempt was made to reach GRUB menu through shift command. It was good to observe that this time GRUB menu was reached successfully but the presence of Windows-10 was not found!
Step-7
It was decided to put a menuentry into /etc/grub.d/40_custom file which is capable of generating Windows entry into GRUB menu. In order to find out the disk and partition numbers corresponding to Windows Boot loader, it was rebooted and GRUB menu was reached by pressing 'shift' key. The grub > command line was entered, by pressing c,  and the following command was given:
grub > ls

But no output yielded. So The disk and partition numbers for Windows loader were guessed to be 0 and 2 respectively which are needed for menuentry preparation.
menuentry "Windows" {
    set root=(hd0,2)
    chainloader +1
}

After creating the above menuentry in file /etc/grub.d/40_custom, issue the following command to make script 40_custom file executable:
$ sudo chmod +x /etc/grub.d/40_custom

Generate GRUB menu with the following command:
$ sudo update-grub

System was rebooted and GRUB menu was reached by pressing shift key. This time  there was a Windows loader found. But while trying to boot, the following error was thrown out:
The EFI file path is incorrect error

#Step-8
It was attempted again and again with various disk and partition numbers entries in the menuentry, but all resulted in the same error message the EFI file path is incorrect error after selecting Windows bootloader from GRUB menu.
All these hurdles happened since Questioner @kihit0mi's laptop did not respond to ls command from GRUB menu's command line: grub > ls .
I tried the same from my desktop's GRUB menu with command grub > ls which resulted in the following output:
(hd0) (hd0.gpt8) (hd0.gpt7) (hd0.gpt6) (hd0.gpt5) (hd0.gpt4) (hd0.gpt3) (hd0.gpt2) (hd0.gpt1) (hd1) (hd2) (hd2,gpt4) (hd2,gpt3) (hd2,gpt2) (hd2,gpt1) (hd3) (hd3,gpt4) (hd3,gpt3) (hd3,gpt2) (hd3,gpt1)

How to interpret the above output from GRUB ls command?

Issue the following command for (hd0):
grub > ls (hd0)

Whose output was:
    Device hd0: No known file system detected - Search size 512 B - Total size 117220824 KiB.

The output even though showed as No known file system but it really represents /dev/sda (look at the Total size). If you keep on probing such as ls (hd0,gpt8), ls (hd0,gpt7), and so on until ls (hd0,gpt1), it will display the partitions that corresponding to devices such as /dev/sda8, /dev/sda7 and so on until /dev/sda1
The above device /dev/sda (120 GB SSD) contains my Ubuntu installation which was shown as (hd0) in grub command line. The gpt1 through gpt8 represents partitions which are efi, swap, /, /usr, /opt, /tmp, /var, and /home respectively.

Now, issue the following command for (hd1):

grub > ls (hd1)
Whose output was:
    Device hd1: No known file system detected - Search size 2048 B - Total size 514 KiB.

Now, issue the following command for (hd2):

grub > ls (hd2)
Whose output was:
    Device hd2: No known file system detected - Search size 512 B - Total size 976762584 KiB.

Although the output was No known file system but it really represents /dev/sdb (look at the Total size). If you keep on probing such as ls (hd2,gpt4), and so on until ls (hd2,gpt1) it will display the partitions that corresponding to devices such as /dev/sdb4 and so on until /dev/sdb1
The above device /dev/sdb is my 1 TB HDD with NTFS filesystem which was shown as (hd2) in grub command line. The gpt1 through gpt4 represents NTFS partitions which are unknown, CodeWrite, ShareMe and Warehouse respectively.

Now, issue the following command for (hd3):

grub > ls (hd3)
Whose output was:
    Device hd3: No known file system detected - Search size 512 B - Total size 244198584 KiB.

Though output showed as No known file system but it really represents /dev/sdc (look at the Total size). If you keep on probing such as ls (hd3,gpt4), and so on until ls (hd3,gpt1), it will display the partitions that corresponding to devices such as /dev/sdc4 and so on until /dev/sdc1
The above device /dev/sdc (250 GB SSD) contains my Windows-10 installation which was shown as (hd3) in grub command line. The gpt1 through gpt4 represents partitions which are  EFI, unknown, WindowsOS and WinRE respectively.
#Step-9
Note: Questioner @kihit0mi's ubuntu: no output for the command sudo os-probed. Refer step-2.
Again, I tried sudo os-probed command from my Ubuntu terminal which resulted in the following output:
/dev/sdc1@/efi/Microsoft/Boot/bootmgfw.efi:Windows Boot Manager:Windows:efi

A clue was devised from the output of above os-probed command. In order to avoid using trial & error method to look for disk and partition numbers, the following search string was incorporated in /etc/grub.d/40_custom:
search --set=root --file /efi/Microsoft/Boot/bootmgfw.efi

Note: To know more about Grub menu search command, refer this link
Now the new menuentry is capable of searching automatically disk and partition numbers corresponding to windows-10 EFI bootloader, as shown below:
menuentry "Windows" {
    search --set=root --file /efi/Microsoft/Boot/bootmgfw.efi
    chainloader /efi/Microsoft/Boot/bootmgfw.efi
}

After creating the above menuentry in file /etc/grub.d./40_custom, the following command was given to generate GRUB menu:
$ sudo update-grub

System was rebooted and GRUB menu was reached by pressing shift key.

This time Windows-10 EFI bootloader was selected and booted into Windows-10 system successfully.

#Step-10:

not yet completed.

The Questioner @kihit0mi's presence is required at chat session in order to complete pending task which is the removal of extraneous bootloader present in the BIOS setup screen.


The instructions are on the download page here

  Ubuntu, Linux Mint, & Ubuntu derivatives:
  13.04 Raring and 13.10 Saucy Add this PPA, PPA may take several hours to sink new package updates. Please be patient. copy and paste the
  following in a terminal:
  sudo add-apt-repository ppa:killhellokitty/themes.ppa
  sudo apt-get update
  sudo apt-get install delorean-dark-stripped-themes-3.8

This will add a repository and let you install a package with the theme in it, which is probably easier/better, because you will also be able to get updates for the theme as well.

If you really want to use the .zip file, that question is answered in detail here, but essentially you just extract the contents of the theme to a directory .theme in your home directory and use the program, MyUnity to to apply the theme.


0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 1 not fully installed or removed

The problem is the libsimgearcore2017.3.1 package, and it looks to be because the package is not doing adequate env setup/checking during installation.

Option 1: Safest Cleanup

It's complaining about a missing directory which is causing a symlink creation to fail.
Try this:

sudo mkdir -p /usr/share/games/flightgear/
sudo apt-get -f install

If that doesn't fix it, then it may be looking for another sub directory.
Try this:

sudo mkdir -p /usr/share/games/flightgear/Timezone
sudo apt-get -f install

Option 2: Not safe, or recommended

dpkg has an option for handling removal of packages which are in a broken state. It's a force, so use with care!

  reinstreq

  A  package  marked  reinstreq  is  broken  and  requires reinstallation. These packages    cannot    be    removed,     unless     forced     with     option --force-remove-reinstreq.

Try this:

sudo dpkg -r --force-remove-reinstreq libsimgearcore2017.3.1


rbash does not work when set as the default shell for a user

You need to restart the user session, either by logging out and back in or by rebooting the machine, to make the changes take place.


Suddenly, after an update, keyboard started to work.


SOLUTION:

Here's the solution I figured out and removed my error:

sudo apt-get remove libgl1-mesa-dri:i386

Doing this showed some unmet dependencies [The clue I needed] and wouldn't let me uninstall this package without removing the ppa. I figured I'd start removing drivers to see what the issue was, it was the next step to troubleshoot this issue.

Wine MUST be installed when you do the oibaf PPA for this to work

I removed the following two ppa repositories:

ppa:ubuntu-x-swat/x-updates [I did this one in LXDE Start Menu > Preferences > Additional Drivers > Other Software [TAB]

$ sudo ppa-purge ppaibaf/graphics-drivers [Terminal]

**The following packages will be DOWNGRADED:**
libdrm-amdgpu1 libdrm-dev libdrm-intel1 libdrm-nouveau2 libdrm-radeon1
libdrm2 libegl1-mesa libegl1-mesa-dev libgbm1 libgl1-mesa-dri
libgl1-mesa-glx libglapi-mesa libosmesa6 libva-x11-1 libva1 libvdpau1
libvorbis0a libvorbisenc2 libvorbisfile3 libwayland-egl1-mesa
libxatracker2 mesa-utils mesa-vdpau-drivers xserver-xorg-video-ati
xserver-xorg-video-intel xserver-xorg-video-nouveau
xserver-xorg-video-radeon
The following NEW packages will be installed:
libllvm3.6v5{a}
The following packages will be REMOVED:
libllvm3.8{u} libomxil-bellagio-bin{u} libomxil-bellagio0{u}
vdpau-driver-all{u}
The following packages are RECOMMENDED but will NOT be installed:
i965-va-driver va-driver-all vdpau-va-driver
0 packages upgraded, 1 newly installed, 27 downgraded, 4 to remove and 1 not upgraded.

dpkg: warning: downgrading libgl1-mesa-dri:i386 from 11.3~git1602290730.07ed00~gd~w to 11.0.2-1ubuntu4
Preparing to unpack .../libgl1-mesa-dri_11.0.2-1ubuntu4_i386.deb ...
Unpacking libgl1-mesa-dri:i386 (11.0.2-1ubuntu4) over (11.3~git1602290730.07ed00~gd~w) ...

Since Lubuntu 15.10 had some recent updates again regarding all the mesa driver packages, it was time to revert from the drivers I originally had working from those ppa repositories.

I still kept the following packages above and added this one from the unmet dependencies shown in the remove prompt:

sudo apt-get install kde-runtime

[Leaving it installed since it system is working well now]

I added sudo apt-get install pulseaudio to remove ALSA pcm errors I was having when it was the other ppa driver installed, just throwing that in extra.

All the other applications I had installed previously like mesa-utils, etc., did downgrade to official Ubuntu packages and now the issue is resolved!

$ dpkg --get-selections | grep mesa
libegl1-mesa:i386                install
libegl1-mesa-dev:i386                install
libgl1-mesa-dri:i386                install
libgl1-mesa-glx:i386                install
libglapi-mesa:i386                install
libglu1-mesa:i386                install
libosmesa6:i386                    install
libwayland-egl1-mesa:i386            install
mesa-utils                    install
mesa-vdpau-drivers:i386                install

$ mame -mt -video opengl -rs -speed 1.00

Average speed: 68.03% (185 seconds)

Now MAME is working correctly with the -Video OpenGL option [No more -Video Soft needed!] Errors gone!

DRICONF showing Mesa Driver Working now: Mesa Driver Loaded/Active

FINAL EDIT: So after a reboot, the issue returned.

FINAL FIX: I duplicated the error/fix

[intel_do_flush_locked_failed:input output error/libGL error: failed to create dri screen
libGL error: failed to load driver: i915

by re-adding the oibaf ppa, then doing LXDE Start Menu > System Tools > Software Updater to get the PPA software updates needed, then ppa purge again to figure out it was the Intel Driver I needed!

Used this link: https://launchpad. net/~oibaf/+archive/ubuntu/graphics-drivers/+packages

Installed these two from the link above and now everything is COMPLETE/WORKING!

xserver-xorg-video-intel-dbg_2.99.917+git1602241932.d16728~gd~w_i386.deb (2.6 MiB)
xserver-xorg-video-intel_2.99.917+git1602241932.d16728~gd~w_i386.deb (1.6 MiB)

Hope this helps someone with MAME who tries to get it working, and runs into this issue running it installing/configuring from Terminal.


How do I recover the pictures and videos I lost when I erased the disk and installed Ubuntu?

TestDisk can recover partitions. Use that. If partition is unreadable that is is beyond recover then you can do nothing. Data recovery depends on how much you overwritten the data.

In any case, I'm sure Ubuntu have written (overwritten?) small part of the disk so I believe you can recover some. I'm sure you messed somewhere in using testdisk. May be you tried to recover data instead of partitions. Checkout this guide on how to do that! Here is another link to help on the same using live CD
All the best!


These are the latest instructions from the WineHQ AppDB, they are for 14.04 (Trusty), but the same should work on 12.04 (Precise). What you need to do is build a custom patched version of a specific wine version. Here is how to do it (also works for x86 without chroot):

First, install the schroot and debootstrap packages:

sudo apt-get install schroot debootstrap

Now create a configuration file for schroot:

sudo editor /etc/schroot/chroot.d/trusty_i386.conf

Put this in the new file:

[trusty_i386]
description=Ubuntu Trusty
personality=linux32
directory=/srv/chroot/trusty_i386
root-users=your_user_name
type=directory
users=your_user_name

Create a working installation of Ubuntu inside the chroot. You can replace http://archive.ubuntu.com/ubuntu/ with an appropriate mirror from https://launchpad.net/ubuntu/+archivemirrors:

sudo mkdir -p /srv/chroot/trusty_i386
sudo debootstrap --variant=buildd --arch=i386 trusty /srv/chroot/trusty_i386 http://archive.ubuntu.com/ubuntu/

Make apt-get work from within the chroot. Gen and paste sources.list. Don't forget to add wine PPA.  http://repogen.simplylinux.ch/index.php:

sudo editor /srv/chroot/trusty_i386/etc/apt/sources.list

Enter the chroot:

sudo schroot -c trusty_i386 -u root

Get the basic packages:

apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 6E80C6B7
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F9CB8DB0
apt-get update
apt-get install ubuntu-minimal
apt-get install software-properties-common

Install the build dependencies:

sudo apt-get build-dep wine

Getting source and patching wine:

apt-get install wget
wget http://prdownloads.sourceforge.net/wine/wine-1.7.23.tar.bz2
tar -xvf wine*
cd wine-*

wget http://pastebin.com/download.php?i=xSNJjkMY -O patch.diff
patch -p1 < patch.diff

Building Deb pack (-jN where N number of CPU cores)

make -j4 depend && make -j4

Exit chroot and install. To be able to use Wine from outside the chroot, Wine's dependencies must be installed outside the chroot. The easiest way is to exit the chroot and install a prepackaged copy of Wine:

logout
cd wine-*
sudo apt-get install wine
sudo make install

Install winetrics:

winetricks wininet vcrun2005 corefonts adobeair d3dx9


GRUB_TIMEOUT in /etc/default/grub not changing the wait time with LVM

Recently a patch has been merged fixing grub timeout menu to 30 seconds for UEFI systems with /boot on lvm or btrfs.

The reason for that in some cases a user can't access boot menu. grub can't write to lvm or btrfs.

If a boot fails, grub can't record it to LVM or btrfs, so there is an unlikely chance that you won't be able to get to grub menu for the safe mode, etc.

See this bug report for more details.

If you look into grub.cfg, you'll see this:

if [ "${recordfail}" = 1 ] ; then
  set timeout=30
else
  if [ x$feature_timeout_style = xy ] ; then
    set timeout_style=hidden
    set timeout=0
  # Fallback hidden-timeout code in case the timeout_style feature is
  # unavailable.
  elif sleep --interruptible 0 ; then
    set timeout=0
  fi
fi
if [ $grub_platform = efi ]; then
  set timeout=30
  if [ x$feature_timeout_style = xy ] ; then
    set timeout_style=menu
  fi
fi

You can change it manually, but it will be reverted on update-grub.

This can be fixed by setting

GRUB_RECORDFAIL_TIMEOUT=0

in /etc/default/grub followed by sudo update-grub command.

if you are sure you'll be able to access UEFI settings. If not quite sure, set it to 5, or 10.

Another workaround would be to create a separate /boot partition outside of LVM or btrfs.


Change default driver of network printer

Open System Settings, and click on Printers.  Once the window opens, right click on the printer that you want to change its driver, and choose Properties.

When the properties windows opens, click on Change to the right of Make and Model under Settings.

Once that window opens, choose driver source, and click on Forward.


When would you want to use a Hard link instead of a soft link? An example to help Understand the difference

In short: don't bother using the hard links.

Hardlink are rarely used (maybe due to legacy unix bugs, who knows), so let see the advantages of hard links, and what scenario could require that feature.

less space consumption (just the inode entry): could be useful if your requirements impose usage of gazillions of links
file reference counting: Within the same filesystem, you can create multiple directory structures containing hard-linked files. It enables you to:

have multiple thematic directory structures (Docs/House/Taxes/fx2015.pdf vs Docs/Taxes/2015/fx.pdf)
even create backup snapshots as seen here
reorganize, rename and delete your documents without naming troubles

Ohh.. you think it's nice ? perfect directory structures for me ? well no..
It will depends on the application used, but when some paranoïd application will save your files, they will do, instead of overwriting it :

create a new file and write to that file
on success : swap the new and existing file with renaming, delete the old file
on failure, data is left unchanged

So, your multiple file names pointing to the same data are now pointing to different data, and you simply cannot tell the difference.


Is it possible to control window positioning using keyboard shortcuts in Ubuntu?

In my case, this can be done with Compiz Setting Manager.

First, you'll need to download Compiz (Skip this part if you already own it).

sudo apt-get install compizconfig-settings-manager compiz-plugins

Open compiz, then navigate to Window Management category which located on the left pane.
Enable Grid plugin.
Set your own desired shortcut/keybinding for tiling window, simply click the corresponding action key, then change it to whatever you want.


If you're using grub installed to /dev/sda, then burg should be there too. I'm inclined to stay out of this question as far as answers go since you could be trying to chainload grub from the windows boot.ini and install a boot loader on sda5 (although this requires forcing some things).

By default grub will install to /dev/sda and that's where you would install burg.


Why do I get "error: directory jot empty" when shows empty but contained 1tb of data

You may be able to retrieve a lot of information about your drive when it is connected, and hopefully this will give you some ideas.  I will list some command-line based tools.

First thought

rm /direcotry/path -rf

...should solve your problem with this direcotry: it should really remove it for good.  If you need to, you can precede the above command with sudo; and you have to be VERY cautious, because you will remove almost anyting you ask it to.  Also, type -rf at the end, so if you press Enter accidentally, prematurely, you will not "force" and "recursively" over something you did not intend.

However, if you feel like experimenting more - there is more for you below:

1) Info about ALL disk devices

sudo fdisk -l

...will list device name, size and partitions (and more).  In the last column you get the partition type.

I think that fat32 is not the optimal choice for large disks, however, it is fairly standard everywhere.  You could use ntfs - nowadays Ubuntu also supports it to some extent.

2) Info about mounted devices

sudo df -h
sudo df -hi

...will pint info about mounted filesystems together with the name of a device that contins it.  You have bytes (default) used, you have inodes (specified by -i parameter) which are correlated to the number of files on the disk (not only a size matters, bu also the number of entries in the file allocation table). "h" for human readible units.

cd /directory/path
du -hs

...will let you know the summary of that is in /direcotry/path.  "s" for summary rather than a complete list and "h" for human readible units.

du -ms *   | sort -n
du -ms */* | sort -n

...this is the protagon of all console-based disk-free-space checks. My favourite. I love how it shows me the biggest items in the current path.  By using asterisk/asterisk instead of asterisk you will compare all sub-items that are in the current location.

ls -lah

...is for viewing the directory too.  "h" as above, "a" includes hidden files/dirs, "l" shows access rights and ownership info.  Especially "a" flag may be of interest in your case.

3) Still nothing? Format the drive

Copy your precious data elsewhere and format the drive over again. After all, the system might have suffered some damages due to the power loss.

sudo unmount /dev/name0    # carefully select the device

CAREFULLY CHOOSE THE DEVICE.  If you make a typo at some point, you may loose all you data and OS, and your machine will stop working.

sudo fsck /dev/name0

...has the potential to repair your disk whis HAS TO BE unmounted.  After fsck finishes, you can remount your drive by mount /dev/name0 /any/path/you/want and verify, but sometimes you have to replace the filesystem internals - keep on reading.

sudo mkfs.ntfs /dev/name0

...it overwrites the file system the disk already has.  This could also be mkfs.vfat for fat32 or (what I prefer) mkfs.ext3.


Ubuntu cannot properly detect the external monitor due to broken laptop screen

Finally got it to work! I ended up manually changing the xorg.conf file and all's good.

So first i ran

sudo nvidia-xconfig

to create a new xorg.conf file. I was hoping this would solve the problem, which it didn't. Then i found this post here and copied over this

Section "Monitor"
    # HorizSync source: edid, VertRefresh source: edid
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "DELL U2412M"
    HorizSync       30.0 - 83.0
    VertRefresh     50.0 - 61.0
    Option         "DPMS"
EndSection

After a restart i went to the Nvidia settings and low and behold the correct resolutions were listed. I think I was correct in thinking that the computer was detecting the laptop's screen settings rather than the external monitor.


ubuntu 16.04 install on compaq 311 with atom n270 cpu gives 'wrong image' error

The Atom N270 doesn't support virtualization/VT-x.

Source

Therefore, you can't run VMs on your machine.

However, you do not need virtualization to install Ubuntu. Follow the instructions here: How do I install Ubuntu?


How to resize the root space from 8GB to 40GB

Delete sda5
Create 4 GB swap at the end of the free space
Delete the two swap of 2 GB
Resize sda8 to fill all empty space


Install Ubuntu on external drive without removing internal drive? (during installation)

You can install Ubuntu onto an external (or internal for that matter) drive without removing the internal drive. You just need to make sure you understand how linux identifies drives and where you install grub.

IMO most people who make such recommendations either

Do not understand grub.
Make such recommendations "just in case".

I do not want you to take my advice as dismissive, when installing a operating system, data loss (due to over writing your data) is a mouse click away.

Probably the 2 most important steps for you to take are:

Make a backup.
Read and understand the installation documentation.


Yes, you  can normally download the ISO file then use unetbootin to make a bootable USB then reboot your laptop and you will have an option to install Ubuntu and completely delete Windows.


FYI, I've created a bunch of indicators (including indicator-virtual-box) located at https://launchpad.net/~thebernmeister.


I just figure it out. The problem was because of the root path in file 000-default.conf at /etc/apache2/sites-enabled directory.

If we lunch this file in terminal we'll see the following result:

<VirtualHost *:80>
...
        #ServerName www.example.com

        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html

        # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
        # error, crit, alert, emerg.
        # It is also possible to configure the loglevel for particular
        # modules, e.g.
        #LogLevel info ssl:warn

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

...
</VirtualHost>

As you can see in line DocumentRoot /var/www/html  the DocumentRoot has been set to /var/www/html which it should be set on following address :

/var/www/itop

and in file :

<VirtualHost *:80>
...
        #ServerName www.example.com

        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/itop

        # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
        # error, crit, alert, emerg.
        # It is also possible to configure the loglevel for particular
        # modules, e.g.
        #LogLevel info ssl:warn

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

...
</VirtualHost>


Connect kernel image (bzImage) running on qemu to network

Try adding these options to your qemu command:

-netdev type=user,id=net0
 -device virtio-net-pci,netdev=net0,mac="52:54:00:12:34:56"

If it doesn't work take a look at https://en.wikibooks.org/wiki/QEMU/Networking.

Also, it might be interesting to look at tap interfaces and bridges.


In my case, what helped, was to edit lightDM config file:

sudo vim /etc/lightdm/lightdm-gtk-greeter.conf

and in section [greeter] adding line:

user-background = false

If you have installed GUI tool for lightDM configuration (sudo apt install lightdm-gtk-greeter-settings) you can achieve the same by ensuring that "Use user wallpaper if available" option is not marked.


12.04 LTS Installs or runs from install CD using my 2nd monitor but won't run or show when installed

This maybe a NVIDIA driver problem. I think it's not loaded during live mode, but gets installed and automatically loaded on hard install.
Try disabling the NVIDIA driver from the "Additional drivers" in the system configuration.


Is there a way to move/remove "system settings" from the shut-down menu?

Yes, you can easily disable it by running the following from a gnome-terminal:

sudo rm /usr/share/indicators/session/applications/gnomecc.desktop

This will simply delete the link to the GNOME Control Center. Then logout/login or restart. Should be away after that ;-)

However, it will be in a different way in Oneiric as replied here by Mr. Shuttleworth himself. ;-)


You can use MEMDISK to boot from the .iso image using your existing bootloader.


Program[Digikam] chooses wrong qt lib and crashes

So the problem was that I had opencv installed from source sitting in /usr/local. Uninstalling it and removing the remaining files from /usr/lib and /usr/include fixed the broken link to qt and reinstalling digikam fixed everything.

The hint was check the manually installed things sitting in /usr in case one of them is conflicting.


Ubuntu 18.04: Changing dock location on monitor rotation

We have to change approaches based on whether your computer comes with an accelerometer or not. If your computer comes with an accelerometer (usually a 2-in-1 laptop or a tablet), this can be completely automated by detecting screen orientation changes. Otherwise, creating a bash script to change the orientation and dock location at the same time would give you enough convenience.

Laptop with an Accelerometer

I wrote a python3 code that gets run on boot. The script listens to the screen rotation changes and changes the dock position accordingly.

Download Dash to Dock gnome extension.
In my case, it did not need to be enabled, but it might be required.
With your favorite text editor, create a python3 file, put the following code, and save it. You can pick any name or location of the file as long as you remember where it is so that you can refer to it in Step 3 and 4. I called it "dock_rotator.py".

#!/usr/bin/env python3
import os
import subprocess
import dbus
from dbus.mainloop.glib import DBusGMainLoop
from gi.repository import GObject as gobject

def run_command(command, shell=False):
    """ Takes a string to run a command on bash
    """
    p = subprocess.Popen(command.split(), stdout=subprocess.PIPE)
    output = p.communicate()[0]
    return output.decode()

def enable_view_rotation_lock():
    os.environ["GIO_EXTRA_MODULES"] = "/usr/lib/x86_64-linux-gnu/gio/modules/"

def rotation_locked():
    locked = run_command("gsettings get \
        org.gnome.settings-daemon.peripherals.touchscreen \
        orientation-lock")

    return locked.strip() == "true"

def move_dash_top():
    run_command("gsettings set org.gnome.shell.extensions.dash-to-dock dock-position TOP")

def move_dash_left():
    run_command("gsettings set org.gnome.shell.extensions.dash-to-dock dock-position LEFT")

def sensor_handler(*args, **kwargs):
    if len(args) < 2:
        return

    dbus_dict = args[1]
    key = 'AccelerometerOrientation'
    if key not in dbus_dict:
        return
    orientation = dbus_dict[key]

    if not rotation_locked():
        if orientation in ["left-up", "right-up"]:
            move_dash_top()
        else:
            move_dash_left()

def main():
    enable_view_rotation_lock()
    global loop
    DBusGMainLoop(set_as_default=True)

    loop = gobject.MainLoop()
    bus = dbus.SystemBus()

    bus.add_signal_receiver(
        sensor_handler,
        path='/net/hadess/SensorProxy')

    loop.run()

if __name__ == "__main__":
    main()

Make the code executable by chmod +x <filename> command. If you saved your file in a directory owned by root in Step 2, you need to run sudo chmod +x <filename> instead.
Open "Startup Application" and add a new entry to direct to the python file you just created.

Name: <any>
Command: <path to the file>
Comment: <any>

Restart your computer.

Computer without an Accelerometer

This approach creates a bash script which needs to be executed when you want to change your display orientation.

Download Dash to Dock gnome extension.
In my case, it did not need to be enabled, but it might be required.
With your favorite text editor, create a bash file called "drotate" (for dash rotate), put the following code, and save it.

#!/bin/bash

show_help () {
    echo "drotate <rotation> [<display number>]"
    echo "<rotation> : inverted | left | normal | right "
    echo "<display number> : any number between 1 to number of displays connected"
    echo "                   defaults to 1"
}

set_gnome_orientation () {
    case "$1" in
        inverted)
            GNOME_ORIENTATION=LEFT
        ;;
        normal)
            GNOME_ORIENTATION=LEFT
        ;;
        left)
            GNOME_ORIENTATION=TOP
        ;;
        right)
            GNOME_ORIENTATION=TOP
        ;;
        *)
        echo "Invalid orientation"
        show_help
        exit 1
        ;;
        esac
}

if [ $# -eq 0 ] || [ $# -gt 2 ]; then
    show_help
    exit 1
fi

if [ $# -eq 1 ]; then
    DISPLAY_INDEX=1 # any number between 1 to # of displays connected
else
    DISPLAY_INDEX=$2
fi

DISPLAY=$( xrandr --current | grep -F connected |\
 grep -Fv disconnected | cut -d" " -f 1 | head -${DISPLAY_INDEX} | tail -1 )

if [ -z "$DISPLAY" ]; then
    echo Could not find display $DISPLAY_INDEX
    exit 1
fi
echo $DISPLAY

ORIENTATION="$1"
GNOME_ORIENTATION=""
set_gnome_orientation $ORIENTATION

xrandr -d :0 --output ${DISPLAY} --rotate ${ORIENTATION}

export GIO_EXTRA_MODULES=/usr/lib/x86_64-linux-gnu/gio/modules/
gsettings set org.gnome.shell.extensions.dash-to-dock dock-position $GNOME_ORIENTATION

Make the code executable by chmod +x drotate command. If you saved your file in a directory owned by root in Step 2, you need to run sudo chmod +x drotate instead.
Open ~/.bash. Create a new line in the end of the file and paste the following line. export PATH="<path/to/the/directory/with/your/script>:$PATH. For example, if you saved your file in /usr/local/drotate, the command becomes export PATH="/usr/local:$PATH. Notice drotate being omitted.
Save the file.
Either restart your terminal or run source .bashrc. They do the same thing. Now your script should be able to run.

Usage

Open your terminal (Ctrl-Alt-t) and type drotate <rotation> [<display number>].

drotate <rotation> [<display number>]
<rotation> : inverted | left | normal | right
<display number> : any number between 1 to number of displays connected
                   defaults to 1

Examples

Rotate the main display to left up: drotate left
Rotate the main display back to normal: drotate normal
Rotate your subdisplay to left up: drotate left 2


Go to bios settings by pressing F2 before booting. Then go to main tab and find touchpad. Change it from advanced to basic. Save and exit by pressing F10 .


Steam (using wine) starting civ 5 on the wrong screen

Civ 5 has a version for Linux.  Try installing Steam for Linux and then installing Civ 5 there.  You may actually get better performance this way too!


Possible MySQL error occurred during system upgrade

Can you paste all output from an apt-get update?

Maybe if you try this:

sudo rm -f /var/cache/apt/archives/mysql*
sudo apt-get autoclean

Then:

sudo apt-get update


What you're trying to do is better achieved with associative arrays:

$ declare -A pattern
$ for((i=0;i<${#types[@]};i++));do pattern[${types[$i]}]=$i; done
$ echo ${pattern["BA"]}
0
$ echo ${pattern["CA"]}
1
$ echo ${pattern["DA"]}
2


Grub installed in pendrive, how to boot from HDD?

If you installed Ubuntu only to the pendrive (no Ubuntu on the HDD), then there is no need to follow that other question's answer, because if you only have windows on your computer you don't need grub at all.

Just use your Windows install DVD, boot from that one, and repair the bootsector. If you don't know how to do that just read the beginning of this answer.


How can I remove an entry from a list in a shells script?

The simplest way is to use unset:

$ options=(aa bb cc dd)
$ echo ${options[@]}
aa bb cc dd
## Remove the 3d element of the array (arrays start at 0)
$ unset options[2]
$ echo ${options[@]}
aa bb dd

For more details, see help unset:

unset: unset [-f] [-v] [name ...]
    Unset values and attributes of shell variables and functions.

    For each NAME, remove the corresponding variable or function.

    Options:
      -f    treat each NAME as a shell function
      -v    treat each NAME as a shell variable

    Without options, unset first tries to unset a variable, and if that fails,
    tries to unset a function.

    Some variables cannot be unset; also see `readonly'.

    Exit Status:
    Returns success unless an invalid option is given or a NAME is read-only.


How to check which graphic card is used by the system?

inxi is a helpful little system info tool that collects all kinds of information about your soft- and hardware and outputs the user relevant pieces in a nice and understandable format.

You install it using sudo apt-get install inxi.

Then you can run inxi -G to print graphics related information.

Here's an example from my hardware:

$ inxi -G
Graphics:  Card-1: Intel Sky Lake Integrated Graphics
           Card-2: NVIDIA GM108M [GeForce 940M]
           Display Server: X.Org 1.18.3 driver: nvidia Resolution: 1920x1080@60.03hz
           GLX Renderer: GeForce 940M/PCIe/SSE2 GLX Version: 4.5.0 NVIDIA 367.44

You see I have a built-in Intel graphics chip and an Nvidia chip. The active device is my Nvidia chip.


file sharing from ubuntu 16.04LTS to Windows 7

There are many ways:
-- Install "Dropbox". It runs on both Devices.

or:

-- Plug a USB-Stick into your Router. It's accessible via

the file manager on your ubuntu Desktop by choosing "+ other locations"

Windows Explorer, open folder "Network"


Stitching a photo below a batch of photos

First you need to open a terminal and sudo apt-get install imagemagick.

Now place all your images in the same folder so you can easily access them from the terminal. Put the top images all in their own folder and keep the bottom image elsewhere to simplify things.

Type cd DIRNAME, you need to replace DIRNAME with the name of the folder the pictures are stored in, for example /home/mark/collating is what I use for this purpose.

Now that your shell is in the right folder and imagemagick is installed we use the following to stick the images together:

convert -append image1.jpg image2.jpg output.jpg

This will take the two images named image1 and image2 and stick image2 on the bottom of image1, saving the result as a file named output.jpg.

To automate this you can use a script like this one. You need to change the variables so they point to the right places.

#! /bin/bash

#   Replace the values of these variables with the locations of your tops and the bottom.
# The output directory must already exist!
#   "~/" is a shortcut for your home dir, FYI.

TopsDir="~/collating/tops" #Only the TOP images should be in this folder!
BottomImg="~/collating/bottom.png"
OutputDir="~/collating/complete"

[ -d "$TopsDir" -a -d "$OutputDir" ] && [ -f "$BottomImg" ] || { echo "One of the paths you supplied wasn't valid."; exit 1;}

cd "$TopsDir"

for TopImg in *; do
    convert -append "$TopImg" "$BottomImg" "$OutputDir/$TopImg"
done

Copy and paste it into gedit or your text editor and edit the variables so that they point to the correct folders. (Or file for the bottom img.) Save it as collator.sh. It is convenient for the next steps if you save it in your home directory.

Now open a terminal and navigate to where you saved the file. (You're already there if you saved it in your home dir, otherwise type cd /path/to/your/location) Type chmod +x collator.sh to give the file execute permissions.

And now we get the work done:Type ./collator.sh to run the script; and you're done.


so in the end this had nothing to do with drivers. it turned out to be all about lightdm and the greeter session. somehow or another the gnome-session package was either messed up or not installed. what clued me in was the debug output of /usr/sbin/lightdm -d which complained that failed to find session configuration default and failed to create greeter session.

this lead me to: http://ubuntuforums.org/showthread.php?t=2226247

which suggested:

sudo apt-get install --reinstall gnome-session ubuntu-desktop

and it worked like a charm!


Two Java JDK version is running in my machine

Install more RAM ;)
Do you mean running in sense of processes?
Open a terminal and look for the java installations: ls /usr/lib/jvm/
Have you used the package manager? Then remove it with the software-center.
Look here if you installed from oracle: [


14.04 LTS - Wifi Drops in 1500 - 1800 seconds - DHCP lease get renewed

I suggest you try the following, in a terminal:

echo "options iwlmvm power_scheme=1" | sudo tee /etc/modprobe.d/iwlmvm.conf
echo "options iwlwifi bt_coex_active=Y swcrypto=1 11n_disable=1" | sudo tee -a /etc/modprobe.d/iwlwifi.conf

Reboot and let us hear your report.

You might also try:

sudo rm /var/lib/dhcp/dhclient.leases
sudo rm /var/lib/NetworkManager/dhclient-xxxxx-wlan0.lease

Where xxxxx is a long string of numbers you can find with:

ls /var/lib/NetworkManager

Then restart NM:

sudo service network-manager restart

And check the lease time:

cat /var/log/syslog | grep -i dhc


Apt-get update getting stuck at 0% while connecting to repository

I had a wrong configyration of network. I put bad dns server


I managed to deal with it

Uninstalled the previous version
Installed X86 bit
Run it with --appimage-extract
Installed appimage daemon to fully integrate my appimage in the system (icons, launcher, desktop entry)

That's it, Not much but it works


How to set firefox as a default kde-help-browser?

You cannot use Firefox as your help browser in KDE.

From the Kubuntu-docs package:

  Though KHelpCenter is recommended, all documentation in this package
  is HTML, which means you can view it with any web browser by browsing
  to /usr/share/doc/kde/HTML/en/kubuntu/"section".

Also the KOffice-doc-html package:

  The documentation will be installed into the usual directories
  /usr/share/doc/kde4/HTML/"language"/"app"/, for instance
  /usr/share/doc/kde4/HTML/en/kword/.

In other words, you will just have to use KHelpCenter, or manually convert the files from docbook format to HTML (which I will not cover here as that is out of the scope of the question).


How can I fix my problems with fonts in Firefox?

The problem was with the Nouveau driver I was using; for whatever reason it wasn't rendering fonts correctly in FireFox. Switching to the proprietary Nvidia driver fixed it.


How to make Unity 3D work with Bumblebee using the Intel chipset

The problem was with libGL.so.1 - apparently, the Nvidia installer also removed the Intel one and replaced it with its own.

So I retrieved it from libgl1-mesa-glx and changed the symlink in /usr/lib to point to it.

I'm not going to go into the details of how to set up Bumblebee, but there are some key parts that are missing that aren't really documented:

The Nvidia driver installer is likely to destroy your existing libglx.so (in /usr/lib/xorg/modules/extensions) and libGL.so (in /usr/lib). Back those up before installing the driver. If you already lost them, you could get them back by resintalling xserver-xorg-core and libgl1-mesa-glx, but when I tried that the first time, it left my laptop in a bad state (black screen after login, had to go into recovery), so I would recommend getting those manually via dpkg-deb.
After installing the Nvidia driver, you'll notice that Nvidia replaced the two files listed above with symlinks to the Nvidia libraries. In my case, for example, libglx.so is a symlink to libglx.so.304.22.
Since Bumblebee needs both drivers, and since it can only differentiate by directory, let move drivers for each graphics adapter into a separate directory. The Nvidia installer I used installed some drivers into /usr/lib/nvidia-current, let's use that. Keep in mind that we need to separate libraries and Xorg modules. Here are where I put the relevant files:

In /usr/lib:

libGL.so.304.22   -- Nvidia's driver (unchanged where the installer put it)
libGL.so          -- symlink to libGL.so.1
libGL.so.1        -- symlink to /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1,
                     i.e. the libgl1-mesa-glx driver

In /usr/lib/x86_64-linux-gnu/mesa:

libGL.so.1   -- symlink to libGL.so.1.2
libGL.so.1.2 -- The normal driver from libgl1-mesa-glx

In /usr/lib/nvidia-current:

libGL.so   -- symlink to libGL.so.1
libGL.so.1 -- symlink to /usr/lib/libGL.so.304.22 (i.e. Nvidia's driver)

In /usr/lib/nvidia-current/xorg:

libglx.so -- symlink to /usr/lib/xorg/modules/extensions/libglx.so.304.22

In /usr/lib/xorg/modules/extensions:

libglx.so.1       -- symlink to libglx.so.xserver
libglx.so.304.22  -- Nvidia's driver (unchanged from where the installer put it)
libglx.so.xserver -- I renamed the original libglx.so to that and put it here

Finally, we need to modify /etc/bumblebee/bumbleebee.conf to tell the system where to find the Nvidia drivers. I'm using the nvidia driver (as opposed to nouveau), so in the nvidia section, I'm using this:

KernelDriver=nvidia
Module=nvidia
PMMethod=auto
# colon-separated path to the nvidia libraries
LibraryPath=/usr/lib/nvidia-current:/usr/lib32/nvidia-current
# comma-separated path of the directory containing nvidia_drv.so and the
# default Xorg modules path
XorgModulePath=/usr/lib/nvidia-current/xorg,/usr/lib/xorg/modules

Note how the LibraryPath and XorgModulePath points to the Nvidia drivers, so if Bumblebee is looking for them, it'll find them. If Unity is looking for them, it'll look in /usr/lib and and /usr/lib/xorg/modules/extensions, and we made sure that those symlink to the non-Nvidia ones.

This is possibly a bit clumsy in places, but what can I say? It works perfectly:

Unity 3D works will full desktop effects, and they're lightning fast but still using the energy-saving slow Intel chipset. Normal 3D acceleration is available to apps like VirtualBox. optirun works, and I have the choice of running "glxspheres" (at ~60 fps) or "optirun glxspheres" (at ~120 fps).


How can I delete the tmp folder in ubuntu

To delete this folder, you have to do sudo rm -rf /tmp/<your folder>


How do I create a program similar to 'fortune', that can be installed using apt-get install

You need to learn how to package your program (no matter whether it's a script or binary executable) in the .deb format.

Then you can sign up to Launchpad and create a PPA (personal package archive) where you can upload the package.

Users may then add your PPA to their software sources (sudo add-apt-repository ppa:USERNAME/PPANAME && sudo apt-get update) and install it (sudo apt-get install abcd) afterwards.

To allow direct installation without having to add a PPA first, your package would have to be added to Canonical's official Ubuntu repositories, but that this is a rather long process which is probably not worth the effort in your case.

Useful links:

Packaging:

https://wiki.ubuntu.com/Packaging
http://packaging.ubuntu.com/
create a .deb Package from scripts or binaries

Creating a PPA:

https://help.launchpad.net/Packaging/PPA
How do I create a PPA?

Official repositories:

How to get my software into Ubuntu?


Remove Files file-manager without losing my Personal Folder

You won't and you do not need to remove it to use another file manager.

Do not know if you can remove it from your system without breaking anything, maybe a better option is to just install another file-manager of your choice and use it instead?

Install another that you might want to use, ie: dolphin, and replace it as your default file handler using dconf-editor.

Another good and easy option for that is to edit /usr/local/bin/nautilus and replace the lines

#!/bin/bash
/usr/bin/Nautilus $@

with

#!/bin/bash
/usr/bin/foo_filemanager $@

this way every time a process calls for Nautilus it will call your new file-manager instead.


To paste a single string into a textfield

install both xdotool and xclip:

sudo apt-get install xdotool xclip

Add the following command to a shortcut key:

/bin/bash -c "sleep 0.5 && printf 'youremail@server.com' | xclip -selection clipboard && xdotool key Control_L+v"

Choose: System Settings > "Keyboard" > "Shortcuts" > "Custom Shortcuts". Click the "+" and add the command above to a key combination of your choice.

Now when enter the cursor in a textfield and choose your shortcut, it will type your email address.


Having trouble finding graphics driver - Ubuntu 18.04

Disable Secure Boot in BIOS and run

sudo apt install nvidia-driver-390

Then reboot.

You can also use a GUI tool "Software & Updates" -> Additional Drivers.


Finally understood what the problem was!
Somewhy, Ubuntu has 2 different input options, Headset and Headphones. I guess because of the microfone, I have to choose headset.
(Sorry for the quality of the picture, I coudn't take a print screen with options opened)


Can't open or ping my ISP's authentication page only from my linux machine

It was a problem with DHCP
Added the following code to /etc/network/interfaces and it started to work after some time.

iface eth1 inet dhcp

Basically no ip address(ipv4. ipv6 was present as its just a modification of the mac address and not assigned by the ISP) was getting assigned to me and the above addition fixed the problem.