Using update-java-alternatives with openjdk 8 updates java but not javac

This seems to be a bug in 'update-java-alternatives`.

Debian bug report: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=825987
Ubuntu bug report: https://bugs.launchpad.net/ubuntu/+source/java-common/+bug/1603692

These reports also contain patches to fix the described behaviour.


How to successfully restart a network without reboot over SSH?

Turns out this is a "feature". The only supported way of restarting an interface in Ubuntu Server is sudo ifdown eth0 && sudo ifup eth0

https://bugs.launchpad.net/ubuntu/+source/ifupdown/+bug/1301015


Downloaded Ubuntu ISO always has wrong checksum?

I would suggest downloading from a different source and then checking the md5. I have good results from linuxtracker.org for both speed and reliability with checksums.


If your directory structure is as follow:

├── subfolder1
│   ├── foo.txt
│   └── bar.other
└── subfolder2
    ├── foo2.txt
    └── baz.old

Running the following command:

find . -maxdepth 1 ! -path . -type d -exec sh -c "mkdir {}/newfolder && mv {}/*.txt {}/newfolder" \;

Will create the below tree structure:

├── subfolder1
│   ├── newfolder
│   │   └── foo.txt
│   ├── bar.other
└── subfolder2
    ├── newfolder
    │   └── foo2.txt
    ├── baz.old


There are some issues with certain manufacturer implementations of the wireless N standard that doesn't play nice with Linux.  Also sometimes having wired ethernet up can interfere.  I wrote a quick script that I placed into my public GitHub repository that fixes this on most people's systems.  You can find it here: https://github.com/FreedomBen/handy-bash-scripts/blob/master/fixTheInternet.bash

Run that script each time you boot up, and your wireless should work well.  It will be limited to G speeds, but that's still really fast.

If you'd rather run the commands in a terminal yourself, here they are.  The script is handy though because you can just run it everytime you boot and you don't have to remember these commands:

sudo ifconfig eth0 down
sudo modprobe -r iwlwifi
sudo modprobe iwlwifi 11n_disable=1


Sim City 4 (Wine) crashes on Key Press, not sure why?

Fixed under Steam version by disabling the in-game overlay thusly: http://forums.steampowered.com/forums/showthread.php?t=3168263

This was disguised by the fact that my CD copy became broken, though it would install it would crash frequently. I purchased a Steam copy and the crash persisted, I recently figured out this was why.


Can't ping Ubuntu Server from Outside network

Ping uses the ICMP protocol, not TCP, so port forwarding is not at all relevant with ping replies. Ping is just a first diagnostic tool, sometimes you don't get a reply but still everything seems to work fine... The webserver is up, you can connect through ftp and ssh, so no problem.

You could use NAT but i am guessing it is a home network and 139.228.159.132 is your only public IP address, so it's not a good idea.

Check whether your router has any settings for ICMP requests. If not that's as much as you can do about it. You can live without ping replies :-)


apt-get commands are failing with libpython3.3 unmet dependencies

Apparently nobody flagged the different versions of the Python packages as conflicting. Therefore apt-get cannot correctly resolve the dependencies and replace, remove, and add the packages in the right order.

