Ultrabook convertibles that work fully with Ubuntu?

You can get Ubuntu up and going on the Yoga [Lenovo 20175]. The problem is net access. Wifi doesn't work and no built-in RJ-45 (basic Ethernet jack). Need a USB to RJ-45 that will work with Ubuntu.

I used the Belkin F4U047. Which would overheat on Ubuntu (not Win8) and stop working off and on.

USB FastE or GigE that "just works" with Linux 2.6 kernels

Installing was pretty easy though. Turn off the comp, plug in your Ubuntu USB installer. Push the small button next to the power button in front with a pen/paperclip, choose to boot from USB. Then Install.

Touchscreen worked great. Seemed better than Win8. Especially with closing windows etc. with small areas. Pinching to zoom didn't work.

Multi-touch touch pad didn't seem to work. ex. 2 finger scroll. Scroll on right side of pad worked. Pinching, swiping from the the sides or top/bottom didn't do anything.

Display flipping didn't work at all. Fold into tablet mode, turn display upside down, this way that way, shake shake, nothing. Keyboard and touch pad should deactivate... nope.

Bluetooth can be turned on. But still showed disabled on setting window.???

Sure felt like being home after Win8 for a few months and glad to see it works as well as it does. Viva la Ubuntu!


Why is openssh-server needed to receive incoming ssh connections?

The TCP/IP network stack in the Linux kernel only provides a means for data transport: you need a program that listens to the incoming data, processes that, and sends output data back.  Such programs are usually called "servers" or "daemons"; that's why you need to run the "OpenSSH server" in order to receive SSH connections on your machine.


Creating and executing shell scripts to run XAMPP on double click

The opening stanza should be

#!/bin/bash

... There isn't a trailing slash.

sudo is also going to want a password every time. You can either:

Add an exception to /etc/sudoers
Use a graphical sudo equivalent like pkexec or gksudo

I think on balance, just substituting in pkexec is the easiest solution.


My experience trying to install/tweak a HD7770 recently (using xubuntu 12.10):

The open source drivers are okay for desktop use, can get dual screens going (but not screen rotation) with some tearing in HD video. Games seem to be rendered on the CPU, making them perform poorly.
Installing "fglrx-updates" via software manager broke the system (nothing visible on screen after reboot, not even console).
Installing Catalyst directly from AMD was a bit better. 3D games worked okay. But dual-screen support was awful.

Apparently there is a magic script (smxi.org/sgfxi) that can fix things, but by the time I tried it my system was so broken I couldn't even get to a Ctrl-Alt-1 console to run it properly. In the end I gave up, reinstalled and bought an nVidia GPU and have found it much better.

As I said, just my experience. Hopefully you have better luck than me. I'd try Catalyst at least and see how it goes.


This is solution that should work on any GUI. And not require specific theme in OS.

Just set dark theme for ex. in tweek-tool.
downloadoad google dark theme for ex. from
http://killhellokitty.deviantart.com/art/DeLorean-Dark-Chromium-Theme-337912877
go to chrome://flags/#top-chrome-md and change to Normal as described Pictures how to change omnibox, (in old chrome version <69 chrome://settings/ and click "Use GTK+ theme").

Chrome do not take gui from GTK until we press "Use GTK+ theme".
Working configuration xubuntu 16.04 + Dorian Theme 3.16 + Version 69.0.3497.100 (Official Build) (64-bit).


Why am I getting "size mismatch" errors from the Iceland mirror?

The Iceland mirror (Siminn hf) is one week out of date.

Please try one of these up-to-date mirrors that should be close to you, network-wise:

Norway: https://launchpad.net/ubuntu/+mirror/ftp.blix.eu-archive
Netherlands: https://launchpad.net/ubuntu/+mirror/nl3.archive.ubuntu.com-archive
UK: https://launchpad.net/ubuntu/+mirror/ftp.ticklers.org-archive


desktop file in ubuntu does not execute command

Try this:

[Desktop Entry]
Type=Application
Terminal=false
Name=Switch IP address
Icon=/usr/desktop/icons/switchip.png
Exec=pkexec service tor restart

service needs to run as root, using pkexec.


How do I customize a LiveCD that can only "Try Ubuntu"?

Yes it is possible. Remove the package ubiquity from a chrooted installation DVD.

Here are several answers on how to create a Live DVD: How to customize the Ubuntu Live CD?


Since you don't have Apache installed and functionally working, you don't need the /etc/apache2 directory where all the configuration files are stored.

You also mentioned that you used touch to create an apache.conf file.  That is very problematic because there are defaults and settings that need to be specified in the conf file, which is missed by creating a blank file.

Apache will work when installed from the repository.  It will create all the necessary files and actually start the server when installed.

Remove what you have, then perform a fresh install from the repository.

Remove and purge the current installation:

$ sudo apt-get remove --purge apache2 libapache2-mod-php
$ sudo apt autoremove
$ sudo apt-get remove --purge apache2 libapache2-mod-php

You may have to cycle through those two commands more than once.  It'll be clean when the last command's output resembles:

apollo@testnode2:~$ sudo apt-get remove --purge apache2 libapache2-mod-php
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package 'libapache2-mod-php' is not installed, so not removed
Package 'apache2' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.

Now remove faulty configuration files that may not be overwritten in a fresh install.  Remove or rename the /etc/apache2 folder:

$ sudo mv /etc/apache2/ /etc/apache2.old

Now install Apache2 fresh with:

$ sudo apt-get install apache2 libapache2-mod-php

If you have settings from your old settings that you want to incorporate into the new installation, you can copy the difference to the new /etc/apache2 directory.  Making step-by-step changes might help you to identify where you went wrong the first time.

Put your site's configuration files into a VirtualHost

Also, I recommend that you leave the /etc/apache2/sites-available/000-default.conf file intact.  Make a new virtual host file to contain your desired configuration.  Just copy the 000-default.conf to a mysite.conf file, then enable this virtual host with the command:

$ sudo a2ensite mysite.conf

This way if there is a problem with your configuration file, you can just disable it with a2dissite mysite.conf while you fix it.  Apache won't be broken in the meantime.  You'll also retain the 000-default.conf as a template for a working reference.

The key to a virtualhost configuraiton is the ServerName directive.  Accessing your site by that name will call that specific configuration.

Starting, Stoping, and checking the Apache2 server

You shouldn't try to start the Apache2 server by running the /usr/bin/apache2 command.  The server should be started with a script to set all the needed variables.

You can start, stop, and check the status of the Apache2 server with one of these commands:

$ sudo systemctl stop apache2
$ sudo systemctl start apache2
$ sudo systemctl status apache2


After installing 16.04.1, no boot...Just fails at Grub with flashing cursor

One of the problems I see by your description is the enabling of legacy boot.  Boot to the install media with UEFI enabled.  The system will more readily recognize what you have from that mode.  It'll use the mode that you boot to.  Install Ubuntu from the UEFI session.

After the install you'll have a BIOS choice of booting Windows or Ubuntu.  If you boot Ubuntu you'll come to the GRUB menu.  From that menu you will have a chance of booting Windows or Ubuntu.

This will cure the problem you're describing of Grub recognizing where the OS is.

By the way, looking at your image, you have a swap partition of less than 200megs.  You might consider having a swap partition about 1 1/2 the size of the amount of ram you have.  If you have 8 gigs of ram you'd benefit in performance by having 12 gigs of ram.  The 200 megs is a teaser to the system.  You might even be better off not having a swap if you can only allocate 200 megs.


What you have is a free fall sensor, (accelerometer)
whether it is failing, or giving erroneous data, I'm not sure.
I recomend you black list the free fall sensor, and depending on how critical your hard disk drive space is, delete or clear the syslog file as well.

sudo  > /var/adm/sylog

I am suspicious that there is another issue as well, that logs should never reach 40GB in size. As in, why hasn't logrotate done its job, and rotate the logs? that is likely a separate question. On to blacklisting your hardware, to prevent the logging of its errors.

do sudo lspci -k
and look through there to identify the part which is giving you the warnings.
you can also look at lsmod, and try to figure out the module givng this error from there.
Once you have figured out the correct module, you will edit the /etc/modprobe.d/blacklist.conf file.
youll do sudo vim /etc/modprobe.d/blacklist.conf and add a line that says:

blacklist free_fall_module

after that, save and close, then reboot. you shouldn't get the errors in syslog any more.


Checking apparmor's status requires root privileges:

$ aa-status
apparmor module is loaded.
You do not have enough privilege to read the profile set.
$ echo $?
4
$ sudo aa-status | head
apparmor module is loaded.
65 profiles are loaded.
32 profiles are in enforce mode.
   /sbin/dhclient
   /usr/bin/evince
   /usr/bin/evince-previewer
   /usr/bin/evince-previewer//sanitized_helper
   /usr/bin/evince-thumbnailer
   /usr/bin/evince-thumbnailer//sanitized_helper
   /usr/bin/evince//sanitized_helper

aa-status is the command run when you do service apparmor status. Since you ran service --status-all without sudo, the check failed, and the status was negative.


Now, it's easy with GUI:

Open Kate → Settings → Configure Kate... → Editor Component → Fonts & Colors
Choose the one you want.  For custom one use: New...

It's also possible to export it. Edit it as text then import it again.


Try installing it directly from the Ubuntu Software Center or simply get it here. (Click Download for Ubuntu under Quick Install)


log in without mouse when returning after logout

Just pressing any key works on my system running Ubuntu 19.10. You can even simply start typing the password directly at the lock screen. Pressing the first letter of the password on the lock screen shows the login screen with the first letter already registered.


While Lubuntu, Xubuntu, etc exist as packages in the repos, installing them can sometimes break other desktop environments. For example I used to have problems with nautilus (from gnome) randomly drawing the desktop even after I installed Xubuntu, so I wouldn't recommend it. It would be better to try out different flavors from live cds.


ubuntu 20.04 LTS:mongod: error while loading shared libraries: libnetsnmpmibs.so.30: cannot open shared object file: No such file or directory

I just ran into the same issue and was able to fix it by removing the existing installation and installing it again https://docs.mongodb.com/manual/tutorial/install-mongodb-enterprise-on-ubuntu-tarball/ (Enterprise Edition) or https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/
I assume the version compiled for Ubuntu 18.x uses libraries that are no longer available in Ubuntu 20.x


A number of options are discussed on our sister site at Get per-core CPU load in shell script

Perhaps the most appropriate is mpstat e.g.

$ mpstat -u -P ALL 1 1
Linux 4.15.0-23-generic (t400s)     2018-07-26  _x86_64_    (2 CPU)

12:40:13 PM  CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest  %gnice   %idle
12:40:14 PM  all    3.50    0.00    1.50    0.50    0.00    0.00    0.00    0.00    0.00   94.50
12:40:14 PM    0    5.00    0.00    1.00    1.00    0.00    0.00    0.00    0.00    0.00   93.00
12:40:14 PM    1    2.02    0.00    1.01    1.01    0.00    0.00    0.00    0.00    0.00   95.96

