Optimal swap partition size for Ubuntu Linux

The swap is the area to change pages or segments (hard disk and RAM). For this argument, the swap often stay in HDD.
The size depends the use of your laptop. I supose is a personal
machine and your use is programming, explore Ethernet, edit videos and images... Then you need ~12 GB of swap. But if your computer is a server, you would need 16 GB (2*RAM).

Good luck in your partition!


How to start, stop and restart rtorrent?

To start rtorrent, just press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, run the command(s) below:

rtorrent

To stop Ctrl+D
To quit Ctrl+q

The above commands you do after pressing Enter, in the rtorrent window.

For more information see the output of:

rtorrent -h

and/or see Using rtorrent like a pro


Dell Inspiron 14-3452 BIOS refuses to boot Ubuntu

In the bios look for a setting that says something like 'enable load ROM'. Disable that. To be able to change it you might have to change the boot setting to uefi or legacy, I forgot which one


Terminate GNU Parallel in Screen Session letting jobs finish

First: The standard way to fix a missing & is:

CTRL-Z
bg

That being said, you probably want to send GNU Parallel a SIGTERM. If you only run one instance, then this should do it:

killall -TERM parallel


QML what to use to store int numbers TextInput or TextField

Both are OK as they store the text property in a String.

You could use the following snippet to restrict the input (with IntValidator) and make some calculation using the standard javascript function parseInt:

import QtQuick 2.0
import Ubuntu.Components 0.1
import QtQuick.Controls 1.1
import QtQuick.Controls.Styles 1.1

MainView {
    id: main
    width: 200
    height: 200

    TextField {
        anchors.centerIn: parent
        placeholderText: "0"
        text: "12"
        validator: IntValidator{}
        horizontalAlignment: TextInput.AlignHCenter
        style: TextFieldStyle {
            textColor: "black"
            background: Rectangle {
                radius: 20
                color: "#F0EBEB"
                implicitWidth: 40
                implicitHeight: 24
                border.color: "#000000"
                border.width: 1
            }
        }
        onTextChanged: {console.log(parseInt(text,10) + 1000)}
    }
}


Failed update from 12.10 to 13.04, boots into terminal.

The following answer was provided by user239585 (the question asker):

Your disk will likely be read-only in recovery mode. Run this command to make it not so:

mount -o rw,remount /
The problem is that during your upgrade, some of the packages did not download/install correctly. To correct this problem, you will need to run a series of commands. If you are on a wired connection, however, you will first need to run:

vi /etc/network/interfaces

Add the following two lines:

auto eth0 iface
iface eth0 inet dhcp

Save (command mode, zz)

Then run this command:

sudo /etc/init.d/networking restart

Now run the following commands in succession, being that you are connected to the internet and your disk is writable:

sudo dpkg --configure -a
sudo apt-get update
sudo apt-get install -f
sudo apt-get upgrade
sudo apt-get dist-upgrade
sudo dpkg --configure -a

Then, as you guessed, just type:

reboot

And all should be well. You may still get the recovery screen on your next boot, but just select the top option, Ubuntu. When the cursor appears, you know you're good, because that is a sign that X server is running properly. After following these instructions, I have 13.04 with XFCE and all important files in tact.


How can I have my terminal start with an ASCII banner?

Your .bashrc file is executed every time you open a new terminal, so if you add this line to it:

echo "____ENTER_ASCII_ART_HERE_____"

That should do it


Why does the 'which' command in Terminal give no output in 20.04?

Because there is no python command installed by default in the system.
Historically python was used for Python version 2.x. Since Python 2 is EOL, there is no longer a  command called python to call the Python 2 interpreter.
You can install the python-is-pyhon3 package to have a shortcut python calling the Python 3 interpreter.
But, normally you should use the python3 command explicitly.


Graphic Problems after installation of 12.04

Maybe the bootloader resolution is set too high, which your monitor cannot handle. To change it, boot into Ubuntu.

Open your terminal and type

sudo gedit /etc/default/grub

find the line

#GRUB_GFXMODE=640x480

remove the # before the line GRUB_GFXMODE=640x480

save, then type in terminal

sudo update-grub

now reboot and see


How to disable shutdown/restart/hibernate without authentication

You wanna deny users to shutdown\hibernate eg. the system from the GUI or terminal?

This should give you a hint of how to remove it from the login\switch-user GUI if that is your consern. You could also do something like this, but it is to dirty if you ask me.

If the sudo shutdown eg is your concern? you should really rethink your design and do some extensive research on how sudo work.


Any recommendations for a command-line download manager?

wget, that is installed by default, has such a feature through the -c option:

   -c
   --continue
       Continue getting a partially-downloaded file.  This is useful when
       you want to finish up a download started by a previous instance of
       Wget, or by another program.

       ...

       Note that -c only works with FTP servers and with HTTP servers that
       support the "Range" header.


Terminal program to log all system reosurces?

You can use the terminal application glances in order to get the following information which you need :

CPU
RAM
Disk I/O

As you need these values stored in some file, use the option --export-csv FILENAME. This should do the job for you.

As for the GPU information it sort of depends on what drivers you have installed. Something which works for me and can work for you as well is

nvidia-smi -f FILENAME -l LOOP_TIME

This stores the nvidia-smi's output, which is the information you require, in the file name FILENAME at a frequency of 1/LOOP_TIME. Although, since it stores in a human readable format parsing this might be cumbersome.

You can also explore the option -x coupled with -q with nvidia-smi to store in an xml format.


How to save the configurations made in Guest session?

IMHO, the most valid approach would be to create a new account only for this purpose, for "guest" users that aren't normal users for you.

Choose a name that is valid for you in this purpose (like visitor), set it to login without password, and you are in!


What graphic driver should I use in Ubuntu 20.04 for NVIDIA Corporation GF106GL [Quadro 2000]?

In a terminal (ctrl-alt-t to start one), type
ubuntu-drivers devices

The list includes your Quadro, several possible drivers, one of which had "recommended" on the line.  Use that one. I'd expect the 440, 450, or the 455 would be the recommended., not the 390.  Ensure you run
sudo apt-get update

before looking at drivers.


I've just tried this and there appears to be a number of required dependencies that are not detailed in the documentation. I found that the following were required:

build-essential
libx11-dev
libgl1-mesa-dev
libglu1-mesa-dev
libxrandr-dev
libxinerama-dev
libxcursor-dev
zlib1g-dev
libasound2-dev
libgtk2.0-dev

All went ok after these were installed.

These can all be installed using the command:

  sudo apt install build-essential libx11-dev libgl1-mesa-dev libglu1-mesa-dev libxrandr-dev libxinerama-dev libxcursor-dev zlib1g-dev libasound2-dev libgtk2.0-dev

and then restart building the dependencies with make dep.


How to find a replace newline and commas in a file using regex function in gedit?

You would do this with a bash command line
If really needed, this could also be scripted inside Gedit with it's 'external tools' addon

afile.txt

"postalAddress2": "Postal Address Line 2",
"postalCity": "Postal City",
"postalPostCode": "Postal Code",
"postalState": "State",

A needed command line could be like this :

cut -d ':' -f1 /path/to/afile.txt | tr '\n' ',' | sed 's/,*$//g'

cut -d ':' -f1 extract first field, delimited by :
tr '\n' ',' replaces \n by ,
sed 's/,*$//g' deletes trailling comma(s)


The answer to this question was provided in the comments.

The solution was to back up the data, destroy the LXC containers,and start fresh.

  I just destroyed those containers. Somehow the problems was with all of them.


Defrag NTFS partition without messing up ext4 partition

In short - perfectly safe.

If you installed Ubuntu with Wubi - then Ubuntu installation is same as every other file in Windows. Defragmentation won't change contents and any installation image moves would be detected by boot loader.
If you have installed Ubuntu in separate partition, then it is even better - no Windows defragger would touch ext4 partition ad performance should be the best.

See more:

http://ubuntuforums.org/showthread.php?t=1696738

http://ubuntuforums.org/showthread.php?t=704584


How to make org.kde.discover (Plasma Discover installed as FlatPak) to work with APT, Snap and FlatPak of the system?

As far as I know, what you want to achieve is not possible because flatpak applications are sandboxed.

I don't know any KDE developer, but judging by this commit and this blog post, they probably use the discover flatpak to test the UI. Discover is one prominent showcase of KDE's Kirigami UI. Using a flatpak for this purpose sounds reasonable to me.


Why do some programs running from Terminal using '&' close when Terminal does and others do not?

When you close a terminal the terminal sends a SIGHUP signal to the shell; the shell, in turn, sends a SIGHUP signal to all its children process groups, which include backgrounded process groups;

How each single process will react to the signal is entirely up to the process: if the process didn't define a handler for the signal and tell the kernel (via some syscall such as signal() or sigaction()) that it wishes to handle it, the kernel executes the default handler for the signal, which in case of a SIGHUP signal consists in terminating the process.

