Way to measure computer usage via screensaver active/not active time? I'm looking for a simple way to determine the rough amount of time per day I spend on a computer. This can be a difficult task if you try to monitor processes, key presses, mouse clicks and the like, because one can be doing anything from thinking about a coding problem, reading a web article, talking on the phone, or gone off walking the dog. The computer cannot read my mind. Since I leave computers on 24/7 monitoring log-ins won't work.

I hit on the idea of logging how much time the computer spends in screensaver mode. My error would then be no greater than the product of the idle-time-to-screensaver with the number of times it goes into screensaver mode. Subtracting this from 24 hours would give me an estimate which would be reasonable for my purposes.

The problem is: I don't know how to log when the screensaver turns on and off. I am running Ubuntu 10.10 at the moment on most machines, about to start upgrading to 11.04 on some of them.

Any ideas?

[edit] After more googling I hit upon the dbus-monitor which looked like it might work, but is missing an important ingredient. Here's the script I am running which launches the monitor as a daemon:

#!/bin/bash
RUNNING=`ps -A | grep "dbus-monitor"`
if [ ! $RUNNING  ]; then
    echo "(Re)starting dbus-monitor daemon"
    nohup dbus-monitor "--profile" "type='signal',interface='org.gnome.ScreenSaver'" >> ${HOME}/sc.log &
fi

Here is the output it produces after locking and unlocking the screen a couple times:

sig     1304860712      153829  2       /org/freedesktop/DBus   org.freedesktop.DBus    NameAcquired
sig     1304860717      318732  462     /org/gnome/ScreenSaver  org.gnome.ScreenSaver   ActiveChanged
sig     1304860725      547928  463     /org/gnome/ScreenSaver  org.gnome.ScreenSaver   ActiveChanged
sig     1304861018      17      464     /org/gnome/ScreenSaver  org.gnome.ScreenSaver   ActiveChanged
sig     1304862919      403523  466     /org/gnome/ScreenSaver  org.gnome.ScreenSaver   ActiveChanged

The second column is obviously unix UTC in seconds. The missing ingredient is it doesn't identify whether the screensaver is on or off! I suppose I could assume they toggle from the time NameAcquired happens, but it makes me queasy that there might be a missing or extra event I can't anticipate which would throw everything out of sync.

Much obliged for ideas.

jkcunningham

I would like to thanks and contribute back a simple, raw script (can be improved), put it on startup applications with:

xterm -e logSessionLock.sh

it is system crash/blackout prepared too.
It is not heavly tested... but is working great til now.
it will create 2 files, one at $HOME (the log) another at /tmp (the sys crash workaround)

logSessionLock.sh

#!/bin/bash

logFile="."`basename $0`".log"

function FUNClog {
  strTime=`gnome-screensaver-command --time`
  strDate=`date +"%Y%m%d-%H%M%S"`
  strLog="$strDate ($1) $strTime"
}

function FUNCwriteLog {
  echo $strLog >>$HOME/$logFile
  echo $strLog
}

active=false
firstTime=true

# restores last log entry in case of a system crash
strLog=`cat "/tmp/$logFile.tmp"`
FUNCwriteLog
echo "" >"/tmp/$logFile.tmp"
if [[ -n "$strLog" ]]; then #if has something, it was active when the system crashed
  active=true
fi

while true; do
  if gnome-screensaver-command --query |grep -q "The screensaver is active"; then
    if ! $active; then
      # restore the saved tmp log
      strLog=`cat "/tmp/$logFile.tmp"`
      FUNCwriteLog

      # update log (can be off when this line is reached? once it seem to happen...)
      FUNClog BEGIN
      FUNCwriteLog #logs the begin time

      active=true
    else
      FUNClog ON #stores the ammount of time the screensaver has been ON
      echo $strLog >"/tmp/$logFile.tmp"
    fi
  else
    if $active; then
      FUNCwriteLog #saves the ammount of time the screensaver has been ON

      FUNClog OFF
      FUNCwriteLog
      echo "" >"/tmp/$logFile.tmp"

      active=false
    fi
  fi

  sleep 1
done

the log is like this:

 20120214-191528 (BEGIN) The screensaver has been active for 0 seconds.
 20120214-193602 (ON) The screensaver has been active for 1234 seconds.
 20120214-193603 (OFF) The screensaver is not currently active.

I use uptime command, but it does not give the system's active/inactive time.
uptime gives a one line display of the following information.  The current time, how long the system has been running,  how  many  users  are currently  logged  on,  and the system load averages for the past 1, 5, and 15 minutes.


Should I symlink my /var/www directory to my home? I have just installed Ubuntu Server 10.04 with a LAMP setup.  I want to host a website there but I'm not sure which is the best way to get/edit my files on the server.  Googling provides many options but I'm not sure which is best?

Unless there's a better option, I'd like to be create the pages on another PC (Windows or Linux) and use SFTP to sync the changes to the server - but do I do this to a symlinked folder in ~/ or by changing rights on the /var/www/ folder?

Every setup is different. For me I have a lot of users on a server that each hosts websites, for you, you likely won't need to create more than just one user on the system. However, if you manage multiple websites on this server this setup will help you to manage, configure, and debug each domain in a fashion easier than a standard LAMP setup. In order for that to happen I utilize several devices by Apache to get around permission errors.

First, this is the document structure I use:

/home/[USER]/domains/[DOMAIN]/html
/home/[USER]/domains/[DOMAIN]/logs