Average:     CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest  %gnice   %idle
Average:     all    3.50    0.00    1.50    0.50    0.00    0.00    0.00    0.00    0.00   94.50
Average:       0    5.00    0.00    1.00    1.00    0.00    0.00    0.00    0.00    0.00   93.00
Average:       1    2.02    0.00    1.01    1.01    0.00    0.00    0.00    0.00    0.00   95.96

It isn't easy to get the information directly from htop for the reasons described here: htop output to human readable file


Is it worth to buy a macbook and install ubuntu on it?

It depends on which MacBook you are talking about. since the hardware differ somewhat between models.

In general terms i can tell you this from my own experience:

Macbook Air: Works flawlessly
I'm on MacBookAir5,2

Macbook Retina 15  Dual GFX card version.
HIDPI on Linux still needs a lot of work many applications look like crap.
battery time is halved because of this.
You cant switch between gfx cards without patching the grub bootloader.
No webcam support yet  at all

Macbook Retina 13
I don't have one so can't compare
probably all of the above except for the gfx switching issue. Since it only has one card.

A side not is that the touch pad driver is not nearly as well made as the one in osX
multi touch gestures, palm & thumb detection etc, but its a lot better than it was a couple of years ago.

Conclusion:
The Macbook Air is the most compatible and has the best bang for the buck.


Cannot connect to some wireless networks

This suggests that wl is incorrect for your device: Installing Broadcom Wireless Drivers I suggest you remove the driver package:

sudo apt-get purge bcmwl-kernel-source

Reboot and see if the native driver brcmsmac does a better job.


That usually means you have another program that uses apt open.  It could be Ubuntu Software Center, the program synaptic, or even another terminal that's running some apt-get ... function.

Try closing all programs that are used to manage software and trying again.

You could find out which program has the lock locked:

sudo lsof /var/lib/apt/lists/lock


I'm not sure if my interpretation is correct, but this (and this) article on OMGUbuntu read to me like you just need a certain font that supports the characters you want to be displayed. Of course for something like an onscreen keyboard app the corresponding font would need to be integrated into the app.

As far as I can tell ubuntu-keyboard is the corresponding source package and when I click round the dependencies a few times I land on ubuntu-keyboard-data which links to the Droid font or to Droid fallback and the Noto font in newer releases.

Comparing the items in your screenshot with the ones for Noto on emojipedia however indicate that the emoji-one font is used instead. The corresponding package is probably fonts-emojione from the stable phone overlay PPA which was last updated around 2016-06-17, so ideally Unicode 9 emojis should be integrated and work if you're up to date. I'm actually not sure how the parts come together.

Edit: Here is an interesting link I just found, including a test page for emoji and some more information. No, I'm not saying one should install this on Ubuntu Touch.


I think what you're looking for is under the "colors" tab. Mid-way down is a checkbox and a slide bar adjust it. Slide it all the way to the right to get full transparency. Below is a picture of it.


Symbol is just a name of a function/variable and the address of its entry point in the object file, archive (archive means static library), shared library or executable.

Executables don't need symbols, because usually nothing links to them.

The modules (plugins) may not need symbols. They are the libraries that, when loaded, execute a startup code that calls into application to give it pointers to callback function and data. But application don't call the functions from that plugin by name, so no need for symbols.

strip has an option to strip only debug information. So, it's a way to split the library and its debug information into separate files. And then it's usually distributed in separate packages: like libfoo and libfoo-dbg.


Are you sure that the USB containing Ubuntu is bootable? I'd highly recommend following this tutorial since it is the recommended way of executing this process.

Once you've done that and the problem still occurs, then the boot order in your BIOS is probably incorrect. Therefore, you need to adjust the boot sequence priority in your BIOS. Go into your BIOS setup and select the BOOT tab. Afterwards, move the USB containing the Ubuntu image on top, thus giving it the highest priority on boot.

Hope this helps. Good luck.


Force https:// and www. with virtual host apache2

This worked for me, you can test it on my domain if you like.

<VirtualHost *:80>
    ServerName freesoftwareservers.com
    ServerAlias *.freesoftwareservers.com
    Redirect / https://www.freesoftwareservers.com/
</VirtualHost>

<VirtualHost *:443>
    ServerName freesoftwareservers.com
    ServerAlias *.freesoftwareservers.com

http://domain.com

http://www.domain.com

https://domain.com

I had issues re-implementing this, and found that if I deleted 000-default.conf symlink from /sites-enabled it worked. Not sure whats the deal, but I have 0 other DNS records on the DNS side and my Apache does all the redirecting and it works.


There are a couple of good pst viewer files out there which can be used to read the contents of your files.  I used pst-utils, available from the software center which output the mail files directly into a thunderbird format - no sweat there.

Contacts are a different beast entirely.  The best solution I found starts in Windows/Outlook

Inside Outlook, select all of your contacts, and in the menu bar, choose to send them as 'business contacts' (a huge collection of vcards)
Open the draft mail, and save all of the attachements to a single directory
In a command window, change to that directory and type the command "copy *.vcf big_vcard.vcf", without the quotes
Move this new file (big_vcard) to your Thunderbird machine, start Thunderbird, Open the address book, and undertools, you can import the big_vcard.vcf file

This works OKish - you should check through your imported contact list as sometimes, especially for business with no person name, there is no name on the new contact imported into Thunderbird.


Problem with package management after interrupting ttf-mscorefonts installer

Try the below commands,

sudo apt-get autoremove
sudo apt-get clean

It will remove all the unused packages.

OR

sudo dpkg -P ttf-mscorefonts-installer
sudp dpkg -P flashplugin-installer


android phone/tablet connects to ubuntu through wireless router WITHOUT ethernet connection

i dont quite understand what your asking here but you sound like you have an impressive car, let me just list some things i know thats possible and they might help, if not sorry

Android allows you to create your own Wifi.
Try downloading and using the app Airdroid, it allows file transfer, masses on information and many others.


How to use rsync via ssh with rsa key passphrases?

If you're using rsync with a regular user, ssh-agent may be what you are looking for.

If ran into this problem while using rsync in a cron job. Cron jobs are run by the user cron in a restricted environement (some env var like SSH_AUTH_SOCK are missing, so ssh-agent does not work).

A walkthrough is to use keychain. Keychain keeps ssh-agent environement variables in a file.
So, first you install keychain.
Then, you add these lines in your .bashrc, .zshrc or .profile file (tweak it to match your ssh keys):

/usr/bin/keychain $HOME/.ssh/id_rsa
source $HOME/.keychain/${HOSTNAME}-sh

Additionnaly, to make cron jobs work, you can add this line at the beggining of your cron scripts:

source $HOME/.keychain/${HOSTNAME}-sh

More infos in this article :
http://eli.thegreenplace.net/2013/10/08/some-notes-on-logging-and-ssh-access-from-cron-jobs/


How to see actual AMD GPU frequency with radeon driver on Xenial?

For me (Ubuntu 14.04.05 LTS, so I'm forced to the open source driver for my HD5670 1GB GDDR3 card) I found this useful (setting DPM must be run as root, or a user that has driver write permissions):

When I have DPM set to "balanced":

cat /sys/kernel/debug/dri/0/radeon_pm_info

uvd    vclk: 0 dclk: 0
power level 0    sclk: 20000 mclk: 40000 vddc: 900 vddci: 0

when I force it high (default is "auto"):

echo "high" > /sys/class/drm/card0/device/power_dpm_force_performance_level

I get:

cat /sys/kernel/debug/dri/0/radeon_pm_info

uvd    vclk: 0 dclk: 0
power level 2    sclk: 77500 mclk: 66700 vddc: 1050 vddci: 0

If you prefer a GUI, there's a small project I came across, which also lets you create app launch profiles:

add-apt-repository ppa:trebelnik-stefina/radeon-profile
apt-get update
apt-get install radeon-profile

The installer failed due to a failed dependency on radeon-profile-daemon, but the tool still works.  I'm guessing this daemon has to do with older kernel versions that used a different approach for DPM.

Side note, I was playing with DPM because I noticed that while running 3D applications with Wine, my CPU cores and GPU were all very much under utilized, yet my FPS was randomly dipping down way low (i.e. 30-40 FPS) for no apparent reason.  Turning off DPM in the CPU and GPU (described above) got them up to a steady ~180-200 FPS.  I also needed to disable VSYNC lock in the driver, which I did by putting the following into a config file:

cat /usr/share/X11/xorg.conf.d/10-radeon.conf

Section "Device"
    Identifier "Card0"
    Driver "radeon"
    Option "SwapbuffersWait" "off"
EndSection

Here's my CPU output after setting it to "Performance" using the indicator-cpufreq tool installed from Ubuntu Software Center:

grep -E "MHz" /proc/cpuinfo

cpu MHz     : 3000.000
cpu MHz     : 3000.000
cpu MHz     : 3000.000
cpu MHz     : 3000.000


How do I start conky when ubuntu starts up?

I added the following command as a startup application:

conky -p 30

and it works for me.

Apparently the desktop has to have initialized before conky starts and the 30 second delay allows for this.


Unable to access encrypted LVM /home directory on Ubuntu

Nautilus is not lying to you, and your files should still be accessible. The problem is where your partitions are mounted.

First of all, your encrypted files are not actually in your home directory. They are in a hidden directory, /path/to/home/.ecryptfs/YOUR-USERNAME. Where /path/to/home is where you have mounted your home partition.

Here's one way to get at your files.

(LVM only) Mount your home partition: sudo mount /dev/VOL-GROUP/HOME-VOLUME /mnt, substituting the correct path to your home partition.
(non-LVM only) Mount your home partition: sudo mount /dev/sdXN /mnt, substituting the correct device to your home partition.
Open a terminal and change directory: cd /mnt/.ecryptfs/YOUR-USERNAME
Decrypt your home dir: sudo ecryptfs-recover-private .Private
Follow the prompts to unlock your directory.
If you have a valid password or your master key (the hex string for recovery), your encrypted home directory will be mounted on a (randomly named) folder in the /tmp dir. If you're running a live OS, You won't be able to access this directory without doing so as root.
If you want more than read-only access: sudo mount -i -o remount,rw /tmp/ecryptfs.XXXXXXXX/ replacing XXXXXXXX with the random string for your mount point.


Try this:

Insert the Ubuntu LiveUSB and reboot the computer.

The machine boots from the LiveUSB.

Click the Try Ubuntu Without Installing icon from the LiveUSB Start menu. Ubuntu boots from the LiveUSB.

Click Applications from the top taskbar in the Ubuntu desktop, and then click Accessories.

Click the Terminal option. The Ubuntu command-line terminal opens.

Type the following command at the prompt and press the Enter key.

sudo -i
umount /dev/sda5
mount /dev/sda5 /mnt
mount --bind /dev /mnt/dev
mount --bind /dev/pts /mnt/dev/pts
mount --bind /proc /mnt/proc
mount --bind /sys /mnt/sys
chroot /mnt
grub-mkconfig -o /boot/grub/grub.cfg
grub-install --root-directory=/mnt /dev/sda
grub-install --recheck /dev/sda
apt-get update
apt-get dist-upgrade
apt-get install --reinstall ubuntu-desktop
apt-get autoremove
umount /mnt
reboot


As of Ubuntu 13.04, apparently, pressing Ctrl+D adds a bookmark to the folder you're in.


USB-C to HDMI not working on Dell XPS 13 9370

It turns out that it comes down to the cable type - my cheap and dodgy USB-C to HDMI cable that I tried the first time around didn't work, but I've tried three other types now that have worked just fine.

Two of the ones that did work were also pretty cheap eBay deals, so it seems like (not surprisingly) that cheap stuff from eBay is a mixed bag. But, I can confirm my XPS13 9370 works with HDMI from USB-C!


Remote desktop conection from Ubuntu 18.04 to Windows 8

1) Get the clients IT team to port forward the RDP ports to the clients PC. I'm sure they will love that suggestion.