However, when you run a command with sudo, the UID of the sudo process and its child process is set to 0 (root); in general, unless the UID of the process sending the signal is 0 (root) or the same as the target process, the kernel dismisses the signal (i.e.: a process can't send signals to a process owned by another user, unless the process sending the signal is owned by root); that's why an user-run process such as the Bash instance run by the terminal can't SIGHUP a sudo process and, ultimately, closing a terminal doesn't affect a process started with sudo.


Drivers should be downloaded from epson support site.
Remove the printer and add it again , it should work fine!


Nautilus won't use Gnome 3 color scheme?

Nautilus should be controlled by the GTK+ theme, whereas Gnome Shell uses its own theme. You'll need to change the GTK+ theme to something that looks better with your Gnome Shell theme.

The easiest way is to pick up Gnome Tweak Tool and change the theme (I think there's an "Adwaita" GTK+ theme to go with the Shell theme). If that doesn't give you enough control, then you can probably find a GTK+ theme switcher that will give you the control you're looking for.


I don't know how to fix that, but you should look this (https://www.linuxwind.org/html/tag/dell-inspiron-7420), may be it can help you.


Changing the network interface for specific user?

Yes, it is possible. You have to mark the packets with 'owner' see this). The MARK extension based on processes and users.

iptables ... -j MARK --set-mark 15

Once the packets have been marked, you can create the new routes, for example, a new default route, and associate it to a routing table:

ip route add table 10 your_route_for_that_user

Then you tell the system to route all packages with the mark 15 by using table 10 (15 and 10 could be any valid number for ip route add table and -j MARK):

ip rule add fwmark 15 table 10


I'll speculate a bit on this:

/home/executable probably depends on the graphics being initialized, which I think would mean after the GUI is running.
If the GUI is not running, it probably exits with an error, and your script continues to the remaining part (which is why the file isn't created). output from rc.local is discarded, so you wouldn't know if it threw an error.
If the GUI is running, your program continues to run, so the script doesn't reach the remaining section until you close it.

Consider using an Upstart session job. Create a .conf file in ~/.config/upstart (say camera.conf) containing:

description "My OpenCV-based camera app"
start on startup
stop on session-end

exec /home/executable

Now it should automatically start when you log in. You can use the following commands to start and stop your application (camera is the name of the .conf file you created):

start camera
stop camera

You can also add respawn to the configuration file, if you want Upstart to start the program again if you close it.


How to compile 32-bit executable on 64 bit system

You have to install correct development packages by
sudo apt-get install build-essential libc6-dev-i386

And then it will work:

$ gcc hello.c -o hello32 -m32
$ file hello32
hello32: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=444fafde1d2281a8af74adc452a8db046df1276e, not stripped


How to disable auto power off of usb devices like usb mouse?

Just copy paste the following command in terminal and it will disable auto suspending.

Disabling auto suspending USB

echo 2 | sudo tee /sys/bus/usb/devices/*/power/autosuspend >/dev/null

Disable USB autosuspend

echo on | sudo tee /sys/bus/usb/devices/*/power/level >/dev/null


vim binary with all libraries statically linked

I had the similar problem when trying some things with pkgsrc on vim port.
Try to open the config.log file. In my case, the configure script told me this :

| int
| main ()
| {
| char s[10000]; int res = tgetent(s, "thisterminaldoesnotexist");
|   ;
|   return 0;
| }
configure:11408: error: NOT FOUND!
      You need to install a terminal library; for example ncurses.
      Or specify the name of the library with --with-tlib.

The problem here is that the termcap.h header is missing on the C code snippet. So I patched the configure script by adding #include <termcap.h> and then it was ok.

I don't know if it the same problem on your platform but you should try :)


According to this reddit post from martin (a kde dev), this is currently not possible. However, there does seem to exist a global shortcut whitelist!

BTW, closing the lid on the lockscreen does suspend the system in my case!


The search in Ubuntu Software Center disappears

Run Ubuntu Software Center from a terminal using the command line:

software-center

If still doesn't work, you should resize the window of Ubuntu Software Center and make it a little bigger. If i resize my window to that size, the Search disappears because there's no space to it be shown.


The issue right now is a syntax errror in the file /etc/apache2/apache2.conf on line 219.

It seems like you reference to a partial configuration /etc/request-tracker4/apache2-modperl2.conf, which in fact doesn't exist. (No such file or directory)

To fix this issue, find out where this file is actually located and adjust the file path.


I've installed Ubuntu on my macbook in a similar fashion and after rebooting, my macbook boots into the Ubuntu grub menu by default.

Then, I disabled the grub menu from appearing on boot by editing my grub configuration file so that my macbook just boots immediately into Ubuntu.

Try rebooting without holding the option key and seeing which environment the machine boots into. If it boots into OS X, plug back in the Ubuntu USB (assuming you used a bootable USB to install) and boot into the live environment. Then, install efibootmgr and adjust the current boot order of the macbook so that it boots into Ubuntu by deafult.

Hope this helps!


Anyway to get Brawlhalla(a windows only steam game) to run on Ubuntu?

It is a possible duplicate of a previous question. Use Wine as a windows emulator to run windows applications. Also take a look at this answer.


Are there APIs to achieve centralized patching?

Assuming you're not actually trying to air-gap the machines for security purposes or something:

Connect one ubuntu machine to the internet. Install updates as normal with apt-get.
The .deb's you just upgraded that box with are now stored in /var/cache/apt/archives.
scp the .deb's to each of the other ubuntu machines.
At a cost of a little bandwidth, on each other machine, place the .debs in /var/cache/apt/archives and run apt-get update && apt-get upgrade (or aptitude, or something). The machine will hit the network to get the new package list, but when it comes to download the packages for upgrade, it'll find it already has them in its cache, and just install them.
For maximum bandwidth conservation, just install the new .deb's with dpkg -i <files.

Obviously, it's slightly more complicated if you have a mix of 32 and 64-bit boxes, diff't architectures, etc. But you'd still have to download all the updated packages anyway.


It is possible to resize grippers or hide them by setting width and height to a zero. Put the following into ~/.gtkrc-2.0:

style "default-style"
{
  GtkWindow::resize-grip-height = 0
  GtkWindow::resize-grip-width = 0
}

class "GtkWidget" style "default-style"

or add this strings in "default" style body of /usr/share/themes//gtk-2.0/gtkrc:

  GtkWindow::resize-grip-height = 0
  GtkWindow::resize-grip-width = 0


NVidia 460 update disables HDMI audio output

Does the solution here work for you?  https://forums.developer.nvidia.com/t/no-hdmi-audio-on-nvidia-1660-super-driver-460-ubuntu-20-10/165785/5
Unfortunately, I'm on Linux Mint 20.1 and can't reproduce the fix.  Only option I've found is to revert to 450.
EDIT: I solved this with the kernel parameter "pcie_port_pm=off".  Ubuntu 20.04 and related users should give this a shot.


Installing gdm on headless Server Edition

For an NX-based solution, I would suggest using X2go. It's not compatible with Nomachines client or OpenNX, but it is much better integrated with things like PulseAudio. This means that you can have two-way audio with the remote desktop, for instance. They have several nice clients, including a Firefox plugin. Like other NX-based solutions, it runs over ssh.

In order to do that, I would just install the ubuntu-desktop package, then install x2go. If you don't already have openssh-server installed, you'll need that one too, but if it's a headless server, I guess you already have that. You don't say which version of Ubuntu you're using, but if it's 11.10, then you'll probably want to test Unity 2D. The X2go client might need to be configured for that. It's likely that you'd also want to disable LightDM or GDM as it'd serve no purpose on a headless server. The easiest way to do that might be to simply uninstall it.

There are also other desktop environments you might want to try. LXDE is really fast and quite suitable for a terminal server. So if Xfce.


How do I disable Touchpad corner functionalities? (e.g. copy, paste, context, right-click)

In terminal, type: synclient RTCornerButton=0. This solved the problem on me.

Execute synclient -l to list all configurations.


Does Steam install games to the / (root) partition?

By default Steam stores games in your home directory (hence home partition) under ~/.local/share/Steam, not in the root partition - Steam I don't think is made to have games available system-wide. When you install a game it gives you a option to install it elsewhere:

As you can see above, I have created a folder extra in the root partition under which I install steam games that won't fit in my home directory (this folder also means I have somewhere to put stuff if I run out of space on another partition):

Here are the commands I created that directory with (you could easily call it something else):

sudo mkdir /extra
sudo chown -R $USER:$USER /extra

The first step creates the directory, the seconds makes sure you can access it as a normal user.

I don't where you got your drive size recommendations from, but I would say a / partition with a minimum size of 20GB (mine contains 25 Gb of files excluding the above Steam installed game, possibly due to other non-steam games and VM programs installed to the root partition), to allow enough space to install various programs to meet your needs (total size of my root partition is 50 Gb). Swap needs to be sized to meet your RAM size (also depending on whether you want to hibernate the computer or not - a opinion on how to do this is here). With swap you can also create a swap file which is one of the partitions, see here


How to separate command output to individual lines

Instead of ill-advisedly putting ls output in a variable and then echoing it, which removes all the colors, use

ls -a1

From man ls

       -1     list one file per line.  Avoid '\n' with -q or -b

I don't advise you do anything with the output of ls, except display it :)

Use, for example, shell globs and a for loop to do something with files...

shopt -s dotglob                  # to include hidden files*

for i in R/*; do echo "$i"; done

* this won't include the current directory . or its parent .. though


Similar to this thread on Unix & Linux the error is caused by "accessability warning" which is known as a bug.

The solution is to edit your ~/.bashrc file and put in the following line(s) (the comments (beginning with #) are optional):

# gedit error: ** (gedit:143): WARNING **: Couldn't connect to accessibility
# bus: Failed to connect to socket /tmp/dbus-qyusGiP2Dq: Connection refused
# As per: https://unix.stackexchange.com/questions/230238/starting-x-applications-from-the-terminal-and-the-warnings-that-follow
# This also speeds up gedit load time
export NO_AT_BRIDGE=1

The error message will go away and gedit will appear to load faster (at least on an Samsung Pro 960 bench-marked at 2.2 GBps on Linux and 3.4 GBps on Windows 10).


Network manager applet shows 'not connected', and one unmanaged Wired connection, internet working

Set /etc/NetworkManager/NetworkManager.conf back to:

managed=false

Set /etc/network/interfaces back to:

auto lo
iface lo inet loopback

Change /etc/netplan/01-netcfg.yaml:

Rename 01-netcfg.yaml to 01-netcfg.yaml.HOLD for backup purposes.

sudo mv /etc/netplan/01-netcfg.yaml /etc/netplan/01-netcfg.yaml.HOLD

Create a new file called /etc/netplan/config.yaml...

sudo -H gedit /etc/netplan/config.yaml # create/edit a new file

or

sudo pico /etc/netplan/config.yaml # create/edit a new file

with the following content:

network:
  version: 2
  renderer: NetworkManager

sudo netplan --debug generate # generate new config files

sudo netplan apply # apply new configuration

reboot # reboot the computer

Use the standard NetworkManager menu to configure your "Wired Connection".

Verify Internet operation.


You can set it via curl, this page has examples:

http://docs.openstack.org/api/openstack-object-storage/1.0/content/special-metadata-acls.html


How to lock and encrypt folder and files

I've used encfs from the command line and it works well in Ubuntu 12.10. The program you're trying to use, cryptkeeper, is a Gnome tray applet which brings encfs to a graphical window. However cryptkeeper seems to work with earlier versions of Ubuntu. I also use Ubuntu 12.10 and couldn't get the applet to appear despite cryptkeeper showing as a process in 'top'. I would guess that it's not compatible with the Unity desktop.

The command line isn't difficult for this, so maybe you would like to try this:
Suppose you want to make an encrypted folder inside your home folder called "locked". Open the command terminal and type:
encfs ~/.locked ~/locked (notice the space before each tilde mark)
This command creates both the visible and the hidden folder (hidden one has a dot at the start). encfs then asks for the password (which you want to type carefully) and the encryption level (just press enter for the default).
If you open your home folder in Nautilus or any file browser you'll see the visible 'locked' folder. When you put anything in the visible 'locked' folder it is really being encrypted and stored in the hidden '.locled' folder.
In reality the encrypted folder is mounted in the visible folder. To verify this type:
fusermount -u ~/locked (this unmounts the encrypted 'locked' folder)
and then in your file browser you'll see that everything you had put in that folder is now "missing". (It is really in the hidden .locked folder, all encrypted and safe.) To access this folder again just type: encfs ~/.locked ~/locked
then type your password. You'll see your files again in the visible 'locked' folder.

So what I've suggested is the command line stuff that cryptkeeper would have done under the surface. Hope it's useful!


I think this might be a duplicate of Fonts corrupted, all look the same.

For me, something like this occured when I upgraded from 12.10 (or maybe it was 12.04?) to 13.04. It seemed to be fixed by

sudo apt-get remove pango-graphite


Mobile Partner does not run on Ubuntu 12.04

Try using bam mobile partner happened to me when I used mobile partner.
http://namakutux.blogspot.com/2012/07/bam-huawei-mobile-partner-for-linux.html


Installing a malicious script on PC through PlayOnLinux , would that script be in ubuntu?

The answer is a worrying No.

First off, it is wholly possible that viruses will look for WINE/PlayOnLinux and use these as a jumping point to get control over your system as a whole. Windows programs (if written properly) can detect if they're running in Wine.

Secondly, PlayOnLinux/Wine has a habit of "virtualizing" your Linux filesystem as a drive to the emulated Windows. If some malware (say, Cryptolocker) runs and targets these drives, your files stored within Ubuntu are also at risk. Now, you could block this risk by just disabling the ability for WINE to access Linux files, but then you're losing a key aspect of what makes WINE useful. Plus, a virus could still use Point 1 to pwn your system.

Now, unless you're installing/running untrusted code or prorams, you probably don't have anything to fear. Most software from the PlayOnLinux repos are typically vetted and are considered safe, but you still need to consider the fact that it is still possible for malware to infect those programs, infecting your computer in turn. There is still no better form of anti-virus than a smart (and slightly paranoid) user.

Even if you delete the PoL folder and any executable, the virus itself will be gone from your system, but any effects (like tampered Ubuntu files) will still persist.


Looks like you are missing some java libraries from the error messages. Try:

sudo apt-get install libswt-gtk-3-jni libswt-gtk-3-java

I think those are the correct packages, but when you see error messages like Unsatistified dependency this means you are missing something the program needs to work. So you need to find the package that has that dependency and add it to your computer.


Install a program automatically with terminal (which has menus)

Usually one can try --quiet, -q --help but as you said, this will not work here. We have to build something on our own.

For an unattended installation I find it useful to let the installation be run on a virtual X-server. We can send keys to the X-server and will not mess with the current screen. Therefore we need xvfb form the X.org project. I also want to take screenshots during the installation to see where the process is at and if any errors occur. We need imagemagick for that. Note that imagemagick will only work on X sessions. No wayland support right now.

First download the installer and unpack it.

cd ~/Downloads
wget http://cdn.rowleydownload.co.uk/arm/releases/arm_crossworks_4_1_0_linux_x64.tar.gz
tar xf arm_crossworks_4_1_0_linux_x64.tar.gz
cd ~/Downloads/arm_crossworks_4_1_linux_x64

then execute this script from my gist:

#!/bin/bash
#
# source: https://askubuntu.com/questions/1002349/install-a-program-automatically-with-terminal-which-has-menus
# dependencies: sudo imagemagick xvfb

# constants
SERVERNUM=99
SCREENSHOT=status.png
CROSSWORKS_PID=
XVFB_PID=
PROGRESS_PID=
KEYS_PID=

# function find_free_servernum() taken from xvfb-run
# Xvfb is part of x.org and licensed under MIT
# http://opensource.org/licenses/mit-license.php
#
# Find a free server number by looking at .X*-lock files in /tmp.
find_free_servernum() {
    # Sadly, the "local" keyword is not POSIX.  Leave the next line commented in
    # the hope Debian Policy eventually changes to allow it in /bin/sh scripts
    # anyway.
    #local i

    i=$SERVERNUM
    while [ -f /tmp/.X$i-lock ]; do
        i=$(($i + 1))
    done
    echo $i
}

start_xvfb() {
    SERVERNUM=$(find_free_servernum)
    echo starting virtual DISPLAY at :$SERVERNUM
    export DISPLAY=:$SERVERNUM

    Xvfb $DISPLAY -screen 0 1280x800x16 &> /dev/null &
    XVFB_PID=$!
}

install_crossworks() {
    check_root
    if [ ! -e ./install_crossworks ]; then
        echo crossworks installation file not found
        exit 1
    fi
    timeout --kill-after=90s 90s sudo -n ./install_crossworks &
    CROSSWORKS_PID=$!

    crossworks_enter_keys &
    KEYS_PID=$!

    show_progress &
    PROGRESS_PID=$!

    if wait $CROSSWORKS_PID; then
        echo ok
    fi

    kill "$PROGRESS_PID" &> /dev/null
    kill "$KEYS_PID" &> /dev/null
}

crossworks_enter_keys() {
    # wait for archive to get checked for crc errors
    sleep 5
    # press next
    xdotool key KP_Enter
    sleep 1
    # accept license
    xdotool key Tab Tab Tab space Tab Tab KP_Enter
    sleep 1
    # select install directory
    xdotool key KP_Enter
    sleep 1
    # start installation
    xdotool key KP_Enter
    sleep 60
    # exit installation
    xdotool key KP_Enter
    sleep 1
}

show_progress() {
    while /bin/true; do
        take_screenshot
        echo -n .
        sleep 1
    done
}

take_screenshot() {
    import -window root $SCREENSHOT
    sudo chown $USER $SCREENSHOT
}

check_root() {
    if ! sudo -n /bin/true 2>/dev/null; then
        echo super user is required for installation.
        sudo /bin/true
    fi
}

check_installation() {
    if [ -e /usr/share/crossworks_for_arm_4.1/bin/crossstudio ]; then
        echo Crossworks installed.
        exit 0
    fi
}

cleanup() {
    kill "$PROGRESS_PID" &> /dev/null
    kill "$CROSSWORKS_PID" &> /dev/null
    kill "$XVFB_PID" &> /dev/null
    kill "$KEYS_PID" &> /dev/null
}

trap cleanup EXIT

check_installation
start_xvfb
install_crossworks
check_installation

One big problem was that I was guessing the times the installer takes before the next user input is necessary. It may vary depending on your CPU.

Please also note that the installation script is only valid for installing crossworks. The script will not work for upgrading or uninstalling.

To uninstall crossworks again, execute

sudo /usr/share/crossworks_for_arm_4.1/bin/uninstall

if there are any errors, try to take a look at the status.png that is placed in the current working directory. It is a screenshot from the X framebuffer.

It will look something like this on installation:

Also take a look at /usr/share/crossworks_for_arm_4.1/. Sometimes if installation is aborted this directory is there but not completely filled with all the necessary data.

You can try to get the script more advanced, i.e. by capturing status images when a keystroke is required and comparing their checksum some already saved checksums to see at which status the installation is.


You are not booting in BIOS/CSM/legacy mode. You have no BIOS-mode boot loader installed in the disk's MBR, but you do have EFI-mode boot loaders in the EFI System Partition (ESP; /dev/sda3 on your computer). The fact that your firmware is set to enable BIOS/CSM/legacy mode is irrelevant; on most computers, that option just opens the door for such boots, but doesn't force the computer to boot in that way.

Do not delete the ESP. Your boot loaders reside there, so deleting that partition will render the computer unbootable!

Your description is unclear about what's causing the sluggish boot. Elaboration on this point is required. For instance, does it take a long time for GRUB to appear, or does the system pause for a long time after GRUB appears? It might be helpful to use GRUB to edit the boot options so as to remove the quiet splash kernel options. This should result in a more verbose boot, which may provide a clue about what's causing the slowdown -- you might see errors or be able to notice a message that precedes or immediately follows an inordinate pause. Alternatively, type dmesg > foo.txt and then upload the contents of foo.txt to a pastebin site and post the resulting URL here.


How to get real-time completion/suggestions in Linux terminal?

This Unix & Linux post describes what you want:

  ... I've come across a great, universal tool:
  command-line fuzzy finder.

  It primarily allows you to “fuzzy-find” files (check the rich gif
  animation by the link above), but it also allows to feed arbitrary
  text data to it and filter this data. So, the shortcuts idea is
  simple: all we need is to maintain a file with paths (which are
  shortcuts), and fuzzy-filter this file. Here's how it looks: we type
  cdg command (from “cd global”, if you like), get a list of our
  bookmarks, pick the needed one in just a few keystrokes, and press
  Enter. Working directory is changed to the picked item:

  It is extremely fast and convenient: usually I just type 3-4 letters
  of the needed item, and all others are already filtered out.

It may not be what you're looking for, but the Vim editor with the CtrlP plugin can be used for this:

You'll need to install one of vim, vim-nox, vim-gnome, vim-gtk or vim-athena for this to work. Installation instructions for CtrlP are provided in its website:

  Clone the plugin into a separate directory:

$ cd ~/.vim
$ git clone https://github.com/kien/ctrlp.vim.git bundle/ctrlp.vim

  Add to your ~/.vimrc:

set runtimepath^=~/.vim/bundle/ctrlp.vim

  Run at Vim's command line:

:helptags ~/.vim/bundle/ctrlp.vim/doc

  Restart Vim and check :help ctrlp.txt for usage instructions and configuration details.

If you have never used Vim before, it can be a bit intimidating. Run vimtutor to get an idea of it.


Can I delete /etc/nologin without ill effects?

From man 5 nologin:

If  the  file  /etc/nologin exists and is readable, login(1) will allow
access only to root.  Other users will be shown the  contents  of  this
file and their logins will be refused.

Since your nologin isn't readable, it might as well not exist at all. You can delete the symlink.


Read-only file system like windows embedded FBWF

I think you search something like Ubuntu LiveCD. Take a look LiveCDCustomization: https://help.ubuntu.com/community/LiveCDCustomization
In your case you need build and setup it to your filesystem and flag it readonly.


Error after updating from Ubuntu 10.04 to Ubuntu 10.10

After some research and folowing the lead of the OP http://ubuntuforums.org/showthread.php?p=11611236#post11611236 the conclusion to question was using Boot-Repair

sudo add-apt-repository ppa:yannubuntu/boot-repair && sudo apt-get update && sudo apt-get install -y boot-repair && boot-repair


Are ubuntu software center sources different from apt-get / synaptic?

Some packages in the Software Center may be free but are offered under a proprietary license.  For this reason (the license) they are not included by default in the Ubuntu apt repositories.

When you install one of these packages via the Software Center it will create a new apt source file in /etc/apt/sources.list.d/.  In the case of Master PDF Editor it will create:

private-ppa.launchpad.net_commercial-ppa-uploaders_master-pdf-editor_ubuntu.list

Once that file has been placed in /etc/apt/sources.list.d/ you can then use the regular apt/aptitude commands to update it.

I also want to add that sources like this often require authentication.  If they do a comment will be placed in the source file indicating as such:

$ cat private-ppa.launchpad.net_commercial-ppa-uploaders_master-pdf-editor_ubuntu.list
deb https://private-ppa.launchpad.net/commercial-ppa-uploaders/master-pdf-editor/ubuntu precise main #Added by software-center; credentials stored in /etc/apt/auth.conf

At the end you can see the comment, "credentials stored in /etc/apt/auth.conf".  That file will store a hash of your password like so:

$ sudo cat /etc/apt/auth.conf # Needs root to read the file
machine private-ppa.launchpad.net/commercial-ppa-uploaders/master-pdf-editor/ubuntu
login riskable
password someGobbldyGookHash


If you are using Ubuntu 12.10, you can right-click items in the dash to reveal more info about that item.


Ubuntu 20.04 - Browsers are taking 100% of CPU

I have this problem too. The only way to resolve it is to use the Opera browser so far. Chrome is not an option and Firefox has performance problems.
I hope the Brave browser is able to patch. I really love the Brave browser experience on Ubuntu.


Cannot add Calendars or Events in Korganizer

Your screen shot of adding an event shows no choice for a calendar in the dropdown box.  That is the cause of the "Select a valid collection first." message.  Your main Calendar window shows Birthdays and Anniversaries which should show up in the Event Creation box Calendar dropdown box.  It doesn't - which indicates a corruption in your configuration.  As you do not have any events yet, I recommend uninstalling and reinstalling Korganizer using your Software Center client (e.g., Discover in Kubuntu).
      In setting up your calendars anew, it might be helpful to work your way through the Korganizer Handbook:

https://docs.kde.org/trunk5/en/pim/korganizer/index.html


Probably just a temporary problem with the server. Try changing to the main one or other.


Is it possible to login in Unity when the nomodeset parameter is set?

I assume, in conclusion, that it is not possible to login in Unity when nomodeset parameter is set. If anyone else had any more complete information, please answer and I'll check that as correct answer.


Trying to fix wine and fglrx incompatibilities

sudo apt-add-repository ppa:dwrj87/fglrxfix

sudo apt-get update

this will implement a patch that will allow it to work on 14.10.

after installing just go to additional driver and pick fglrx, or fglrx-updates if you feel lucky. This worked really good for my r7 260x ati card and I play team fortress 2 and diablo 3 on it with no issues.

It'll work until the bug is fixed i think, within wine 1.6.

I have to use the fglrx drivers due to scaling issues, so I was determined to find an answer.


First things first: XDG_RUNTIME_DIR

To answer your first question, "What is XDG_RUNTIME_DIR?", it is an environment variable that is set automatically when you log in. It tells any program you run where to find a user-specific directory in which it can store small temporary files. Note that XDG_RUNTIME_DIR is set by pam_systemd(8), so it is not actually related to X (running programs graphically), which is the problem you seem to be having.

How to troubleshoot

Your second question, "How to troubleshoot this problem?" is a very good one. That means you're interested in not only what the fix is, but also how to figure it out on your own. To start, look at the first error messages first. In particular, searching for No protocol specified or WARNING **: Could not open X display, should show you that the problem is with X (also called The X Windowing System) which is how graphical programs are shown on your screen. Knowing that should raise many troubleshooting questions in your mind.

X DISPLAY

Your next question might be, what is this "X display" that evince can't open? A "display" is the address for your screen.[*] Any program that wants to write to your screen has to know the address. You can see what your X display is by checking the DISPLAY environment variable:

echo $DISPLAY

And you can check what sudo thinks your DISPLAY is by typing:

sudo -s
echo $DISPLAY
exit

If it doesn't show anything, then that's the problem. (See fix below).

XAUTHORITY

But, what if that's not the problem and the DISPLAY is set correctly in sudo? Then you might wonder, does X have some sort of permissions that prevent other users from writing on my display? If you thought that, you'd be right, X has two main authorization methods: xauth and xhost. The most commonly used one today is xauth(1) which uses the XAUTHORITY environment variable. Again, let's check if it is properly set in sudo:

echo $XAUTHORITY
sudo -s
echo $XAUTHORITY
exit

If XAUTHORITY is pointing to a file in your home directory for you, but it's blank when you run sudo, then that's the problem.

FIX: Save the Environment Variables

So, what's the fix? If either the DISPLAY or the XAUTHORITY environment variables aren't getting saved across the sudo, you can tell sudo(8) to preserve the environment by using the -E option, like so:

sudo -E evince

A better way: env_keep

You might well ask, Wait, if -E makes everything magically work, then why isn't it the default for sudo? The answer is that it is a potential security hazard. Environment variables affect the way programs work and you don't want them all being exported from a user account to the root. The "correct" way to do it is to add the line Defaults env_keep += "DISPLAY XAUTHORITY" to the sudoers(5) file using visudo(8). You can check what environment variables sudo preserves by running:

sudo sudo -V

(Yes, you type sudo twice). I recommend putting the line not in the default sudoers file (/etc/sudoers), but in a local file that won't get overwritten when you upgrade your system. You can do that like so:

sudo visudo -f /etc/sudoers.d/local

But wait, what if none of the above works?

I think this is a fairly thorough answer, but if you're still having trouble, there's one other thing I'd suggest. You can use xhost(1) to grant access to a specific user on the local host (your machine) like so,

xhost si:localuser:root

In this case, we're specifying root as the username, since that's the account that sudo runs programs as.

[*]: Q: I've only got one screen, so why does an X display need an "address"? A: It's because X can work not only on your machine, but over the internet. With X, it's easy to run programs on your machine that show up on other internet hosts and programs on other hosts that appear on your screen (assuming you give them permission).


Open Update Manager
Go to Settings button at the bottom left.
Open tab at the botton which says "Notify me of a new version of ubuntu"
select the option that says "All new versions."

You can switch it back to only LTS versions if you find you prefer the stability to new features.


The command xprop WM_CLASS will not work as you expect. Consult man xprop to learn how the program works. To obtain the WM_CLASS and filter out any other information, use
xprop | grep WM_CLASS


Ubuntu 16.04, gcc 4.9, CUDA 7.5.18, includes gcc5 headers

You'll want to add a -Idir flag to your CXX flags in the make file and likely the cmake file. The dir would be the path to the headers you do want to use. If just including the proper directories doesn't work then it would be best to also disable the default include paths with --nostdinc but this shouldn't be needed since it searches the include directories first. To add these flags to the cmake files you have to specify something along the lines of

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -I/usr/local/include -L/usr/local/lib")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I/usr/local/include")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L/usr/local/lib")

from an answer about setting the cmake flags. (The -L flag is to specify libraries that are only searched for in the "" style includes and not the <> style)


Why wont Ubuntu boot unless I remove my windows hard disk?

Since you removed the Windows disk when you installed Ubuntu, the GRUB boot loader has been set up to boot from disk #1 (the only disk in the machine at the time).

Now, you have plugged both disks (Windows is #1, Linux is #2), and told the BIOS to boot the Linux disk. The BIOS start GRUB, GRUB looks for its files on disk #1, except they are now on disk #2. GRUB does not find the files, and fails.


The gsettings command to tweak the hide mode of launcher would be:

gsettings set com.canonical.Unity2d.Launcher hide-mode 2

Do note that this command will work only for Unity-2D and not for Unity-3D.

The supported parameters for this command and what they do:

0: Never hide; The launcher is always visible.
1: Auto hide; The launcher will disappear if it not actively used.
2: Intellihide; The launcher will disappear only if there is an active window over it.


As an ITS release, ubuntu has point releases so you can download the last point release: 12.04.2 so you don'T need to download all updates.


Not able to view all options in Ubuntu desktop

Solved in comments:

  Install the guest additions. Click Devices in the top bar and then Insert Guest Additions CD image. A CD will appear in Ubuntu Click it and it will open. Then you will see a button, at the top of the window that just opened that says "Run this software". Then click it, and click "run in terminal.


It cannot acquire the system info because glxinfo is not installed.

Install the package mesa-utils by clicking on the icon below:

Or by opening a terminal (Ctrl+Alt+T) and typing:

sudo apt-get install mesa-utils

This is bug 914631 on Launchpad.


CRC error during extraction of downloaded compressed tar. Tar file is intact

Try

gunzip DS500-BN-00019-r5p0-21rel1.tgz

Then the file becomes DS500-BN-00019-r5p0-21rel1.tar.

Then try

tar -xvf DS500-BN-00019-r5p0-21rel1.tar

If that doesn't work file may be corrupt. Try to find the file type by using the command

file DS500-BN-00019-r5p0-21rel1.tgz

Check the output and confirm whether it shows gzip compressed data? If not, try after downloading the file once again.

Hope this helps.


How to convert vmdk to bootable Disk or usb

these steps:

Convert the vmdk file to vhd (use a tool to do so)
Flash the vhd file to your USB devices.

then you may know..


How do I setup Ubuntu to boot in the morning and play music?

You have basically two options to get a timer-controlled auto-boot with

In your BIOS, search for the timer-controlled Auto-Bootup-Option and select it. Some BIOSes have this function, BUT NOT all! This depends on the BIOS manufacturer and version. Here you also can define when the computer will boot up.
In your BIOS, you select the Wake-on-LAN option. Now you want to configure your Router so that the router wakes the PC everyday at the time you want via Wake-on-LAN. It could be that your Router doesn't support this function, but it should.

Now, you can configure your Ubuntu so that you have an auto-login and a startup-script that plays the music.

I hope you understand my answer and that it is helpful for you.


Using different internal network mask within a single server

Indeed you will want to start OpenVPN will multiple configs which reside in /etc/openvpn. Please take note that you'll need to make sure that port #### will have to have a different value for each configuration and that you'll be using, as well as those ports opened up on your firewall.

Also, please note that the 125.16/16 subnet is not allocated for personal use. If you use that space in your configuration it will interfere with connectivity to those actual machines. For internal network purposes you'll want to use the subnets listed here:

10.0.0.0    10.255.255.255  (10/8 prefix)
172.16.0.0  172.31.255.255  (172.16/12 prefix)
192.168.0.0 192.168.255.255 (192.168/16 prefix)

Simple config modifications would be as follows:

Config 1:

port 1194
server 10.20.30.0 255.255.255.0

Config 2:

port 1195
server 10.20.40.0 255.255.255.0


Why does my machine display a different hostname?

What you're referring to is called a prompt. Every shell has their default way of displaying this. For Bash, it is

username@hostname:/current/working/directory$

When you run ZSH for the first time, you should get a menu asking you to create a configuration. By selecting (2) to populate your ~/.zshrc with the recommended configuration, you'd get the default prompt that looks like

username@HOST /current/working/directory
 %

Note that in addition to hostname which is the name of your machine, there is such a thing as HOST environment variable. You can print it by echo $HOST. This is what you see in your ZSH prompt. In you case, it seems you've installed Anaconda, and according to this, this variable gets set to x86_64-conda_cos6-linux-gnu after a conda environment activation. You can of course manually reset it back by adding

export HOST=$(hostname)

to the end of your ~/.zshrc.

One of the most well known and elaborate ways to customize the ZSH prompt is using what's called Oh-My-ZSH. As you can find on their website, it is installed simply by

sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

You will find that with Oh-My-ZSH, the possibilities with customization are endless. Here you can find many themes to choose from.


Keyboard layout issues using Ubuntu 12.04 in ssh via X11 for mac

In my case, running Yosemite and the latest version of xquartz, going through ssh -X to CentOS 6.5 in VMWare Fusion, I could not resolve that problem with switching layouts. US and Russian layouts, in my case. When I started, for example, gnome-terminal, I just couldn't switch to my RU language, using any key combinations. So, after half a day of experimenting (I am not really a Linux geek, just kinda "half-of-a-power" user), I found a solution.

Your mac ~/.profile should look like this:

export LC_COLLATE=en_US.UTF-8
export LC_ALL=ru_RU.UTF-8

If you use another language, change LC_ALL= for your language in your MacOs.

Then you need to add the following line at the end of your ~/.bash_profile on your ssh-connected machine (in my case - CentOS 6.5)

setxkbmap -rules evdev -model pc104 -layout us,ru

This goes correctly, especially for the Russian language. But I am sure your OS must have another collection of  layouts. And, at the end - ensure, than you enabled "Follow system keyboard layout" in X11->Preferences->Input tab.

After these manipulations, forwarded through ssh-X11, the GUI of your application will be able to switch layouts, using your usual MacOS shortcut. In my case, Command+Space. Don't forget to restart X11.

Maybe this will help someone ;-)

P.S.: in this example, I worked only with the Russian layout and keymap, so, again, change parameters for your own!


In Thunderbird 17.0.6, how do I remove the [GMail] folders?

You should use the Flat Folder Tree add-on.


Belgian card reader, Ubuntu 17.10

Libraries "libacr38u" https://packages.ubuntu.com/search?keywords=libacr38&searchon=names ... Download xenial packages. And cd Downloads/ && sudo apt install ./libacr38u*

Eid https://eid.belgium.be/en/linux-eid-software-installation Download eid-archive.deb : Todays update = 05 Apr 2018 → Ubuntu 17.10 artful is now included.

When ...

deb http://files.eid.belgium.be/debian artful main
deb http://files2.eid.belgium.be/debian artful main

... is added to /etc/apt/sources.list and the the keys /usr/share/eid-archive/keys/ are installed ( sudo apt-key add * ) you can run sudo apt update and then install eid-viewer etc. http://files.eid.belgium.be/debian/dists/artful/main/binary-amd64/Packages  with apt.


Don't know - I had already an Apple-Trojan in my machine ...
This Trojan was only found by avast, but not by clamTK ... it sounds weird, but I have avast installed for Linux. You can get it here :

http://avast.softpedia.com/#nx_linux

or here it is - as short description specially for Ubuntu :

http://forum.avast.com/index.php?topic=91145.0

More details for little trouble-shooting you find there in forum.avast.com

You will get free License-Code for 1 Year, when you mail to support@avast.com

For emergency cases you can obtain a rescue-CD from Kaspersky for free - it bases on Linux as live-CD :

http://support.kaspersky.com/4162

Rescue-CD of Kaspersky creates a directory for Kaspersky in your home-directory of your Linux-Installation, when running as Live-System, only for to store the recent search-results and for found malware in Quarantaine (to send to Kaspersky-Labs - if new - then delete them).

something forgotten - there can be rootkits too, but this is rare :

  sudo apt-get install rkhunter

and

  sudo apt-get install unhide

Think now this thread is complete.


ModuleNotFoundError: No module named 'apt_pkg' terminal not working

sudo apt install --reinstall python3-apt

This reinstalls apt_pkg, and fixes the error of it not being present in /usr/lib/python3/dist-packages.


Why does my Canon printer cut off margin on one side of double sided pages?

If you install the drivers that Canon supply for this printer?
If you go here http://support-asia.canon-asia.com/contents/ASIA/EN/0100690202.html and click to download and SAVE what will be cnijfilter2-5.20-1-deb.tar.gz

If you open a terminal; copy each command below; line by line; and paste into the terminal and hit the ENTER key after each paste

cd Downloads
tar -zxvf cnijfilter2-5.20-1-deb.tar.gz
cd cnijfilter2-5.20-1-deb

the final command runs the install script; please watch the terminal as it will ask some questions

sudo ./install.sh

we hope this helps


In 16.04 the install of SeLinux would make uninstall of both snap and lxd

AppArmor is a big part of snapd's confinement story, and thus is a hard dependency (by way of ubuntu-core-launcher/snap-confine). There are ongoing discussions for SELinux support as an alternative (mostly to enable other distributions, but might also help in this situation).

lxc/lxd is likely running into the same issue (its containers are typically confined).


AMD Radeon RX 640 not recognized on freshly installed Ubuntu 20.04

Kernel Mode Setting (KMS) is a method for setting display resolution and depth in the kernel space rather than user space.
The Linux kernel's implementation of KMS enables native resolution in the framebuffer and allows for instant console (tty) switching. KMS also enables newer technologies (such as DRI2) which will help reduce artifacts and increase 3D performance, even kernel space power-saving.
With Kernel Mode Setting (KMS), the kernel is now able to set the mode of the video card. This makes fancy graphics during bootup, virtual console and X fast switching possible, among other things (see also this).
I am posting actions that may get you going.
Selective modeset
Selectively disable Kernel Mode Setting for one or the other graphics card by adding to the grub boot line (either temporary or permanent, you already know how to do both)
amdgpu.modeset=0
radeon.modeset=0
i915.modeset=0

for Radeon, Radeon (legacy driver), or Intel, respectively.
The link also provides other alternatives to try.
Combine this with inxi -G as you did, and with lspci -k | grep -EA4 'VGA|3D'.
Reinstall
You may need to access recovery mode and reinstall drivers as shown here.
Perhaps you can access a terminal (e.g. as in here) and do the same.
Related

https://www.notebookcheck.net/Radeon-RX-640-vs-Radeon-620-vs-Radeon-610_9935_9927_9933.247598.0.html
https://forums.linuxmint.com/viewtopic.php?t=122257
https://www.udoo.org/docs-bolt/Operating_Systems/Linux/Known_issues.html
https://itsfoss.com/fix-ubuntu-freezing/


Is there a way to start up System Monitor from the terminal?

The command is:

gnome-system-monitor

If you want to know what application command, navigate to /usr/share/applications, then right click on the application's icon to select "Properties" in the context menu.


Saving more corsor positions (with tput?) in bash terminal

You can use the following function to extract current cursor position in a simple array:

extract_current_cursor_position () {
    export $1
    exec < /dev/tty
    oldstty=$(stty -g)
    stty raw -echo min 0
    echo -en "\033[6n" > /dev/tty
    IFS=';' read -r -d R -a pos
    stty $oldstty
    eval "$1[0]=$((${pos[0]:2} - 2))"
    eval "$1[1]=$((${pos[1]} - 1))"
}

(the source of code used in this function was taken and adapted from this answer)

Now, for example, to save current cursor position in pos1, use:

extract_current_cursor_position pos1

To save current cursor position in pos2, use:

extract_current_cursor_position pos2

To see cursor positions saved in pos1 and pos2, you can use:

echo ${pos1[0]} ${pos1[1]}
echo ${pos2[0]} ${pos2[1]}

To move/restore cursor position to pos1, you have to use:

tput cup ${pos1[0]} ${pos1[1]}

To move/restore cursor position to pos2, you have to use:

tput cup ${pos2[0]} ${pos2[1]}


What happened to the opera-next package?

opera-next was never an Ubuntu package. You got it from http://deb.opera.com

(FWIW, the partner repository isn't part of Ubuntu, either, it's an add-on repository from Canonical, that doesn't obey Ubuntu's rules)


Right click on .jar file
Select "Properties" tab
Select your Java Runtime
Press Set as default

Now you can open/execute any .jar file by double clicking them

UPDATE

If you cannot find "OpenJDK" option, maybe you don’t have the runtime environment installed. Use below command to install it.

sudo apt-get install openjdk-8-jre


Upgrading Ubuntu from 18.04 to 18.10, but the process was terminated, what now?

after a few hours i manage to work it out and was able to fix the broken upgrade. First of all i was not able to reboot the system so i had to do it using the hard reboot (by pressing and holding the power button on my laptop). Then i was not able to boot the system again.

I had to go to the restore mode (holding Shift when system is booting) and then to go Run terminal as root (or something like that)
Then I had to connect to the internet and because my internet was not working i had to edit the file /etc/resolv.conf and place the following nameserver 8.8.8.8 8.8.4.4
Then I ran aptitude (because my apt was going me error i had to run dpkg --configure -a, but this was not helpful, so both apt and dpkg were not working for me), then i press g and then again g (twice) and aptitude start to download and upgrade all the packages that weren't upgrade because the process was stopped when the terminal shut down
Then i quit aptitude and run apt update and apt upgrade. Upgrade was not working again so i run dpkg --configure -a and this time dpkg worked its magic and then i run apt upgrade and if you see everything executing without any errors you are good to go and u can boot your system in a normal way and everything should work fine.

Hope i can help to all the people that were interrupted after starting the upgrading process of Ubuntu


Is sudo required for installing VMware Tools?

On 14.04 and later open-vm-tools from the default Ubuntu repositories is the recommended method of installing VMware Tools on Ubuntu. The Open Virtual Machine Tools (open-vm-tools) project is an open source implementation of VMware Tools. It is a suite of virtualization utilities and drivers to improve the functionality, user experience and administration of VMware virtual machines. Open the terminal and type:

sudo apt install open-vm-tools open-vm-tools-desktop open-vm-tools-dkms

This command will return an error message if you run it without sudo unless you run it as a root user, the same as for installing .deb packages from the default Ubuntu repositories with apt in general.

For descriptions of what these three packages do, run the following command which doesn't require sudo because it doesn't install anything:

apt show open-vm-tools open-vm-tools-desktop open-vm-tools-dkms


The standard Ubuntu NVidia drivers generate some problems on slightly older and slightly newer NVidia hardware.

If you want more then the standard Ubuntu repository drivers, install the xorg.edgers PPA.  As the xorg.edgers group ask not to give installation instructions directly without linking to their page, this is the best I can do for now...

If you don't know what a PPA is or need some guidance about rolling forward and backward of driver versions after reading their page, leave a comment below.


how to set up nat and host only to access server from other computer virtual box

If you need to access from other computer, why don't you just use bridged network?  This is best suitable in your condition.

For host-only network, you can by no means access to other computers or access from other computers.

As for NAT, even host and guest cannot talk to each other without port forwarding.

Please refer the Official Virtual Network document and think again what are you trying to do.


Get specific data in table format using bash script

You could possibly manage like this:

#!/bin/bash
if [[ ! -f "$1" ]]; then
  echo "oops, no such file"
  exit 1
elif [[ $# -lt 5 ]]; then
  echo "oops, not enough params"
  exit 2
fi
sed -n "$2,$4p" "$1" | cut -d ':' -f$3-$5

Notes

sed -n call sed in quiet mode - no printing until we ask for something
"$2,$4p" "$1" print lines from $2 until $4 inclusive in file $1
| cut -d ':' -f$3-$5 print fields $3 to $5 inclusive from whatever sed printed


If you visit https://launchpad.net/~ubuntu-mozilla-daily/+archive/ubuntu/ppa/+packages, you'll see the following image as of today indicating build failures for xenial, bionic, and cosmic:

I'm sure you're aware that nightly builds aren't advisable for regular use. But if you want, you can download builds directly from https://www.mozilla.org/en-US/firefox/channel/desktop/ for 64-bit or 32-bit and follow http://forums.mozillazine.org/viewtopic.php?f=23&t=3041682 where other users of nightly and beta post their observations and report bugs they encounter and bugs they file.

This build will update automatically.


Combine setsid with .bshrc alias or launcher

I don't really understand what you're doing or why you chose such a complex way. All you need to do is add path/to/folder/ to your PATH variable (that is the list of directories that will be searched for executables). Edit ~/.profile and add this line:

PATH=$PATH:path/to/folder/

Now you will be able to run X directly, be it from the commandline or a launcher. Alternatively, point your launcher (I guess you mean .desktop file) to path/to/folder/. Assuming this is a GUI program, there's no reason to have a terminal associated with it.


After fresh installation of XUbuntu 16.04, US layout on USB keyboard after each reboot

I use an Ubuntu 16.04 based Openbox custom spin, and I had the same problem, but with a 'gb' keyboard being reset to 'us'.

My solution:

Open file manager.

Key in 'ctrl+h' to show '.hidden files'.

To '.profile' add this line (without quotes): 'setxkbmap de' (I used 'setxkbmap -layout gb').

I hope this helps.

This is a bug that keeps on cropping up in different releases or after kernel updates, so it seems to be one that's not getting fixed.


Canon MG5300 series won't do duplex printing in 12.04

Canon provides drivers that print duplex on the MG5300 series on Asian servers.

Their recommended installation method failed but another way is available.

How to do it is detailed at in another questions answer.


apt-get -f install gives ominous warning about essential package (Trusty)

Removing apt will not make your system unbootable but it would be a very bad decision.

Look in /var/log/apt/history.log to see which packages you have installed and removed that led to this situation, and carefully reverse every action.


Conky does not starting automatically after boot

This is a classic issue with conky. the solution is usually to have it wait a few seconds. One way to do this is to write a script that calls conky with a delay and add that to your startup applications instead of conky itself:

#!/usr/bin/env bash

## Wait 10 seconds
sleep 20

## Run conky
conky

Save the script above as (for example) $HOME/start_conky.sh, make it executable (chmod +x $HOME/start_conky.sh) and then add it to your startup applications instead of conky.


How do I remove Ubuntu to install Windows?

In order to reinstall Windows, you must boot directly from the stick without launching Ubuntu at all. Do you know what this means or do you need further explanations? Your style of writing is somewhat incomprehensive.


16.04 Oct 10 update breaks wifi and libkmod

Remove this local.conf by

sudo rm /etc/modprobe.d/local.conf

This file has a wrong format.

If you really need this setting (I have no idea why you added it), the correct format of that file is

options drm_kms_helper poll=N

You need to remove the first two lines.

Regarding the wireless adapter do not install bcmwl-kernel-source. This adapter is supported by brcmfmac in kernels 4.4+. It may be blocked by rfkill though.


Thanks to @WU-TANG, I was able to determine the file that was causing the problem, namely ~/.config/mimeapps.list. Simply deleting it and restarting fixed the problem.
However, I still don't understand why this was happening. There was nothing obviously wrong with the file's contents, and xdg-mime query default was showing the correct association.


I typed iptables -F by mistake, how to undo?

According to This Post iptables -F only flushes out the currently running rule set and everything will be back after reboot.

To block ports, you can follow This Howto or use the following (blocking incoming on port 80 as an example):

sudo iptables -A INPUT -p tcp --destination-port 80 -j DROP
sudo service iptables save


I don't have Chromium, but the Software Updater keeps updating some extensions!

To tell if you can remove safely a package I will chose to use apt in shell. Run:

  as @mook765 says using -s option will be a better choice to prevent any mistake

apt-get -s remove chromium-codecs-ffmpeg-extra oxideqt-codecs-extra

And you can see if there are dependencies that are gonna be resolved by removing packages u wanna keep or installing new ones

$ sudo apt-get remove chromium-browser chromium-codecs-ffmpeg-extra oxideqt-codecs-extra
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package 'chromium-browser' is not installed, so not removed
Package 'chromium-codecs-ffmpeg-extra' is not installed, so not removed
The following packages were automatically installed and are no longer required:
  bbswitch-dkms linux-headers-4.4.0-93 linux-headers-4.4.0-93-generic linux-image-4.4.0-93-generic linux-image-extra-4.4.0-93-generic linux-signed-image-4.4.0-93-generic
  nvidia-prime
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  oxideqt-codecs
The following packages will be REMOVED:
  oxideqt-codecs-extra
The following NEW packages will be installed:
  oxideqt-codecs
0 upgraded, 1 newly installed, 1 to remove and 4 not upgraded.
Need to get 648 kB of archives.
After this operation, 1.118 kB disk space will be freed.
Do you want to continue? [Y/n]


'autoconf' 2.50 not found when compiling 'mate-common' 1.15.0

Simply install it without a version number added:

sudo apt-get install autoconf


That I will not get a ton of errors or Ubuntu will run slow?

How do we find out?

Well simple:

download your version of Ubuntu (12.04.2 = what I advise, or 12.10) and make a bootable DVD or USB-stick (this you can do with Unetbootin on both Windows or Ubuntu)
Set your Bios to boot the desired medium; DVD or stick.
And follow the on-screen procedures.

You can test Ubuntu by selecting 'try Ubuntu' (this option will let you test-run Ubuntu and NOT install it) ; check if all your hardware is supported (e.g. Wifi-card/ CD-bay / etc)
If so all went well, you can be pretty shure that installing and using this operating system will go fine.

Things to mind: your graphic card is maybe a pain; download and use, if nessecary, additional drivers.

for more information and how-to's click here !!


Read the documentation on HowToMySql hope that helps.


How to remove ccp when installed from binary?

EDIT: Understanding now you mean you need to use the "source" command (.) in bash, I thought you meant you needed to recompile from source.
Now that you have identified the package as CCP (which I don't know) please look at this wiki related to CCP, seems to be a known issue that you have to source it every time you want it. Put the source command in your .bashrc (or in your case .cshrc or .tcshrc) and it should work fine, this appears to be expected behavior for CCP.
From the linked wiki (in case the link ever breaks):

(t)csh add the following lines to your ~/.cshrc file:
source /where/I/put/ccp4/setup-scripts/ccp4.setup source
/where/I/put/ccp4/setup-scripts/ccp4-others.setup
bash add these lines to your ~/.bashrc file:
. /where/I/put/ccp4/setup-scripts/ccp4.setup .
/where/I/put/ccp4/setup-scripts/ccp4-others.setup
The next time you start a terminal CCP4 will be available.

To uninstall it, just go to the directory where it's installed and rm it:
cd to the location of the ccp4 directory (/usr/local? ~?)
being very careful and not as root(!):
rm -rf ccp4

If it's not installed with a package manager in the first place then dpkg is not going to be helpful, as you stated. You just need to delete the directory and remove any related commands from your .tcshrc/.cshrc file, the files that are called every time you start a new terminal


Google Chrome default page because of Brackets is file:///opt/brackets/www/LiveDevelopment/launch.html

Finally solved.
I had to find this file and remove it:

  $HOME/.local/share/applications/google-chrome.desktop

This topic helped me to solve this problem:
Google Chrome opens in a new window in a new launcher icon


How can I tell how fast the CPUs are running on a POWER8 server?

Yes, on Power /proc/cpuinfo shows the static "nominal" clock speed. The hardware also provides some frequency steppings above nominal that the cpufreq governors will include by default when running in OPAL firmware mode.

The reason 'ppc64_cpu --frequency' is showing different output is because that command reads some hardware counters and generates CPU activity to measure the frequency, therefore typically producing the max frequency of the system since the CPU utilization is increased while running the command.

The cpufreq method displays the actual frequency at that point in time, without bumping up the CPU utilization. So if the system is otherwise idle, cpufreq-info will show the lowest scaling frequency. This is the recommended method to check frequency of the host when running KVM guests since the PMU is shared between the host/guest(s) and the 'ppc64_cpu' method uses PMU hardware counters to measure frequency.


Ubuntu installed to USB key, but not recognized as bootable

UPDATE / 2014-10-20:
My below answer doesn't solve all the problems and it can't be the last word spoken in this regard. I'm keeping this answer here, because the problem described here interfers with the symptoms described in the question. For details about another problem which can't be caused by the BIOS problem, see update on question.

ANSWER:

The problem is a bug in the BIOS which, instead of listing the USB key in the boot menu, doubles the entry for the internal drive:

When selecting the second (doubled) entry for the internal drive, the machine boots from the USB key. Similar bugs (wrong labels, missing entries) exist in the BIOS' options when configuring the boot order.

Machine: Medion Erazer X7827
BIOS Version: (I will add this later.)


You can follow the instructions on the Ubuntu Community Help Wiki

Essentially, you make a file with contents like:

[Desktop Entry]
Version=x.y
Name=ProgramName
Comment=This is my comment
Exec=/usr/share/applications/VVVVVV
Icon=/home/alex/Pictures/icon.png
Terminal=false
Type=Application
Categories=Utility;Application;

Then save it as a *.desktop file in /usr/share/applications

You can also use the Desktop File Validator to make sure you did it right.


Auto Mount Windows Partition in Rhythmbox player

You could build a little shell script "/usr/local/bin/myrythmbox" like
    #!/bin/bash
    mount /media/musicfiles
    rythmbox (or however the commandline would be for starting it ina terminal)
    umount /media/musicfiles

This would first mount the drive, start your player and when that is "done with", unmount the drive again. For this to work, you would need to do three things:

add an entry in fstab mapping your music partition to an (empty) folder /media/musicfiles, making it available for non-roots
/dev/sda8   /media/musicfiles   noauto,user,unhide(...otherOptionsIGuess)   0   7
find out the commandline name of rythmbox
chmod u+x "/usr/local/bin/myrythmbox" to make it executable and put a link to the script into your menu or onto your desktop/starterpage.

I am not quite sure as for the line in the fstab regarding the "otheroptions", but "noauto" should keep the system from mounting the drive automatically and "user" allowing it non-roots to mount it.

Hope that helps,


Disk slowly filling up but no visible file size changes

If there's an invisible growth in disk space, a likely culprit would be deleted files. In Windows, if you try to delete a file opened by something, you get an error. In Linux, the file will be marked as deleted, but the data will be retained until the application lets go. In some cases, this can be used as a neat way to clean up after yourself - application crashes won't prevent temporary files from being cleaned.

To look at deleted, still-used files:

lsof -b 2>/dev/null | grep deleted

You may have a large number of deleted files - that in itself is not a problem. A single deleted file getting large is a problem.

A reboot should fix this, but if you don't want to reboot, check the applications involved (first column in lsof output) and restart or close reasonable looking ones.

If you ever see something like:

zsh   1724   muru   txt   REG   8,17   771448   1591515  /usr/bin/zsh (deleted)

Where the application and the deleted files are the same, that probably means the application was upgraded. You can ignore those as a source of large disk usage (but you should still restart the program so that bug-fixes apply).

Files in /dev/shm are shared memory objects and don't occupy much space on disk (an inode number at most, I think). They can also be safely ignored. Files named vteXXXXXX are log files from a VTE-based terminal emulator (like GNOME Terminal, Terminator, etc.). These could be large, if you have a terminal window open with lots (and I mean lots) of stuff being output.


dislocker doesn't work after upgrade from 17.10 to 18.04

I have finally did it.

Steps to get it to work:

add /usr/lib/x86_64-linux-gnu/ to LD_LIBRARY_PATH:

LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/x86_64-linux-gnu/
export LD_LIBRARY_PATH
in /usr/lib/x86_64-linux-gnu/ i have libmbedcrypto.so.2.8.0 so i had to create symlink as mentioned before by Elder

/usr/lib/x86_64-linux-gnu$ sudo ln -sf libmbedcrypto.so.2.8.0 libmbedcrypto.so.0
after doing that there was also a problem  with libruby-2.3.so.2.3. Doing another symlink solved that problem to:

sudo ln -sf libruby-2.5.so.2.5 libruby-2.3.so.2.3

After that dislocker is finally working and i can decrypt my windows bitlocker encrypted drives.


Ubuntu 12.10 gnome system monitor high cpu usage

Install htop in your system using

sudo apt-get install htop

Now run htop from terminal. Usually the running processes are sorted in the oder of their cpu usage by default. If not change to sort by cpu usage. It'll look something like this.

Now you can find out the process that's hogging your cpu. Kill it or uninstall the software to prevent it from doing so.

Alternative you can use top


Can I open Peazip files on windows operating system?

Yes you can open .zip, .rar, .tar, etc. files in Ubuntu just fine. And create said files that will open in Windows.


This Press F1 to continue looks like a BIOS message which means it has nothing to do with Ubuntu as the OS has not even started to boot at that time yet. Therefore you can not find it in any Ubuntu logs.

As far as I know, the BIOS usually does not have any error logs either, so you won't be able to investigate this further with the help of logs, unfortunately.

What you could do is to check your disk health/S.M.A.R.T. status (see e.g. How can I check the health of my hard drive? or How do I check the health of a SSD?).

Other than this, you can only wait if the same error appears again and maybe reset your BIOS settings and replace the CMOS battery.


How to configure desktop appearance from the terminal?

Most of these settings are stored in the dconf database.

I'd suggest to monitor the dconf change using the donf watch / command and change a desktop setting using the GUI.

So first open a terminal and start the dconf monitoring and open the system settings->Appearance menu :

On close, you can see the above settings stored in the database.

Now to set a value from your installation script you can use for example:

dconf write /org/compiz/profiles/unity/plugins/unityshell/icon-size 32

to set the launcher icon size.

Look at the dconf and gsettings commands man pages, you can set most of your desktop settings by using this method.


KVM Setting Issue (libvirt-sock not found) on Ubuntu 18.04.1 LTS

The sockets are a special type of file that should get created when the libvirt daemon starts.
My guess is, libvirtd is not running - to start it, try:

systemctl start libvirtd

To check it's status, try:

systemctl status libvirtd

It may also not be enabled, therefore would not run by default on reboot - you can fix this with:

systemctl enable libvirtd


How to get the touchscreen on HP ENVY x360 (AMD Raven Ridge) working?

I've been having this same issue with my x360 m6ar004dx.  It has an AMD FX-9800p, and the exact same ELAN touch screen device.  All works in Windows, but doesn't show up in Linux.

In my dmesg, I found an error related to the GPIO.  After scouring for possible solutions, I stumbled on this gem the other day:
https://bugzilla.kernel.org/show_bug.cgi?id=198715#c14

I tried the patch on the latest kernel in Arch Linux, and the GPIO error is gone, and the ELAN device is recognized in xinput.

The problem now is it still doesn't work :(  I tried a cat on all of the input events, and sadly I get nothing from the touchscreen.  Further, the wacom settings don't recognize any devices.

So, while I feel this patch got us 2 steps closer, I'm not sure what to do next.  Perhaps someone will figure it out.


Can't open ODT large file in 16.04 after upgrade from 15.10

Take a look at here, I had similar problem before. Otherwise your document may be corrupted


Also make sure you are mounting the file system read/write.

After immediately selecting 'Drop into root shell prompt' I found the filesystem was mounted read only, which prevents resetting the password.

Choosing the option to remount / as read/write and going back into the root shell prompt enabled the password change.

The command to run prior to changing the password is: mount -rw -o remount /


mp3 to ogg converter plugin for rhythmbox or banshee?

Sound Converter can handle it, if you want to convert a large folder of music.

sudo apt-get install soundconverter


When will Gimp 2.8 come to the software repository?

In October 2012, as part of the 12.10 release.

(GIMP 2.8 was released on 3rd May 2012. The 12.10 release is the first after this date. And 12.10 definitely contains version 2.8.)


I recommend you not to use a manual installation. In this case you have to manually update Java as well. There is a nice workaround with a automatic update function:

https://askubuntu.com/a/368529/153278


upgrading to ubuntu 14.04, edit grub.cfg ro to rw everywhere?

Try this - in the terminal type:

sudo gedit /etc/grub.d/10_lupin

This opens the text editor. Then find the line that looks like

linux ${rel_dirname}/${basename} root=${LINUX_HOST_DEVICE} loop=${loop_file_relative} ro ${args}

and replace ro with rw, then save (you need sudo for the save part)

then you need to rebuild your grub file so (again in the terminal) type

sudo update-grub

Hope this helps.


There is salt used in the crypt method. The same salt always produces the same crypted password. However, the salt is random and then it seems that the whole crypted password is random.

There is salt stored in the crypted password and it is used when checking the password. Password hashing works only one way. When checking the salt is read from encrypted password and password is crypted. If the crypted password is the same as the one in /etc/shadow, the password is OK.

Take a look here: https://en.wikipedia.org/wiki/Salt_(cryptography)


Mounting HFS+ drive over network, write not required

Use slashes (/) instead of backslashes (\).

mount will accept slashes, and the problem with backslashes, even if they are accepted, is that a backslash is also a shell escape character. If you want the mount command to see \\, you would have to put \\\\ on the command line.

So name the host-and-share you want to mount like this:

//FUZZY/Movies

With just that change, your mount commands (except the -t hfsplus one) should be correct. But I recommend writing your Samba mounting commands in a more ordinary fashion, like this:

sudo smbmount //FUZZY/Movies /media/Movies -o username=**,password=**

Thanks to Braiam for correcting a serious error in this command.

(Make sure /media/Movies exists and is empty.)

Even better, if you're invoking this manually anyway, leave off the  ,password=** part; it will prompt you for the password and you can enter it, and then the password won't go into your command history (thus becoming visible in cleartext).


Start windows application with single core in wine

try this.

Open up play on Linux

click on the game you installed then click on configure.
I am using ImageBurn as an example.
Note you need to be running the application.

then click on the wine tab

Then click on Task Manager

right click the task and click on go to processthen right click on the process and click on set affinity.

then unpick the cores you don't want to use.

Hope it helps.


12.10 login error "Unable to mount Floppy Disk"

There is a bug open about this issue.
As a workoraund...you can try to disable the floppy drive in your BIOS's machine.(If nobody uses floppy drive).

Best Regards.


How to remove legal notice from MOTD / Banner for non-root users

clear/remove /etc/legal that contains the message

... or ...

create a file ~/.cache/motd.legal-displayed

Read more: ubuntuforums.org/showthread.php?t=1511335


Computer won't connect to network after coming out of suspend

Try running this code after coming out of suspend mode for resuming the network services:
sudo service network-manager restart


ubuntu 12.04 live cd installation process is extremely slow

I would suggest a different OS that is less resource hungry Xubuntu

Xubuntu 12.04 is a Long Term Support release and will be supported for three years. This contrasts with Edubuntu, Kubuntu and Ubuntu 12.04 which, while also LTS releases, will all be supported for five years.

Xubuntu 12.04 incorporates many changes including that the i386 images use a non-PAE kernel, some default shortcuts were altered and new ones added, plus there were many appearance changes, including a new logo and wallpaper. Fixes were included for Greybird, Ubiquity, Plymouth, LightDM, and Terminal themes.

The release shipped with the Linux v3.2.14 Linux kernel. Pavucontrol was introduced to replace xfce4-mixer as it did not support Pulseaudio. The Alacarte menu editor was used by default.

The minimum system requirements for this release were 512 MiB of RAM, 5 GB of hard disk space and a graphics card and monitor capable of at least 800x600 pixel resolution

An official derivative of Ubuntu using Xfce. Xubuntu is intended for use on less-powerful computers or those who seek a highly efficient desktop environment on faster systems, and uses mostly GTK+ applications.


After resuming my laptop it is unlocked for a while before locking

Nothing seems out of the ordinary about that laptop except that that Atom chip is very, very slow.  Maybe this is making an existing bug more obvious, as in, it should normally lock upon resume a lot faster?

A workaround might be to lock the screen with Ctrl+Alt+L before you close the laptop screen?


The trick was to run my own auth agent, here's what I did:

First I disabled the AuthAgent plugin in Blueman (Bluetooth tray icon -> Plugins -> AuthAgent (uncheck))

sudo apt-get install bluez-tools
bt-agent --capability=NoInputNoOutput

After that, I was able to pair and connect without any confirmation on the Ubuntu Box


How to disable S.M.A.R.T. check for single drive?

This is by no means any kind of recommendation. But it is an answer.

Open the application "Palimpsest". It's installed by default, but usually called something else, although I'm not using English desktop. In Unity, you'll find it if you search for palimpsest, or you can press alt+f2 and type palimpsest.

Select your disk. At the bottom of the upper right column, you'll see something like "SMART-data" with a sub-label similar to "Show SMART-data and run self-tests". Click it. It will open another window. In that window, at the bottom-left, you can check a checkbox to not warn you if the drive fails.

Here are some screenshots for reference:


How do I create a completely unattended install of Ubuntu?

The complete solution is:

Remaster a CD, ie, download a non graphical ubuntu installation ISO (server or alternate installation CD), mount it

$ sudo su -
# mkdir -p /mnt/iso
# mount -o loop ubuntu.iso /mnt/iso

Copy the relevant files to a different directory

# mkdir -p /opt/ubuntuiso
# cp -rT /mnt/iso /opt/ubuntuiso

Prevent the language selection menu from appearing

# cd /opt/ubuntuiso
# echo en >isolinux/lang

Use GUI program to add a kickstart file named ks.cfg

# apt-get install system-config-kickstart
# system-config-kickstart # save file to ks.cfg

To add packages for the installation, add a %package section to the ks.cfg kickstart file, append to the end of ks.cfg file something like this.

%packages
@ ubuntu-server
openssh-server
ftp
build-essential

This will install the ubuntu-server "bundle", and will add the openssh-server, ftp and build-essential packages.

Add a preseed file, to suppress other questions

# echo 'd-i partman/confirm_write_new_label boolean true
d-i partman/choose_partition \
select Finish partitioning and write changes to disk
d-i partman/confirm boolean true' > ks.preseed

Set the boot command line to use the kickstart and preseed files

# vi isolinux/txt.cfg

Search for

label install
  menu label ^Install Ubuntu Server
  kernel /install/vmlinuz
  append  file=/cdrom/preseed/ubuntu-server.seed vga=788 initrd=/install/initrd.gz quiet --

add ks=cdrom:/ks.cfg and preseed/file=/cdrom/ks.preseed to the append line. You can remove the quiet and vga=788 words. It should look like

  append file=/cdrom/preseed/ubuntu-server.seed \
     initrd=/install/initrd.gz \
     ks=cdrom:/ks.cfg preseed/file=/cdrom/ks.preseed --

Now create a new iso

# mkisofs -D -r -V "ATTENDLESS_UBUNTU" \
     -cache-inodes -J -l -b isolinux/isolinux.bin \
     -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 \
     -boot-info-table -o /opt/autoinstall.iso /opt/ubuntuiso

That's it. You'll have a CD that would install an Ubuntu system once you boot from it, without requiring a single keystroke.


Difference between linux-image-5.11.0-16-generic & linux-image-generic-hwe-20.04?

Primarily package names.
The first you list is for hirsute or 21.04 a standard/interim release.
Ubuntu kernels for standard release are re-packaged for LTS (long-term-support) releases where HWE is enabled.  The second is the LTS packaged version for boxes using the hardware enablement (HWE) stack.
The second package name you list will change over the life of the system, it was 5.8 (20.10 kernel) before the 21.04 kernel is introduced... ie. the kernel inside will change before it reaches it's final 22.04 (GA stack) kernel.
See

https://wiki.ubuntu.com/Kernel/LTSEnablementStack
https://wiki.ubuntu.com/Kernel/RollingLTSEnablementStack


How to open Network PC there folders in Net Beans by open project option

In Ubuntu 13.10 is located in

/run/user/USERNAME/1000/gvfs/SHARENAME


Ubuntu 12.04 cannot connect to wireless network (wireless card unspecified)

Wireless support can be dependent on your wireless chip.  I would recommend using lspci (terminal command) to find your wireless chipset and then google around using that information to see if others have theirs working.  good luck!


From the comments...

re:  I get the purple screen and choose Ubuntu (as normal), but then I am greeted with BusyBox and it won't let me get to Ubuntu for some reason.

At the busybox prompt, type fsck -f / (you may have to type exit and then fsck -f /) to fix any file system corruption.


Deleting GRUB2 which is placed in sda? And how to fix two Ubuntu entry in EFI Boot selector?

Boot from a ubuntu image in UEFI mode. Select "Try without installing".

First run sudo apt-get install efibootmgr (No need an internet connection)

Then view the entries using sudo efibootmgr -v. Which gives a lot of entries like this:

$ sudo efibootmgr -v
BootCurrent: 0000
Timeout: 0 seconds
BootOrder: 0000,0001,0003
Boot0000* rEFInd Boot Manager   HD(1,28,96000,bc34b60c-6611-492f-99b0-d2c37bd77f48)File(\EFI\refind\shim.efi)
Boot0001* fedora    HD(1,28,96000,bc34b60c-6611-492f-99b0-d2c37bd77f48)File(\EFI\fedora\grubx64.efi)
Boot0003* ubuntu    HD(1,28,96000,bc34b60c-6611-492f-99b0-d2c37bd77f48)File(EFI\Ubuntu\grubx64.efi)

Then try deleting an entry ubuntu using the following code

$ sudo efibootmgr -b 3 -B


Problem changing resolution using xrandr: BadMatch

Seems that you're trying within VirtualBox. If it's the case, just install VirtualBox Guest Addition, you can get any resolution (by resizing the VirtualBox window)


why dont you try upgrading the kernel to 3.1.0 to remove the bug.

Donwloading from the Mainline the linux-image-3.1.0-030100rc10-generic. Installing it. Rebooting with it and the ubuntu 11.10 is running with the 3.1.

http://www.howopensource.com/2011/08/how-to-install-linux-kernel-3-1-rc2-oneiric-in-ubuntu-11-04-10-10-and-10-04/

                             if you want to downgrade

Ubuntu Packages Search: http://packages.ubuntu.com

Picking natty-updates kernel linux-image-2.6.38-10-generic : http://packages.ubuntu.com/natty-updates/linux-image

Downloading it and installing with the command:

sudo dpkg -i linux-image-2.6.38-10-generic_2.6.38-10.46_i386.deb

reboot.


There is a syntax error in the add-apt-repository file.

Open a terminal and execute :

sudo apt-get update
sudo apt-get install gksu
gksudo gedit /usr/bin/add-apt-repository

Add ( to the beginning and )) at the end of the command

print _("The %s named '%s' has no PPA named '%s'"

... so that the print command afterwards correctly reads ->

print(_("The %s named '%s' has no PPA named '%s'"))

Save the file - now you should be able to add repositories.

Note : Here is the the link to the PPA you want to add ->
https://launchpad.net/~openjdk-r/+archive/ubuntu/ppa

There you can see, that the command in the Java 8 answer
sudo add-apt-repository ppa:openjdk-r/ppa is correct.


Try:

sudo apt-get install libxcursor1:i386

(this will install 32-bit library)


apt-get is broken and I can't install anything (update issue)

You are running 17.10, not 16.04. You should migrate to a supported release of Ubuntu.

Your apt update output seems to indicate that you are running 17.10 (Artful).Here's an example:

Ign:2 http://archive.ubuntu.com/ubuntu artful InRelease

See how it says "artful" (17.10) instead of "xenial" (16.04)?

17.10 has reached End of Life, those repositories have been withdrawn (that's why you cannot reach them), and we no longer provide support for it.

There are several easy ways to migrate to a supported release of Ubuntu. We strongly recommend backing up your data before trying any of them, since your system may have problems that we don't know about. A simple do-release-upgrade will attempt to migrate your system to 18.04 (bionic), which is fully supported. Alternately, you can create a new install USB for any supported release of Ubuntu, and simply overwrite your current system.


Laptop started crashing on resume, but only on battery

I have been having a similar problem mid-December with my Precision 7530. I could suspend my computer plugged in or running on battery, but I could not resume while running on battery.

I have tried stock Ubuntu 18.04.x, and Pop! OS 18.04 and 19.10. All were running variants of kernel 5.3.x, although Pop! OS builds their own kernel. BIOS upgraded to 0.1.12.1, the latest version at this time per Dell's website and firmware-manager. The computer is using my NVidia GPU, although the problem still happens with Intel graphics. No extra flags added my kernel parameters in /etc/default/grub.

I was clued into a solution by reinstalling my OS, and suspend/resume worked fine, until I installed updates. One of the updates is the intel-microcode package.

Rolling back intel-microcode from 3.20191115.1ubuntu018.04.2 to 3.20180312.0~ubuntu18.04.1, and apt-mark hold intel-microcode seems to have fixed the problem for now.

On a related note, my loaner Dell Precision 5520 with similar hardware specs running an up-to-date version of Pop! OS 18.04 does not have this problem.


Ubuntu 18.04 Terminal, Software & Updates, Software Updater not working

you can try to update your system from command line :
Open the terminal then type :

sudo apt update

You can try to upgrade your system from command line :
Open the terminal then type :

sudo apt update && sudo apt upgrade

You will have an error probably, just copy past it here.

  best regards


Fresh Ubuntu 16.04 Install no internet (wireless nor wired)

So my ultimate fix was to connect to an internet source using eno1 aka using an ethernet instead of tethering my phone. Once connected I did as sudo apt-get update and sudo apt-get upgrade.

After this I decided to start trying some of the fixes I had tried before and the first one I tried worked, namely: on the IPv6 setting, set the method to ignore.

You go to setting > network > wireless.
Click settings on the bottom left description card of your router. Go to the IPv6 tab and set method to ignore.

After a reboot my wireless was up and running. Thanks all.


How to enable display of framebuffer images (e.g. in w3m, fbi) within byobu (pts)?

As Braden Best's answer says, you need to add your user to the video group.
But you can also do it with the following command:
sudo usermod -a -G video {your username}

Log out and back in (or reboot) after doing this to see the change.


Can I get Unity-style Super+[1-9] keyboard shortcuts for launching apps in Gnome Shell?

Option 1: Gnome Shell extension: AppKeys

This extension emulates the Unity behavior in Gnome Shell:
https://extensions.gnome.org/extension/413/dash-hotkeys/

Does exactly what is expected and adds some more key bindings, like opening a new window for the application with Super+Shift+[1-9]. Confirmed working in Ubuntu 14.04.2 and Gnome Shell 3.10.4.

Option 2: xbindkeys & wmctrl

While It's not as user-friendly to setup and manage, you can get this kind of functionality in many environments, by using wmctrl and xbindkeys.

Xbindkeys can set to start at login. It will monitor a file called .xbindkeysrc, which can contain lines like this:

#Launch or switch to E-mail
"wmctrl -xa Thunderbird || thunderbird"
    Alt + 2

#Launch or switch to Konsole
"wmctrl -xa Konsole || konsole"
    Alt + 3

#Launch or switch to IRC client
"wmctrl -xa Xchat || xchat"
    Alt + 4

Like Unity, with this recipe you set up a key to switch to an application if it is running, or launch it if is not. I used Alt here, but you could use Mod4 instead, I think.

Option 3: Use workspace-switching shortcuts

Something similar is to assign keyboard shortcuts that switch to specific desktops (or "Workspace"). If you run one application per workspace, then the shortcut effectively switches to that application. Look under Keyboard: Shortcuts: Navigation for the place to set the workspace-switching shortcuts.

Option 4:  gnome-shell-extensions-windows-navigator

After installing this Gnome extension, in overlay mode you can hold the ALT key and see a number assigned to each window. You can then press the number to switch the window. More here, including installation instructions.


Does XFCE/Xubuntu have a system monitor panel applet?

You can install Multiload-ng or XFCE4-hardware-monitor-plugin as all-in-one solution. Also some separate solutions are in the xfce4-goodies package.
Tested on Linux Mint XFCE Edition 20.1 x86_64 (clean install).
Actually, after building Multiload-ng correctly on XFCE desktop environment, there will be three apps from this package:

Standalone app (has its own window, not embedded in any panel)
Panel plugin (version of your desktop environment is automatically detected during build)
Standard system tray app

So, you can use Multiload-ng-systray version even if your panel is not supported or you can not resolve some panel-specific dependencies (in such case remove --disable-autostart option during build).
Installing Multiload-ng
Update your OS:
sudo apt update
sudo apt upgrade

Install dependencies (depends on your system, check for warnings and errors during build):
sudo apt install git autotools-dev automake libtool intltool libgtk2.0-dev xfce4-panel-dev

Clone source code:
git clone https://github.com/udda/multiload-ng

Build (check for warnings and errors):
cd ~/multiload-ng
./autogen.sh
./configure --disable-autostart
make

Install:
sudo make install

Installing XFCE4-hardware-monitor-plugin
Update your OS:
sudo apt update
sudo apt upgrade

Install dependencies (depends on your system, check for warnings and errors during build):
sudo apt install git libgtkmm-2.4-dev libgnomecanvasmm-2.6-dev libgtop2-dev libxfce4ui-1-dev build-essential libgtk2.0-dev xfce4-panel-dev intltool

Clone source code:
git clone https://git.xfce.org/archive/xfce4-hardware-monitor-plugin/

Build (check for warnings and errors):
cd ~/xfce4-hardware-monitor-plugin/
./autogen.sh
./configure --prefix=/usr
make all

Install:
sudo make install

The screenshot below also includes xfce4-weather-plugin and xfce4-datetime-plugin from official repo.


Should I install AMD Catalyst drivers or the open source drivers to play HoN?

I'd say first try the proprietary drivers, they generally have the best performance, while the open source drivers are generally suited for non-demanding GPU tasks, at least that's the case with Nvidia.

Some people want to not be dependent on the hardware producer releasing and updating drivers, so they choose an open source one.


Alt + right click does not work to edit GNOME panel in Unity

I had the same problem as you have, then I tried this combination: Alt + Super + Right Click and it worked!