As a workaround you can remove the conflicting packages manually while overriding dependency issues. You may need to play around a bit with the order (as I don't know the exact dependency chains here), but the general idea is to run

dpkg -r --force-depends libpython3.3-minimal libpython3.3-stdlib

This may crash/break running applications or system services relying on Python 3.3 and you may need to restart them after upgrading.


how to install an binary and execute it from other folders 12.10

You need to create a link to the binary in one of the directories in your path.  You can check which those are by running:

echo $PATH

but the best place to put it is probably /usr/local/bin/ like so:

ln -s ./jq /usr/local/bin/


Wildcards in exclude-filelist for duplicity

The two formats are not compatible, so you have to do some changes to the list to get it to work. If you want to re-use your exclude list from rsync you have to:

use --exclude-globbing-filelist on duplicity
prefix each line of your rsync's exclude list file with **.

You can achieve the latter with sed:

sed -e 's/^/**\//' rsync_backup_exclude_file >> duplicity_backup_exclude_file


Different computer with the same hard drive won't boot

After following this answer

Trying to single install on MacBook Pro but won't automatically boot from new OS?

I was able to get it to boot with a live USB's grub menu.  However, something went wrong with the rest of the steps and while trying a few other things I formatted my boot partition.

I had to reinstall and transfer my files from backup.  Everything is working now from a fresh Ubuntu install.


Finding Mouse click position in IconView in GTK

To get the path, you should be able to do something like this (untested):

    def on_iconview_selection_changed(self, widget):
        try:
            path = widget.get_selected_items()[0]
        except IndexError:
            # No icon selected, so the list returned by get_selected_items() is
            # empty and indexing returns an IndexError
            path = None


Ubuntu (dual boot Windows) Ethernet Not Connecting/Detecting

The bible of network connection problems

The best place to start is with your favorite bible of network connections like this (wiki.archlinux.org - Enable WOL in Windows driver) from ArchLinux.

Although there are dozens of things you can try:

1 Check the connection 2 Set the hostname
2.1 Local network hostname resolution 3 Device driver
3.1 Check the status
3.2 Load the module 4 Network interfaces
4.1 Device names
4.1.1 Get current device names
4.1.2 Change device name
4.1.3 Reverting to traditional device names
4.2 Set device MTU and queue length
4.3 Enabling and disabling network interfaces 5 Configure the IP address
5.1 Dynamic IP address
5.1.1 systemd-networkd
5.1.2 dhcpcd
5.1.3 dhclient
5.1.4 netctl
5.2 Static IP address
5.2.1 netctl
5.2.2 systemd-networkd
5.2.3 dhcpcd
5.2.4 Manual assignment
5.2.5 Calculating addresses 6 Tips and tricks
6.1 ifplugd for laptops
6.2 Bonding or LAG
6.3 IP address aliasing
6.3.1 Example
6.4 Change MAC/hardware address
6.5 Internet sharing
6.6 Router configuration
6.7 Promiscuous mode 7 Troubleshooting
7.1 Swapping computers on the cable modem
7.2 The TCP window scaling problem
7.2.1 How to diagnose the problem
7.2.2 Ways of fixing it
7.2.2.1 Bad
7.2.2.2 Good
7.2.2.3 Best
7.2.3 More about it
7.3 Realtek no link / WOL problem
7.3.1 Enable the NIC directly in Linux
7.3.2 Rollback/change Windows driver
7.3.3 Enable WOL in Windows driver
7.3.4 Newer Realtek Linux driver
7.3.5 Enable LAN Boot ROM in BIOS/CMOS
7.4 No interface with Atheros chipsets
7.5 Broadcom BCM57780
7.6 Realtek RTL8111/8168B
7.7 Gigabyte Motherboard with Realtek 8111/8168/8411 8 See also

We'll start with the most likely based on limited information given that the network card works in Windows but not Ubuntu. This is outlined in the next section.

Windows disables NIC (Network Interface Card) on shutdown

When a BIOS feature known as Wake on LAN (WOL) is disabled your NIC will have no blinking LED's indicating connection and no connection to your router. Windows can disable your NIC on shutdown. To prevent this from happening on Realtek cards under Windows XP (example) use:

Right click my computer and choose "Properties"
--> "Hardware" tab   --> Device Manager
 --> Network Adapters
  --> "double click" Realtek ...
   --> Advanced tab
    --> Wake-On-Lan After Shutdown
     --> Enable

This may not solve the OP problem because exact details are not given. However there is a high degree of confidence that one of the other solutions on this web page will solve the problem.


Terminal: Jump to directory found with find

I'd use bash's history support to do this. After any command, you can reference it again with !!:

[jk@pecola tmp]$ find . -name test.text
./directory1/directory2/directory3/test.text

To perform a ls -l on the output of the last command:

[jk@pecola tmp]$ ls -l $(!!)
ls -l $(find . -name test.text)
-rw-rw-r-- 1 jk jk 0 Jan 23 20:49 ./directory1/directory2/directory3/directory4/test.text

In this example, we use the $(...) syntax to use the output of the command as an argument to another command.

Because !! references the last command run, we now need to be more specific if we want to re-run the find command, since we've run ls since. We can use the !<match> syntax to re-run the last command that started with <match>

[jk@pecola tmp]$ dirname $(!find)
dirname $(find . -name test.text)
./directory1/directory2/directory3

[jk@pecola tmp]$ cd $(dirname $(!find))
cd $(dirname $(find . -name test.text))

[jk@pecola directory4]$ ls
test.text

I also find this handy for re-doing commands which you need sudo for:

[jk@pecola tmp]$ adduser newuser
adduser: Only root may add a user or group to the system.

[jk@pecola tmp]$ sudo !!
sudo adduser newuser


Why doesn't java -version return anything with Oracle's JRE 7?

When installing java I use the following steps and they always work without fail:

Download latest tar from the Oracle website
Extract the contents and move the folder into:

/usr/lib/jvm
Install Java alternatives:

sudo update-alternatives --install /usr/bin/java java /usr/bin/jvm/<jreName>/bin/java 1
Update alternatives (generally is not necessary if you are installing your first Java version but obviously does not hurt to run just to be sure):

sudo update-alternatives --config java
Provide the link to the plugin for your browser:

ln -s /usr/lib/jvm/<jreName>/amd64/libnpjp2.so .mozilla/plugins/

These steps have always worked for me without a single issue. If you are running into any troubles after following these (maybe step 4 could be all you need), then please post more information like:

What java -version actually displays (or is it literally blank?)
The results of sudo update-alternatives --config java

In my experience, I have never seemed to need JAVA_HOME and currently have perfectly working versions of Java with no variable set.


If you want to install some packages in wine, try wine explorer.exe and It would show you an file manager. Then you can double-click the installation media (EXE).

If you want to install some packages in your OS (Linux, probably Ubuntu), Try deb or yum to install the package.


So I finally found my solution thanks to these two sites: here and here.

The first one, with the response of Toon Macharis, helped me to resolve my dpkg:divert problem (need to modify the fglrx.postrm file), and then I was able to purge fglrx with the very good explanation of the second site.

Everything's working now.


Extract a specific pdf from a zip file with lots of pdfs

unzip specific file from zip archive

unzip -j "myarchive.zip" "in/archive/file.pdf" -d "/destination/path/"

In your script

# Set a destination path
dest="/path/to/unzip/to"
# dump pdf to temp text file
tempfile=$(mktemp)
# unzip the file to stdOut and convert it to text
unzip -p "$z" "$f" | pdftotext - $tempfile
if grep -q $searchString $tempfile; then
    unzip -j "$z" "$f" -d "$dest"
    # some text output
    echo "$z -> $f"
fi
rm $tempfile


Go to  ~/.local/share/evolution/calendar and delete the data files there.


Don't see chrome in ubuntu even after installing it

To add the Chrome Browser launcher icon to the list of unity icons, try this

perform a search for chrome - hit Super/windows, type chrome
When the chrome icon appears in search, Click on it to launch the Chrome browser.
Chrome icon should now appear in  unity sidebar
Right click the icon and select Lock to launcher

It should now be fixed into the unity launcher


When I capture a screenshot with shutter it opens automatically

shutter has -e or --exit_after_capture , which is what you're looking for. For example, using shutter -a  -e , you can capture the currently focused window and receive small popup notification that will let you know where screenshot file was saved, but no shutter window will be opened. This can be used in scripts or as keyboard shortcut. Please see man shutter for more info on other command-line switches that shutter has


The package r-cran-rjags is contained in the official precise repositories: http://packages.ubuntu.com/precise/r-cran-rjags


Okay, so we found the solution for this problem. First of all there was a wrong argument number if the netbeans.sh file. So url=$2 should be url=$1.
But also the parsing of the filename and the line number in the script was wrong.

Since the provided string has the form netbeans:///path/to/file?line=[LineNumber] the parsing can be done by:

#!/bin/bash

# extract the protocol
proto="$(echo $1 | grep :// | sed -e's,^\(.*://\).*,\1,g')"
# remove the protocol
url="$(echo ${1/$proto/})"
# get file and line
file="$(echo $url | cut -d\? -f1)"
line="$(echo $url | cut -d\= -f2)"

/home/david/Programs/netbeans-8.1/bin/netbeans --open $file:$line


Boot from a USB stick with a live system on it; it doesn't matter much what Ubuntu version or flavour it is. Then try investigating and maybe even mounting that filesystem manually from a shell in that live system. The internal disk might be /dev/sdc now.
You can investigate partitions with any of
sudo parted --list

sudo fdisk -l

sudo blkid

Once you identified which partition your root filesystem is, you can try to run fsck -f on it for a filesystem check.
Try to mount it; I'd start with a read-only mount:
sudo mount -r /dev/sdc42 /mnt

(/dev/sdc42 being the device you just identified as your root filesystem)
then check /mnt/boot for available kernels and if there is a matching initrd* (the initial RAM disk containing kernel modules).

After reading some more comments above, it appears to me that the protective MBR might be a problem. Basically, it attempts to mirror the GPT partition table to make older tools believe they are seeing an old-style PC ("MS-DOS") partition table. That's alright as long as those older tools never attempt to modify any partitions; if they do, however, the protective MBR (which is what they will change) and the GPT (which contains the true information) may start to mismatch.
The result can be that some OS (not Linux, I am pretty sure) writes to disk blocks outside the current partitions and filesystems. If you experience problems after Windows gaming that would be a hint into that general direction.


Try something like

at now +30 minute
at> gnome-session-quit
at> <EOT>

Install at if not already.


Thunderbird 78.7 - How to sync Google contacts and calendar

Problem solved. On the Mozilla forum, I received a reply, which worked like a charm. So let me summarize, for clarity's sake, the steps to take.

Tools/addons/search:
"TbSync"
"Provider for CalDAV & CardDAV"
Both are installed straight into Thunderbird – no need to download first.

Edit/preferences/general
Scroll to the bottom of that page and find: "Config editor"
Open (you will get a warning, but "accept the risk") Scroll down till you find:
"extensions.dav4tbsync.googlesupport"
Click that line to change from false to true.

Edit/Synchronization settings/Account actions/Add new account/CalDAv & CardDav ->
Find Google down the list, and click it.
Add account name - Just a name. Call it anything, e.g. Work or Private
Click "Next", and now you are in Google territory.

And, oh yes, you have to allow cookies in privay settings.
All your calendars, tasks and contacts will be there, definitely better than ever before, but the process should have been explained. Most people don't think of editing the config list; I certainly didn't.


How to install MySQL DB 5.6.12 (downloaded from mysql.com) on Xubuntu (kubuntu-desktop) 13.04?

You need to download the .deb file, and not .rpm.  Download your desired architecture, either 32bit or 64bit.  Once done, just press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, navigate to the download folder (probably the Downloads Folder), and run the command(s) below:

sudo dpkg -i <package_name>.deb


What do I do if I forgot to pay the $30 shipping on the Ubuntu edge?

According to Ubuntu Edge's FAQ on the Indiegogo page, you can pay for the shipping by making another contribution and selecting the No Perk, Just a Contribution option. There is no need to contact Canonical.

  I contributed to a perk but I forgot to add the extra $30 for
  shipping. How can I increase the amount?

  No problem! If you'd like to add funds for shipping, you can make
  another contribution and select "No Perk, Just a Contribution."


Why does my computer shuts down itself every morning at 6 AM?

To find what's causing it, there are multiple sources you could look up:

check /etc/cron.daily and /etc.cron.d for contained files
check root's crontab using sudo crontab -l
check the system log (/var/log/syslog) which should mention the execution of this event

As it turned out, in your case the cause was in root's crontab:

sudo crontab -l
4 6 * * * /sbin/poweroff # JOB_ID_1

Which is confirmed by your /var/log/syslog, as you wrote:

Jul 26 06:04:01 ubuntu CRON[2593]: (root) CMD (/sbin/poweroff # JOB_ID_1)

Explanation of above crontab line: 4 minutes past 6 on every day and every month, every weekday execute /sbin/poweroff (i.e. switch off the computer). remark: JOB_ID_1 (i.e., everything following a '#' is treated as comment).

Just do a sudo crontab -e to edit that crontab. Using the cursor keys, move the cursor to that line and remove it. Assuming vi will be used as editor, enter dd (which removes that line), followed by :x to save it back and exit the editor.

Now the event is removed, and no longer will be executed -- problem solved.


Partial answer (still not working)

The author of eyefi-config had a mailing list about it for a while.  Deep in the mailing list, I found a post detailing the procedure for the similar X2 card.

Basically, the answer is to create the following files:

cd /media/NAME_HERE_OF_CARD
mkdir -p EyeFi
dd if=/dev/zero bs=16384 count=1 of=EyeFi/reqm
dd if=/dev/zero bs=16384 count=1 of=EyeFi/reqc
dd if=/dev/zero bs=16384 count=1 of=EyeFi/rspm
dd if=/dev/zero bs=16384 count=1 of=EyeFi/rspc

The rest of the setup procedure appears to be what's detailed in the README.

I don't actually have it working yet, but until I have further evidence, I'm blaming that on the server.


Is it possible to remove a particular host key from SSH's known_hosts file?

Use this command to remove entries from known_hosts:

ssh-keygen -R hostname


Changes to sudoers have no effect. Following basic Ubuntu tutorial

The settings you are using will allow your user to run sudo reboot without entering a password. You will always need to run it with sudo though, the best you can get is passwordless sudo for certain commands.

This is because of the way the system works. When you attempt to run, for example reboot, as a normal user, you get this message:

$ reboot
reboot: must be superuser.

This has nothing to do with sudo, the command in question simply checks whether your userid is 1 (the super user) and if it is not, it won't let you run it. You could set up your system to have another user as userid 1 but that would simply change the username of root and would be a lot of trouble for no reason (and would not help you do what you are attempting anyway).

So, unless you are actually logged in as the user whose userid is 1, you will always have to use sudo to run privileged commands. The only workaround would be to create an alias (or a function, or a script) for reboot in your shells's configuration file (~/.bashrc for example):

alias reboot='sudo reboot'

That way, since you have already set shutdown to be passwordless in /etc/sudoers, you will be able to run

$ reboot

and get your desired result.


Try removing bumblebee:

sudo apt-get remove --purge bumblebee

If that doesnt work then try including nomodeset as a boot option in grub. From the main grub bootloader press 'e' to edit the boot parameters. Find where it reads:

quiet splash

Edit to look like this:

quiet splash nomodeset

Hopefully this will solve your boot issue.


how to install new download of 14.04.1-desktop-amd 64.ISO

Coming from Windows shouldn't be a problem for installing an OS.  This installation is no different than installing a Windows ISO OS.  It's exactly the same.

Just burn the ISO to a disk, boot to it, and follow the prompts.

The installation questions in Ubuntu should even be easier.  It basically asks for a user name and password, perform the installation and reboots into the OS.

Upgrading should be just as easy.  The command to upgrade is:

$ sudo do-release-upgrade

Then follow the prompts.  The upgrade is different from Windows upgrade.  I don't think Windows has an equivalent.  It certainly doesn't have this simplicity.  But of course, this being different is a command that you would have had to be provided with to know it.

The system would normally advise you of this command periodically when there is an upgrade available.


Changing the size of the mouse pointer in Ubuntu MATE 18.04 does not work

You should open MATE Control Center, navigate to Appearance (or run mate-appearance-properties) then select active theme and click Customize button, go to Pointer tab and then adjust Size slider:

The dconf command is the following:

dconf write /org/mate/desktop/peripherals/mouse/cursor-size 96

You can reset the value with:

dconf reset /org/mate/desktop/peripherals/mouse/cursor-size


I downloaded through Bash in Ubuntu on Windows 10, but where do the files get saved?

In Windows, go to the directory

C:\Users\<USERNAME>\AppData\Local\Packages\

There you should see a folder named something like  CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc or CanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgsc

And then open

LocalState\rootfs

And you should see the familiar linux directory structure.


Keyboard layout in Ubuntu 13.10 changes after restart

To the left of my cloud icon in the top right of my desktop there are two windows. It seems there is a value in this that was set to Macintosh (En) even though the language to the right was set to Irish. Fixed now


How to install the latest Linux Kernel, Mesa, Intel/AMD GPU drivers, and Xorg.. on Ubuntu 18.04 LTS?

You can use this for AMD, it has a guide on the page.


How can I get into Ubuntu 11.04 when there's no boot menu for it?

There is an Ubuntu help page about this.  You don't have to boot into Ubuntu for this, you can do this from a live CD/live USB.  The gist is that you load it up, mount your hard disk, update grub, and that should then present you with the Grub menu the next time you start the machine.


Installing ClipBucket but installation cannot find ffmpeg

My suspicion is that you have installed FFmpeg in a location that ClipBucket does not look. I do not know ClipBucket at all but there are instructions here for adding in a non-standard $PATH.

If this does not work you need to add the location of FFmpeg to your $PATH, and you should really do this anyway on a well setup system. There are 2 options:

1. Change the local $PATH:

Add the following to your ~/.profile file:

export PATH=$PATH:/opt/ffmpeg/bin

Then run the following command:

source ~/.profile

But this will only have effect for an individual user, you may very well need to make a system change to affect all users:

2. Change the system $PATH:

Add the following to your /etc/environment file:

:/opt/ffmpeg/bin

Add this to the end of the existing $PATH statement so that the whole line will look something like this:

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

You will need to use sudo and your favorite editor to edit this file and don't forget to log out and back in for this to take effect.

3. Testing:

I tested these changes on my own system, the results can be seen with either technique by using the following command:

andrew@corinth:~$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/opt/ffmpeg/bin
andrew@corinth:~

And you can see that now your $PATH is extended and your application should be able to see FFmpeg...

Further Reading:

ClipBucket Docs: FFMpeg


How to add persian/farsi keyboard input method in Lubuntu 14.04?

On the right side of your LXPanel there is a small flag or country code.
If you right click that icon, a menu will pop up.
Choose Keyboard Layout Handler Settings and uncheck keep system layouts.
When you choose add a menu of available languages will be displayed.
Scroll down to Persian and select it.  Move it up if you want it to be default or leave it where it is.  Your choice.
Then re-check keep system layouts.
I believe that it will not take effect until the next boot.


How to add Ubuntu to the Windows XP boot.ini file?

Windows XP? Well...

This has been working since the early days of NT4:

boot into your linux
mount your Windows boot drive R/W to /media/fat
perform dd if=/dev/sdxY of=/media/fat/linux.bin bs=512 count=1 as root, replace sdxY with your linux partition
edit your boot.ini to look like mine:

[boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(5)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(5)\WINDOWS="Microsoft Windows XP Professional" /NOEXECUTE=OPTIN /FASTDETECT
multi(0)disk(0)rdisk(1)partition(1)\WINDOWS="Microsoft Windows XP Professional (Safe mode)" /BASEVIDEO /SOS
c:\CMDCONS\BOOTSECT.DAT="Microsoft Windows XP recovery console" /CMDCONS
c:\linux.bin="Grub (loader)"

Your results may vary: Grub2 might need downgrading to Grub 1.x for this to work.


You can use

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-jdk7-installer

This will install Oracle JVM and will update it when needed.

But if you want to install JVM manually, you should use these commands:

tar -xzf jre-7u51-linux-i586.tar.gz
sudo mv jre1.7.0_51/ /usr/lib/jvm/jre1.7.0_51

Then run

sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jre1.7.0_51/jre/bin/java

and

$ sudo update-alternatives --config java
There are 3 choices for the alternative java (providing /usr/bin/java).

  Selection    Path                                       Priority   Status
--------------------------------------------------------------------------------
* 0            /usr/lib/jvm/java-6-openjdk/jre/bin/java    1061      auto mode
  1            /usr/lib/jvm/ia32-java-6-sun/jre/bin/java   63        manual mode
  2            /usr/lib/jvm/java-6-openjdk/jre/bin/java    1061      manual mode
  3            /usr/lib/jvm/java-6-sun/jre/bin/java        63        manual mode
  4            /usr/lib/jvm/jre1.7.0_51/jre/bin/java       4         manual mode

Press enter to keep the current choice[*], or type selection number:

Follow the instructions on screen. Your numbers would be quite different from mine.


Poor upload speed in KVM guest with virtio eth driver in OpenStack on 3.14

It looks like this wasn't actually kernel related, but instead for some reason upgrading to the 3.14 mainline kernel caused TSO to be enabled on the bridge, tap, and other interfaces that OpenStack automatically create.

After running ethtool -K [interface] gro off tso off on each qbr, qvb, qvo, and tap interface, virtio driver returns to good performance.

Since I need 3.14 for some other changes related to bcache, I ended up patching OpenStack nova in /usr/lib/python2.7/dist-packages/nova/network/linux_net.py to run the ethtool command (via utils.execute with run_as_root=True) each time one of these interfaces is created. So far it seems to be working.


After installing nvidia drivers and Xorg, generate a suitable xorg.conf for a headless server :

sudo nvidia-xconfig -a --cool-bits=31 --allow-empty-initial-configuration

Then, as mentioned here on linuxquestions.org, try :

sudo DISPLAY=:0 XAUTHORITY=/var/run/lightdm/root/:0 nvidia-settings -t -q GPUUtilization


You can try PostScript Development Tools for Eclipse.

It features syntax coloring, outline view, code folding, content assist, auto-edit for brackets, marked syntax errors, debugger, documentation, integration with ghostscript.


apt upgrade: Failed to execute operation: No such file or directory

This answer by @vskubriev may hold the key to forcing the removal.

Essentially:
Add exit 0 after the shebang to /var/lib/dpkg/info/snapd.prerm. Then run the following commands.

dpkg --purge --force-all snapd
apt-get update

Optionally re-install by running apt-get install snapd

If @vskubriev's answer helps upvote it there not here.


How to change the name of localhost to custom name which is available to other users in lan

You should add :

Your Network Ip address          Name you want

Example :

192.168.0.1      My_Pc

127.0.0.1 & 127.0.1.1 are loop-back Ip addresses .

To know your Ip address just type ifconfig in Terminal .

More help Question


How can I make a bash script to change password every day?

Please check out "one time passwords":

https://www.linuxjournal.com/content/configuring-one-time-password-authentication-otpw

https://www.digitalocean.com/community/tutorials/install-and-use-otpw

http://manpages.ubuntu.com/manpages/bionic/man1/otp.1.html

https://wiki.archlinux.org/title/One_Time_PassWord#:~:text=One%20Time%20PassWord%20(OTPW)%20is,which%20will%20never%20work%20again.
(yes, this guide is about arch Linux, but it gives you a starting point)


Random files (invalid encoding) appearing in home directory

It seems that this was due to my failing hard disk. However I'm not sure about this and would post an update if and when this happens again.


How do I disable the sleep button on my keyboard?

Disable the suspend button in your system

gsettings set org.gnome.settings-daemon.plugins.power button-suspend "nothing"

Revert to the default value

gsettings set org.gnome.settings-daemon.plugins.power button-suspend "suspend"

Disable the sleep button in your system

gsettings set org.gnome.settings-daemon.plugins.power button-sleep "nothing"

Revert to the default value

gsettings set org.gnome.settings-daemon.plugins.power button-sleep "hibernate"

Disable the hibernate button in your system

gsettings set org.gnome.settings-daemon.plugins.power button-hibernate "nothing"

Revert to the default value

gsettings set org.gnome.settings-daemon.plugins.power button-hibernate "hibernate"

Settings those options above does not disable the functions in your system, you can still use the cog wheel menu to hibernate / suspend, this only disables keyboard and other buttons you might have in your computer.


In general , backports on Ubuntu is as easy and reliable as backports on Debian (they tend to have the same maintainers). Support can vary a little by package. Backports are, IMO, no more or less official or supported on Ubuntu then Debian. IMO the advice on backports is very very similar between Debian and Ubuntu.

Backports cannot be tested as extensively as Debian stable, and backports are provided on an as-is basis, with risk of incompatibilities with other components in Debian stable. Use with care!
It is therefore recommended to only select single backported packages that fit your needs, and not use all available backports.

http://backports.debian.org/

The Backports Project is a means to provide new features to users. Because of the inherent stability risks in backporting packages, users do not get backported packages without some explicit action on their part. This generally makes backports an inappropriate avenue for fixing bugs. If a package in an Ubuntu release has a bug, it should be fixed either through the Security Update or the Stable Release Update process, as appropriate.

https://wiki.ubuntu.com/UbuntuBackports
It also depends on what you need. Some packages are going to be available in either backports or a ppa, and some you will need to build from source, which is a pain on a server (I do not like to install gcc / build-essential on a server unless absolutely necessary).
In general, due to the lower number of packages, upgrades on a server are easier then upgrades on a Desktop.
In general, I would advise you stay with LTS if at all possible on a server, but if your unique set of packages / requirements require a higher version, go with the most recent release. 14.04 is still in development and I would personally not run 14.04 on a server for anything but testing.


Upgraded to 16.04 and now getting error message

This is an inofensive message and you should not worry about it.

If you do 'man lvmetad' you'll find that it is a daemon that caches disk metadata. If this daemon is not available, lvm will read the metadata from the disk. This may be a problem with very complex systems with hundreds of volumes, but it is not for a desktop.

Every message that says it has been solved by touching grub or after installing some packages, has probably solved by upgrading the system and recreating the grub configuration.

This is a very very low priority bug and was there in Ubuntu and Debian for a while. Probably will dissapear in a upgrade without doing anything.

I've got that message for a while and without any adverse condition.

People complaining to be unable to login are being affected by another error and should continue checking the logs to find it.


You can download Boost.Build from the Boost.Build GitHub webpage. In this archive /tools/build/v2/engine/ is replaced by /tools/build/src/engine. The .zip archive contains a file named bootstrap.sh in the root directory and a tutorial (tutorial.html) which is the same as the official Boost.Build tutorial at Boost.Build tutorial.


Try this to cancel all print jobs.

lprm -

if you happen to need to specify destination for the lprm - command you can get the address of your printer from lpoptions or better yet lpq -a as that will show you all queued jobs from all printers.


Downloaded the Ubuntu ISO from torrent and normal download, but they're not the same size

I think the torrent you downloaded is a 64-bit version of ubuntu, is this correct? Try downloading from the Ubuntu website, and download according to your architecture (if you are not sure, just download the 32-bit version).


my wireless network is not working. i have my wireless info results. what should i do next?

Since your ethernet appears to be working, in terminal enter sudo apt-get install firmware-b43-installer
Reboot and wifi should be working.  If you look at the end of the wireless-info file you will see that it has firmware problems


How to install the OS when testing a bare-metal recovery?

Sample grub menu entry to run live Ubuntu ISO-image:

menuentry "Try Ubuntu without installing 18.04.3" {
  loopback loop /boot/images/ubuntu-18.04.3-desktop-amd64.iso
    set gfxpayload=keep
    linux   (loop)/casper/vmlinuz iso-scan/filename=/boot/images/ubuntu-18.04.3-desktop-amd64.iso   file=(loop)/cdrom/preseed/ubuntu.seed boot=casper quiet splash ---
    initrd  (loop)/casper/initrd
}

Sample for installing Ubuntu from mini-ISO:

menuentry "Ubuntu mini 18.04 64bit cli expert" {
 loopback loop /boot/images/ubuntu__18.04__mini64.iso
 linux (loop)/linux iso-scan/filename=/boot/images/ubuntu__18.04__mini64.iso tasks=standard pkgsel/language-pack-patterns= pkgsel/install-language-support=false priority=low --
 initrd (loop)/initrd.gz
}

And howto install grub onto USB


Why is my Brother DCP-7055 not printing in Ubuntu 13.10?

This worked for me:
http://ubuntuforums.org/showthread.php?t=590793

Copy/pasting for reference:

Step 1:
Open Terminal by selecting Applications ---- Terminal from the task bar.

Step 2:
Type or Copy & Paste the following into Terminal and press enter:

sudo apt-get install tcsh

Step 3: (don't know if it matters but I did it anyway)
From the task bar go to: System ---- Administration ---- Printing, select your printer that's not working then select edit and click delete.

Step 4:
Download the LPR Driver and CUPS Wrapper. Locate your model & download your "Debian" LPR printer driver from HERE.
Locate your model & download your "Debian" CUPS wrapper from HERE.

Step 5:
Now change to the directory where the drivers are. Presuming you downloaded the driver to your desktop Type or Copy & Paste the following into Terminal:

   cd Desktop

Step 6:
Create the lpd directory. This is the first I have encountered this but in Hardy the directory had to be created. Skip this and move on to Step 7 if you're using Gutsy or below. In terminal Type or Copy & Paste the following command:

    sudo mkdir /var/spool/lpd

Step 7:
Install the LPR Driver. In terminal Type or Copy & Paste the following command changing mfc210clpr-1.0.2-1.i386.deb to match the driver you've downloaded. The following line is for the MFC-210C which is also used for the following printers:
DCP-115C, DCP-117C, DCP-120C, DCP-315CN, DCP-340CW,MFC-215C, MFC-425CN, MFC-640CW, MFC-820CW

  sudo dpkg -i --force-all mfc210clpr-1.0.2-1.i386.deb

Step 8:
Create the model directory. As with the lpd directory this is the first I have encountered this but in Hardy the directory had to be created. Skip this and move on to Step 9 if you're using Gutsy or below. In terminal Type or Copy & Paste the following command:

  sudo mkdir /usr/share/cups/model

Step 9:
Now to install the CUPS wrapper driver. In terminal Type or Copy & Paste the following command changing cupswrapperMFC210C-1.0.2-3.i386.deb to match the driver you've downloaded.The following line is for the MFC-210C which is also used for the following printers:
DCP-115C, DCP-117C, DCP-120C, DCP-315CN, DCP-340CW,MFC-215C, MFC-425CN, MFC-640CW, MFC-820CW

  sudo dpkg -i --force-all cupswrapperMFC210C-1.0.2-3.i386.deb

After the installation observe that there are no errors. Here are 2 examples of a successful and unsuccessful installation:

Successful:

  matthew@matthew-laptop:~/Desktop$ sudo dpkg -i --force-all             cupswrapperMFC210C-1.0.2-3.i386.deb
  [sudo] password for matthew:
  (Reading database ... 119742 files and directories currently installed.)
  Preparing to replace cupswrappermfc210c 1.0.2-3 (using cupswrapperMFC210C-1.0.2-3.i386.deb) ...
   * Restarting Common Unix Printing System: cupsd                               [ OK ]
  Unpacking replacement cupswrappermfc210c ...
  Setting up cupswrappermfc210c (1.0.2-3) ...
  rm -f /usr/lib/cups/filter/brlpdwrapperMFC210C
   * Restarting Common Unix Printing System: cupsd                         [ OK ]

  matthew@matthew-laptop:~/Desktop$

Unsuccessful:

    turner@turner-desktop:~/Desktop$ sudo dpkg -i --force-all cupswrapperMFC210C-1.0.2-3.i386.deb
    [sudo] password for turner:
    Selecting previously deselected package cupswrappermfc210c.
    (Reading database ... 91832 files and directories currently installed.)
    Unpacking cupswrappermfc210c (from cupswrapperMFC210C-1.0.2-3.i386.deb) ...
    Setting up cupswrappermfc210c (1.0.2-3) ...
    ERROR : Brother LPD filter is not installed.
    rm -f /usr/lib/cups/filter/brlpdwrapperMFC210C
    chmod: cannot access `/usr/local/Brother/inf/brMFC210Crc': No such       file or directory
    chmod: cannot access `/usr/local/Brother/inf': No such file or directory
     * Restarting Common Unix Printing System: cupsd                         [ OK ]

If your installation was successful please continue at Step 10. If it was unsuccessful please repeat the installation at the LPR Driver installation at Step 7. Copy the output(text from the install commands in the terminal) of both the LPR and CUPS driver installations and save them to a text document for future reference. As there have been reports of errors but the the printer still worked perfectly you may have no problem. Continue on with Step 10.

Step 10: (This is for Gutsy 64bit users only, 32bit users continue onto Step 11 )
If you're using the MFC-210C driver Type or Copy & Paste the following command in Terminal:

  sudo cp /usr/lib/cups/filter/brlpdwrapperMFC210C /usr/lib64/cups/filter

If you're using another driver please adjust MFC210C to suit your model. Example for the MFC-3820CN driver:

  sudo cp /usr/lib/cups/filter/brlpdwrapperMFC3820CN /usr/lib64/cups/filter

If you're not sure you can check by typing the following in Terminal:

   cd /usr/lib/cups/filter
   dir

Step 11:
From the task bar go to: System ---- Administration ---- Printing, select your printer and click Print Test Page. That's It!

Please note that adjusting printer settings for all applications takes place in this Printing Configuration menu by selecting your printer then selecting the tab Printer Options.

Not working?
Some printers might not configure themselves without a few more adjustments as follows:

After completing the driver installation open Firefox and enter the following into the address bar:

   http://localhost:631

Click on “Manage Printers” and confirm that the driver name is listed there.

If the driver name is NOT listed there, click on "Add Printer" and install the driver following the on-screen instructions.

The default port is USB. If you want to use a different port, click on “Modify Printer” and select the required printer port.

Scanner:

Unfortunately the Sane Scanner Driver wasn't quite as straight forward to setup, however it will be a lot easier with these steps:

FIRST MAKE SURE YOUR SYSTEM HAS ALL UPDATES INSTALLED IF YOU HAVE A FRESH INSTALLATION OF UBUNTU.

Step 1:
Locate your model & download the appropriate "Debian" brscan or brscan2 driver from HERE. Please take note that there is a separate driver depending on whether you have a 32bit or 64bit Gutsy installed. Typically it will be 32bit.

Step 2:
Now change to the directory where the brscan or brscan2 driver has downloaded to. Presuming you downloaded the driver to your desktop Type or Copy & Paste the following into Terminal:

   cd Desktop

Step 3:
For the brscan2 32bit driver which most will be using Install with the following command in Terminal:

   sudo dpkg -i brscan2-0.2.4-0.i386.deb

Please note that if you don't use the 32bit brscan2 driver change the brscan2-0.2.4-0.i386.deb in the terminal command above according to your sane driver you've downloaded. Example: brscan2-0.2.4-0.amd64.deb

Step 4:
Confirm you need to continue on with the following steps, I believe it is only Gutsy that has problems. Simply open Xsane, choose you scanner and click OK. If you get an I/O-Error you will need to continue onto Step 5, if it's all working you're done!

Step 5:
Give yourself permission to use it! At time of release it's a Gutsy Quirk/Bug... First we need to find out the Vendor ID & Product ID for our scanner or printer/scanner combo. For anyone using the DCP-115C printer/scanner ignore this step as your ID's are the same as mine; Vendor ID: 04f9 Product ID: 018c.

Any other model type the following in Terminal:

   lsusb

Your output will be something like this:

   matthew@matthew-laptop:~/Desktop$ lsusb
   Bus 005 Device 004: ID 05ca:1810 Ricoh Co., Ltd
   Bus 005 Device 001: ID 0000:0000
   Bus 003 Device 002: ID 03f0:171d Hewlett-Packard
   Bus 003 Device 001: ID 0000:0000
   Bus 002 Device 003: ID 062a:0000 Creative Labs Optical Mouse
   Bus 002 Device 001: ID 0000:0000
   Bus 004 Device 001: ID 0000:0000
   Bus 001 Device 003: ID 04f9:018c Brother Industries, Ltd
   Bus 001 Device 001: ID 0000:0000
   matthew@matthew-laptop:~/Desktop$

Locate Brother Industries, Ltd and take note of your Vendor IDroduct ID as shown in bold in the above output and adjust Step 6 to match.

Step 6:
In Terminal type the following:

Ubuntu:
       sudo gedit /etc/udev/rules.d/45-libsane.rules
Kubuntu:
       sudo kate /etc/udev/rules.d/45-libsane.rules

At the bottom of the page but before LABEL="libsane_rules_end" add the following changing YOUR-VENOR-ID & YOUR- PRODUCT-ID to yours, both are 4 characters long:

   # Brother DCP-115C
   SYSFS{idVendor}=="YOUR-VENOR-ID", SYSFS{idProduct}=="YOUR-PRODUCT-ID", MODE="664", GROUP="scanner"

The last section of 45-libsane.rules should look like this after adding your scanner/printer to the last line:

   SYSFS{idVendor}=="413c", SYSFS{idProduct}=="5105", MODE="664", GROUP="scanner"
   # Dell A960
   SYSFS{idVendor}=="413c", SYSFS{idProduct}=="5107", MODE="664", GROUP="scanner"
   # Dell 922

SYSFS{idVendor}=="413c", SYSFS{idProduct}=="5109", MODE="664", GROUP="scanner"
       # Dell 1600n
SYSFS{idVendor}=="413c", SYSFS{idProduct}=="5250", MODE="664", GROUP="scanner"
       # Brother DCP-115C
SYSFS{idVendor}=="04f9", SYSFS{idProduct}=="018c", MODE="664", GROUP="scanner"

   LABEL="libsane_rules_end"

Step 7:
Save your changes and restart your PC. All going well it will be working!


You can install MonoDevelop 7.3 as FlatPak.

Flatpak is in 17.10 repositories, for previous Ubuntu releases you can use ppa:alexlarsson/flatpak PPA:

#sudo add-apt-repository ppa:alexlarsson/flatpak # for 14.04 LTS and 16.04 LTS
sudo apt-get update

sudo apt-get install flatpak
flatpak install --from https://download.mono-project.com/repo/monodevelop.flatpakref

You can it from Applications->Programming->MonoDevelop menu or from terminal:

flatpak run com.xamarin.MonoDevelop

Traditional APT-like method is not recommended by program authors.


First, you need to install "gcc-multilib" and "g++-multilib"

sudo apt-get install gcc-multilib g++-multilib

Then your current command will work,

$ cat hello.c
#include <stdio.h>

int main(int argc, char *argv[]) {
    puts("Hello, World!");
}
$ uname -a
Linux vbox-1404 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
$ gcc -m32 hello.c
$ ./a.out
Hello, World!
$ file a.out
a.out: ELF 32-bit LSB  executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=80bdc95e2941e3ba8d7bb7c1682098f20e77cebc, not stripped


It will be up to the OEMs and carriers what ships on their phones


Gnome does not remember last file location if you untar a file

There is a bug and a patch submitted, but unfortunately the patch has been sitting there idle for almost two years.


Asus ZENBOOK UX330 UAK finger printdriver

Visit Supported devices in libfrint. If your device is not supported, you can open an issue in their gitlab page to know if it can be supported and whether it is being worked on (check the current list of issues).
The 04f3:0903 Elan Microelectronics Corp. is supported.


If your date/time was structured yy-mm-dd hh:mm:ss instead of day first, then you could perform string comparisons to filter on lines after a given date.  To reformat the data use

sed 's/\(..\)-\(..\)-\(..\)\(.*\)/\3-\2-\1\4/' log > log.reformatted

You can then use awk to print lines after a given date and time by concatenating them together, e.g.

awk '$1 " " $2 >= "17-06-22 06:40:00"' log.reformatted

Your use of date to obtain the time 30 minutes ago is good - just change it to  be in year-month-day format.  You don't need the print $0 action since that is implied if no action is specified.

Note that I assume that "grepping" is intended to mean using Unix tools to filter for a desired subset of the available data.

The original error is likely due to a space between the date and time so that the -v argument only receives the date, while the time appears as a separate argument, confusing awk.  To resolve this use the %H format rather than %k (since your log format is two digit hour anyway), and remove the space between day and hour (as a simplistic solution to the problem).  Then the whole solution becomes:

sed 's/\(..\)-\(..\)-\(..\)\(.*\)/\3-\2-\1\4/' log |
awk -v date=$(date -d "30 minutes ago" +"%y-%m-%d%H:%M:%S") '$1$2 >= date'


Reboot times

We can procrastinate rebooting at times in this world of "overly busy" and not wanting to waste 5 or 15 seconds. When I had first looked at this question my boot times had gone from 45 seconds to 14 seconds with an SSD and systemd tweaking.

Recently I acquired a "modern" laptop with a NVMe M.2 Gen 3.0 x 4 SSD with blazing 3.4 GB/s Windows read speed and 2 GB/s Linux read speed. So it should be faster right? Um... no. It's painfully slower:

$ systemd-analyze
Startup finished in 6.823s (firmware) + 4.447s (loader) + 3.467s (kernel) + 8.412s (userspace) = 23.151s

This time is actually after tweaking. It was much worse 80 seconds because nVidia and Dell choose to cut power to HDMI audio on nVidia GTX970M graphics card which drives the HDMI port. As such a setpci command was required which caused "low grapics error" message and you had to wait 20 seconds for mouse pointer to proceed. Then it would reload all graphic drivers and restart lightdm.

Another problem with the "modern" laptop is BIOS POST was taking 15 seconds. Tweaks in BIOS to turn off hardware error checking, turn off loading boot drivers for NICs and other tweaks I can't remember just now changed BIOS POST time to 6 seconds. By comparison the "old" laptop BIOS POST time was only a couple of seconds using Legacy BIOS CSM and no BIOS tweaking.

Ubuntu's RapidReboot project from 2010

The Ubuntu RapidReboot project mention in ByteCommander's post is from 2010. The project's rationale is summed up thusly:

  Rationale

  There are a few cases where we can safely assume the user does not
  want to see the boot loader; in these cases, we should use kexec to
  avoid long reboots, BIOS POSTs, and boot loader time. This can take 10
  seconds in optimal situations; but with SCSI or RAID BIOS and network
  boot roms, the time can climb to 20, 30, or even over 60 seconds, even
  in cases where the time between loading the kernel and seeing the
  log-in screen is 30-60 seconds.

The project's usage examples:

  Use cases

  Bob has just upgraded his kernel; update-notifier informs him he must reboot for the changes to take effect, and the 'Restart' button
  uses kexec to make this faster.
  Alice just upgraded dbus; update-notifier tells her to restart, and uses kexec.
  Seveas has performed several updates in the past month, and now is under three times as much memory pressure due to different programs
  using different copies of shared libraries. He decides to reboot to
  clear this up, and uses a "Quick Reboot" to make this faster.
  Keybuk just installed Ubuntu Edgy and wants to boot into it. The LiveCD loads the target kernel and initrd with kexec; umounts all
  disk-based file systems; sync; and then uses kexec to start the new
  system rather than rebooting.

Using kexec to reboot

kexec is the magic spell we cast to reboot without BIOS post and some other low level discovery mechanisms such as RAID setup.

Kernel must be compiled with CONFIG_KEXEC flag

The first step is to ensure your kernel was compiled with the CONFIG_KEXEC=y option:

$ uname -r
4.14.2-041402-generic
$ grep KEXEC= /boot/config-`uname -r`
CONFIG_KEXEC=y

The first command uname -r is optional just to show what kernel you've booted with. As we can see on the second command the kernel is compiled by Ubuntu team with the necessary flag set. Not sure when this was added but likely <= year 2012.

Install kexec-tools

The next step is to install the kexec tools for user space:

$sudo apt install kexec-tools

After normal binary downloads you are greeted with this screen:

I answered No in part because of this bug report that the option is not relevant in systemd.

Then the installation continues (snippet shown below):

Unpacking kexec-tools (1:2.0.10-1ubuntu2.4) ...
Processing triggers for man-db (2.7.5-1) ...
Processing triggers for systemd (229-4ubuntu21) ...
Setting up kexec-tools (1:2.0.10-1ubuntu2.4) ...
Generating /etc/default/kexec...
Generating grub configuration file ...
  (... CUT ...)
Found Windows Boot Manager on /dev/nvme0n1p2@/EFI/Microsoft/Boot/bootmgfw.efi
Found Windows Boot Manager on /dev/sda1@/efi/Microsoft/Boot/bootmgfw.efi
Adding boot menu entry for EFI firmware configuration
done
Processing triggers for systemd (229-4ubuntu21) ...

Configuring kexec

Our cohorts at ArchLinux have great documentation for kexec but it needs massaging for Ubuntu / Debian distributions.

Basic usage are with two commands:

sudo kexec -l /boot/vmlinuz-`uname -r` --initrd=/boot/initrd.img-`uname -r` --reuse-cmdline
sudo kexec -e

from this point forward it appears every time you click reboot it automatically reloads the last kernel in fast reboot mode.

Using Systemd to load kexec

Create the file /etc/systemd/system/kexec-load@.service:

[Unit]
Description=load %i kernel into the current kernel
Documentation=man:kexec(8)
DefaultDependencies=no
Before=shutdown.target umount.target final.target

[Service]
Type=oneshot
ExecStart=/usr/bin/kexec -l /boot/vmlinuz-%i --initrd=/boot/initrd.img-%i --reuse-cmdline

[Install]
WantedBy=kexec.target

Then enable the service file for the kernel you want to load, for example to simply set the current kernel uname -r:

$ sudo systemctl enable kexec-load@`uname -r`
Created symlink from /etc/systemd/system/kexec.target.wants/kexec-load@4.4.0-101-generic.service to /etc/systemd/system/kexec-load@.service.

Then to kexec:

$ sudo systemctl kexec

If you have youtube running there might be a system inhibitor preventing you from rebooting in which case use:

$ sudo systemctl kexec -i

If you wish to load a different kernel for the next kexec, for example 4.12.2-041202-generic, disable the service for the current kernel and enable the one for the new kernel:

$ sudo systemctl disable kexec-load@`uname -r`
$ sudo systemctl enable kexec-load@4.12.2-041202-generic

More to come

I have to post this answer now as it's time to boot, fix, boot, fix, repeat. I have a complicated setup where systemd loads five nVidia drivers which I have to unload, run setpci to power on audio to hdmi, reload nVidia drivers and restart lightdm. It might take awhile to work out.

After getting the cli methods working I'll create a desktop shortcut for one-click rebooting with sudo password prompt. After that I'll create a desktop shortcut to a yad dialog box allowing you to pick from installed kernels to reboot. Similar to grub's advanced options menu.


Macchanger returns error in the terminal

"Insufficient permissions" usually means you need to have root privileges. Try using sudo, e.g. sudo macchanger <arguments>.

If that doesn't work probably the other cause is true: "interface up". You have to turn the interface off before changing the MAC address. You can do it with ifconfig <interface name> down, e.g. ifconfig wlan0 down. Then change the mac address. But after that remember to turn the interface on again with ifconfig <interface name> up.


apt-get -f install fails with emacs25 conflict with emacs26

To temporarily fix the issue you can force package installation with

sudo dpkg -i --force-all /var/cache/apt/archives/emacs25-common_25.3~1.gite0284ab-kk1+18.04_all.deb


Wifi not connecting on Ubuntu after I closed my laptop

I have solved the problem and will answer my own question. I shut the screen down, pulled it up. I then clicked 'suspend' and then turned it on by pressing any key. After a few seconds the wifi connected and my rfkill list now outputs

3: phy0: Wireless LAN
    Soft blocked: no
    Hard blocked: no


I cheat and use the list of packages needed to build other big GTK applications instead:

sudo apt-get build-dep inkscape

Or for a more minimal starting point, go with the bare minimum and add on when you need to:

sudo apt-get install build-essential libgtk2.0-dev


Deleted Windows and installed Ubuntu 20.04. Internet is blazing fast then slows down and disconnects completely

This is most likely due to an aggressive power-saving configuration in /etc/NetworkManager/conf.d/default-wifi-powersave-on.conf. Try this:
Open the above system file:
sudo vi /etc/NetworkManager/conf.d/default-wifi-powersave-on.conf

You will see this:
[connection]
wifi.powersave = 3

Change the powersave value from 3 to 2.
Other possible values:
NM_SETTING_WIRELESS_POWERSAVE_DEFAULT (0): use the default value
NM_SETTING_WIRELESS_POWERSAVE_IGNORE  (1): don't touch existing setting
NM_SETTING_WIRELESS_POWERSAVE_DISABLE (2): disable powersave
NM_SETTING_WIRELESS_POWERSAVE_ENABLE  (3): enable powersave


Changing the Default Color Schemes will  resolve the issue

Steps:

Open Terminal Window.
Click Edit in the Menu bar and go to Profile Preferences
Move to Colors Tab and un-check Use Colors from System Theme

Your Problem will be solved


Getting list of installed apps (NOT packages)

Here you are. The result of the following command is a list of comma separated values. First column: path to the .desktop entry, second column: path to the icon, third column: the executable.

find /usr/share/applications/ -name '*.desktop' -exec perl -ne 'BEGIN { $pname = $ARGV[0] ; } ; /(Icon|Exec)=(.*)/ and $ret{$1} = $2 ; END { printf "%s,%s,%s\n", $pname, $ret{Icon}, $ret{Exec} ; }' {} \;

Explanation: find prepares a list of files that end with .desktop and are found in /usr/share/applications or a subdirectory thereof, and calls (-exec ... {} \;) a perl oneliner to parse the information.

Perl is started with the -n option which creates an implicit loop iterating over each line of the given file, and an -e option which specifies to run the argument provided.

The perl program contains BEGIN and END blocks to be run before and after each of the .desktop files is parsed (the perl oneliner is called separately each time for each of the files that find has located). BEGIN block records the filename (which is given as the first argument to the oneliner, the {} pragma of find), and the END blocks summarizes the information in a comma separated manner.


Minecraft server on Ubuntu 16 not saving worlds on shutdown

You need to tell the Minecraft server to actually save the world state before you shut the machine hosting it down.  The Minecraft console command for this is save-all.


How to make login keyring forget a password

You can use seahorse to change and delete keyrings and items in keyrings.


browser compositor issues - chromium versus chrome

Aura hasn't been push to beta. M34 initially was planned to have Aura, but it was decided that there were too many bugs (most likely among other reasons). M35 (currently on dev) does have Aura enabled.

Part of the reason that they are switching to Aura is so that they have less code to maintain, fewer #ifdef's (code to compile on one OS, but not on the other), and the ability to push out new features at around the same time as Windows. This does mean that there is probably less reliance on GTK, and the looks of menu entries will be slightly different.

Which one works better? Hopefully, by the time Aura is pushed to beta and stable, Aura will be nearly equivalent in terms of functionality and looks as GTK (note that not everything will be the same; the omnibox drop down menu fills the whole width of the browser rather than just the width of the omnibox, and this is intentional). In terms of performance, Aura seems to be a little smoother for me (I'm currently on Chromium Dev), but that's completely unscientific and possibly just a placebo effect. There are one or two major bugs where the rendering is messed up when you exit full screen or shrink the browser window, but I work only in maximized mode and don't see these bugs. On my Intel i3 and HD Graphcs 3000, I don't see any major bugs in Aura.

Note that M34 did suffer from a major rendering bug that affected Intel GPUs where pages would be frozen. The most recent beta release (34.0.1847.60) should have fixed that.

If you want, you can try Chromium Aura from my PPA, and report any major bugs you see to Chromium.


Try adding nomodest parameter in the kernel settings on startup. This tutorial details the process of adding this parameter while booting from live USB/CD.


I also had a similar issue. In my case, however, I could hear sound but it sounded like it was coming out of a very deep cave.

I  changed the balance and that helped. Try that perhaps and see if it helps.

All settings > Sound > Output

and try changing the balance.


Why the 20.04.1 is still not available in the update manager?

You can upgrade to Ubuntu 20.04.1 by inputting the following into terminal:
sudo do-release-upgrade

Alternatively , you can upgrade using the gui tool by entering the following into terminal:
sudo do-release-upgrade -f DistUpgradeViewGtk3


How to escape a single quote inside a double quote string in bash script?

You should not need to use \ with double quotes:

$ DB_USER='abc'; echo "test '${DB_USER}'"
test 'abc'

Alternatively, you can break the double quote, and escape the single quote - that's where it's necessary:

$ DB_USER='abc';  echo "test"\'"${DB_USER}"\'
test'abc'

Yet another way would be to use printf with command substitution and using hex value for the quote (\x27):

sudo mysql -uroot -p123  -e "$(printf 'CREATE SCHEMA \x27%s\x27 DEFAULT CHARACTER SET utf8;SHOW DATABASES;CREATE USER \x27%s\x27@\x27localhost\x27 IDENTIFIED BY %s ; GRANT ALL PRIVILEGES ON * . * TO \x27%s\x27@'localhost'; FLUSH PRIVILEGES;SELECT Host,User,Password FROM mysql.user;' ${DB_MAGENTO} ${DB_USER} ${DB_USER_PASSWORD}  ${DB_USER})"

Side note: you have 3 commands in the script calling sudo. This is redundant. Just run the whole script as sudo myscript.sh and remove the need to add sudo to each of those lines.


Problem with second monitor's resolution

After a lot of search, I found a workaround ( or fix if I may call it). Here are the steps I did to fix it.

I disabled the Nvidia drivers from Software & Updates -> Additional Drivers
Having two identical monitors ( same vendor etc ) I acquire EDID of the working monitor
I generated the X configuration file through Nvidia settings window
I manually modified the xorg.conf file (located at /etc/X11/xorg.conf) and on the "Screen" section I added the following option :
Option "CustomEDID" "CRT-0:/myfullPath/edid.bin where 'CRT-0' is the previously name of my monitor assigned by the Nvidia and the edid.bin is the EDID file of the working monitor.
then I made a reboot and everything was working fine.


1GB RAM installed, Ubuntu 13.10 detects 992,4 MiB

That is completely normal. Part of the RAM is reserved to the system to use it so it doesn't show as available. In my case I've got 4 GB and I get 3.8 GB under "About this Computer".

Run "free" in a terminal and it will tell you how much memory you have got, and how much it is reserved. Just type in a terminal:

free -h

If you want to be sure it's not a case of corrupted RAM, check the amount detected in your BIOS when you turn on the computer. Also, you could run memtest on the GRUB menu to check that all the RAM is working.


I need to understand something about Ubuntu's default backgrounds and resolution

It's not possible. The ratio of 2500x1600 is 1.5625 and your 1024x768 ratio is 1.1/3 or 1.33333. A typical desktop at 1366x768 is 1.77865 and 1200x740 is 1.62162.

The desktop backgrounds only appear to fit perfectly but they actually are either using the scale or the zoom setting. My best guess is that the zoom setting is the one used. You can see in this screenshot of my desktop using 1024x768 with a comparison of the photo in the foreground how the sides of the photo are cropped off and not seen when used as wallpaper. This background is included with the ubuntustudio package.

The actual photo files are contained in the folder /usr/share/backgrounds you can take a look at the pictures here and see how the default background photos compare to the display on your desktop.


How do you install python3.6 on Ubuntu Core

If what you want is a development environment, then you should check out this answer, about the classic snap, which is to provide a chroot with a classic console development experience. You can then install Python 3.6 normally through packages or by building from source, here, to develop with.

If however, what you want is a specific Python version to depend on in a package which you intend to ship and run on Ubuntu core, you will need to build that specific version of Python, and any additional libraries you may need for it, and include it within your snap package.


Can I install Ubuntu on windows 7 without affecting the recovery facility of windows 7?

If you just follow the guided installation "install alongside Windows 7" it should work fine and with no problems; if you decide to manually edit your pc's partitions, make sure to leave the recovery partition as is, as rajan suggested


I found this command
alias gksu='pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY'

in this page
After running the alias command:
gksu /path/to/script.sh

It will ask you for a password like normal.
You will need to add the alias to the end of ~/.bashrc in order to keep the gksu command persistent on reboot.


Is there an equivalent of the file-browser applet for unity?

I've started using the Screenlets program (available in the Ubuntu Software Center) to replace the applet items I used to run in gnome-panel (i.e. weather indicator).

Screenlets has a file browser applet.

I know that this isn't exactly equivalent, but it works.


There is a manual page here - the ones I think you are referring to are:

Signal     Value    Action       Comment
-------------------------------------------------------------------------
SIGKILL          9       Term    Kill signal
SIGTERM         15       Term    Termination signal

Here are some other signals:

Ctrl+C on a running process in terminal sends the Keyboard Interupt signal:SIGINT2       Term    Interrupt from keyboard. This does not always stop the program straight way, often it will just finish that part of what it is doing and then stop.
Ctrl+\ on a running process in terminal sends the Quit signal:SIGQUIT3       Core    Quit from keyboard
The default signal sent by the killall PROCESS-NAME is SIGTERM15       Term    Termination signal. This is also the default one sent from top when pressing k and entering the process PID

To make sure a process is stopped you can use SIGKILL (or alternatively, SIGSTOP) as that cannot be caught, blocked, or ignored by the program.

Here is a longer list from the above link, for reference:

   Signal     Value     Action   Comment
   -------------------------------------------------------------------------
   SIGHUP        1       Term    Hangup detected on controlling terminal
                 or death of controlling process
   SIGINT        2       Term    Interrupt from keyboard
   SIGQUIT       3       Core    Quit from keyboard
   SIGILL        4       Core    Illegal Instruction
   SIGABRT       6       Core    Abort signal from abort(3)
   SIGFPE        8       Core    Floating point exception
   SIGKILL       9       Term    Kill signal
   SIGSEGV      11       Core    Invalid memory reference
   SIGPIPE      13       Term    Broken pipe: write to pipe with no readers
   SIGALRM      14       Term    Timer signal from alarm(2)
   SIGTERM      15       Term    Termination signal
   SIGUSR1   30,10,16    Term    User-defined signal 1
   SIGUSR2   31,12,17    Term    User-defined signal 2
   SIGCHLD   20,17,18    Ign     Child stopped or terminated
   SIGCONT   19,18,25    Cont    Continue if stopped
   SIGSTOP   17,19,23    Stop    Stop process
   SIGTSTP   18,20,24    Stop    Stop typed at tty
   SIGTTIN   21,21,26    Stop    tty input for background process
   SIGTTOU   22,22,27    Stop    tty output for background process

   The  signals SIGKILL and SIGSTOP cannot be caught, blocked, or ignored.

   Next the signals not in the  POSIX.1-1990  standard  but  described  in
   SUSv2 and POSIX.1-2001.

   Signal       Value     Action   Comment
   -------------------------------------------------------------------------
   SIGBUS      10,7,10     Core    Bus error (bad memory access)
   SIGPOLL             Term    Pollable event (Sys V). Synonym of SIGIO
   SIGPROF     27,27,29    Term    Profiling timer expired
   SIGSYS      12,-,12     Core    Bad argument to routine (SVr4)
   SIGTRAP        5        Core    Trace/breakpoint trap
   SIGURG      16,23,21    Ign     Urgent condition on socket (4.2BSD)
   SIGVTALRM   26,26,28    Term    Virtual alarm clock (4.2BSD)
   SIGXCPU     24,24,30    Core    CPU time limit exceeded (4.2BSD)
   SIGXFSZ     25,25,31    Core    File size limit exceeded (4.2BSD)

   Up  to and including Linux 2.2, the default behaviour for SIGSYS, SIGX-
   CPU, SIGXFSZ, and (on architectures other than SPARC and  MIPS)  SIGBUS
   was  to  terminate  the  process (without a core dump).  (On some other
   Unices the default action for SIGXCPU and SIGXFSZ is to  terminate  the
   process  without  a core dump.)  Linux 2.4 conforms to the POSIX.1-2001
   requirements for these signals, terminating the  process  with  a  core
   dump.

   Next various other signals.

   Signal       Value     Action   Comment
   --------------------------------------------------------------------
   SIGIOT         6        Core    IOT trap. A synonym for SIGABRT
   SIGEMT       7,-,7      Term

   SIGSTKFLT    -,16,-     Term    Stack fault on coprocessor (unused)
   SIGIO       23,29,22    Term    I/O now possible (4.2BSD)
   SIGCLD       -,-,18     Ign     A synonym for SIGCHLD
   SIGPWR      29,30,19    Term    Power failure (System V)
   SIGINFO      29,-,-         A synonym for SIGPWR
   SIGLOST      -,-,-      Term    File lock lost
   SIGWINCH    28,28,20    Ign     Window resize signal (4.3BSD, Sun)
   SIGUNUSED    -,31,-     Term    Unused signal (will be SIGSYS)

   (Signal 29 is SIGINFO / SIGPWR on an alpha but SIGLOST on a sparc.)

   SIGEMT  is  not  specified in POSIX.1-2001, but nevertheless appears on
   most other Unices, where its default action is typically  to  terminate
   the process with a core dump.

   SIGPWR (which is not specified in POSIX.1-2001) is typically ignored by
   default on those other Unices where it appears.

   SIGIO (which is not specified in POSIX.1-2001) is ignored by default on
   several other Unices.


Top bar in Ubuntu 12.04 Gnome Classic is missing

From Ans :

  This can be caused by multiple reasons. Try to reset unity. To to so, go to terminal

  Just press Ctrl+Alt+T to start a user terminal.
  and type:

  unity --reset

  try this as well:

  sudo apt-get install --reinstall unity

  IF that does not work or you need more info Click Here


Ubuntu 18.04 Intel wireless-AC 9260 connectivity issues / freezes on dell precision 5530

We see these interesting clues in your wireless_info:

  Queue 0 is inactive on fifo 2 and stuck for 2500 ms. SW [145, 146] HW
  [162, 162] FH TRB=0x0a5a5a5a2

Which leads to this: https://forums.intel.com/s/question/0D50P0000490TtKSAU/dual-band-wirelessac-7260-iwlwifi-queue-2-stuck-for-10000-ms-microcode-sw-error-detected-restarting-0x2000000?language=en_US and then to this: https://bugzilla.kernel.org/show_bug.cgi?id=194853

  Intel Dual Band Wireless-AC 7260 adapter hungs with 40MHz width
  connection

We also see:

  Reason: 6=CLASS2_FRAME_FROM_NONAUTH_STA

Which leads to this: https://bbs.archlinux.org/viewtopic.php?id=220809

  Update: I solved the issue by deactivating the "WiFi Coexist" option
  in my FritzBox router which apparently switches from 40MHz to 20MHz
  every time it detects too many 40MHz routers nearby. This makes the
  ath10k firmware crash (my old laptop and my phone handle those
  switches nicely).

I recommend that you change the settings in the router to specify a channel width of 20 MHz in the 2.4 GHz band instead of automatic 20/40 MHz, although it is likely to affect N speeds.

If you do not have administrative priveleges for the router, then try:

sudo -i
echo "options cfg80211 cfg80211_disable_40mhz_24ghz=Y"  >  /etc/modprobe.d/cfg80211.conf
exit

Reboot and let us hear the result.


Ubuntu with Kodi -- how do I suspend based on audio output?

With a little bit of testing here I saw Kodi close its client to Pulseaudio after a couple of minutes of idling. That makes this problem quite simple. In your shutdown script all you need to test for (other than time) is that there's no Kodi or Chrome clients. That's as simple as:

DISPLAY=:0 pactl list clients | grep -E 'kodi|chrome'

Edit: I honestly hadn't read past the title before writing this answer. Setting the DISPLAY seems to be the critical element, at least here, to get pactl looking at the right Pulseaudio session.

If you're scripting this into something remember that grep returns 0 on a match. And you can use the -q argument instead of redirecting to /dev/null.

However if you have navigation sounds turned off too, the user might just be in a menu. You might want to do another sort of check, perhaps hooking into input or checking the average screen colour (set the screensaver to black screen, if screen is black, and there's no sound, suspend).


solved it by fixing a static ip to ubuntu and creating an arp entry in windows


while installing phpmyadmin getting dependency in ubuntu 12.04

Did you install PHP before installing phpmyadmin? Make sure you have a web server software of some sort (such as Apache2) as well as PHP running before trying to install phpmyadmin. Phpmyadmin is not an independent software but relies on the functions of other software to perform its functionalities. Most importantly, make sure you have MySQL also installed before phpmyadmin.

Since you are new to web hosting, maybe you should install a package that includes all that stuff. Check out http://vestacp.com for a great package with everything you need. Very easy to install and you can start hosting right away.


AMD graphics problems after upgrading to 14.0.4.5 with HWE

The root cause of my issue was that only the kernel portion of the HWE was installed, meaning the kernel was upgraded but not the graphics stack. Since the Xenial kernel isn't compatible with the proprietary fglrx AMD driver, that caused the graphics problems.

Before doing anything else, it's best to do some cleanup:

Remove all the utopic, vivid, and wily HWE packages since they're no longer supported (without this, the prompt to upgrade the HWE will continue to appear)

sudo apt purge `dpkg --get-selections | egrep "utopic|vivid|wily" | awk '{print $1}' | tr '\n' ' '`

Remove all utopic (3.16), vivid (3.19), and wily (4.2) kernels since they're also no longer supported (this causes hwe-support-status to print a security warning)

sudo apt purge `dpkg --get-selections | egrep "linux-.+-(3\.16|3\.19|4\.2)" | awk '{print $1}' | tr '\n' ' '`

After doing that, there are two solutions:

(Recommended) Install the full Xenial HWE

Following the instructions here, install the full Xenial HWE:

sudo apt install --install-recommends linux-generic-lts-xenial xserver-xorg-core-lts-xenial xserver-xorg-lts-xenial xserver-xorg-video-all-lts-xenial xserver-xorg-input-all-lts-xenial libwayland-egl1-mesa-lts-xenial

This should install the new graphics stack, which should also remove fglrx
Make sure fglrx is removed, just to be safe

sudo apt remove fglrx fglrx-core fglrx-updates fglrx-updates-core

Remove any other unused packages

sudo apt-get autoremove

Reboot

The final state of your machine should look something like this:

$ uname -r
4.4.0-112-generic

$ dpkg --get-selections | grep xenial | wc -l
40

$ dpkg --get-selections | grep fglrx | wc -l
0

$ fglrxinfo
fglrxinfo: command not found

If at this point everything seems to be working fine, it's probably best to go ahead and upgrade to 16.04 since 14.04 is only supported until April 2019.

(Not recommended) Fully remove the Xenial HWE

Remove the xenial HWE packages

sudo apt purge `dpkg --get-selections | grep xenial | awk '{print $1}' | tr '\n' ' '`

Remove the xenial kernels (4.4)

sudo apt purge `dpkg --get-selections | egrep "linux-.+-4\.4" | awk '{print $1}' | tr '\n' ' '`

Remove any other unused packages

sudo apt-get autoremove

Reconfigure xserver-xorg (for some reason cleaning up the HWEs removes the symlink from /etc/X11/X to /usr/bin/Xorg, breaking X; this fixes it)

sudo dpkg-reconfigure xserver-xorg

Reboot

The final state of your machine should look something like this:

$ uname -r
3.13.0-119-generic

$ dpkg --get-selections | egrep "utopic|vivid|wily|xenial" | wc -l
0

$ dpkg --get-selections | grep fglrx | wc -l
4

$ dpkg -l | grep fglrx
ii  fglrx-amdcccle-updates                      2:15.201-0ubuntu0.14.04.1                             amd64        Catalyst Control Center for the AMD graphics accelerators
ii  fglrx-updates                               2:15.201-0ubuntu0.14.04.1                             amd64        Video driver for the AMD graphics accelerators
ii  fglrx-updates-core                          2:15.201-0ubuntu0.14.04.1                             amd64        Minimal video driver for the AMD graphics accelerators

$ fglrxinfo
display: :0.0  screen: 0
OpenGL vendor string: Advanced Micro Devices, Inc.
OpenGL renderer string: AMD Radeon(TM) HD8490
OpenGL version string: 4.5.13399 Compatibility Profile Context 13.35.1005


"Error splicing file" while copying from External 3TB drive

Yes, the destination disk could be formatted with: FAT32 --> Maximum file size = 4GB.

If it was formatted with EXT3, EXT4, or NTFS you could save the file.

But you can also split and join files easily: Split a large file into smaller files and then integrate them to get the original file


How to download and number all videos in a youtube playlist as best quality and also set the directory that they are downloaded to?

For best video, audio and specific path you can use:

youtube-dl -f bestvideo+bestaudio -o '/home/yourusername/Downloads' "youtubelink"

If you get an error, you can check the available video quality:

youtube-dl -F "youtubeLinkVideo"

Example: If the best quality number is 22 on YouTube, then download using this command:

youtube-dl -f 22 -o '/home/yourusername/Downloads' "youtubelink"


Problem with default shell and home directory

Read man 1 login, read /etc/login.defs.  Also see what you have in $PATH, $LOGNAME.

I'd make sure that /home/glperez really exists, with ls -ld /home/glperez. If it does not exist, and /etc/login.defs permits, you will be given a directory that login is sure exists, /.

You can also check that /bin/bash exists, is executable, and is included in /etc/shells

ls  -l /bin/bash;ldd /bin/bash;grep /bin/bash /etc/shells

You should ask blackhawk2's sysadm how s/he created the glperez account. useradd or adduser? What parameters? Are you supposed to have an encrypted home directory? Does blackhawk2 authenticate users locally, or over the network (check /etc/nsswitch.conf)? If over the network, what does that server think of you?


Restore duplicity archive with entire path remembered

That's easy to solve. Backup / (yes, that's the file system root), but define in/excludes to only backup the folders you want eg.

--include '/home/user1' --exclude '**'

more info about in/excluding can be found on duplicity's man page.


nmcli the WiFi network could not be found

this one fixed the issue for me - https://unix.stackexchange.com/a/519620/407616
add this

[device]
wifi.scan-rand-mac-address=no

to /etc/NetworkManager/NetworkManager.conf
then run

sudo systemctl restart NetworkManager

then you can connect to the ssid by

sudo nmcli dev wifi connect "SSID" password "wifipassword"


How to install KDE 4.10 on Precise from repos?

I came across this question from google asking how can I update KDE on (k)Ubuntu 12.04 without updating the server parts of the system.

So, I have Kubuntu 12.04.01 LTE, and there was KDE 4.8.5 installed (along Unity and a few others DMs)

I did

sudo apt-add-repository ppa:kubuntu-ppa/backports -y
sudo apt-get update
sudo apt-get dist-upgrade

.. and now I have same system with KDE 4.10 running on it without much problem so far.

Since the backports are from Kubuntu team, that does include kubuntu-desktop (in your situation it might be a better choice to first install kubuntu-desktop, then update from backports, and then remove extras you don't like too much).

Other option might be looking at http://techbase.kde.org/Getting_Started/Build


Here is a very basic script that I have put together. Replace the DIR constant with the path to the directory which contains the files.

import os

DIR = "" # Change to the directory which contains the files

for srcfile in os.listdir(DIR):
    original = os.path.join(DIR, srcfile)
    temp = os.path.join(DIR, "%s_tmp" % srcfile)
    with open(original) as infile:
        with open(temp, 'w') as outfile:
            outfile.write("\n")
            for line in infile:
                outfile.write("%s\n" % line.rstrip())

    os.remove(original)
    os.rename(temp, original)


High frequency noise in G752VL on Ubuntu Gnome 16.04.01

Run alsamixer, use F6 to select sound card in question, and use M key to disable all its channels. If the noise is still there, it is a hardware defect, and you have to solve it as such.


How do I run Firefox OS as a standalone application?

AWWWWWW YEEEEEEAAAAAHHHH!!!

I figured it out! Turns out that there's a special version of it designed to be run by itself. (As soon as I posted the question, I began to do some research myself. I found what I needed.)

I've made an installation script, if anybody wants it: https://dl.dropbox.com/u/98745514/firefox-os-installer.sh
People with 64-bit computers, please open it with a text editor and follow the comment instructions.

To uninstall, type

sudo rm -R /opt/b2g
sudo rm /usr/bin/b2g
sudo rm /usr/share/applications/b2g.desktop

You're welcome!

Better Way:

At the terminal, run

~/.mozilla/firefox-trunk/{PROFILE_NAME}/extensions/r2d2b2g@mozilla.org/resources/r2d2b2g/data/linux64/b2g/b2g -profile ~/.mozilla/firefox-trunk/{PROFILE_NAME}/extensions/r2d2b2g@mozilla.org/resources/profile

...change linux64 to linux if on a 32-bit machine.

I have mine set up where ~/.mozilla/firefox-trunk/{PROFILE_NAME}/extensions/r2d2b2g@mozilla.org/resources/r2d2b2g/data/linux64/b2g is a symbolic link to /usr/lib/b2g, and a simple launching script has been written at /usr/bin/b2g.


I was able to make it work using wmctrl and xdotool . Both are window manipulation tool.

#!/bin/bash
WIN=$(xdotool getactivewindow)
eval $(xdotool getwindowgeometry --shell $WIN)
WIDTH=$(calc "int($WIDTH*0.75)")
wmctrl -r :ACTIVE: -b remove,maximized_horz,sticky
wmctrl -r :ACTIVE: -e "0,0,24,$WIDTH,-1"

Above script snap window to 75 % to its size to left side. Save above script in a file and assign shortcut to the file.

Similarly following script snap window to 25% width to the right.

#!/bin/bash
WIN=$(xdotool getactivewindow)
eval $(xdotool getwindowgeometry --shell $WIN)
X=$(calc "int($WIDTH-$WIDTH*0.25)")
WIDTH=$(calc "int($WIDTH*0.25)")
wmctrl -i -r $WINDOW -b remove,maximized_horz
wmctrl -i -r $WINDOW -e "0,$X,-1,$WIDTH,-1"

Check wmctrl and xdotool manpages and tutorials to find how they work.
Install dependencies using

sudo apt-get install apcalc wmctrl xdotool

Note: The resizing works relative to current window position and size. To make it relative to screen size, maximize the window then execute the script.


I did a bios upgrade when i first got my 1640; I did not do it on ubuntu; instead I immediately did it on Win 7 that came pre-installed. I am not sure though whether I had dual boot at the time or not.

My suggestion is that you do the upgrade from Windows; I guess its safer. If you don't have Windows installed I'd recommend you install a genuine one if you have it.
In either case, find the right bios by using the service tag of your laptop; use this page: https://www.dell.com/support/drivers/us/en/19/DriversHome/NeedProductSelection
Follow the "Installation Instructions" as written on the bios upgrade page.

Otherwise I suggest you seek help from a computer specialist.

Warning: a bios upgrade, if failed, can break your computer!

Disclaimer: this is just suggestions not guidance; I hold no responsibility for any problems or failures!

All the best


How can I stop apt-get from asking about using minor amounts of additional disk space that will be used?

This is not possible with tool itself. The script linked by @ByteCommander would be nice if slightly modified. I think apt-get could use this feature. Consider making a feature request or asking a question. Offering a patch is a little more challenging but makes it more likely you and others can get the feature.


For the meaning of rc, check the header of the dpkg --list output.

$ dpkg --list | head -n3
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)

The first letter is desired, r here means Remove. The second letter is status, c here means Conf-files.

In other words, the package itself is removed but its configuration is kept. You can run apt purge <package> to remove the configurations too. The configuration files are mostly small and they are kept for easy re-installation.

The initrd.img-*.old-dkms files must be removed manually. See the answers

purging old kernels fails to remove old initrd files
Can I remove *.old-dkms files

for additional information.


For the latest Ubuntu release, set your DNS servers to your modem IP and Google (8.8.8.8, 8.8.4.4). This option is located in System Settings > Network on the  IPV4 tab. To add DNS servers, click on the small icon on the right of the DNS server field.


How can i burn directory and files to DVD with another disc name in ubuntu 16.04 via terminal?

genisoimage has a -V option that specifies a volume label for the ISO. You can use this program to create ISOs for the data you want to burn and let wodim work with the images.

-V volid
    Specifies the volume ID (volume name or  label)  to  be  written
    into  the  master  block.   There  is  space  for 32 characters.
    Equivalent to VOLI in the .genisoimagerc file.  The volume ID is
    used  as  the mount point by the Solaris volume manager and as a
    label assigned to a disc on various other platforms such as Win‐
    dows and Apple Mac OS.


System76 using ATI cards in their laptops -- good or bad?

Recent Radeon HD cards have been working very well with the open source drivers. I have a multiscreen setup even!

I would not hesitate to recommend the Desktop equivalents, so I would not be worried about using the laptop mobility versions, especially if System76 have tested them.


Permanently enabling the scroll lock button in Ubuntu?

You can use the xset utility to toggle it. Either search the software center and search for x11-xserver-utils or enter the following from the terminal to install it.

sudo apt-get update;sudo apt-get install x11-xserver-utils

All you need to do is add a new entry in settings-->session and startup with the following..

xset led named "Scroll Lock"

FYI: to turn it off..

xset -led named "Scroll Lock"

To find out how to add a something to auto-run at login see this       How do I start applications automatically on login?


Use command of "software-properties-gtk -open-tab=4" to change the your graphic card driver (called as restricted drivers)


Repository software will always tend to lag behind a little. Adding a PPA often fills the gap and there is a nice one for Netbeans:

sudo add-apt-repository ppa:vajdics/netbeans-installer
sudo apt-get update
sudo apt-get install netbeans-installer

And on Trusty Tahr this successfully installs Netbeans version 8.1:


Regardless of the name that you assign to your computer (hostname), what will define whether or not it is in a subdomain will be the public DNS server (bind, for example) and not the /etc/hosts file, which only affects the requests of your local network.
You can manage the subdomains on your Resource Records A, AAAA, CNAME, MX, TXT, PTR, SRV.

Note that one of the prerequisites of that article is "A valid domain name, like example.com, pointing to your server."

You can use kermit.muppets.org since you point the DNS server to that VPS server. Another approach is to set a reverse proxy to point to the resource you want.

Check out a more detailed explanation here: https://serverfault.com/questions/507103/hostname-or-subdomain


Running a Screen instance of a program as non-root

One of the most common problems with cron is that it runs with a minimal shell and minimal environmental variables. Because of this it is best to always use the full path to programs, binaries, libs, or files.

In addition, although you can use su, sudo is, IMO, a better tool. Specify the user with the -u flag.

So, putting it altogether,

sudo -u ftpuser "screen -dmS /var/MC_SVR/McMyAdmin /var/MC_SVR/MCMA2_Linux_x86_64"


Ubuntu Terminal takes a while when performing commands using sudo

This could be the effect of changing the hostname during the installation.

Open the hosts file using:

sudo gedit /etc/hosts

After that, edit it according to the following:

127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 <ADD_YOURS_HERE>
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 <ADD_YOURS_HERE>


Developer documentation for the Messaging Menu?

Try the libindicate-doc package (and then look at what it installed with dpkg -L libindicate-doc). That should contain what you need.


Working with quickly, are there any gtk.Builder code sketching tools that integrate?

That might be nice. It shouldn't be too difficult to implement either, since the handlers are defined in the ui-file. I don't know of any tools that does it now. I don't think it could be done in the GUI designer, since it's language independent. But adding a 'sketch' command to  Quickly should be possible. If you add a wishlist bug to Quickly, perhaps someone can get around to it? I might want to have that myself.

https://launchpad.net/quickly


Some Windows softwares can tell me the memory's manufacturer and date.

Probably not from the actual module and likely uses an internal database or does a look-up on the net.

Most memory modules do not have a manufacturer's name. If there was dmidecode --type memory would show a "Manufacturer" with the name.

Use the value of "Part number" for a google search (KP223C-ELD is Kingston)
Another option:

decode-dimms | grep -i manuf

It does it with an internal list too.

3.Found a list and it looks the same as at #2.


The hstore extension, as well as many other extensions such as cube, fuzzystrmatch, uuid-ossp, etc., are packaged in postgresql-contrib, which you can install for your PostgreSQL version using:

sudo apt-get install postgresql-contrib-9.2

On a standard Ubuntu install,

sudo apt-get install postgresql postgresql-contrib

will install PostgreSQL with its contributed extensions.


Custom icon for .desktop file not appearing

As of July 2018, there seem to be some bugs in Unity in how it reads .desktop files. Specifically, the path provided for the Icon field cannot be wrapped in quotes. Even if the path contains spaces, it must not be wrapped in quotes.

On the other hand, it's worth mentioning here that the path provided for the Exec field must be wrapped in quotes if it contains spaces. If it doesn't contain spaces, the quotes can be left off. This inconsistency in behavior is horribly confusing and should really be considered a bug.

Thus, the following is a valid .desktop:

[Desktop Entry]
Name=Firefox Developer Edition
Comment=The developer edition of Firefox Quantum.
Exec="/home/jack/Applications/Firefox Developer Edition/firefox"
Icon=/home/jack/Applications/Firefox Developer Edition/browser/chrome/icons/default/default32.png
Terminal=false
Type=Application

The following will run, but not display the icon:

[Desktop Entry]
Name=Firefox Developer Edition
Comment=The developer edition of Firefox Quantum.
Exec="/home/jack/Applications/Firefox Developer Edition/firefox"
Icon="/home/jack/Applications/Firefox Developer Edition/browser/chrome/icons/default/default32.png"
Terminal=false
Type=Application

And the following won't even run:

[Desktop Entry]
Name=Firefox Developer Edition
Comment=The developer edition of Firefox Quantum.
Exec=/home/jack/Applications/Firefox Developer Edition/firefox
Icon=/home/jack/Applications/Firefox Developer Edition/browser/chrome/icons/default/default32.png
Terminal=false
Type=Application


Ubuntu 16.4 front panel audio not detected with ALC892

Try sudo alsa force-reload in a terminal. alsamixer It should be able to reconfigure everything from there. If that does not work then try sudo dpkg-reconfigure alsamixer and then sudo alsa force-reload.


Ubuntu doesn't download files using apt-get update

As NGRhodes points out, there simply isn't a 14.04 version of this PPA. You say you get this for every PPA... If that's really the case, you're either picking a load of duff PPAs without checking they have a 14.04 version, there's something else going on.

Anyway, for this one, you have a couple of options:

You can continue as you are (in the hope that they add one eventually) and nothing will be hurt. The warning is just a warning, the rest of the package lists are being updated still.
You can remove the PPA:

sudo add-apt-repository -r ppa:openshot.developers/ppa

The next sudo apt update should be warning free.