2) Allow the client an ssh connection to your machine and have him/her establish the connection. Something like:

ssh -R 3389:localhost:3389 -o ExitOnForwardFailure=yes <client>@<your IP>

Then you would just connect to localhost:3389

This would probably violate the clients IT policy as well.


Transfering my Ubuntu install onto a replacement hard drive

For question 2, I assume you have at least 2 IDE ports ... else there is no way to do your copy

I'd put in the two drives then boot off a live CD/USB disk.

The safest/clearest way to then copy the partition would be using gparted.


What is the purpose of each of the 5 GNU_Smalltalk Packages

You have to consult with https://packages.ubuntu.com/source/focal/gnu-smalltalk and maybe follow links for each package:

gnu-smalltalk → GNU Smalltalk interpreter and image
gnu-smalltalk-browser → GNU Smalltalk browser
gnu-smalltalk-common → GNU Smalltalk class library sources and extras
gnu-smalltalk-doc → GNU Smalltalk info documentation
gnu-smalltalk-el → GNU Smalltalk Emacs front-end

Also the -dev package may be useful too

libgst-dev → GNU Smalltalk virtual machine development files


You could play with the 'gphoto2' to see if the camera is supported. See if is recognized at all try:

gphoto2 --auto-detect

More specifics on camera model would help. 04b0:017e Doesn't seem to bring anything up for that usb device id.


apt-get resolves dependencies and can delete needless packages -> apt-get autoremove


Well, if there will be an ARM build of MATLAB, then this will be possible, but I highly doubt that Mathworks will make such release.


The man page of bash has a section PROMPTING (shouting in the original), from which I only cite the beginning:

  PROMPTING
         When  executing  interactively, bash displays the primary prompt PS1 when it is ready to read a command,
         and the secondary prompt PS2 when it needs more input to complete a command.  Bash allows  these  prompt
         strings  to be customized by inserting a number of backslash-escaped special characters that are decoded
         as follows:

          \w     the  current working directory, with $HOME
                 abbreviated with a tilde (uses the value of the
                 PROMPT_DIRTRIM variable)
          \W     the basename of the current working directory,
                 with $HOME abbreviated with a tilde

You can include the result for a command - since I don't know git well enough, I use $(date +%S) as example:

PS1='\w $(date +%S) > '

I don't understand requirement 3. Is this a request how to define colors for ls?

Ah - from the question on U&L, I think you're asking for such a thing:

In ~/.bashrc I have an entry:

# enable color support of ls and also add handy aliases
if [ "$TERM" != "dumb" ]; then
    eval "`dircolors -b`"
    alias ls='ls --color=auto'
fi

to use ls per default with --color=auto.


How to remove Windows 7 (loader) without losing data?

You should edit the /etc/default/grub file and add the following line:

GRUB_DISABLE_OS_PROBER=true

Save it and run sudo update-grub, it will remove Windows from your GRUB menu list.


Generating an app list from the old installation to run it on the new installation

Run this monster on your existing install, replace 12.04 your Ubuntu version and i386 with the architecture (i386 or amd64):

release_num='12.04'
arch='i386'