Each user has their own account with a domains folder (which I added to /etc/skel so it gets created every time. Each domain has it's own folder in the domains folder with an html folder (I have my reasons for this, primarily so domains can have web files outside of the public realm). Feel free to modify this structure as you see fit, just remember to carry those changes throughout this post.

Secondly, I host a lot of PHP sites so I use suPHP in my configuration. By default the standard archive package doesn't have the proper compile flag enabled resulting in a less secure version of suPHP. I've made my own suPHP package which I use on my servers, installation instructions below. suPHP allows you to define what user PHP scripts should be executed as (among other things including: custom php.ini for each site, etc). I also enable suExec for Apache - further removing the need to have any ownership to www-data user (a user which I despise).

First ensure you have Apache, and all other services installed on your server. Make sure they are at least working. After that I recommend installing suphp-common and the required libapache2-mod-suphp module (More information: What are PPAs and how do I use them?). Then, after those install, activate suPHP and suexec using a2enmod

sudo a2enmod suphp
sudo a2enmod suexec
sudo a2dismod php5

sudo /etc/init.d/apache restart

Next will come the configuration file. I've made various tools that automatically generate the configuration files everytime I add a new site; however, here is the basic template I use:

<VirtualHost *:80>
    ServerAdmin [EMAIL]
    ServerName [DOMAIN]
    ServerAlias www.[DOMAIN] [DOMAIN]
    DocumentRoot /home/[USER]/domains/[DOMAIN]/html

    <Directory /home/[USER]/domains/[DOMAIN]>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride all
    </Directory>

    ErrorLog /home/[USER]/domains/[DOMAIN]/logs/error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog /home/[USER]/domains/[DOMAIN]/logs/access.log combined

    SuexecUserGroup [USER] [USER]

    suPHP_UserGroup [USER] [USER]
    suPHP_ConfigPath /home/[USER]/etc
</VirtualHost>

This sets up logging for that domain, the document root, and all other basic necessities for the domain to operate. I place these files in /etc/apache2/sites-available/ typically named [USER]-[DOMAIN] and enable/disable them with a2ensite like so:

sudo a2ensite [USER]-[DOMAIN]
sudo a2dissite [USER]-[DOMAIN]

After each modification to configuration files Apache will need to be reloaded with

sudo /etc/init.d/apache reload

While it may seem like a lot to setup the amount of flexibility gained, in my opinion, far outweighs the setup time. Though you only need a single user webserver, in the future if you ever wanted anything other than a single user webserver, you would need to perform further actions (or just drop security all together) in order to do so.

Are you after something like this

rsync -az --rsh "ssh" --rsync-path "sudo rsync" ~/website ubuntu@REMOTE-IP:/var/www


Chromebook C7 - installation I just downloaded the Ubuntu file to my chromebook and its not letting me open the file to actually download it. When I click on it to open the file it tells me to go to the chromestore to find an app that can open this type of file because the file is not supported. I just got my chromebook today so I dont think its a computer issue. I don't understand why it's not letting me open the file. I downloaded it directly off of the ubuntu website and downloaded what ubuntu had recommended me to download.

You can't install the Ubuntu image from the Canonical website on any Chromebook. Chromebooks have a different booting mechanism than most laptops, so you need a special install process to install Ubuntu on some of these laptops.

You can follow these instructions that are specific to the C7 Chromebook you mention: http://liliputing.com/2012/11/how-to-install-ubuntu-12-04-on-the-199-acer-c7-chromebook.html

Note that this is Ubuntu 12.04, but I believe that is the latest supported release (as I post this anyway.)

Hopefully this will help you find the answer to your question as well.
http://www.andrewq.netau.net/tutorials/how-to-set-up-ubuntu-on-chromebook/


How do I determine the total size of a directory (folder) from the command line? Is there a simple command to display the total aggregate size (disk usage) of all files in a directory (folder)?

I have tried these, and they don't do what I want:

ls -l, which only displays the size of the individual files in a directory, nor
df -h, which only displays the free and used space on my disks.

The command du "summarizes disk usage of each FILE, recursively for directories," e.g.,

du -hs /path/to/directory

-h is to get the numbers "human readable", e.g. get 140M instead of 143260 (size in KBytes)
-s is for summary (otherwise you'll get not only the size of the folder but also for everything in the folder separately)

As you're using -h you can sort the human readable values using

du -h | sort -h

The -h flag on sort will consider "Human Readable" size values.

If want to avoid recursively listing all files and directories, you can supply the --max-depth parameter to limit how many items are displayed. Most commonly, --max-depth=1

du -h --max-depth=1 /path/to/directory

The best one I think is the following:

du -h directory_name | tail -n1

This will show you only the size of the directory that you are interested in and will not print sizes of any directories and files inside that directory.

I should add that if the size of the folder is large then du takes longer time. You must be patient for this command to work. Just like any other unix command, you may find out the total time for this process by using time before this command:

time du -h directory_name | tail -n1


Only seeing the current computer listed in the Sync Between Computers section in Software Center I have enabled Sync Between Computers using the same Ubuntu account on three different computers.

When I open Sync Between Computers in Software Center I only see the current computer. I used to be able to see the two other machines and could access a list of the packages I had installed on the other systems. I have the same problem on all three computers.

How can I resolve this problem?

Software Center issues tend to need a reinstall to be resolved. The best thing to do would be to deal with it until the 17th, when Ubuntu 13.10 comes out. Then, you will want to reinstall anyway. That should fix your problem.


"Authentication required to refresh system repositories" in Ubuntu 19.10 If one of the users in our group tries to login to his desktop computer, he gets a popup "Authentication required to refresh system repositories". When I type in my administrator password in this popup, the popup does not disappear. It seems that only a hard reboot solves the problem temporarily, because after a few days the same popup appears again. When I login as a user with sudo privileges, though, everything works fine. The operating system is Ubuntu 19.10.

The user has no scripts running on startup, other than loading his bashrc and setting his environment variables.

I already searched the internet, but I have been unable to find a solution (I have done the most recent upgrades). I would really appreciate your help.

This happens when using xRDP (remote sessions or Hyper-V enhanced sessions) into Ubuntu. The remote sessions are more restrictive than local sessions for the same user, and this fixes it.

For Ubuntu 19.10, do this in a terminal

sudo bash
cd /etc/polkit-1/localauthority/50-local.d
nano 46-allow-update-repo.pkla

and then put this inside the file

[Allow Package Management all Users]
Identity=unix-user:*
Action=org.freedesktop.packagekit.system-sources-refresh
ResultAny=yes
ResultInactive=yes
ResultActive=yes

I created a user account for a friend to try Ubuntu with no password and forced a password change upon login.  I switched to the user account and then canceled since they were unavailable and this problem occurred.  I think this issue might be due to the user password.


How do I delete kernels from a server? I need to delete older kernels from a server to make room for updating to a new one. I can't really use GUI-based methods like synaptic, and apt-get remove --purge didn't work.

What to do?

Create a shell script with this content:

#!/bin/sh
dpkg -l linux-*  | \
awk '/^ii/{ print $2}' | \
grep -v -e `uname -r | cut -f1,2 -d"-"` | \
grep  -e '[0-9]' | xargs sudo apt-get -y purge

This script will remove old kernels, headers and sources.

Download and install either of these from software center:

Janitor
Ubuntu Tweak(it has the janitor built in it)

Open Janitor(direct janitor or tweak), you will find "Old Kernel Packages" under "System". Tick mark on it and click 'Clean'

Enter the password and the old ones will be removed


When I play a video full screen after about ten minutes the screen goes black, and the sound repeats a loop I'm running Ubuntu 12.04. I had to reinstall the OS on this computer. I didn't have this problem before. This happens in VLC, and youtube. If I'll play a video in full screen, the screen will go black after about ten minutes, and the sound will kind of repeat over, and over where it went black. The only way to fix it is to restart the computer. I can't even get my screen to go back on after that happens.

Now it's not only when it's full screen. When I watch youtube videos at their regular size my screen will go black after a while, and I have to restart it.

Have you guys checked the power settings on your systems? I believe the default is to put the display to "sleep mode" after 10 minutes, and then the setting are defaulted to lock the system when the screen does go to sleep.
Go to your system settings and check those, if they are set to put the screen to sleep, change the setting to a longer time, usually 2 hours is sufficient, and uncheck the box that says "Lock screen when going to sleep" hopefully that will solve your problem.


How can set disk IO priority automatically? If I use some IO intensive application (like Virtualbox, Steam data verification or even dd) my system becomes almost unresponsive. Despite  all being started with normal priority, they make the desktop very sluggish and delay a lot the startup of other applications.

I know I can use something like ionice to change the priority to idle for instance, but in the case of Virtualbox which spawns many processes it becomes difficult.

Can I give some type of hints to the system, so when launching some specific applications they are started with the least IO priority?

Note: This solution only works with the cfq scheduler, as explained here. You should check which one is used by issuing

cat /sys/block/sda/queue/scheduler

and change it if necessary.

If I understood correctly, you want some ionice setting to be applied every time you start a command. You can do it this way:

echo 'ionice -c 3 /usr/bin/VirtualBox "$@"' > VirtualBox
chmod a+x VirtualBox
sudo mv VirtualBox /usr/local/bin/

First command creates a file VirtualBox with the single-quoted text as its content. This should have the full path to the program, because if one only specify VirtualBox it can interpret it as the file we just created and create a "loop".

Second command makes it executable, and third moves this new file in a folder which is in front of the "system" bin folder /usr/bin, so our new file gets executed instead of the original. The "$@" part contains all the arguments the command was invoked with, so they get forwarded to the real VirtualBox command.

According to answer ("yes") to this Super User question Do children processes inherit ionice priorities from their parents? How do you check the IO priority of a running process?, it should be enough to ionice the parent process, like this:

ionice -c 3 VirtualBox

From ionice man page, following I/O scheduling class values are available:

0 for none
1 for realtime
2 for best-effort
3 for idle (used in example above)

A number or class name can be used.

Also, -n level option is applicable for realtime and best-effort classes, with 0-7 as valid data (priority levels).

You can use the 'renice' command to prioritise processes:

renice -<priority> <application's pid>

It could also be your drive is spinning down too much, so when you want to start application like Virtualbox it has to spin up before you can start working around (this can take a while).


Which method should I choose to install GNOME? Note : My question itself answers how to install GNOME

I want to install Gnome desktop in my 64-bit Ubuntu 14.04 I just googled and I found two ways to install GNOME. I also read other answers on Ask Ubuntu and googled but can't find what is difference between this both!

1st method to install is :

sudo apt-get install gnome-shell
sudo apt-get install ubuntu-gnome-desktop

2nd method

sudo add-apt-repository ppa:gnome3-team/gnome3-staging
sudo add-apt-repository ppa:gnome3-team/gnome3
sudo apt-get update
sudo apt-get dist-upgrade

If I try installing using first way, it shows following errors:

The following packages have unmet dependencies:
gnome-shell : Depends: gnome-settings-daemon (>= 3.4.0) but it is not
                       going to be installed
              Recommends: gnome-control-center but it is not going to be installed
ubuntu-gnome-desktop : Depends: gdm but it is not going to be installed
                       Depends: gnome-control-center but it is not going to be installed
                       Depends: gnome-session but it is not going to be installed
                       Depends: gnome-settings-daemon but it is not going to be installed
                       Depends: gnome-shell-extensions but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

And If I try installing 2nd way, after entering sudo apt-get dist-upgrade command it tells me that 299Mb space will be used and I just aborted it pressing n.

What is right way to install Gnome desktop in Ubuntu 14.04.

And one more thing, as there are two methods available to install Gnome, which is best? Up to I know using 1st method I can switch to Gnome desktop by logging out from Unity and choosing GNOME.

What would happen if I install Gnome using 2nd method? Will it remove Unity from my computer or I will be able to use both Unity by logging out?

There is a better and simple way available to install gnome-desktop using tasksel.
Tasksel is a debian tool to install multiple related packages as a coordinated task. You will get many such tasks like lamp-server etc which can be installed in just one click.

Here's how to do that for gnome-desktop:

sudo apt-get install tasksel
sudo apt-get update

(Updating cache is necessary because you may get an error like this if you don't:
    tasksel: aptitude failed (100)

Then

sudo tasksel

Select the Task Ubuntu GNOME desktop using spacebar and click OK.

Ubuntu GNOME desktop will get installed.

One more thing: you may get the error tasksel: aptitude failed (100) again(it is a bug in tasksel for a long time) so just restart the system.

You will get the desktop environment selection menu on login panel:

GNOME Default
GNOME Classic
Ubuntu

Select the one you want, Enjoy.

hope this helps :)

You're not going to have very much luck trying to do this. Ubuntu doesn't like any other window manager than the one it ships with. If you insist, however, you can do

sudo apt-get install gnome

and it'll get you most of the way there. Be prepared to deal with broken themes and unstable behavior, however.

I prefer Debian because a solid gnome desktop works right out of the box, but I have to use Ubuntu for work. I can't stand unity, so about the only thing I've been able to make work satisfactorily is a nuts-and-bolts configuration of Openbox, tint2, and Compton (for compositing).


Global menu not working in 13.10 After upgrading to 13.10 the global menu doesn't show for some applications like Terminal and Chrome.

Is this a bug or is it normal?

Thanks in advance.

I had the same problem I was able to fix by installing unity-gtk-module-common unity-gtk3-module

sudo apt-get install unity-gtk-module-common unity-gtk3-module

Just to quote what I've already said on launchpad

  On side note why this has happened to me is cause of this bug during the upgrade:

  https://bugs.launchpad.net/ubuntu/+source/tex-common/+bug/1241563

  Which broke my upgrade progress, I was only able to continue it with sudo apt-get install -f which most likefly failed to install new packages as it didn't know about them

ansidev, are you even aware of the what the global menu is, or even what gnome is as of now? To answer the question, it is perfectly normal for Google Chrome to not have global menu integration. It's plain and simple- not supported. Firefox has global menu integration, BTW! As for the terminal, are you using the default gnome terminal or something else? Global menu integration depends from application to application. So rest assured, it's not a bug.


Ubuntu 14.04 no sound I can hear no sound from my laptop. I installed Ubuntu 14.04 2 days ago and at first everything worked fine, but after a reboot the sound stopped. I searched for 3 hours on google and tried everything I found, but nothing helped.

EDIT: I already tried the solution from the posted thread and it didn't help.

EDIT2: The sound does work on headphones. But it doesn't work on speakers. It's not a hardware problem.

AlsaInfo: http://www.alsa-project.org/db/?f=5b7f589a8cd035feb28d0a87bd1c79a304c5ad29

Try first to reload ALSA:

sudo alsa force-reload

If that won't help, try to reinstall ALSA and pulseaudio:

sudo apt-get remove --purge alsa-base pulseaudio
sudo apt-get install alsa-base pulseaudio

I had no sound on headphones jack, but when I tried above to remove alsa and re-install I lost the sound completely instead!

Reinstalling the operating system it will sort the problem out for sure but I think it has to do with the installation of Skype from ubuntu repositories. I have done a fresh install and after installing skype, as it requires 32bit libraries and pulsaudio32, the wasn't any sound coming out from the headphone jack again.

I would suggest to install skype from skype.com website instead. This sorted my problem out.


How can a script check if it's being run as root? I'm writing a simple bash script, but I need it to check whether it's being run as root or not. I know there's probably a very simple way to do that, but I have no idea how.

Just to be clear:
What's a simple way to write a script foo.sh, so that the command ./foo.sh outputs 0, and the command sudo ./foo.sh outputs 1?

#!/bin/bash
if [[ $EUID -ne 0 ]]; then
   echo "This script must be run as root"
   exit 1
fi

This code works under both Bash and stock Bourne sh (tested under FreeBSD) that does not define EUID. If EUID exists its value is returned, else the 'id' command is run. It is a tad shorter than the "or" example above, as it uses a shell built-in ":-".

Root in sh:

# echo $EUID

# euid=${EUID:-`id -u`}
# echo $euid
0

In bash:
[chaapala@tenfwd2 ese]$ euid=${EUID:-`id -u`}
[chaapala@tenfwd2 ese]$ echo $euid
10260


How to redirect stderr to a file While using nohup to put a command to run in background some of content appear in terminal.

cp: error reading ‘/mnt/tt/file.txt’: Input/output error
cp: failed to extend ‘/mnt/tt/file.txt’: Input/output error

I want to save that content to a file.

There are two main output streams in Linux (and other OSs), standard output (stdout) and standard error (stderr). Error messages, like the ones you show, are printed to standard error. The classic redirection operator (command > file) only redirects standard output, so standard error is still shown on the terminal. To redirect stderr as well, you have a few choices:

Redirect stdout to one file and stderr to another file:

command > out 2>error

Redirect stdout to a file (>out), and then redirect stderr to stdout (2>&1):

command >out 2>&1

Redirect both to a file (this isn't supported by all shells, bash and zsh support it, for example, but sh and ksh do not):

command &> out

For more information on the various control and redirection operators, see here.

First thing to note is that there's couple of ways depending on your purpose and shell, therefore this requires slight understanding of multiple aspects. Additionally, certain commands such as time and strace write output to stderr by default, and may or may not provide a method of redirection specific to that command

Basic theory behind redirection is that a process spawned by shell (assuming it is an external command and not shell built-in) is created via fork() and execve() syscalls, and before that happens another syscall dup2() performs necessary redirects before execve() happens. In that sense, redirections are inherited from the parent shell.  The m&>n and m>n.txt inform the shell on how to perform open() and dup2() syscall (see also How input redirection works, What is the difference between redirection and pipe, and What does & exactly mean in output redirection )

Shell redirections

Most typical, is via 2> in Bourne-like shells, such as dash (which is symlinked to /bin/sh) and bash; first is the default and POSIX-compliant shell and the other is what most users use for interactive session. They differ in syntax and features, but luckily for us error stream redirection works the same (except the &> non standard one). In case of csh and its derivatives, the stderr redirection doesn't quite work there.

Let's come back to 2> part. Two key things to notice: > means redirection operator, where we open a file and 2 integer stands for stderr file descriptor; in fact this is exactly how POSIX standard for shell language defines redirection in section 2.7:

[n]redir-op word

For simple > redirection, the 1 integer is implied for stdout, i.e. echo Hello World > /dev/null is just the same as echo Hello World 1>/dev/null. Note, that the integer or redirection operator cannot be quoted, otherwise shell doesn't recognize them as such, and instead treats as literal string of text. As for spacing, it's important that integer is right next to redirection operator, but file can either be next to redirection operator or not, i.e. command 2>/dev/null and command 2> /dev/null will work just fine.

The somewhat simplified syntax for typical command in shell would be

 command [arg1] [arg2]  2> /dev/null

The  trick here is that redirection can appear anywhere. That is  both 2> command [arg1] and command 2> [arg1] are valid. Note that for bash shell, there  there exists &> way to redirect both stdout and stderr streams at the same time, but again - it's bash specific and if you're striving for portability of scripts, it may not work. See also Ubuntu Wiki and What is the difference between &> and 2>&1.

Note: The > redirection operator truncates a file and overwrites it, if the file exists. The 2>> may be used for appending stderr to file.

If you may notice, > is meant for one single command. For scripts, we can redirect stderr stream of the whole script from outside as in myscript.sh 2> /dev/null or we can make use of exec built-in. The exec built-in has the power to rewire the stream for the whole shell session, so to speak, whether interactively or via script. Something like

#!/bin/sh
exec 2> ./my_log_file.txt
stat /etc/non_existing_file

In this example, the log file should show stat: cannot stat '/etc/non_existing_file': No such file or directory.

Yet another way is via functions. As kopciuszek noted in his answer, we can write function declaration with already attached redirection, that is

some_function(){
    command1
    command2
} 2> my_log_file.txt

Commands writing to stderr exclusively

Commands such as time and strace write their output to stderr by default. In case of time command, the only viable alternative is to redirect output of whole command , that is

time echo foo 2>&1 > file.txt

alternatively, synchronous list or subshell could be redirected if you want to separate the output ( as shown in related post ):

{ time sleep 1 2> sleep.stderr ; } 2> time.txt

Other commands, such as strace or dialog provide means to redirect stderr. strace has -o <filename.txt> option which allows specifying filename where output should be written. There is also an option for writing a textfile for each subprocess that strace sees. The dialog command writes the text user interface to stdout but output to stderr, so in order to save its output to variable ( because var=$(...) and pipelines only receives stderr ) we need to swap the file descriptors

result=$(dialog --inputbox test 0 0 2>&1 1>/dev/tty);

but additionally, there is --output-fd flag, which we also can utilize. There's also the method of named pipes. I recommend reading the linked post about the dialog command for thorough description of what's happening.


Ubuntu 12.04 Install Problems.. Installation Type screen. No options Possible Duplicate:
  Only ‘sdb’ shows up when installing 12.04 on a new Dell inspiron 14z

I am new to Linux and trying to install Ubuntu 12.04 on a new HP Pavilion DV6TQE Ivy Bridge and being presented with the below screen which I believe is incorrect. My disk is set up as a basic disk (not dynamic) and I tried with a single C:\ partition and by creating a second partition in windows with no luck. Any ideas?

UPDATE: I think I know what the problem is but I don't know how to fix it yet.. My hard drive has a 32gb mSSD cache which is listed as dev/sdb. for some reason this is causing the installation trouble.

This can be a symptom of computers with Intel Smart Response Technology / Intel Rapid Storage Technology. Basically, Intel does fancy stuff (including the solid-state-drive cache) to make the disk drive faster and more reliable. It's related to RAID ... the same file may be stored in multiple places etc.

Intel has posted a PDF saying that DMRAID (the usual linux program to deal with RAID) is old and neglected, and incapable of understanding Intel's newest flavor of RAID. The other linux RAID program is mdadm (aka "MDRAID"), and supposedly works perfectly with ISRT / IRST and is supported by Intel.

Therefore, it seems to me that the most logical solution is the one suggested by oldfred here: Open ubuntu in liveCD or live-usb mode, open a terminal and type

sudo apt-get install mdadm

After that finishes (strangely, it might install an email service in the process), immediately run the livecd's installer. With any luck it will work perfectly.

When I encountered this same problem on my Dell Inspiron 14z, this procedure fixed the problem. [One other thing was, before I did the procedure above, I turned off acceleration in the Intel Rapid Storage Technology program within Windows 7.

I don't think that step was necessary though.]

I am not trying to dual boot but here is the answer I found. From terminal issue this command:

    sudo apt-get remove dmraid

Now re-attempt the installation. This then allowed the partition table to display properly. Found the answer here: "No root file system is defined" error during installation


Can't install Guitar Pro 6 on 64-bit Ubuntu on laptop, but I could on desktop I have Ubuntu 12.04 LTS 64-bit on both my laptop and my desktop.

I managed to install Guitar Pro 6 on my desktop by using 32-bit dependencies, following the instructions here to install:

I followed the exact same methods on my laptop, but Guitar Pro 6 won't run.
I have tried the official demo from the website, which didn't work either.

When downgrading my libraries to 32-bit for Guitar Pro 6 install, at some point in the terminal it had an issue with LibGL, saying it was installed by the video driver.

I suspect this may be the cause of the problem, since after Googling for hours, the only issues were with libportaudio, which I downgraded successfully.

So, is there a way to downgrade LibGL to 32-bit, since it is installed with the video driver? Would this stop my display working, or is it impossible?

--

I also tried installing the Windows version under Wine and PlayOnLinux, neither of which worked. Guitar Pro 6 installs successfully, but then nothing happens when I try to run it.

If I am wrong about LibGL, does anyone know a way I could get Guitar Pro 6 working? I desperately need it to work, and don't want to downgrade to 32-bit.

UPDATE: I ran /opt/GuitarPro6 !$ ldd ./GuitarPro and it reported that libGL.so.1 was 'not found'
I found the file(s) in the nvidia-current directory, and placed them in /usr/lib/i386-linux-gnu/mesa/
The issue now is, how can I tell Guitar Pro 6 where to find them?

You just need to install the libglu1-mesa:i386 package. You cannot downgrade the GL library only as used by the system to 32-bit, but you can have both 32-bit and 64-bit versions installed on a 64-bit Ubuntu PC.

I would suggest you to install tuxguitar instead It can read Guitar Pro tabs.

sudo apt-get install tuxguitar


Working with two internet connections That's my server network setup:

/etc/network/interfaces

auto ethLAN
iface ethLAN inet static
address 192.168.10.3
netmask 255.255.255.0
network 192.168.10.0
broadcast 192.168.10.255

auto ethOI
iface ethOI inet static
address 10.1.1.3
netmask 255.255.255.0
network 10.1.1.0
broadcast 10.1.1.255
gateway 10.1.1.1
dns-nameservers 192.168.10.1 8.8.8.8 8.8.4.4
dns-search hsi.local

auto ethGTC
iface ethGTC inet static
address x.y.z.82
netmask 255.255.255.192
network x.y.z.64
broadcast x.y.z.127
gateway x.y.z.65

And that's my route table:

0.0.0.0         10.1.1.1        0.0.0.0         UG    0      0        0 ethOI
10.1.1.0        0.0.0.0         255.255.255.0   U     0      0        0 ethOI
10.8.0.0        10.8.0.2        255.255.255.0   UG    0      0        0 tun0
10.8.0.2        0.0.0.0         255.255.255.255 UH    0      0        0 tun0
192.168.10.0    0.0.0.0         255.255.255.0   U     0      0        0 ethLAN
x.y.z.64        0.0.0.0         255.255.255.192 U     0      0        0 ethGTC

The ethOI provides internet connection to lan clients and the ethGTC is used to external VPN, WEB and another services.

I'm using iptables to masquerade and firewall (snapshot here).

iptables -A INPUT -i lo -j ACCEPT
iptables -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
iptables -t nat -A POSTROUTING -o ethOI -j MASQUERADE
iptables -A INPUT -i ethLAN -j ACCEPT
iptables -A INPUT -i ethGTC -p tcp --dport 80 -j ACCEPT
... other rules

With this setup the lan clients could access the internet with the ethOI interface, but the services doesn't work.

However, if I change the default route to ethGTC all works fine except clients are routed by this interface and not ethOI.

How to configure this scenario?

The solution for this problem is to add a custom route like:

up ip route add 10.1.1.0/24 dev ethOI src 10.1.1.3 table adsl1
up ip route add default via 10.1.1.1 table adsl1
up ip route add x.y.z.64/26 dev ethGTC src x.y.z.82 table adsl2
up ip route add default via x.y.z.65 table adsl2
up ip route add 10.1.1.0/24 dev ethOI src 10.1.1.3
up ip route add x.y.z.64/26 dev ethGTC src x.y.z.82
up ip rule add from 10.1.1.3 table adsl1
up ip rule add from x.y.z.82 table adsl2

Please try:
  For all machines in the net of "GTC" excluding x.y.z.82, adding routing entry as:
       route add -net 192.168.10.0/24 gw x.y.z.82


How to log out with a command in a gnome-less environment? I installed various window managers (Awesome, dwm, etc.) from which I am not able to log out back to the login screen (gnome-session) in order to switch to another window manager. I need to reboot to do that, which is a waste of time (and can lead to data corruption).

Question How can you log out via the terminal? didn't work..

dbus-send --session --type=method_call --print-reply --dest=org.gnome.SessionManager /org/gnome/SessionManager org.gnome.SessionManager.Logout uint32:1

..neither did this:

gnome-session-save --force-logout

..nor that:

gnome-session-quit --force-logout

they all returned:

Failed to call logout: The name org.gnome.SessionManager was not provided by any .service files

Is there a quick way to log out back into Gnome's session manager from a non-Gnome desktop manager using a terminal emulator? I know that CTRL+ALT+BACKSPACE can be configured to restart X, but I'm looking for the easiest way to log out.

You could restart the desktop manager, which is similar to restarting X.

On Ubuntu 11.10:

sudo service lightdm restart

On earlier versions:

sudo service gdm restart

If that fails or you are on a very old system, try:

sudo /etc/init.d/gdm restart

One of these should take you back to the login screen.  Be aware that you will not be prompted, so save any work before running this command!


How to run a php file after installing LAMP in ubuntu 11.10? I installed lamp on ubuntu. Apache2 and Mysql are working fine.

The folder apache2 is in /etc and contains:

apache2.conf  envvars     magic           mods-enabled  sites-available
conf.d        httpd.conf  mods-available  ports.conf    sites-enabled

The httpd.conf file is empty.
As far as windows is concerned apache had a "www" folder where we used to store our php files. What should I do in this case ?
The tutorials given on the internet could not help! :|
Please help!

The equivalent folder in Ubuntu should be /var/www, unless you changed it yourself. This directory is (by default) defined in /etc/apache2/sites-enabled/000-default, in the line that begins with the word DocumentRoot.

If you are running  your file just for the localhost then change the chmod to 777 for /var/www/html
save every php file in html folder which is found in the path mentioned above. The new apache loads the file from the server only if it is present in the HtMl folder.
i hope it will work.
(Though 777 chmod is not recommended  of course because of the security issues)


How can I restore my Unity themes to their defaults? When I installed KDE on Ubuntu 14.10, it messed up some of the Unity settings like the text size and theme colors. I finally managed to completely remove it from my computer, and the text is back to normal, but my theme colors are still off.

Only the Ambiance theme is different, specifically, the menu bar drop-down text is a dark grey. I've tried a few different methods of fixing it, none of which worked. I created another user account to diagnose the problem and the Ambiance theme is normal in the other account. How can I get the Ambiance theme back to it's default? (I've tried reinstalling light-themes.)

Similar to this question, except the solution doesn't work for me.

This is how it looks in the admin account:

This is how it looks in the new account and how it should look:

EDIT: I later installed Wallch and it messed up the icons to always be the gnome icons, regardless of what theme or icons I chose with Unity Tweak Tool. This was also fixed with the solution described below. I don't actually know if it was Wallch that caused the problem.

Finally figured it out!!! Somehow, KDE must've modified my user's gtk3 settings.

To fix it, just go to /home/[USERNAME]/.config/gtk-3.0 and delete settings.ini. Ubuntu will freak out and try to report a bunch of errors, but restart your system and it will all be back to normal.

This is what my settings.ini file looked like:

[Settings]
gtk-font-name=Ubuntu 9
gtk-theme-name=oxygen-gtk
gtk-icon-theme-name= oxygen
gtk-fallback-icon-theme=gnome
gtk-toolbar-style=GTK_TOOLBAR_ICONS
gtk-menu-images=1
gtk-button-images=1

$ unity --reset

This option allows the user to reset profile parameters in compiz and restart the Unity shell with default settings.


How long can ubuntu work on a usb drive? I have a 128gb usb drive lying around and I was planning on installing ubuntu on it. But then I started having concerns about how long the usb would last. I read that an average usb flash drive can have up to 1 million read/write operations before becoming corrupted. So, how long would it take to reach this number? Anyone having experiences with the lifespan of usb drives with ubuntu on them?

Depends on the USB drive. Cheap USBs such as consumer Lexar drives may die fairly quickly, and are fairly slow.

However, there are some, such as the Sandisk Cruzer Extreme that are basically SSDs, and have much higher tolerances than cheaper drives.

I recommend that when permanently installing Ubuntu on a USB drive that you use a light distribution such as Lubuntu and disable journaling. This will significantly reduce write cycles to the drive- however, disabling journalling puts you at a far higher risk of disk corruption. Make sure to make backups!

If you are worried about the lifetime of the flash drive you should probably use a copy to ram distro like Puppy Linux on it, instead of a regular distribution.

A frugal installation of Puppy Linux resides in RAM and writes changes to the Flash drive only on shutdown and/or on configured time intervals/on user request. This reduces the number of file ops.

So if you are really worried about the lifetime of your Flash drive you could look into something like that.

Links:

https://en.wikipedia.org/wiki/List_of_Linux_distributions_that_run_from_RAM
http://puppylinux.org/wikka/FrugalOrFullInstallation


How do I find out my motherboard model? Is there a way to find what motherboard model I have?

If yes, how, please?

This will directly show you motherboard info:

sudo dmidecode -t 2

or

sudo dmidecode | more

You can also try:

lspci

Simple one-liner in Ubuntu variants
sudo dmidecode -s baseboard-product-name

will give you motherboard model name
You can also find out motherboard's manufacturer, version, serial-number, asset-tag, and other string commands for other devices.


How to install "perf" monitoring tool? How do I install the perf monitoring tool?

On Ubuntu I had to install three packages:
apt-get install linux-tools-common linux-tools-generic linux-tools-`uname -r`

sudo apt-get install linux-tools-virtual


Losing Drivers and Functionality on Ubuntu I have a machine that runs ubuntu 13.10. It has been slowly but surely losing system functionality for a couple of months. Application center stopped working a couple of months ago because X Drawable disappeared. Now the clock functionality is gone and it can no longer play sound at all. Is this a problem with my install? I am using an ASUS X201EP That I bought from CDW 9 months ago. Intel 847 processor and 3.7 gb ram... Not sure if that's relevant

Here's the output lspci -nnk | grep -iA2 VGA:

00:02.0 VGA compatible controller [0300]: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller [8086:0106] (rev 09)
Subsystem: ASUSTeK Computer Inc. Device [1043:108d]
Kernel driver in use: i915

When I tried downloading the linux graphics installer and running sudo dpkg -i [filename] I got this output

(Reading database ... 254111 files and directories currently installed.)
Unpacking intel-linux-graphics-installer (from intel-linux-graphics-                       installer_1.0.3_amd64.deb) ...
dpkg: dependency problems prevent configuration of intel-linux-graphics-installer:
intel-linux-graphics-installer depends on libpackagekit-glib2-16 (>= 0.8.10);         however:
Package libpackagekit-glib2-16 is not installed.
 intel-linux-graphics-installer depends on ttf-ancient-fonts; however:
 Package ttf-ancient-fonts is not installed.

dpkg: error processing intel-linux-graphics-installer (--install):
dependency problems - leaving unconfigured
Processing triggers for bamfdaemon ...
Rebuilding /usr/share/applications/bamf-2.index...
Processing triggers for gnome-menus ...
Processing triggers for mime-support ...
Processing triggers for desktop-file-utils ...
Errors were encountered while processing:
intel-linux-graphics-installer

I tried modifying the grub as the tutorial JohnnyD. Recommended and now I can no longer load gnome and I get 'could not open x display' and 'could not find display 0'... I would post full output but I am posting from my phone cause I can't open chromium

For anyone who comes to this in the future. I had to revert the operating system to factory install after backing up all of my files. Press esc on startup and and press restore to factory settings.

This helps: http://liliputing.com/2011/07/how-to-install-nearly-any-linux-distro-using-a-usb-flash-drive-and-unetbootin.html

Install linux drivers from intel, from here. Select ubuntu 13.10 and 32 bit or 64 bit , depending on your system. you can check which architecture(32/64 bit) is in system settings -> Details, here:


Kubuntu taskbar requires double click to open minimized window After installing updates this morning, I could not login to KDE any more ("startkde not found"). I reinstalled KDE and solved that problem.

However, something has changed, because now I have to double click on the taskbar to maximize/minimize open applications, which is really annoying!

Is there a way to go back to normal single click behaviour?

I have Googled and checked the system settings, but found nothing that I could logically relate to this problem.

Ajkain was right, it was a known bug that has been fixed after today's kde and plasma upgrades. If you're using kubuntu you just need to update your packages in order to solve it.

I have same problem about the double click on taskbar, after I have updated KDE 4 (4.11.1).

It's a bug, I have found this link

https://bugs.kde.org/show_bug.cgi?id=324470


How do I install a .deb file via the command line? How do I install a .deb file via the command line?

Packages are manually installed via the dpkg command (Debian Package Management System). dpkg is the backend to commands like apt-get and aptitude, which in turn are the backend for GUI install apps like the Software Center and Synaptic.

Something along the lines of:

dpkg --> apt-get, aptitude --> Synaptic, Software Center

But of course the easiest ways to install a package would be, first, the GUI apps (Synaptic, Software Center, etc..), followed by the terminal commands apt-get and aptitude that add a very nice user friendly approach to the backend dpkg, including but not limited to packaged dependencies, control over what is installed, needs update, not installed, broken packages, etc.. Lastly the dpkg command which is the base for all of them.

Since dpkg is the base, you can use it to install packaged directly from the command line.

Install a package

sudo dpkg -i DEB_PACKAGE

For example if the package file is called askubuntu_2.0.deb then you should do sudo dpkg -i askubuntu_2.0.deb. If dpkg reports an error due to dependency problems, you can run sudo apt-get install -f to download the missing dependencies and configure everything. If that reports an error, you'll have to sort out the dependencies yourself by following for example How do I resolve unmet dependencies after adding a PPA?.

Remove a package

sudo dpkg -r PACKAGE_NAME

For example if the package is called askubuntu then you should do sudo dpkg -r askubuntu.

Reconfigure an existing package

sudo dpkg-reconfigure PACKAGE_NAME

This is useful when you need to reconfigure something related to said package. Some useful examples it the keyboard-configuration when you want to enable the Ctrl+Alt+Backspace in order to reset the X server, so you would the following:

sudo dpkg-reconfigure keyboard-configuration

Another great one is when you need to set the Timezone for a server or your local testing computer, so you use use the tzdata package:

sudo dpkg-reconfigure tzdata

There are many tools to install a deb package
I personally use built-in package installer dpkg

If you are logged as root
change the directory to location of deb package

dpkg -i package_name.deb

if you are not logged as root

sudo dpkg -i package_name.deb

To make sure that package installed correctly and didn't have any broken dependencies

sudo apt-get check

If there are any broken dependencies

sudo apt-get -f install


Can I stop apps from selecting "Recently Used" by default in file chooser dialogs? In Ubuntu and Kubuntu 11.10 I see changes in behaviour of GTK file chooser dialog. When I try to open new file (second, third etc, not first in editor) dialog show "Recenty used" section. It is very unsuitable for me, in 10.04 dialog shows folder where located previous open file. Anybody knows how i can bring back old behaviour?

To my knowledge, this is a "feature" of GTK+ 3.x, and I'm not so certain it can be changed.

If I find a solution I will update my answer, but for now I don't know of any (other than reporting a bug).

Update:

I believe I may have found a partial solution. It's not a permanent one unfortunately.

Install dconf-tools.
Run dconf-editor.
Navigate to org.gtk.settings.file-chooser.
Change the last-folder-uri value to the folder of your choosing, for example file:///home/rolandixor/Desktop.
Your file chooser dialogues should now use this folder by default. However, they will revert to recently used if you use the dialogue but do not actually open/save a file.

Update2:

As this is rather tricky, here is another possible solution (partial):

Open gedit.
Open a file (from the folder you want to use).
Save a file (save as) to the folder you want to use.
Close gedit. This will only work if you actually open a file from a folder and save to a folder. If you open the dialogue and don't do anything, it will revert when you close it. There is no way around this.

Also you could use shortcut for revealing Location input box and going to desired directory: ~ (tilde sign), Shift-` on some keyboards.


Connection activation failed: (5) IP configuration could not be reserved Since yesterday I can't connect to my Android's WiFi anymore.

To understand the problem better, I set NetworkManager's monitor log level to "DEBUG" and used the CLI. The error appears after 45 seconds:

# nmcli d wifi connect nico password mypass
Error: Connection activation failed: (5) IP configuration could not be reserved (no available address, timeout, etc.).

Meanwhile via nmcli monitor:

nico: connection profile created
wlp3s0: connecting (prepare)
wlp3s0: using connection 'nico'
NeworkManager is now in the 'connecting' state
wlp3s0: connecting (need authentication)
nico: connection profile changed
wlp3s0: connecting (prepare)
wlp3s0: connecting (configuring)
nico: connection profile changed
wlp3s0: connecting (getting IP configuration)
wlp3s0: connection failed

What is going wrong? How to investigate the problem further and hopefully solve it?

My Android is connected to the Internet (typing from it right now).
No luck with Bluetooth nor with USB cable tethering either.
On the opposite, I can connect to my company's WiFi with no problem.

Install dnsmasq and then try it again:

sudo apt install dnsmasq


How do I get two Eclipse sessions running at the same time? When I used Windows I could simply click the Eclipse icon and run a session, then click it again to run another. This way I could compare 2 different projects.  With Ubuntu 15.04, is there a way to do this?

I take it you don't want to use tabs to compare the projects, anyway I'd recommend that if you use Eclipse from the Ubuntu repositories-which are very very outdated-to download an updated version from the official website https://www.eclipse.org/downloads/
For the Mars release there is a helpful Eclipse Installer or just download and extract the package you require.

To start open the file "eclipse" within the extracted folder. Opening this file again gives you another Eclipse instance. You can drag the icon into the Unity toolbar for easy access. Generally running more than one instance is only a problem if the same workspace is being used, because when saving modifications one instance would interfere with the other.   So if you want to compare 2 different projects in 2 instances of Eclipse just have them in different workspaces. You could just quickly copy a workspace into the same directory, call it workspace2 and open the other instance using workspace2.

When playing around until you get the setup you need, a backup of your workspace(s) isn't a bad idea

It's a duplicate question. Btw, you may do as directed here:
https://stackoverflow.com/questions/118243/open-multiple-eclipse-workspaces-on-the-mac

I did exactly same on Ubuntu 14.04LTS and it worked perfectly. Give it a try.


Error message "E: unable to locate package firmware-b43-installer" I am using an Acer Aspire 5002WLMi laptop and set up a dual boot with Windows XP and Ubuntu 12.04. Wi-Fi is working well in Windows XP, but when I start Ubuntu I will get the below error.

[ 95.514855] b43-phy0 ERROR: You must go to http://wireless.kernel.org/en/users/Drivers/b43#devicefirmware and download the correct firmware for this driver version. Please carefully read all the instruction on this website.

Then I followed the instructions from the below link.

file:///C:/Documents%20and%20Settings/MGL/Desktop/how%20to%20install%20ubuntu/Ubuntu%2012.04%20Splash%20Screen%20Lockup%20with%20LiveCD%20_%20Ben%20Rousch%27s%20Cluster%20of%20Bleep.htm

But I am stuck in installing the Broadcom Wi-Fi firmware in Terminal, and it is showing this error:

  E: unable to locate package firmware-b43-installer

How can I proceed?

Well, you have to have an internet connection somehow.  Then you need to add the software source(repositories) needed for the b43.  Make sure that they look like the image below.  Make sure that you have a check mark just like the image.

Then To install the firmware, Just press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, run the command below.

sudo apt-get install firmware-b43-installer

Another way is to open Synaptic and go to Settings > Repositories and enable as shown in the image above, and then search for b43 and install your packages.

All that of course after adding the software source(repositories)

Note: If you don't have Synaptic Package Manager installed, you can do so by clicking below.

try this:

sudo apt-get install firmware-b43-installer
sudo modprobe -r wl
sudo modprobe b43


Right click not working on Ubuntu 18.04 I have installed Ubuntu 18.04 LTS on my HP Pavilion series laptop. After installing this version of Ubuntu, right click is not working of my touchpad. How can I solve this?
BTW: This question does not have any solution which which is working for me.
PS:- Problem remains after selection area in gnome-tweak-tool

For instance, to right-click method on touchpads without a physical
  button you need to perform a two-finger click (just tap anywhere with
  two fingers). Clicking in the bottom right area of the touchpad no
  longer works.

  If you don’t like this behaviour — and there’s a fair chance you might
  not — you can use the Tweaks app (see step #5) to change the setting.

Source: OMG Ubuntu  (see link for how to fix it)

Try

sudo vi /etc/X11/xorg.conf

add:

Section "InputClass"
  Identifier "libinput touchpad catchall"
  MatchIsTouchpad "on"
  MatchDevicePath "/dev/input/event*"
  Driver "libinput"
  Option "Tapping" "True"
  Option "NaturalScrolling" "True"
EndSection


Dual boot setup- no GRUB on boot On a dual boot Ubuntu 18.04LTS -Windows 10 setup.

By default I launch into Ubuntu

I see a black screen on boot for about 10 seconds then my desktop.

I last reconfigured my setup over a year ago but can't recall what I did to hide the GRUB on boot.
I was able to see the GRUB menu on boot at one time.

My goal is simply to log into BIOS to switch my startup to my Windows partition.

Any help appreciated!

You can change some grub options by editing the /etc/default/grub file. One thing to try could be to change the GRUB_TIMEOUT value there to some larger value, like 30 or so, then it should wait for 30 seconds hopefully giving your screen enough time to show the menu.

After editing the /etc/default/grub file, run the update-grub command:

update-grub

and then reboot.

When you boot up your computer, after the BIOS splash screen, you should start spamming Shift


dpkg: error processing package mendeleydesktop (--install) Now I am sick of this error and after trying all the things that I found from similar questions, I decided to post this. So I am trying to install mendeleydesktop on my newly installed Ubuntu 14.04 :

sudo dpkg -i mendeleydesktop_1.16.1-stable_i386.deb

But it throws the following error:

(Reading database ... 248304 files and directories currently installed.)
Preparing to unpack mendeleydesktop_1.16.1-stable_i386.deb ...
Unpacking mendeleydesktop (1.16.1) over (1.16.1) ...
dpkg: dependency problems prevent configuration of mendeleydesktop:
 mendeleydesktop depends on python.

dpkg: error processing package mendeleydesktop (--install):
 dependency problems - leaving unconfigured
Processing triggers for gnome-menus (3.10.1-0ubuntu2) ...
Processing triggers for desktop-file-utils (0.22-1ubuntu1) ...
Processing triggers for bamfdaemon (0.5.1+14.04.20140409-0ubuntu1) ...
Rebuilding /usr/share/applications/bamf-2.index...
Processing triggers for mime-support (3.54ubuntu1.1) ...
Processing triggers for hicolor-icon-theme (0.13-1) ...
Errors were encountered while processing:
 mendeleydesktop

I tried

sudo apt-get install -f

But this doesn't get rid of the error. I would be very happy if somebody could solve my problem. Thanks in advance.

I had the same problem in ubuntu 18.04. I solved it with:

sudo apt --fix-broken install

Then try to install the program again.
It worked for me.

dpkg: dependency problems prevent configuration of mendeleydesktop:
   mendeleydesktop depends on python.

Check if python is still installed like here: Do we have to install Python or It is already installed in Ubuntu 14.04LTS?


How can I copy/paste files via RDP in Kubuntu? I recently installed the latest Kubuntu (x64) on my work machine as I am trying to migrate away from Windows.  Unfortunately I use RDP very frequently to connect to customer's servers and need to be able to copy files across.

I have tried the following packages with no luck:

remmina
rdesktop
xfreerdp

My latest attempt to solve this involved connecting one of my folders to the remote server, here is the command I used to launch rdesktop:

rdesktop -5 -K -r disk:home=/home/dai -r clipboard:CLIPBOARD -r sound:off -x l -P 192.168.0.2 -u "administrator" -p pass

The servers are not all running the same version of Windows, the one I've been trying so far is running Server 2003 R2.  Customer servers range from Server 2000 to Server 2008.

I've been Googling this like mad but all the solutions I find seem to fail, maybe because almost all the help out there assumes that I'm running Gnome.

Sorry if this is a stupid question.

Thanks in advance for your help.

Edit: Copying and pasting text seems to work just fine, but that's not what I need.

https://gitlab.com/Remmina/Remmina/issues/243 says that shares show up using Remmina when you also enable sound redirection. To recap, here is what you have to do:

Create a Remmina RDP connection to the windows machine
Edit that connection.
Under the Basic tab Choose a share folder
In Advanced tab, change sound to local. Save it and connect

Then the shared folder appears in My computer in windows.
(If it does not appear, trying clicking Refresh).

You could connect to shared windows folders, e.g. with nautilus.
You could setup a Samba Server on your machine and connect to it from the windows machine.
You could setup an FTP Server on one of the Machines and an FTP Client on the other machine.
Most solutions do not depend on whether you use KDE or Gnome or whatever. You can use "Gnome-Programs" in KDE and the other way around.

There is also an openssh for windows which could help you:

sshwindows

Then you could use scp e.g.:

scp sourcehost:/any/directory /any/local/directory
scp /any/local/directory destinationhost:/and/directory

But I did not try that.


Konica Minolta bizhub printer does not print under Ubuntu 14.04 64 bits I have a network printer Konica Minolta bizhub C20P. Until yesterday, I'd been able to print for the past couple of years. I had Ubuntu 10.04, I upgraded to 12.04 a couple of days ago (both 10.04 and 12.04 were 32 bits). Yesterday I did a fresh installation of 14.04 64 bits, and today I've been trying to get the printer to work. I've tried several things:

a. install a new printer through System Settings/Printers, then either 1. add a driver file kmC20Pnp.ppd which I downloaded from the Minolta download centre (which is the driver I had until yesterday, which worked for all these years), or 2. select the printer model from a list;

b. install a new printer through localhost:631 with 1. and 2. (every time I try a new thing, I uninstall the unsuccessful printer first);

c. I've also tried selecting ipp and lpd printers, the last thing I tried was type lpd://IP_address/print on the Device URI, which ended up in crashing the printer

d. also some of what's described here about the i386 architecture: Can't get my Canon LBP printer to run under Ubuntu 14.04 (I had problems before while trying to install acroread that had to do with an incompatibility between i386 and amd64, so I thought that might be the problem).

Whenever I try to print a test page or otherwise connect to the printer (like when I for instance change the ipp: address) it keeps crashing (it's a copier and printer at the same time, so when it crashes, no one can print anymore, it doesn't respond to pings, and the copier doesn't respond either).

Any insight on what's happening and how to solve it will be very appreciated.

I am in  the same boat here. I work for a school district that has several c754 BizHub machines. Download and read Linux Cups Driver user guide for driver version 1.6, it sheds some light on the procedures to installing the new drivers from Konica, however I run 14.04 on two computers side by side and the driver is working on the 32 bit machine and not the 64 bit just yet. I have a suggestion, maybe we should contact Konica or have the local support person come out to assist. I really think it's a glitch in the driver more that it is an issue with Ubuntu. Also I noticed the driver I downloaded is marked version 1.4. When I finally get this resolved I will post it for everyone. Just because this driver doesn't work for me, it might work for you. Also when setting up the printer, use find network printer and it will set up the correct communication parameters. Hope this helps. I work with Windows, FreeBSD, and Linux. Here is the link I used for ours.

http://onyxweb.mykonicaminolta.com/OneStopProductSupport/SearchResults?products=1675


Ubuntu server behind corporate firewall I really hope that someone here. I'm setting up an Ubuntu server behind a corporate firewall. I'm trying to get repositories to work. The problem I have found it that it is not that straight forward. For archive.ubuntu.com I have opened firewall ports 80 and 443, but then you also need port 11371 to keyserver.ubuntu.com. There are plenty more addresses and ports that needs to be opened to get everything to work properly.

So my main question is, is there a comprehensive list of all addresses and ports that need to be open in a cooperate firewall for apt to work?

So my main question is, is there a comprehensive list of all addresses and ports that need to be open in a cooperate firewall for apt to work?

Plain and simple: No. There ain't. Because apt can be configured to use any repositories you want.

Even with the default, tld.archive.ubuntu.com, this is difficult. It redirects to other. Consider for instance no.archive.ubuntu.com:

$ dig no.archive.ubuntu.com +short
ubuntu-archive.trivini.no.
ftp.acc.umu.se.
194.71.11.173
194.71.11.165

These may very well change from time to time, so if you whitelist (based on DNS preferably) you will have to make sure your firewall solution updates it from time to time.

In addition to the local archive (probably se.archive.ubuntu.com in your case), you should add security.ubuntu.com to your whitelist. Both is accessible over port 80, normal HTTP.

For keys, you don't need open ports; you can fetch keys over http, and the number of keys is usually rather small, and you can add them manually. So I'd wager that you will manage with port 80 open towards tld.archive.ubuntu.com and security.ubuntu.com.

Under /etc/apt/sources.list you can look up your sources and what port you are gonna need is something you have to check per source.

So, this may be outdated or datacenter specific. But I believe the following ports

86323
56421
12921
53
22

Another thing is if you are in a cooperate network are you sure you have all the right privileges to get this done?

Actually, in some cases, you are better of mirroring the repository server within the cooperation.


LibreOffice stopped working Ubuntu 16.04 LTS I just did a software update this morning, it went through without any issues, but then I discovered that LibreOffice stopped working completely. It was working fine yesterday and I had files open. After the update it crashed and would not come back. This is my work machine, so this is kind of a really big deal. I removed it completely using:

sudo apt-get remove --purge libreoffice*

I removed the ~/.config/libreoffice. I reinstalled it (using the Ubuntu Software). Still no dice. Just sits there for a few moments blinking and the icon of whatever you picked, say Writer, goes away. No error message, nothing.

Any ideas?

Tried installing from Ubuntu software and apt-get install but broken.

Remove LibreOffice completely.

sudo apt-get remove --purge libreoffice*

Remove the configuration files from:

~/.config/libreoffice

Download Fresh package

https://www.libreoffice.org/download/download/

extract and install using

sudo dpkg -i *.deb

LibreOffice 5.3 is still broken and installing it through Ubuntu Software is broken too. I used sudo apt-get install libreoffice, just to see what would happen. It grabbed version 5.4, installed it and it's working fine. So if this happens to somebody else, just use apt-get to remove the thing, kill the ~/.config/libreoffice directory and then install using apt-get. Don't bother with Ubuntu Software. 5.3 distribution has been on the fritz a bit for a few weeks. It lost my extensive font library from the menu. You could still get the fonts you wanted if you typed in a name, but in the drop-down box it would only show about a dozen standard system fonts. Yeah, I rebuilt the font cache and that didn't fix it. Anyways, if this happens to someone else, just get rid of 5.3 installation and install 5.4 and don't use Ubuntu Software to do that, use apt-get or dpkg, do the command-line thing. Oh, and 5.4 picked up all my fonts, everything. All back to normal.


How can I install and use powerline plugin? Powerline is a plug-in to display informational and beautiful statusline for vim, tmux and shell prompt for bash, zsh.

Vim statusline:

How can I install and setup Powerline for different applications and shells in Ubuntu?

Plugin Installation:

Install python-pip and git: Open terminal by hitting Ctrl+Alt+T and run:

sudo apt-get install python-pip git

Per user:
In terminal run:

pip install --user git+git://github.com/Lokaltog/powerline

Add ~/.local/bin to $PATH by modifying ~/.profile with your favourite editor:

gksudo gedit ~/.profile

and adding following lines at the end of it:

if [ -d "$HOME/.local/bin" ]; then
    PATH="$HOME/.local/bin:$PATH"
fi

System wide:
In terminal run:

su -c 'pip install git+git://github.com/Lokaltog/powerline'

Font Installation:

Powerline provides two ways of installing the required fonts. If you're using one of following terminal: Gnome Terminal, Konsole, lxterminal, st, Xfce Terminal, Terminator, Guake, Yakuake then you should use "Fontconfig" method.

Fontconfig: (recommended)

Per User:
Run the following commands in terminal:

wget https://github.com/Lokaltog/powerline/raw/develop/font/PowerlineSymbols.otf https://github.com/Lokaltog/powerline/raw/develop/font/10-powerline-symbols.conf
mkdir -p ~/.fonts/ && mv PowerlineSymbols.otf ~/.fonts/
fc-cache -vf ~/.fonts
mkdir -p ~/.config/fontconfig/conf.d/ && mv 10-powerline-symbols.conf ~/.config/fontconfig/conf.d/

System wide:
Run the following commands in terminal:

wget https://github.com/Lokaltog/powerline/raw/develop/font/PowerlineSymbols.otf https://github.com/Lokaltog/powerline/raw/develop/font/10-powerline-symbols.conf
sudo mv PowerlineSymbols.otf /usr/share/fonts/
sudo fc-cache -vf
sudo mv 10-powerline-symbols.conf /etc/fonts/conf.d/

Patched font:
Use this method only if "Fontconfig" method doesn't work for you or you're using a terminal other than mentioned above.

Download the font of your choice from powerline-fonts.
Move your patched font to ~/.fonts/ for per user installation or /usr/share/fonts for system wide installation.
Run fc-cache -vf ~/.fonts to update your font cache, sudo fc-cache -vf to do it system wide.

To use patched font in Gvim see this answer and to change the font of your respective terminal check this question: How to change the font of various terminal emulators?. You may have to reboot your system after font installation for changes to take effect.

Usage: (for per user installation)

Vim statusline:
Add following to your ~/.vimrc or /etc/vim/vimrc:

set rtp+=$HOME/.local/lib/python2.7/site-packages/powerline/bindings/vim/

" Always show statusline
set laststatus=2

" Use 256 colours (Use this setting only if your terminal supports 256 colours)
set t_Co=256

Bash prompt:
Add the following line to your ~/.bashrc or /etc/bash.bashrc:

if [ -f ~/.local/lib/python2.7/site-packages/powerline/bindings/bash/powerline.sh ]; then
    source ~/.local/lib/python2.7/site-packages/powerline/bindings/bash/powerline.sh
fi

Zsh prompt:
Add the following line to your ~/.zshrc or /etc/zsh/zshrc:

if [[ -r ~/.local/lib/python2.7/site-packages/powerline/bindings/zsh/powerline.zsh ]]; then
    source ~/.local/lib/python2.7/site-packages/powerline/bindings/zsh/powerline.zsh
fi

Tmux statusline:
Add the following line to your ~/.tmux.conf:

source ~/.local/lib/python2.7/site-packages/powerline/bindings/tmux/powerline.conf
set-option -g default-terminal "screen-256color"

If your terminal supports 256 colours, set TERM environment variable to xterm-256color by modifying ~/.bashrc or /etc/bash.bashrc and adding following line:

export TERM=xterm-256color

To check if your terminal supports 256 colours check the documentation of your terminal or google it. Most popular terminals support 256 colours.

Usage: (for system wide installation)

Vim statusline:
Add following to your ~/.vimrc or /etc/vim/vimrc:

set rtp+=/usr/local/lib/python2.7/dist-packages/powerline/bindings/vim/

" Always show statusline
set laststatus=2

" Use 256 colours (Use this setting only if your terminal supports 256 colours)
set t_Co=256

Bash prompt:
Add the following line to your ~/.bashrc or /etc/bash.bashrc:

if [ -f /usr/local/lib/python2.7/dist-packages/powerline/bindings/bash/powerline.sh ]; then
    source /usr/local/lib/python2.7/dist-packages/powerline/bindings/bash/powerline.sh
fi

Zsh prompt:
Add the following line to your ~/.zshrc or /etc/zsh/zshrc:

if [[ -r /usr/local/lib/python2.7/dist-packages/powerline/bindings/zsh/powerline.zsh ]]; then
    source /usr/local/lib/python2.7/dist-packages/powerline/bindings/zsh/powerline.zsh
fi

Tmux statusline:
Add the following line to your ~/.tmux.conf:

source /usr/local/lib/python2.7/dist-packages/powerline/bindings/tmux/powerline.conf
set-option -g default-terminal "screen-256color"

If your terminal supports 256 colours, Set TERM environment variable to xterm-256color by modifying ~/.bashrc or /etc/bash.bashrc and adding following line:

export TERM=xterm-256color

To check if your terminal supports 256 colours check the documentation of your terminal or google it. Most popular terminals support 256 colours.

Configuration:

For detailed information on configuring Powerline: Configuration.

Uninstall:

To uninstall Powerline run one of following commands in terminal:

To uninstall per user installation:

pip uninstall powerline

To uninstall system wide installation:

su -c 'pip uninstall powerline'

Source: Powerline beta documentation

Alternatives:

If you're installing Powerline just for Vim you should try vim-airline which is more customizable and lightweight.

If you just want the bash extension, I wrote a small script that automates the manual steps that Basharat Sialvi wrote (many thanks for that complete reference).

In synthesis (but please, have a look at the script first as I won't be responsible if it throws your computer out of the window or delete your files):

git clone git@github.com:vincepii/ubuntu-powerline-bash.git
cd ubuntu-powerline-bash
./install.sh

https://thealarmclocksixam.wordpress.com/2016/02/28/quickly-setup-powerline-for-bash-in-ubuntu/

https://github.com/vincepii/ubuntu-powerline-bash


Wireless not working with an Atheros AR9285 I recently installed Ubuntu 12.04 and found my wireless card is not detected by OS. I tired to detect it by network manager but still it is not get

output of the required command:

toor@Linux:~$ sudo lshw -class network
  *-network
       description: Ethernet interface
       product: AR8131 Gigabit Ethernet
       vendor: Atheros Communications Inc.
       physical id: 0
       bus info: pci@0000:03:00.0
       logical name: eth0
       version: c0
       serial: f0:de:f1:9e:22:4d
       size: 100Mbit/s
       capacity: 1Gbit/s
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress vpd bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=atl1c driverversion=1.0.1.0-NAPI duplex=full firmware=N/A ip=124.123.227.84 latency=0 link=yes multicast=yes port=twisted pair speed=100Mbit/s
       resources: irq:44 memory:f2400000-f243ffff ioport:2000(size=128)
  *-network UNCLAIMED
       description: Network controller
       product: AR9285 Wireless Network Adapter (PCI-Express)
       vendor: Atheros Communications Inc.
       physical id: 0
       bus info: pci@0000:04:00.0
       version: 01
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress bus_master cap_list
       configuration: latency=0
       resources: memory:f2500000-f250ffff

and
toor@Linux:~$ rfkill list all
0: ideapad_wlan: Wireless LAN
    Soft blocked: yes
    Hard blocked: no
1: ideapad_bluetooth: Bluetooth
    Soft blocked: yes
    Hard blocked: no

Please let me know what more info is required to resolve it.

Your problem is two-fold and you'll have to handle both errors.

*-network UNCLAIMED means no kernel module (driver) is taking care of this piece of hardware.

For your device, I'd recommend first to see if there are drivers available using the regular method: How do I install additional drivers?

In case that doesn't list any drivers for your device, try installing backported drivers from newer Linux kernels. Ubuntu has packages available for these so-called compat-wireless set of drivers. See my answer in another related question on how to do this.
ideapad_wlan: Wireless LAN, Soft blocked: yes means that your radio kill switch is activated. This prevents all communication and is useful in case you intend to do so (e.g. when requested in an airplane). To enable your radio, disable this killswitch by issuing

sudo rfkill unblock all

to enable both WiFi and Bluetooth in your case.

See My WiFi adapter is not working at all, how to troubleshoot? for a more general, complete how-to.

Why don't you try to install the drivers for your wireless card?

Download this drivers: compat-wireless-3.6.8-1.tar.bz2
Install the drivers:

tar -xf /path/to/compat-wireless-3.6.8-1.tar.bz2
cd /path/to/compat-wireless-3.6.8-1
./scripts/driver-select ath9k
make
sudo make install

Reboot your computer.

If this doesn't work let me know.


What is the difference between Ctrl-z and Ctrl-c in the terminal? Can anyone tell me the difference between ctrl+z and ctrl+c?

When I am in the terminal, both the combinations stop the current process, but what exactly is the difference between both?

If we leave edge cases to one side, the difference is simple. Control+C aborts the application almost immediately while Control+Z shunts it into the background, suspended.

The shell send different signals to the underlying applications on these combinations:

Control+C (control character intr) sends SIGINT which will interrupt the application. Usually causing it to abort, but this is up to the application to decide.
Control+Z (control character susp) sends SIGTSTP to a foreground application, effectively putting it in the background, suspended. This is useful if you need to break out of something like an editor to go and grab some data you needed. You can go back into the application by running fg (or %x where x is the job number as shown in jobs).

We can test this by running nano TEST, then pressing Control+Z and then running ps aux | grep TEST. This will show us the nano process is still running:

oli     3278  0.0  0.0  14492  3160 pts/4    T    13:59   0:00 nano TEST

Further, we can see (from that T, which is in the status column) that the process has been stopped. So it's still alive, but it's not running... It can be resumed.

Some applications will crash if they have ongoing external processes (like a web request) that might timeout while they're asleep.

when you press ctrl+c, it means you send SIGINT to your process. like you type this command: kill -SIGINT <your_pid>. It will kill you your process. That why you cannot see it when issue ps command.
When you press ctrl+z, it means you send SIGSTOP to your process. like you type this command: kill -SIGKSTOP <your_pid>. It will stop your process, but the process still alive. So you can re-activate your process by sending SIGCONT to your process.


Re-mapping keyboard keys I am using a keyboard with the "fn" key. This is on a laptop.

So my FN + Up/down/left/right keys are mapped to brightness/volume. I would much rather them be mounted to page up/down, home/end. And map the other 4 keys to these 2. The page up/down has FN+ them for home/end. Its a shitty keyboard layout but I want to make it work.

Anyone knows how to figure out what the keycodes are and how to remap them?

Version: 10.04  x32

So here are some experiments:

Using xmodmap -pke I discovered that keycodes 122 = vol down, 123 = vol up. And I got all the info for Home/End/Page Up (next), Page Down (prior).

Now when using the vol up keys, there are no events being fired that xev can detect.

I can remap the volume keys to XF86AudioLowerVolume or XF86AudioRaiseVolume, but once I map those two to Home/End (respectively) they don't do anything. xev still does not pick up these events after a remap.

Remap: xmodmap -e "keycode 122 = Home"

Some laptop Fn key combinations are multimedia keys (appearing to the OS as ordinary keys with nonstandard codes), while others trigger ACPI events that eventually reach the OS, and some are just handled by the BIOS and never seen by the OS. The information paths are explained on the Hotkeys/Architecture page on the Ubuntu wiki, complete with diagrams.

The KeyTouch program should handle anything that is seen by the OS, and has a friendly GUI for describing your model and configuring what the keys should do (install the keytouch-editor package as well as keytouch).

If the OS can't see anything when you press the brightness keys, it could be because they're handled directly by the BIOS. The battle is not completely lost — it is in principle possible to hack the BIOS — but the difficulty level is considerably raised.

The Fn key combinations is not defined in software and can therefor not be redefined, so you need a soldering iron and some electronics knowhow!


What is the difference between "gksudo nautilus" and "sudo nautilus"? I've been using gksudo nautilus and sudo nautilus through Alt+F2.

What's the difference? They look very similar!

Taken from here:

  You should never use normal sudo to start graphical applications as
  root. You should use gksudo (kdesudo on Kubuntu) to run such programs.
  gksudo sets HOME=/root, and copies .Xauthority to a tmp directory.
  This prevents files in your home directory becoming owned by root.

Please note that this is primarily about configuration files. If you run Nautilus as root, even with gksu/gksudo, and you create a file or folder anywhere with it (including in your home directory), that file or folder will be owned by root. But if you run Nautilus (or most other graphical applications) as root with sudo, they may save their configuration files in your home directory (rather than root's home directory). Those configuration files may be owned by root and inaccessible when you're not running as root, which can severely mess up your settings, and may even keep some applications from working altogether.

The solution, once you have made this mistake, is to find the configuration files and delete them or chown them back to belonging your non-root user. Many such files start with a . or are contained in a directory that starts with a .. Some are located inside the .config folder in your home directory. To see files and folders that start with a . in Nautilus, press Ctrl+H (this shows hidden files.) To see them with ls, use the -a (or -A) flag.

To find if there are files not owned by you in your home directory, you can use the following command in a terminal:

find $HOME -not -user $USER -exec ls -lad {} \;

which will list all files under the home directory not owned by the user.

If you choose gksudo nautilus, You ask your password graphically. With sudo, you ask it in a terminal


remove youradexchange malware from chrome Does anyone have experience removing the 'youradexchange.com' browser hijack on ubuntu? I find a lot of information regarding this for Windows, but there is nothing for linux. When I am using Chrome, I always see, "waiting for my-app-analytics.com". Googling has led me to believe it is related to the browser hijack.

I have exactly the same issue.

I manage to remove the malware extension from my ubuntu machine.

The extension is saved under :

/home/user/.config/chromium/Default/Extensions/gpomcmpdonjdffeabllcklpbnfdknnko

But it could be saved under another folder name. You can find it searching for this file :

find -name gui_web.js

Just delete this folder, and it should be fixed.

the content of this file is explicit :

var app  = document.createElement('script');
app.type = 'text/javascript';
app.src  = '//www.web-cdn.net/cdn/web.js';
document.getElementsByTagName("head")[0].appendChild(app);

It downloads this script web.js which content is :

var app  = document.createElement('script');
app.type = 'text/javascript';
app.src  = '//www.my-app-analytics.com/app-ga.php';
document.getElementsByTagName("head")[0].appendChild(app);

If you are having trouble in all browsers or all machines on the same network, it is likely a DNS issue.

You can simply reset your modem.

If you can't, change your machine's DNS with the public one, such as google DNS.


How could I use my second laptop to extend my laptop's screen? I was wondering how I could create a dummy or fake monitor that I could use to extend my display. Then I wanted to use vnc to connect to the dummy screen with my other laptop. If someone has something easier or better please suggest it. I'm using normal unity Ubuntu 16.10 on both.
It's been done on windows as see here.
- https://youtu.be/W9gAlqCX5Lw

I've also tried xdmx but it didn't work for me. It would give me a "(Fatal Error) dmx: InitOutput: no back-end displays found" error after I ran xdmx :1

Check the laptop manufacturer information online. Most laptops only have their video card sources (HDMI, DVI, VGA, etc.) set to output only, but that is not always the case.

For the case of Ubuntu, if you can't use your laptop using those cables, a networked connection is possible. It seems that XDMX is the best possible route but it seems difficult to set up.
There is also Synergy, but that's not exactly the same thing. Synergy works by allowing use of one keyboard and mouse across multiple computers.


JDBC Driver Not in CLASSPATH eroor I have try to running apirior alogorithm in IdeaJ IDE. Where the following error occur

Trying to add database driver (JDBC): Driver - Error, not in CLASSPATH?

How do I overcome this error. I have to issues.

How Do I install JDBC Driver in Ubuntu
How Am I get the path and add in CLASSPATH

Install the connector driver.

sudo apt-get install libmysql-java
The next step is to make sure that the classpath is set. You can have this set automatically by adding this a command to you bashrc file.

export CLASSPATH=$CLASSPATH:/usr/share/java/mysql-connector-java.jar

If you want to set this for all users or permanently, you should modify the
sudo /etc/profile.
just enter this command on terminal
2.sudo gedit /etc/profile
and set CLASSPATH following as
export CLASSPATH=$CLASSPATH:/usr/share/java/mysql-connector-java.jar
it work perfectly please try


Can't install Gimp in Ubuntu 16.04 due to missing dependencies I'm getting below error when I run apt install gimp

Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
 The following packages have unmet dependencies:
   gimp : Depends: libgimp2.0 (>= 2.9.7~17-ubu16.04.2.2~ppa~9eb75cd) but it is not going to be installed
        Depends: libgimp2.0 (<= 2.9.7~17-z) but it is not going to be installed
        Depends: gimp-data (>= 2.9.7~17) but it is not going to be installed
        Depends: gimp-data (<= 2.9.7~17-z) but it is not going to be installed
        Depends: libgegl-0.3-0 (> 1:0.3.21~16) but it is not going to be installed
        Depends: libmypaint (>= 1.4.0~7-u16.04.1~ppa~c196a86) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

Edit: I've ended up installing gimp from Ubuntu Software.

You must uninstall Gimp and remove the external Gimp PPA from software sources.

$ sudo apt remove gimp

Then open Software & Updates and remove the PPA from 'Other Software'.

After that, you can install a new clean instance of Gimp:

$ sudo apt update
$ sudo apt upgrade
$ sudo apt install gimp

I had a similar problem with BOINC Manager after an update a few weeks ago.  The general form of my solution will likely fix your problem.

I dug through the dependencies of the package I was trying to install, then looked for other packages that depended on an older version of the same packages.  That dependency (especially in the case where a newer version was listed as breaking the second package) prevented the installer from removing/upgrading the dependency, hence preventing installation of the desired package.

Fortunately, this kind of conflict in Ubuntu is likely to occur only in relatively uncommon packages or those that come from third party repositories, so it narrows the search.  In my case, I had to choose between golly, a Life simulator, and BOINC Manager, which depended on and were broken by different versions of a GTK support library.  I uninstalled golly and BOINC Manager installed and worked.

Find the conflicting library, and you'll find why GIMP won't install.


List all versions of a package Is there a equivalent of this command; yum list kernel-headers --showduplicates on Ubuntu with apt-get, apt-cache etc. The above command lists various versions of the kernel-headers rpm available on F20/RHEL or installations.

Closet I can get using apt-cache showpkg, not sure if there is a better way ?

$ apt-cache showpkg linux-image
Package: linux-image
Versions:

Reverse Depends:
  firmware-crystalhd,linux-image
  systemtap,linux-image
  fiaif,linux-image
Dependencies:
Provides:
Reverse Provides:
linux-image-3.13.0-27-lowlatency 3.13.0-27.50
linux-image-3.13.0-27-generic 3.13.0-27.50
linux-image-3.13.0-24-lowlatency 3.13.0-24.47
linux-image-3.13.0-24-generic 3.13.0-24.47
linux-image-3.13.0-24-lowlatency 3.13.0-24.46
linux-image-3.13.0-24-generic 3.13.0-24.46

Expecting similar output:

$ yum list kernel-headers --showduplicates
Loaded plugins: langpacks, refresh-packagekit
Installed Packages
kernel-headers.x86_64 3.11.10-301.fc20 @fedora
Available Packages
kernel-headers.x86_64 3.11.10-301.fc20 fedora
kernel-headers.x86_64 3.14.4-200.fc20 updates

This would help me simply do a downgrade or upgrade to a specific version.

You have the correct command, except linux-image isn't a real package name.

$ apt-cache show linux-image
N: Can't select versions from package 'linux-image' as it is purely virtual
N: No package found

apt-cache showpkg should work for real packages, though. e.g.

$ apt-cache showpkg lyx
Package: lyx
Versions:
2.1.0-1~trusty~ppa4 (/var/lib/apt/lists/ppa.launchpad.net_lyx-devel_release_ubuntu_dists_trusty_main_binary-amd64_Packages) (/var/lib/dpkg/status)
 Description Language:
                 File: /var/lib/apt/lists/ppa.launchpad.net_lyx-devel_release_ubuntu_dists_trusty_main_binary-amd64_Packages
                  MD5: 8c75d53cfd29c5b19c2172cb07b7fe9a

2.0.6-1build1 (/var/lib/apt/lists/ftp.iinet.net.au_pub_ubuntu_dists_trusty_universe_binary-amd64_Packages)

If you want to see all the versions of linux-image-like packages, you can just do a search, e.g.

$ apt-cache search linux-image | grep '^linux-image'

The problem is that the different versions of the kernel (linux-image) are in individual packages, and named independently according to the version. They are not all versions of the one package.

EDIT

This lists all available packages. To show which is installed, you can use dpkg -l. e.g.

$ dpkg -l lyx
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                                           Version                      Architecture                 Description
+++-==============================================-============================-============================-==================================================================================================
ii  lyx                                            2.1.0-1~trusty~ppa4          amd64                        Document Processor

EDIT2

Another way to get information about different but similarly-named packages (e.g. linux-image*) is by using aptitude search.

$ aptitude search linux-image

You can also filter with grep using this awkward syntax to get around an aptitude bug/feature.

$ aptitude -w $COLUMNS search linux-image | grep '32 bit'

An i in the first column tells you that it's already installed. See man aptitude for the other characters.

Have you tried to to boot an old kernel, and in the terminal enter:

showpkg kernel-header.list

and i think it might be in the boot directory, and all the kernel lays there, and this might work fine.

and then you can just type in to downgrade this in the terminal:

 sudo apt-get -y --force-yes purge linux-shim-efi shim-amd64-generic linux-shim-amd64

and it might work fine this way.


Ubuntu 12.04 installer does not recognize Windows 7 I recently purchased an ASUS N56VZ-ES71 laptop which came with Windows 7 Home Premium installed on it. I wish to dual boot Windows 7 and Ubuntu 12.04 on it. I shrank the hard drive partitions to leave about 150 GB unallocated for Ubuntu 12.04. When I boot the Live CD of Ubuntu and attempt to install, the installer does not recognize any other operating systems. Through reading a few questions, I have found that this is due to a GPT partitioning table that Windows uses.

I ran boot-repair as per other threads' suggestions. This was my output: http://paste.ubuntu.com/1176988/

I suppose my question is: how do I proceed in order to get the installer to recognize Windows, so that I don't have to erase the current partition table and can get a safe install?

Thanks in advance.

First, GPT is not, in and of itself, the problem. The error you report (no partitions appearing in the installer) is indicative of a partition table problem. It's a long-standing bug of libparted (which the installer uses) that broken partition tables show as if they were blank disks. GPT is supported by libparted, though, and Ubuntu will install to GPT disks.

The key is this:

/dev/sda1 ends after the last sector of /dev/sda

This error message refers to the GPT's protective MBR, which is a "fake" MBR partition table that exists just to keep GPT-unaware utilities from using the disk. Your protective MBR contains a protective 0xEE partition that's too big. This really doesn't matter, but it's triggering libparted's "broken partition table" bug.

The solution is to fix the protective MBR. This is easily done using gdisk or sgdisk, which are part of the gdisk package in Ubuntu; however, I'm not sure if that package is installable in a live CD. Therefore, I'll tell you how to do this from an emergency disk:

Download Parted Magic and burn it to CD.
Boot Parted Magic.
Launch a terminal window (the icon of a monitor on the bottom of the screen).
Type gdisk /dev/sda to launch gdisk. You should see some startup messages and a prompt that reads Command (? for help):.
Type p in gdisk to view your partition table and verify that everything looks OK. If you see weird partitions, exit by typing q.
Type x to get to the experts' menu. The prompt should change to read Expert command (? for help):.
Type n. This generates a fresh protective MBR. The program will respond merely by displaying a new prompt.
Type w to save your changes. The program will warn you it will overwrite your old partitions and prompt you for confirmation. Respond y.
Reboot and try installing again. It should now work fine.

One caveat: Your computer is booting Windows in EFI mode, so you should also install Ubuntu in EFI mode. This is sometimes trouble-prone. I recommend backing up your EFI System Partition (ESP; /dev/sda1) while you're in Parted Magic or by using the Ubuntu installer. If you have problems after installing, you may need to install a new boot loader. See my EFI Boot Loaders for Linux page for details.

You can manually specify the drives you want to use. When you install click on "partition Manually" or something in that context.

Then select your unallocated space, allocate space for the ubuntu partition and the swap partition.

I had the same problem too. :)


Dual Boot Windows 8 with Ubuntu 12.10 This is my First time so please help

Steps I Followed :

Install windows 8 pro with media center
On my asus k55vm, i7 ,8gb.
Windows boots fine and is in perfect condition.
Booted into Ubuntu live USB and installed ( it detected windows, installed alongside windows 8 with recommended setting )
Installed perfectly. Rebooted, but no option to select Ubuntu, just loads into windows 8 without any option, tried boot repair and no use.

Please Help , tried many tutorials to no use , heard about easybcd also , any help ?

This issue is to do with UEFI. In Windows 8 on the start screen, type in "msconfig" (without the quotes) and in the boot tab, see if Ubuntu is listed. If it is, select the entry by highlighting it and click on "Set as default". This should hopefully load the Ubuntu bootloader instead of Windows' boot menu allowing you you boot into Ubuntu.

Also, from the start screen type in "uefi" and in the settings option on the seach charm, click on "Advanced start up options", click on it. Scroll down to the bottom of the entry and under "Advanced start up", click Restart now. You should now have an option to change the boot order.

Hope this works!

Ben

I had same problem. I followed the instructions in this video and it works fine now.
http://www.youtube.com/watch?v=PK7gWIkAY7s

Good luck


Server certificate problem with Cisco AnyConnect VPN Client When I try to connect using the Cisco AnyConnect VPN Client, I receive this error:

  Connection attempt has failed due to server certificate problem.

I happened to have this problem in my previous Ubuntu 11.10 installation. That time I could fix it using some tutorials on the internet (I don't remember which one). Basically, they suggested installing 4-5 packages and then some ln -s. But this time none of them are working. Can anyone help me step by step?

The following fix worked for me - fresh install of 12.04 LTS 32bit (with Firefox 12). Installed the AnyConnect client, then tried to run it.

Got this message:

  AnyConnect cannot confirm it is connected to your secure gateway. The
  local network may not be trustworthy. Please try another network.

Checked syslog in Ubuntu. Lots of this sort of stuff:

CERTSTORE_ERROR_CERT_NOT_FOUND The /opt/.cisco/certificates/ca/ directory was not found

Created /.cisco/certificates/ca directories in /opt using sudo

cd /opt
sudo mkdir .cisco
cd .cisco/
sudo mkdir certificates
cd certificates/
sudo mkdir ca

We use Globalsign as our certificate authority. So I just copied all the Globalsign .pem files from /etc/ssl/certs. If you don't know your provider, you could just copy everything.

sudo cp /etc/ssl/certs/Global* /opt/.cisco/certificates/ca

or if CA is unknown

sudo cp /etc/ssl/certs/cd /etc/ssl/cert/* /opt/.cisco/certificates/ca

I was able to start the AnyConnect client and connect to the VPN

Hope this helps.

Make sure that you have Firefox installed and are able to successfully launch it. If all is successful, there are a few other troubleshooting steps to try.