comm -23 \
    <(sort <(aptitude search '~i!~E' --disable-columns | grep -v "i A " | cut -d " " -f 3)) \
    <(sort <(wget -q -O- http://releases.ubuntu.com/maverick/ubuntu-${release_num}-desktop-${arch}.manifest | grep -E -o '^[^ ]+')) \
| sed 's/$/ install/g' > packages

It will generate a file called packages. Copy this to somewhere in your new install and then run:

sudo apt-get update
sudo bash -c "cat packages | xargs apt-get -y install"

Note: This compares the packages used on the LiveCD with the current ones. At the moment there are a few packages (gparted, btrfs-tools, etc) that are on the CD that aren't installed. If you installed gparted manually, you'll need to reinstall it on the new machine manually too. Thankfully this only applies to a few packages, all of which are simple to install if/when you realise you need it.

Also if you use any PPAs or other repositories, make sure you set them up on the new machine before you run this.


I think you can safely ignore the "pseudo random number" thing.  All of mine do that (about eight nodes so far).

Believe it or not, this is the expected behavior at this point.  The machine wakes up, checks in with MAAS, gets a temporary IP address, downloads some code, reports back its resources (you should see the RAM, number of cores and hard disk space in the console) and then... it shuts down.

If you have your BIOS set correctly then it will wake up again as required from MAAS.  BIOS should have the S3 option set in the Power-related section.  In many cases you'd set it so that it will boot up without complaining if there's no keyboard (in the POST section).  And just make sure that Wake On LAN (Onboard LAN Boot ROM) is set in the Integrated Peripherals section.

The commissioning step simply checks the system initially and I believe it also installs the Ubuntu system as well and runs update.  If you then click the Acquire button it will give the IP adapter an IP address with a longer lease (or perhaps a static IP address in this case) so that you can then, in theory, ssh to the box.  Note that you'll need to do an ssh-keygen in order to create a key pair and then paste that into the MAAS console in the SSH key area.  This should allow you then to do a:

ssh ubuntu@mynodename.domain

...answer the yes/no question about whether or not you want to connect and then use the passphrase that you provided earlier in that ssh-keygen step.  So at this point then you'd have commissioned and provisioned an Ubuntu server and connected to it via ssh, the goal of a successful MAAS install.

So then if you want to continue on and install OpenStack on top of all this (assuming that you have two or more nodes now happy), you'd RELEASE that node so that it's back again in the READY state and can be deployed by Juju.


The exclude pattern is relative to the source files, not the destination files. You're actually excluding 192.168.2.100:/etc/etc/fstab, which does not exist.

You should use:

rsync -avP --exclude '/fstab' 192.168.2.100:/etc/ /etc


Try the following, you will need to open Terminal:

sudo apt-get purge ubuntu-restricted-extras

Enter your password when prompted, then press Enter again to complete the action

That will remove the Ubuntu Restricted Extras package, now you will need to reinstall it:

sudo apt-get install ubuntu-restricted-extras

Now you have reinstalled the Ubuntu Restricted Extras package, could you please launch Rhythmbox and try playing a track.


I'm one of the unlucky owners of that computer... Its wireless chip is a Broadcom 43xx.
You can follow these instructions: https://help.ubuntu.com/community/WifiDocs/Driver/bcm43xx#b43_-_No_Internet_access


From help.ubuntu.com/community/RestrictedFormats/PlayingDVDs

By installing the libdvdcss2 package you can play
encrypted DVDs with:

Kaffeine , the Kubuntu video player
MPlayer
xine
Totem-xine
VLC media player
Ogle
XBMC Media Center

12.04 onwards works this way.

Install the libdvdread4 package ( no need to add third party repositories ) via Synaptic or command line: (note: if you have installed *ubuntu-restricted-extras this has already been installed automatically for you)

sudo apt-get install libdvdread4

Then open a terminal window and execute:

sudo /usr/share/doc/libdvdread4/install-css.sh

Rebooting may be necessary.

After this, VLC will automatically use it.


g++ not working... need to change PATH variable

After discussing with the OP in chat the output of dpkg -L g++ | grep bin was:

/usr/bin
/usr/bin/g++
/usr/bin/x86_64-linux-gnu-g++

However, when OP did file /usr/bin/g++ he got a file not found error.

I'm not sure which of the below fixed the issue, but something did:

First I had him try

sudo apt-get purge g++
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install build-essential g++

The first command removes build-essential, so it was necessary to reinstall it at the end. However, g++ still wasn't working as a command. Since the entry for /usr/bin/g++ was still not there, I had him manually add in the symbolic link with

ln -sv /usr/bin/g++-4.8 /usr/bin/g++

And that seemed to solve the issue


Try to install chromium-browser through terminal,

sudo apt-get install chromium-browser

Because in some cases if you connected to the internet through sakis3g or anyother script, installing package through software-center won't work.But terminal does.


Accessing headless virtual box web server installed on a parent server

As I can tell from your screenshots of the headless system's network configuration, you have a host-only adapter and a NAT adapter attached to Server B. Neither of these will allow outside machines to access Server B directly unless you set up port forwarding from Server A to Server B.
As Per Chapter 6 of the Virtualbox Manual:

Host-only networking is another networking mode that was added with version 2.2 of VirtualBox. It can be thought of as a hybrid between the bridged and internal networking modes: as with bridged networking, the virtual machines can talk to each other and the host as if they were connected through a physical Ethernet switch. Similarly, as with internal networking however, a physical networking interface need not be present, and the virtual machines cannot talk to the world outside the host since they are not connected to a physical networking interface.

And for NAT:

A virtual machine with NAT enabled acts much like a real computer that connects to the Internet through a router. The "router", in this case, is the VirtualBox networking engine, which maps traffic from and to the virtual machine transparently. In VirtualBox this router is placed between each virtual machine and the host. This separation maximizes security since by default virtual machines cannot talk to each other.
The disadvantage of NAT mode is that, much like a private network behind a router, the virtual machine is invisible and unreachable from the outside internet; you cannot run a server this way unless you set up port forwarding (described below).

So, as per Chapter 6 of the manual, your best bet for allowing the headless machine to easily face the outside network is to give the machine a Bridged Adapter:

With bridged networking, VirtualBox uses a device driver on your host system that filters data from your physical network adapter. This driver is therefore called a "net filter" driver. This allows VirtualBox to intercept data from the physical network and inject data into it, effectively creating a new network interface in software. When a guest is using such a new software interface, it looks to the host system as though the guest were physically connected to the interface using a network cable: the host can send data to the guest through that interface and receive data from it. This means that you can set up routing or bridging between the guest and the rest of your network.
For this to work, VirtualBox needs a device driver on your host system. The way bridged networking works has been completely rewritten with VirtualBox 2.0 and 2.1, depending on the host operating system. From the user perspective, the main difference is that complex configuration is no longer necessary on any of the supported host operating systems.[31]

By giving the headless server a bridged adapter, it will be able to connect to the wider network that Server A is actually connected to, getting its own IP Address from DHCP or from a static IP if necessary.
However, if you are running Server A as a Virtual Private Server (VPS) on some hosting service, that may not be a feasible option. In such a case, I would recommend leaving Server B with a NAT adapter that has been set up with Port Forwarding, forwarding traffic for port 80 and 443 for HTTP/HTTPS so that you can use the web server.

To configure Port Forwarding you can use the graphical Port Forwarding editor which can be found in the Network Settings dialog for Network Adaptors configured to use NAT. Here you can map host ports to guest ports to allow network traffic to be routed to a specific port in the guest.
Alternatively command line tool VBoxManage could be used; for details, please refer to Section 8.8, “VBoxManage modifyvm”.

For further information on the port-forwarding aspect (if needed) or for more information on networking in Virtualbox in general, I strongly recommend you read the relevant parts of Chapter 6 of the Virtualbox Manual.
Edit: I misread your intent to ssh into Server B directly as actually needing to access web pages, rather than SSH. The information above still stands, however. Simply open port 22 (or whatever your desired port for SSH is), as a port forward for the NAT/Host on Server A's Virtualbox Configuration, or set up a bridged adapter.


Warning: Moving a partition might cause your operating system to fail to boot

Short answers:

nothing
none

gparted message is misleading as it pertains only for OS booted with lilo, which is not used anymore on modern linux distro where Grub 2 is used most of the time.

So you have nothing to do before reallocating disk space.
And ubuntu will automatically used the space added during that process. So again nothing to do there.


Your question doesn't quite gel with the output. You've added the xbmc build dependency repo which isn't maintained and doens't have a Trusty version and that's why you're seeing errors.

Simply put, you don't need it for using xbmc or Kodi so don't use it. Get rid of it:

sudo add-apt-repository -r ppa:team-xbmc/xbmc-ppa-build-depends

You just need the main xbmc/kodi repo:

sudo add-apt-repository ppa:team-xbmc/ppa
sudo apt-get update
sudo apt-get install kodi


Theme identification (ubuntu 11.10) and file location unknown!

You can try Ubuntu Tweak, which gives easy interface to tweak desktop and system
 configuration available under utils section in Precise.

How do I install Ubuntu-Tweak?

Or you could use Dconf editor (install with sudo apt-get install dconf-tools). In Precise it's available under universe/libs section.

And you can find the themes and their configuration files in /usr/share/themes. There under the target theme directory, you can edit the configuration files (like the ones in gtk-2.0, gtk-3.0 directories) to suit your need.

Reference: Radiance theme customization in Ubuntu: edit Window decorator and all!


I just ran into this problem myself. Fixed with sudo apt-get install cgpt.


I had the same problem after letting the system upgrade with the Ubuntu upgrade tool last week. Luckily I had an older kernel still in the grub advanced menu, which worked. If you don't have another (older) initramfs/kernel, the only wayout will be to boot an installation medium, chroot the 13.10 and run apt-get upgrade that way.

Problem was a bug. They did not include all included USB drivers for the keyboard in the initramfs (dated 10th October): https://bugs.launchpad.net/ubuntu/+source/initramfs-tools/+bug/1238194

The bug-fix just arrived. I rebooted and it works here now, i.e. upgrading to 13.10 now should pull the fixed package.


Which Ubuntu desktop besides Unity can I drag rearrange taskbar icons?

Try Cinnamon.

sudo add-apt-repository ppa:gwendal-lebihan-dev/cinnamon-stable

sudo apt-get update

sudo apt-get install cinnamon

See here: Cinnamon Installing tutorial and How-to- geek


unable to access windows files in ubuntu

To see which shares are available on a given host, run:

/usr/bin/smbclient -L host

where 'host' is the name of the machine that you wish to view. this will return a list of 'service' names - that is, names of drives or printers that it can share with you. Unless the SMB server has no security configured, it will ask you for a password. Get it the password for the 'guest' account or for your personal account on that machine.

For example:

smbclient -L zimmerman

The output of this command should look something like this:

Server time is Sat Aug 10 15:58:27 1996
Timezone is UTC+10.0
Password:
Domain=[WORKGROUP] OS=[Windows NT 3.51] Server=[NT LAN Manager 3.51]

Server=[ZIMMERMAN] User=[] Workgroup=[WORKGROUP] Domain=[]

        Sharename      Type      Comment
        ---------      ----      -------
        ADMIN$         Disk      Remote Admin
        public         Disk      Public
        C$             Disk      Default share
        IPC$           IPC       Remote IPC
        OReilly        Printer   OReilly
        print$         Disk      Printer Drivers

This machine has a browse list:

        Server               Comment
        ---------            -------
        HOPPER               Samba 1.9.15p8
        KERNIGAN             Samba 1.9.15p8
        LOVELACE             Samba 1.9.15p8
        RITCHIE              Samba 1.9.15p8
        ZIMMERMAN

The browse list shows other SMB servers with resources to share on the network.

To use the client, run:

/usr/bin/smbclient service <password>

where 'service' is a machine and share name. For example, if you are trying to reach a directory that has been shared as 'public' on a machine called zimmerman, the service would be called \zimmerman\public. However, due to shell restrictions, you will need to escape the backslashes, so you end up with something like this:

/usr/bin/smbclient \\\\zimmerman\\public mypasswd

where 'mypasswd' is the literal string of your password.

You will get the smbclient prompt:

Server time is Sat Aug 10 15:58:44 1996
Timezone is UTC+10.0
Domain=[WORKGROUP] OS=[Windows NT 3.51] Server=[NT LAN Manager 3.51]
smb: \>

Type 'h' to get help using smbclient:

smb: \> h
ls             dir            lcd            cd             pwd
get            mget           put            mput           rename
more           mask           del            rm             mkdir
md             rmdir          rd             prompt         recurse
translate      lowercase      print          printmode      queue
cancel         stat           quit           q              exit
newer          archive        tar            blocksize      tarmode
setmode        help           ?              !
smb: \>

If you can use ftp, you shouldn't need the man pages for smbclient.

Although you can use smbclient for testing, you will soon tire of it for real work. For that you will probably want to use the smbfs package. Smbfs comes with two simple utilties, smbmount and smbumount. They work just like mount and umount for SMB shares.

One important thing to note: You must have smbfs support compiled into your kernel to use these utilities!

The following shows a typical use of smbmount to mount an SMB share called "customers" from a machine called "samba1":

[root@postel]# smbmount "\\\\samba1\\customers" -U rtg2t -c 'mount /customers -u 500 -g 100'
Added interface ip=192.168.35.84 bcast=192.168.255.255 nmask=255.255.0.0
Got a positive name query response from 192.168.168.158 ( 192.168.168.158 )
Server time is Tue Oct  5 10:27:36 1999
Timezone is UTC-4.0
Password:
Domain=[IPM] OS=[Unix] Server=[Samba 2.0.3]
security=user

Issuing a mount command will now show the share mounted, just as if it were an NFS export:

[root@postel]# mount
/dev/hda2 on / type ext2 (rw)
none on /proc type proc (rw)
none on /dev/pts type devpts (rw,mode=622)
//SAMBA1/CUSTOMERS on /customers type smbfs (0)

ref:  http://www.tldp.org/HOWTO/SMB-HOWTO-8.html

also please be specific in your questions, since we can't be knowing what exactly the problem is with your local env, add some more information such as the error message or any other form of dump that you got


Installation of touchfreeze and gpointing-device-settings fails

You can use syndaemon to automatically disable your touchpad while typing, e.g. do

syndaemon -i 2 -d

to disable (-i) it for 2 seconds. Read man syndaemon for more. If this solution works for you, add the command to your Startup Applications as described here: How do I start applications automatically on login?

touchfreeze isn't in the 16.04 repositories, but you can download the .tar.gz package from linux.softpedia.com and install it as explained here: How do I install a .tar.gz (or .tar.bz2) file?

gpointing-device-settings isn't in the 16.04 repositories as well and doesn't seem safe to use any more, see here for more: Is gpointing-device-settings in Ubuntu 16.04?


Taking a look around

It doesn't look like your sources.list contains http://mega.nz/linux/MEGAsync/Debian_6.0/./Packages.

You will need to check the files within /etc/apt/sources.list.d/ and find the problematic file containing this repo.  After you delete the file, or comment out the line, try sudo apt-get update to see if you've fixed the problem.

Note

If you wish to use mega.nz as a repository for MEGAsync, you will need to find the updated/correct URL, as well as determine and import the signer's public key (apt-key).  Please read up on apt and how it uses public/private keys before importing keys without understanding the consequences.


Why does a .sh file's md5sum change when copying to another folder?

MD5 is widely used as a quick way to see if a file has been unintentionally modified. The same data always has the same MD5 hash, so if you transfer a file and it has a different MD5 hash at the destination than at the source, then the file was corrupted.

This answer goes over the various common causes and solutions to this sort of problem. But if you want to try something immediately, then yes: your idea of archiving the file with tar may work. (See below for details.)

Check if the file was downloaded correctly in the first place.

First, it is best to check that the file was downloaded correctly in the first place. The website where you downloaded it may contain instructions for how to do this. If this is a script that calls md5sum, or some such utility, to compute its own MD5 hash, and you are able to run the script on the machine where you download it, that is one way of testing it.

Without specific information about how you are downloading the file, it is difficult to know the most likely causes of corruption. With installers provided as shell scripts that contain binary data, sometimes a web server tells your browser an incorrect MIME type for a file. I have had this problem myself, more than once, with .sh files I have downloaded from software vendors' websites. But I have no specific reason to think that is what is happening in your case.

A similar problem could be happening when you transfer the file between your two machines. If so, that problem is one you can solve easily.

Make sure to transfer the file between your machines the right way.

Second, you should examine how you are transferring the file from one machine to the other. Some installers provided as shell scripts contain binary data in a here document, and some protocols used to transfer files -- such as FTP -- have separate modes for text files and binary files. If a file contains binary data that is incorrectly interpreted as text while it is transferred, the destination file may be corrupted.

If you are using an old-style FTP client where you must manually set whether to transfer the file as text or binary, use binary mode anytime a file might contain binary data, including in this situation.

To be sure you are sending it as a binary file in ftp or a similar utility, you can issue the binary command (at the ftp> prompt once you're connected and ready to transfer the file), you should be told 200 Type set to I, and then you can issue the put command immediately afterward to send the file.

Many modern FTP clients automatically figure out whether to transfer a file as text or binary data by looking at how the file is named. Files with extensions like .txt, for example, may be sent as text. If the script is named in a way to indicate that it is a script -- for example, if it ends with .sh, as you seemed to indicate it does -- then such an ftp client may assume it consist solely of text, as most shell scripts do.

If your ftp client -- or perhaps some other kind of program, depending on how you're sending the file -- were to examine the inside of the file itself, and not just its name, it would likely still make this mistake, since .sh files with binary here documents usually start with a significant quantity of well-formed text.

There are a few ways to solve that particular problem. I suggest using one of the following three solutions. If you are using a protocol that is not FTP but that has different ways to transfer a file based on its type, these methods should work for that, too.

Tell your program to transfer the file as binary. For example, you could temporarily make it transfer all files as binary, or you could edit the whitelist of file extensions (.sh) or globs (*.sh) to remove the entry that causes it to treat this particular file as plain text.
Archive or compress the file so that it is unambiguously binary data. Using tar, as you suggested, it one way to do this. Note that, if you are using an FTP client where you enter commands manually, and it defaults to text mode (which is a long-standing, traditional behavior for interactive command-line ftp clients), then this will probably not help. But for most ftp clients people uses these days, it should help.
Use a different protocol. Specifically, use a protocol where files of different types aren't treated differently. For example, if you can transfer the file with sftp or scp, that is not subject to this problem -- that always treats files as binary data, and it checks to make sure they're being sent correctly, too (though you can still have a file corrupted at the destination due to truncation).

Many graphical FTP clients also support SFTP, though you must tell them you want that, which is often achieved by selecting SFTP in a menu or prefixing the destination hostname with sftp://.

Compressing or Archiving a File for Transfer

As you suggested, you can use tar. To put script.sh in a tar archive:

tar cf script.sh.tar script.sh

Then, at the destination:

tar xf script.sh.tar

Alternatively, you can compress it with gzip:

gzip -k script.sh

Without -k, gzip replaces script.sh with the compressed file script.sh.gz. So if you want the original file removed at the source, then you can simply omit -k and run gzip script.sh (or just delete the file afterwards).

Then, at the destination:

gunzip script.sh.gz

There are other compression methods, such as bzip2 and xz, but since it doesn't matter how well (or even if) the file is compressed, you can stick with gzip (or use tar, as above).

It might even work to just rename the file.

Of course, if the problem is that your FTP client (or other program being used to transfer the file) is incorrectly inferring that the file is plain text based on it being named with a suffix like .sh, then it should be sufficient to rename the file.

However, if any other mechanism is being used to detect the file's type, then that would break -- furthermore, it could be confusing to have files lying around that are named in a way that could mislead you. I therefore consider the method of just renaming the file to be brittle, and I suggest you use one of the methods above instead. (They aren't any harder than renaming -- each method takes just a single command at the source, and another single command to undo it at the destination.)


How to set/change default Download folder for Uget?

From the official documentation:

Open property by right-click on Home

Change Folder location on Default for New Download


Is there a free realtime spectrograph available for Ubuntu?

This may be a bit overkill, but Baudline is an incredible real-time FFT spectrogram. It's not in Ubuntu repos, so you will need to download it on your own. It displays a real-time analysis of source signal, but it also allows to analyze pre-recorded data. The brightness of a point represent the power of the sound at this frequency, where horizontal axis represents frequencies, and vertical time - so it kind of shows history of your signal.
It's extensive features make it definitely the most advanced spectrogram available for Linux. It may be a bit too complicated for your uses, though. I am not sure what exactly you are looking for.


OK, I finally figured this out after a lot of research and trial/error.

/usr/local/lib/libxml2.so and /usr/local/lib/libxml2.so.2 were both symlinks to /usr/local/lib/libxml2.so.2.7.2

The correct version of libxml to use was 2.9.4, which was installed at /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.4

I removed the symlinks (see below)

 sudo rm /usr/local/lib/libxml2.so
 sudo rm /usr/local/lib/libxml2.so.2

then recreated the symlinks, pointing to the correct version

 sudo ln -s /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.4 /usr/local/lib/libxml2.so
 sudo ln -s /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.4 /usr/local/lib/libxml2.so.2

Once I did this, and restarted Apache, it worked correctly.

And here I was thinking that DLL hell only existed in Windows ;)


"file too short" error while loading libtermcap.so / libncurses.so

The libncruses library is actually in /lib/libncurses.so.5.

Just make a symlink to /lib/libncurses.so.5 (or the right version, /lib/libncurses.so.5.9 in my system) into /usr/lib/libtermcap.so.2 and it will work.


Run the command

egrep -c '(vmx|svm)' /proc/cpuinfo

from an open terminal to see if this is possible.

0 means no and 1+ means yes

You may still be able to run a virtual machine if the answer is no but it will run really slow.

see here for more info

If you want to run windows programs on ubuntu, just install wine and you won't need virtualization.

sudo apt-get update
sudo apt-get install wine

Right click on the exe file and choose to run with wine.


I found a solution.
After trying different versions of video drivers and some manipulations with settings I installed firefox esr
I'm confused what the cause of the problem but even Mozilla Support didn't give any helpful advice.


how can I run my script automatically on ac switching

You should be able to do what you want with a script in /etc/pm/power.d.  Quoting from the HOWTO.hooks file in pm-utils:

  How to write a pm-utils hook:

  PARAMETERS

  A pm-utils hook is simply an executable file that accepts at least one
  parameter.

  For hooks in power.d, the potential values of that parameter are:

  true -- the hook MUST perform whatever action is appropriate when the system
      transitions TO battery power.
  false -- The hook MUST perform whatever action is appropriate when the system
      transitions FROM battery power.

You might also want to read some of the existing power hooks in /usr/lib/pm-utils/power.d for ideas about how to structure your script.

Note that if you use the pm-utils interface, you'll be told whether you're on AC power or not through the first argument: if $1 is true, then you're switching to battery power, and if it is false then you're switching back to mains power.


iptable matching rule for STUN/TURN traffic

The iptables u32 module offsets are referenced to the packet minus the ethernet wrapper (minus the source and destination MAC, 6 bytes each, and the ether type, 2 bytes. Therefore your wireshark offset of 46 needs to adjusted by 14, and should be 32.

Now, for a sanity check, find the type of service byte, which we know from the u32 area of the man pages for iptables-extensions is at offset 9 and we also know is 0x11 (17) for UDP. It is at byte 0x17 (23) of your wireshark screenshot. Counting from there, we also get 32 as the offset you should be using.

EDIT 1: Since the protocol is UDP, you also need to adjust that part of your iptables command. So:

sudo iptables -A PREROUTING -i eth0 -p udp --dport 443 -m u32 --u32 "32=0x2112A442" -j REDIRECT --to-port 3478

EDIT 2: In your example wireshark screen shot, the destination port is 5004, not 443. So the iptables command still will not work for your particular packet example. Maybe this:

sudo iptables -A PREROUTING -i eth0 -p udp --dport 5004 -m u32 --u32 "32=0x2112A442" -j REDIRECT --to-port 3478


Installation completed but not saved to hard disk

Remove the installation medium(live-usb device or live-disk).After that change the boot-order to hard-disk as the first option in bios.


Can't install libpng-dev and libtiff5-dev

You mention

  it looks like it's just looking for the wrong versions

so update your machine's software repository lists with the command

sudo apt update

This will update the lists of software packages available (including versions) available for sources listed for your machine (sources found in /etc/apt/sources.list & sources.list.d/)


There's not a PPA unfortunately, but you could install it from source.


What constructive work can be done from spare 64 bit Ubuntu System

What CAN'T be done with a spare Ubuntu system.

Learn/practice coding without the risk of tanking your main machine. And if you mess it up just reinstall.

Set up a web server to experiment with web development

Set up many kinds of servers: A file server is fairly simple to start with.

There are many more things that can be done with Ubuntu and it is an excellent platform for learning/teaching.


Cannot boot both windows and ubuntu anymore due to wrong partition processes. How do i fix this?

2 Possibilities:

Contact Lenovo Turkey and ask them for a "Recovery DVD" (Depending on the vendor, they will do this for free, charge just Shipping&Handling, or charge you a lot)
Delete all partitions, create 1 swap partition with size equal to twice your RAM, create a 64 GB / partition and a 1TB /home partition and install Ubuntu with all its updates.  Then install wine under Ubuntu and forget Windows ever existed. (which is how I'm running now)

(yes, that's not all of your disk: keep the rest as "spare" to add wherever you want in a few years time)


Bash: Download latest version of program from website via terminal

I would scrape the website’s download page in order to get the URL for the desired package.

Example: download the 32-bit version of Plex Media Server:

url=$(curl -s https://plex.tv/downloads | grep Ubuntu32 | cut -d\" -f2)
wget "$url"
dpkg -i "${url##*/}"

For other packages, you would need to examine the HTML source of the page containing download links. In the above example, I could see that the phrase Ubuntu32 only appeared once in the HTML source. Luckily, it is in the same line as the URL for the desired package: this URL is the first string of text enclosed in double quotes and the cut command provides a simple way to extract this string from the rest of the line.

Other applications may have more complicated download pages which may require more complex scripting using sed, awk or possibly a more fully-featured language such as Perl, Python or Ruby.


Why does pressing ctrl+space bring up a keyboard layout menu?

Okay so I found it was ibus that was causing the conflict, and the way to disable it is to run (sudo) ibus-setup and disable the keybinding


Oracle VM issue + Ubuntu is not starting

In my experience that usually means a damaged virtual disk, but in your case it could also be settings related. I noticed your settings don't list anything under acceleration. It would also be helpful if you mentioned whether this was a pre-built machine, or if you installed Ubuntu yourself.

Screenshot of VirtualBox 4.3.6 Default Unaltered Settings For Ubuntu VMs:

http://i.imgur.com/BAnidp6.png


How do you prevent the 2nd page in a PageStack from running?

Component.onCompleted runs as soon as the interpreter has read the QML file and parsed it into objects.  Your "page 2" object is created at this time, but it has visible: false so you can't see it.  That doesn't keep the onCompleted code from running.

I know of three ways to get code to run only when the page gets pushed to the stack:

Create a custom function that calls pageStack.push() and triggers whatever other code you want run.
Move the code from page 2's onCompleted handler to the onVisibleChanged handler.  Note that this will be called both when the page is pushed a popped from the stack; check the value of visible to tell which is happening.
Move the page 2 object into a separate file, say "page2.qml", and change the push call to pageStack.push(Qt.resolvedUrl("page2.qml")).  This will create a new page 2 object each time it's pushed to the stack; this may or may not be what you desire.

Note that all three of these will call the code each time page 2 is pushed to the stack.  If you only want it to be called the first time, you'll have to keep track of that yourself.  For more information on how object creation interacts with the pageStack, check out this answer.


how do I install a network manager on Ubuntu?

I did not realize the OP could not connect to the internet. You don't need a network manager to connect to the internet. Don't waste your time looking for a different computer and transferring the files. If you have an Ethernet cable connect the computer directly to the modem and then:

sudo nano /etc/network/interfaces

Append the following lines to the end of the file:

allow-hotplug eth0
iface eth0 inet dhcp

Ctrl+X to exit and Y to save. Then:

sudo ifdown eth0
sudo ifup eth0

You should get an internet connection. If you do not have a DHCP server use the following instead (if you don't know if you have a DHCP server, then you probably have one so nevermind the following):

iface eth0 inet static
address 192.168.1.5
netmask 255.255.255.0
gateway 192.168.1.254

Replacing the address, netmask and gateway values with the ones you are used to.

If you cannot possibly connect the computer directly to the modem, you can also manually connect to a wireless AP, though it's much more complicated.

After connecting to the internet:

sudo apt-get install network-manager

or wicd instead of network-manager - it's the one I use.

If you are not on the sudoers list issue su to become root and then do all the commands without sudo.


How can an interactive script move multiple files from one directory to another?

This script loop over all files in current directory, and ask to move to specified directory:

#!/usr/bin/env bash

set -e

read -p "enter the target directoy name:" -r dir
if [[ ! -d "$dir" ]];then
  echo "incorrect directory"
  exit 1
fi
if [[ ! -w "$dir" ]];then
  echo "directory is not writeable by current user"
  exit 1
fi

for filename in ./*; do
  [[ ! -w $filename ]] && echo "$filename cant be moved, access denied" && continue
  read -p "move $filename to directory? [y/Enter=No]" domove
  [[ ! -z "$domove" ]] && mv -i "$filename" "$dir" && echo "$filename moved successfully" || true
done


Check what kind of hardware slots are available linux

I think this will do it:

sudo dmidecode --type connector

For me, it shows a lot of ports - masses of USBs, a Firewire, ESATA and SATA connectors etc. I expect it will show an m.2 port - although it might have a different name - for example, my Firewire shows up as P1394.

If you're interested, here is the output for me, and here is the output for just sudo dmidecode.


How do I install the older GTK version of the Ubuntu One Control Panel?

The old ubuntuone-control-panel-gtk code is no longer available in the trunk source tree, or in the Ubuntu archive. The package is now a transitional package, so that people upgrading from older versions of Ubuntu to 12.04 will automatically get the ubuntuone-control-panel-qt package installed (as it is not part of the default install, due to CD size limitations), rather than having the ubuntuone-installer pop up asking them to install Ubuntu One again.

If you really must have the older version, you can tell apt to install a specific version of a package like:

  sudo apt-get install ubuntuone-control-panel-gtk=2.99.5-0ubuntu2

If it is still in the archive or your local apt packages cache (packages apt has downloaded before), it should install it. You can also download the older package from Launchpad and install it directly, with gdebi, dpkg, or similar. However, be aware that installing the older control panel will break system integration, and is totally unsupported. You get to keep both pieces if something breaks. :)


OP accidentally tried to install 32bit driver, while using a 64bit OS.

32bit driver
64bit driver

OP installed the 64bit driver, and all was resolved.


How to switch to root user but stay in the same directory

First of all, don't use sudo su. It's not wrong, or dangerous or anything, it's just inelegant and pointless. You are running two separate programs to do a job easily handled by one. If you want to start a shell as root, sudo can do it for you.

If you want to start a login shell (that's what sudo su -) does, use sudo -i. That, however, since it starts a login shell, will take you to root's home directory by default.

To start a regular, non-login shell, you can use sudo -s. That will start a root shell for you and keep you in the directory you ran it from:

terdon@tpad ~ $ pwd
/home/terdon
terdon@tpad ~ $ sudo -i  ## changes directory
[root@tpad ~]# pwd
/root
[root@tpad ~]# logout
terdon@tpad ~ $ sudo -s  ## doesn't change directory
[root@tpad terdon]# pwd
/home/terdon

So, the way to start a root shell and stay in the same directory is sudo -s.


Cron by default sends a mail to the user with the output of the commands it runs. But, as it says, no MAT (Mail Transfer Agent) is installed, so cron can't send the mail and discards the command output. You can redirect the output yourself, to a file or into the void (/dev/null) by changing your cron line to:

47 9,22 * * * cd Travel/lastsecond && scrapy crawl tours > outfile 2>&1

or

47 9,22 * * * cd Travel/lastsecond && scrapy crawl tours > /dev/null 2>&1

The second possibility is to install an MTA (sendmail, postfix or similar) - and configure it to handle local mail.

Or you could make sure that your script doesn't generate any output.


No selection menu after installing ubuntu with win 10

use live ubuntu cd

and install boot-repair

and fix it by Recommended repair in boot-repair menu


How to switch and list windows (possibly of the same application) in Unity?

One suggestion is to use the default Launcher capability to display all the windows of a running application.

Press Win - also known as the super key to display your Launcher - or move your mouse to the left hand edge to display the launcher.

You'll notice that applications with multiple windows will have "dots" next to them.

Click once to bring the first window to the foreground.  Click again to reveal all the windows for that application:

From that view you can choose which window you are interested in.

Alternatively:

Use the keyboard shortcut Alt+`

That "`" is called a grave - let go of the grave without letting go of Alt and then repress grave to cycle through the windows group.


Broken 14.04 LTS while upgrading to 16.04

You could try booting into an older kernel from the grub menu.
Holding the shift key while booting should give you the grub boot menu.

Hopefully you will see a newer kernel that was installed as part of the upgrade and also an older kernel version to boot into.

If the older kernel is an option then boot into it. Then you can try to fix any broken packages with

sudo apt-get -f install

From previous experience I normally give up and do a clean install if things don't go smoothly when upgrading. In fact when I went from 14.04 to 16.04 I just choose the clean install option.
You may be able to perceive and fix the boot problem only to find other issues exist and you may spend more time than its worth fixing them.

Worst case (and probably easiest option) I would suggest using a live cd to boot and get all your files off onto a USB drive then clean install.


Ubuntu 20.04 prompts for software updates but doesn't update

I found this similar issue :
blank software updater window
It says that it can be caused by an orphaned update-manager process.
Lets hope it can solve your problem.
Regards


Error: 'Unsupported document-format "application/pdf"'

This could mean two things:

CUPS does not know how to convert incoming PDF documents to the final format your printer (What printer model is it at all??? Troubleshooting stuff like this and trying to help you out is not easy if you are so tight-lipped...) wants.

You should check if you have installed the cups-filters package: dpkg -l cups*.
If it is missing, install it: sudo apt-get install cups-filters

CUPS does not have an entry (or a commented out entry) naming application/pdf as one of the formats allowed for print submission, and/or does not have a ruleset to allow for auto-detection of this format -- but yet some print client explicitly told CUPS that it is wanting to send application/pdf.

Check if the following entry is in /usr/share/cups/mime.types:

application/pdf

Check if above entry also has the second field like in the following line:

application/pdf                 pdf regex(0,^[\n\r]*%PDF)


Mount failed with "NFS: nfs4_discover_server_trunking unhandled error -22" - any suggestions?

Irritatingly I have just found a solution, I did run the search again with the full error message and found

https://bbs.archlinux.org/viewtopic.php?id=204532

and at the end the relevant advice to change the mount command to

mount -t nfs -o nolock,posix,nfsvers=3 ...

Obviously NFS has been updated and the Synology box hasn't (I might look at whether there are any updates for it)

I have tried the fix and it works here

I was debating whether to delete the question but as it applied to 18.04 it may be relevant to others and may be easier to find here.

Hope it is of use

graham


I cannot increase my disk space using Gparted in Vmware

sda2 contains swap space. When your VM runs out of RAM, it will temporarily move some sections of the RAM to the swap space to make room. You cannot delete/move it, because it is currently in use. You can use the command swapoff -a to deactivate it. Then you will be able to move it.
However, you will then be faced with the problem that you cannot resize sda1 (which is what you actually want to do), because it is in use too.
There are ways to resize a file system while it is in use. However, it is safer (and easier) when a file system is not in use.
The easiest way would be to download an ISO of a Ubuntu live CD and boot the VM from this live CD. The live CD comes with gparted, so you can launch it from within the live CD. The live CD probably makes use of swap, so you need to deactivate it using swapoff -a. The file system in sda1 is not used by the live CD, so you can resize it. Once you are done applying your changes, just shutdown the live CD, remove it from the VM and start your system as usual.


How to Solve Increasing Size of MySQL Binlog Files Problem?

If you do not need to keep those binary logs, you can “trim” them within MySQL like this:
mysql> PURGE BINARY LOGS BEFORE '2021-01-01 00:00:00';

Of course, you can change the date to whenever you would like. If you would like to trim to a specific binary log file, you can do it like this:
mysql> PURGE BINARY LOGS TO 'mysql-bin.12345';

Be sure to specify the actual file you are trimming to.
IMPORTANT: Do not simply delete the files from the file system. MySQL will complain at some time in the future in a terrible fashion. Save yourself the unnecessary downtime by using PURGE BINARY LOGS command from within MySQL.


I have just installed latest Zimbra desktop in Ubuntu 11.10. The following procedure should be the same for 10.10 and 11.04.

Download the compressed file from Zimbra website.
Open Nautilus as root. You can do this by running the following command in a terminal: gksudo nautilus
Navigate to the folder where the file was downloaded and decompress it.
Go inside the decompressed folder and run the install.pl (double click it and run in terminal). Accept the license, and hit enter to the default location of the files /opt/zimbra. Note: Do not install the desktop to root user.
close Nautilus as root, and open a normal Nautilus session.
Navigate to /opt/zimbra/zdesktop/linux
Run user-install.pl, by double cliking it and running it in terminal.
Accept the first folder to install your files /home/user/zdesktop.
The second folder I change it to only /home/user so I can have an accessible icon and can add it to the Unity launch by dragging from the dash and dropping it in the launcher.
Run zimbra.


How to check if openvpn is connected in Upstart?

Is openvpn an emmitting service there? I would rather it focussed on the network side of things by using upstart's net-device-up directive:

start on (started mysql and net-device-up IFACE=tun0)

You'll probably need to poke that around (I'm not sure what your VPN tunnel device is named (refer to ifconfig -a).


Any app on Ubuntu to open and/or convert HEIF pictures (.HEIC, High Efficiency Image File Format)?

In recent Ubuntu versions (>= 18.04):

sudo apt-get install libheif-examples

And then

for file in *.heic; do heif-convert $file ${file/%.heic/.jpg}; done

In older Ubuntu or Mint versions, first add this PPA and then do the above steps.

sudo add-apt-repository ppa:strukturag/libheif
sudo apt-get update


This fixed it

sudo -i
echo "blacklist ideapad-laptop"  >>  /etc/modprobe.d/blacklist.conf
modprobe -r ideapad-laptop
exit


Not able to installe ubuntu 14.04 version on windows 7 64 Bit 4 Gm Ram .

you can download metalink files using download managers such as this and this or if you're using firefox this plugin will do.


Starting from hibernate switches off the computer

After noting that the problem only happens when the hardware power button is pressed (resume from hibernation works fine when the hibernation was started from the command line or the KDE GUI) I discovered that the script /etc/acpi/powerbtn.sh was failing to detect the presence of KDE. In theory, when this script detects the presence of environments that handle the power button press by themselves, it bails out. AFAIK, for KDE it tests for the presence of kpowersave, but it is missing on this system, so the script goes on and switchess off the computer. This happens just after the systems resumes from hibernation, because the script execution was freezed when the machine entered hibernation.

I put an `exit' at the beginning of the script and now everything works fine.


After switching from Windows 10 back to Linux Ubuntu 14.04, Nvidia won't work for dual monitor

Instead of using binaries install only from the official default repositories or, if a even newer version is required, add the semi-official Graphics Drivers PPA.

Preliminary step:   Remove any traces of the previously installed Nvidia drivers with sudo apt-get purge nvidia* .

Add the additional repository and install nvidia-375:

sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt-get update
sudo apt-get install nvidia-graphics-drivers-375

Or search for Additional Drivers, select and apply the desired version.

Reboot.

This drivers are updated when required and are rebuilt for any new kernel. This is the way to install the nvidia drivers and be done forever (almost).


The command you're looking for is:

do-release-upgrade

If the system is telling you that there is no new release found you can try to get to the development version with (be careful with this as it may lead you at later times to 18.10 as soon this goes into development):

do-release-upgrade -d


Installing Ubuntu 13.04 via the Windows installer

Incase you're still looking, here's the WUBI Installer for 13.04. For all other Ubuntu releases see here.


Using alltray in Kubuntu 16.04: "ERROR get class hints"

Had the same issue, solved by building from source...

download

  wget
  https://launchpad.net/alltray/trunk/0.7.5.1dev/+download/alltray-0.7.5.1dev.tar.gz

  or

  wget https://github.com/mbt/alltray/archive/v0.7.5.1dev.zip

tar -xvf v0.7.5.1dev.zip
cd alltray*
./configure
make
cd src
./alltray

to install rung make install


How do I move the Unity launcher to the left monitor?

This is an unfortunate bug in Unity. Someone has posted a workaround, though I've not tried it myself.


Wifi not working [ No wifi adpater found ubuntu 18.04 ]

iwlwifi: probe of 0000:01:00.0 failed with error -110

Error -110 often suggests that, in a dual-boot system, Windows has not completely shut down the wireless device in order to allow it to boot quite quickly.  Since Windows still has at least partial control of the wireless device, it is not fully available to Ubuntu. Please see: https://wireless.wiki.kernel.org/en/users/drivers/iwlwifi#about_dual-boot_with_windows_and_fast-boot_enabled
Please reboot into Windows and disable Fast Boot. Reboot into Ubuntu and I suspect that the Error -110 messages will be gone and that the wireless will now be working.


Cite from https://help.ubuntu.com/community/Samba/SambaServerGuide

The shares are defined in the background using the "net usershare" command and the definitions are saved in /var/lib/samba/usershares/ . Therefore, shares defined with this method are not visible in smb.conf.


(converted OP comment to answer)

I connected a screen with a VGA connector and now I see the beautiful login screen.

My solution indicates a hardware issue not a software problem.


Can't restart apache due to invalid 'echo' command

Apparently, you have a syntax error in a config file.  The first step would be to look at /etc/apache2/conf.d/fqdn to see what it says, and perhaps post the contents of the file if you need help.  You can check this file with a text editor, or use cat or less (ie gedit /etc/apache2/conf.d/fqdn).

FYI, this file stands for "Fully Qualified Domain Name", and is normally a single line with something like this:

ServerName localhost

That should be all that is necessary for a home server.  Did you change this file?


modifier only ibus keyboard layout switching in kde

Navigate to System Settings -> Hardware: Input Devices -> Keyboard -> Advanced -> Switching to another layout and choose as you please, there are modifier-only and also normal shortcuts.

works with KDE Plasma 5


Windows 10 doesn't start after setting up dual boot with Ubuntu 20.04

Boot this directly from UEFI, it will just say Windows.
Boot0000* Windows Boot Manager

You have Windows hibernated or fast start up on, which also sets hibernation flag.
> The disk contains an unclean file system (0, 0). Metadata kept in
> Windows cache, refused to mount.

Grub only boots working Windows, or Windows that is not hibernated.
Unable to mount Windows 10 partition; it "is in an unsafe state"
Unable to mount Windows (NTFS) filesystem due to hibernation


bash substring syntax as a means of disambiguating environment variable identifiers

Substring has more function, as the name says it can be used to take a substring of a variable.
For example

var='123456789'
echo ${var:2:4}

Will output

  3456

While using array you have to use substring for accessing array variables.
For example

a[0]=0
a[1]=1
a[2]=2

echo $a will print 0.
 echo "$a[1]" output 0[1]
So accessing array variable at location 1 as follows

echo ${a[1]}

This outputs 1

echo "${a[@]}" output all variable. ie 0 1 2
In these cases substring can't be repaced with ""


How to grep series title from list of paths?

Assuming that the delimiter between the series title and the remainder of the filename is a consistent space-hyphen-space, you could do something like this with awk:
find . -type f -name '*.srt' ! -name '*.en.srt' -printf '%f\0' |
  awk -v RS='\0' -F ' - ' '!seen[$1]++{print $1}' | paste -sd,

The !seen[$1] construct de-duplicates the results. The final paste command turns the output from a newline-delimited list to a comma-delimited list.


From BIOS to Login screen now takes 20 minutes. How do fix it?

Hold down SHIFT key while booting and the boot menu will appear, from there you can select to use a previous kernel which should hopefully remedy your situation...


Policykit is not initialised in custom xsession launched via LightDM

The solution to this problem is not a .xsession script, but a custom tailored gnome session, just like unity, unity2d, gnome-classic are all varieties of the gnome desktop.

The Session file

Place this under /usr/share/gnome-session/sessions and name it docky.session

[GNOME Session]
Name=Neither Ubuntu nor Gnome
Required=windowmanager;panel;filemanager;
Required-windowmanager=compiz
Required-panel=docky
Required-filemanager=nautilus
DefaultApps=gnome-settings-daemon;synapse;

The xsession file

Place this under /usr/share/xsessions and name it docky.desktop

[Desktop Entry]
Name=Docky
Comment=This session logs you into Ubuntu
Exec=gnome-session --session=docky
TryExec=gnome-session
Icon=
Type=Application
X-Ubuntu-Gettext-Domain=gnome-session-2.0

It is just too much work to figure out which freedesktop stuff like DBus, policykit, gvfs has to be started in which order, just let the gnome-session do the heavy lifting and concentrate on what is considered essential.

EDIT: This works with 11.04 and gdm, but the session file format has changed in 11.10, so docky.session needs to look like:

[GNOME Session]
Name=Docky
RequiredComponents=gnome-settings-daemon;
RequiredProviders=windowmanager;panel;launcher;
DefaultProvider-windowmanager=compiz
DefaultProvider-panel=docky
DefaultProvider-launcher=synapse
IsRunnableHelper=/usr/lib/gnome-session/gnome-session-check-accelerated
DesktopName=Docky


Segmentation faulty tree: while running any command using apt

When an ordinary application (like apt) start segfaulting, and it seems like nothing has changed that might otherwise account for the problem, then try reinstalling the package.

sudo apt install --reinstall the_package_name

In this case, since apt is the problem, you can't do that. Instead, use dpkg to reinstall apt.

This is usually pretty easy:

The original .deb package is sitting in your /var/cache/apt/archives
dpkg will automatically overwrite the older package files with newer when simply told to --install (so you DON'T need to specify --reinstall to dpkg).

So poke around in your filesystem to find the .deb file and you get...

sudo dpkg --install /var/cache/apt/archives/exact_name_of_the_deb_file.deb

However, in this case, there's an additional problem: Sometimes folks delete the deb file from their /var/cache! They usually don't mean to - they just don't quite understand how apt works, and perhaps don't quite understand the magic shell incantations that they are inputting.

(Advice: DON'T input magic shell incantations. Take the time to understand what a command does before you run it. It might make things worse.)

You can overcome this problem by downloading the package using a web browser from http://packages.ubuntu.com. DON'T cleverly download the newest package from the newest release (that causes new problems). Just download the appropriate package for your release of Ubuntu.

Save the .deb package where you can find it. Then:

sudo dpkg --install /full/path/to/the/package.deb

If this didn't solve the segfault problem, then you have some other problem (like a wrong-release package) that simple reinstallation won't solve.


Edit /etc/apt/sources.list

add the following line:

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

update and type:

sudo apt-get -f install

sudo apt-get build-dep your_package_name

Edit

Type:

sudo apt-get remove libc6:i386=2.18-0ubuntu4

then:

sudo apt-get install libc6=2.15-0ubuntu10.13
sudo apt-get install libc6:i386=2.15-0ubuntu10.13


If you want to save the state of PS1 there is no way around saving it in some file. But you do not need to source the whole ~/.bashrc every time you want to change your prompt. You just need to change PS1 for that. Instead of aliases just use two functions that set PS1 accordingly and save the state (or rather the matching function call) in ~/.bashrcpl :

shortp () {
    PS1='${debian_chroot:+($debian_chroot)}\[\033[0;32m\]➤\[\033[01;34m\] '
    echo shortp > ~/.bashrcpl
}

longp () {
    if [[ ${EUID} -eq 0 ]]; then
        PS1='${debian_chroot:+($debian_chroot)}\[\033[0;31m\]\u\[\033[0;32m\]@\[\033[0;36m\]\h\[\033[0;32m\]:\[\033[01;34m\]\w\[\033[0;31m\]➤\[\033[1;31m\]➤\[\033[0;32m\]➤\[\033[01;34m\] '
    else
        PS1='${debian_chroot:+($debian_chroot)}\[\033[1;31m\]\u\[\033[0;32m\]@\[\033[0;36m\]\h\[\033[0;32m\]:\[\033[01;34m\]\w\[\033[0;31m\]➤\[\033[1;31m\]➤\[\033[0;32m\]➤\[\033[01;34m\] '
    fi
    echo longp > ~/.bashrcpl
}

source ~/.bashrcpl

The last line loads the last prompt used (The file is sourced and the appropriate function is called).

Saving the state is only needed in order to load a new shell with the last set prompt. If you do not need this feature just remove both lines with echo and replace source ~/.bashrcpl with either shortp or longp, whichever you prefer.

Note: I removed the check for $color_prompt. Unless $color_prompt is exported in ~/.bashrc it will not be availble when running either function in the interactive shell. You can always add another function for a monochrome prompt, if you need it.


PulseAudio & Ubuntu 14.04: Audio source switches when using USB device

Did you try this:
Launch pavucontrol from sound menu (pulseaudio volume control, install it if necessary).
Go to the "output devices" tab, and click the green "define as default" button that is near USB soundcard.


Did not found root folder browser after upgrading to latest

First of all check out what exactly is in '/' folder - do it using Terminal.

ls /

There really should be 'opt' folder. You can check out what exactly is in it by ls command or just use Nautilus.

sudo nautilus /opt

It's better to use with sudo because normal user cannot do much there.

Hope that will help.


Can't access OS selection screen or Windows files form Ubuntu

First you can fix the boot problem , you must update the grub by typing:

sudo update-grub

and you will have the boot options again.

Second for the mount error you simply start windows and then you "restart" it (so windows is fully shut down ) and on directly boot on Ubuntu when the grub shows up.


~/.xinput.d folder is ignored in Ubuntu 13.04

It should work if you put the file in /etc/X11/xinit/xinput.d

I guess the default xinput.d no longer sources the ~/xinput.d.


Ubuntu 19.04 Desktop - Dash is crashing the desktop and log out the user

I had the same problem.

Started gnome-tweaks from a terminal and disabled extensions.

Looks like Ubuntu appindicators caused the problem.


14.04, LD_LIBRARY_PATH fails after setcap cap_sys_ptrace=eip?

the answer is actually what I thought I would be forced to do (to use ldconfig), but I think it is much better this way:

install all separate versions of wine somewhere you understand it is ok to chown root:root; you may prefer to use may be /opt/Wine? I just put it all at /Wine tho (just make it sure, all its folder tree, from parentest to ./Wine is root:root)

then you just chown root:root and follow that answer (that modifies ptrace_scope and use ldconfig at the end) instructions and it will work fine and I understand it will remain secure


Easytether .deb won't install due to errors

Open a terminal ( by pressing Ctrl+Alt+T keyboard shortcut ) and type easytether connect and hit Enter, then minimize the terminal - if you close it it will end. No sudo and you don't really need to install the deb package as long as its there to be accessed.

Hope this helps.


How do I list logged-in users without duplicates?

We can pipe the output of who to awk to print only the first cell of each record (row) and then pipe it to the command sort, that will sort the values alphabetically and will output only the unique -u entries:

who | awk '{print $1}' | sort -u

Or we can use only awk in this way:

who | awk '!seen[$1]++ {print $1}'

A POSIX compliant solution, provided by @dessert - where cut will use the spaces as delimiter -d' ' and will print only the first field of each record -f1:

who | cut -d' ' -f1 | sort -u

Thanks to @DavidFoerster here is a lot shorter syntax that doesn't lose the information of all the other columns:

who | sort -u -k 1,1

For the same purposes we could use the command w with the option -h (ignore headers), for example:

w -h | awk '!seen[$1]++ {print $1}'

We could use also the command users combined with the command rs (reshape data) with the transpose option -T and then again sort -u:

users | rs -T | sort -u

We could use and who -q with transposition in the following way - where the command head -1 will crop only the first line of the output of the previous command:

who -q | head -1 | rs -T | sort -u

See also:

How do I find who is logged-in as root?
How do I get the list of the active login sessions?


Will a fresh installation of Ubuntu recognize two drives that have been in a RAID?

I had faced this predicament once. I took the gamble and formatted my boot drive. Later on i realized that mdadm can assemble the RAID arrays even after a clean installation. What this means is, you dont need to re-configure the RAID once again. mdadm does it and the RAID device would be active for the system.

Run sudo fdisk -l. This will list the RAID device, something like /dev/md0

Then run sudo mdadm --assemble /dev/md0 and you are done.

Check if it worked by running
cat /proc/mdstat

If fdisk doesnt output any RAID device, you can run sudo mdadm --assemble --scan to automatically detect and assemble the RAID

The above instruction assumes that you boot from a completely different drive and the RAID is just a media storage


How do I change the scrollbar's color in Firefox?

My theme is Ambiance and I added

style "scrollbar" {
    bg[NORMAL]  = shade (0.9, @selected_bg_color)
    bg[SELECTED]    = shade (0.7, @selected_bg_color)
    bg[ACTIVE]  = shade (0.7, @selected_bg_color)
    bg[PRELIGHT]    = shade (0.7, @selected_bg_color)

    GtkScrollbar::trough-border = 2

    engine "murrine" {
        roundness   = 8
        border_shades   = {1.0, 1.0}

        contrast    = 0.0
    }
}

in ~/.theme/copy_of_the_Ambiance_theme/gtk-2.0/gtkrc after tweaking the shades and it worked.


Launchers of snaps and flatpak applications not visible

Regarding the snap issue, if you're using zsh you might be hitting this snap bug.

A workaround is to explicitly source /etc/profile.d/apps-bin-path.sh in your .zshrc or .zshenv.


How do I install packages selectively from repositories?

In general you can't mix packages from different releases. It may work in some cases when the dependency changes do not have an impact on the package upgrade.

Your options are to either find a ppa which provides an updated version for your release, or rebuild the package yourself from the latest source, you can find how to do this at:
http://www.cyberciti.biz/faq/rebuilding-ubuntu-debian-linux-binary-package/


Some check didn't succeed on this line:

if (umask 077 && touch "$ERRFILE") 2> /dev/null && [ -w "$ERRFILE" ] &&
[ ! -L "$ERRFILE" ]

and now your .xsession-errors is instead in /tmp/file..... where dots represent a random name.

Check https://askubuntu.com/a/1156247/20275 for more info.


Create a debian package with dependency to older version of python-cherrypy3 package

This can't be done with just the dependencies on your package. Without special configuration, apt-get always prefers the highest version available, so, even if your package depends on python-cherrypy3 (<< 3.2.5), it will pick the highest version of python-cherrypy3 available. And since Ubuntu 15.10 and above have only 3.5.0+, that's what you'll get.

What you can do is provide a 3.2.5 version packaged of python-cherrypy3 in your personal repository, which uses an epoch number, so that it is preferred over the newer package. Then depend on that.


Wacom eraser working as pen? (Ubuntu 15.10)

I have a few solutions for you....

I would strongly suggest getting a new pen, but here are some ways that might work. First, you should check out this website. This person ran into the same problem as you and was able to take the pen apart to fix it
http://wishidknownthat.blogspot.com/2009/04/fixing-wacom-bamboo-pen.html

To answer you question though, yes, it would be possible to set up the eraser as your First, get the output of:

  xsetwacom --list devices

you should get something like this, but with more devices, since you have a bamboo.

  Wacom Intuos S 2 Pen stylus        id: 13  type: STYLUS
  Wacom Intuos S 2 Pad pad            id: 14  type: PAD

this will give you your DEVICE NAME. I DO NOT HAVE A STYLUS WITH AN ERASER, but you will use the device that says type: ERASER

  xsetwacom --set "REPLACE WITH YOUR DEVICE NAME HERE" Button4 "2"

That should work. Just as explination of what all that means, "button" is the side of the pen and buttons on stylus as well. usually, Button1 (or sometimes just Button) will be the tip, Button2 is the button the the side of your pen that is closer to the tip of the stylus. Button3 is the button above Button2. Button 4 should be the eraser. The number after button (in this case "2") sybolizes clicks. What i mean by that is:

2= Left click/Primary click (pen)

3= Right click (eraser)

So if you get something like parameter "Button4" does not exist, just keep changing the number until it works. This is what I had to do except mine was flipped (pen tip acted as eraser). The whole process was copious amounts of trial and error. If you try that and it still doesn't work, tell me and I will continue to help you.

Best of luck,
Caroline


Failed to install ubuntu through unetbootin- now can't boot from USB

Reset BIOS settings to default, and try hitting f7/f12 and selecting USB manually, also next step would be if your laptop has a disk drive to try booting from any LiveCD like gparted-live.iso and then wipe HD.


Have you checked, if the Windows partitions are still available. For instance in you file-manager (nautilus) or a partition tool like "disks" (not sure about the name, as I run a German version) or gparted.
If the Windows-partition are gone - sorry, but you lost Win.
If the Windows-partition(s) is/are still on the disk, open a terminal and run sudo update-grub. Copy the resulting output to an editor (gedit) and save it.
Then try a reboot and see if the grub-menu has changed. If not, paste the output from above here.


Backspace key not working in Ubuntu 18.04 LTS

Ubuntu LTS 10.04   Backspace key in my case would only delete letter by letter. Annoying if its a big text.    Solution  ;  -> applications -> universal access -> repeat keys - turn on.  Default is off ?


I followed rsync instruction to create a repo - can't update X packages from it

I resynced it with:

 rsync --recursive --links --perms --times --compress --progress --delete rsync://archive.ubuntu.com/ubuntu /ubuntu/ubuntu-mirror2/

So far, this is working. Perhaps some symlinks or timestamps were not correct.


PINE64 - Failed to spawn window-stack-bridge main process: unable to execute: No such file or directory

I went with xfce4 and that booted to desktop without any issues. Proceeded to remove unity and everything so far has worked out.


How to script a mount command involving a dm-crypt / luks volume

Is mount has some luks specific commands ? I don't know.

No, the whole encryption part is managed with the crypsetup-tools and in /etc/crypttab, both have valuable man-pages.

  How can I mount an encrypted volume via a script without having "human" interaction with my script (aka : my script type the password)?

You can use keyfiles instead of passwords. See the documentation mentioned above or search the web for tutorials and examples. There is also the script /lib/cryptsetup/scripts/decrypt_derived which allows the use of unlocked luks-devices as key. You will also find help on that topic in the web.


Can't create folders from GUI even though I'm ADMIN/ROOT

You're not the root user; you are a user which has the privilege to become root, using the sudo (or various graphical surrogates) method.

In Ubuntu (and in most not-embedded Unix environment) you normally work, and have the privileges, of a normal user. Only deliberately you can override the normal rules; it is a way of telling you that you have to know what you are doing. It is a great safety net that works normally quite well(1).

For example, although it can have legitimate uses, trying to add manually a file to /usr/bin is normally wrong.

You can find all the info you need here: https://help.ubuntu.com/community/RootSudo

(1) although remember that Unix, in general, gives you rope(2) if you really want to hang yourself.

(2) You can run the file manager application as root, as explained in the other answer.

Alas, you shouldn't.

This is the rope I mentioned in (1). A wrong click, a spurious double click, and you can have a completely messed up system, to the point of having to reinstall it. I am a power user, and I have to use root powers maybe... once a week? And most of the time is just to install some program, which you can do easily via the graphical application.

You should be able to do all of your work in normal mode; copy and paste between places you own works perfectly with the graphical interface. Why and what are you trying to copy to /usr/bin?


aptitude ugrade does not change my kernel

Turned out to be dead simple.

sudo update-grub

automatically found the newer kernels and set the latest one as the default.

Now all I have to do is remove the old ones.

Plenty of documentation on that subject.

Thanks for all the pointer.


Installed new graphics card, broke my drivers

Solved the problem by running sudo apt-get purge nvidia-* in tty2
(Ctrl+Alt+f2). In retrospect I probably should have tried this sooner.