How can I get a list with the packages selected by apt-get autoremove?

Since as per your comment you want to list only the packages that are going to be removed:

apt-get --dry-run autoremove | grep -Po '^Remv \K[^ ]+'

grep command breakdown:

-P: Interprets the given pattern as a PCRE (Perl Compatible Regular Expression) pattern
-o: Prints only the matched string instead of the whole line

Regex breakdown:

^: matches the start of the line
Remv: matches a Remv string
\K: excludes the previously matched substring from the matched string
[^ ]+: matches one or more characters not

$ apt-get --dry-run autoremove | grep -Po 'Remv \K[^ ]+'
libapache2-mod-php5
php5-readline
php5-cli
libonig2
libqdbm14
php5-json
php5-common


Removing files with a certain extension except one file from terminal

Here's the simple solution you should probably use:

mv filename.gif filename.gif.keep
rm *.gif
mv filename.gif.keep filename.gif

There's nothing special about the .keep extension, this just makes it so that the filename temporarily doesn't end in .gif.

If you must not rename the file (and there are scripting situations where this is important):

for X in *.gif; do
    if [ "$X" != "filename.gif" ]; then
        rm "$X"
    fi
done

Or you can write it shorter like this:

for X in *.gif; do [ "$X" != "filename.gif" ] && rm "$X"; done

You may prefer to use find instead; it's very powerful, you might consider it more readable, and it better handles weird filenames with characters like * in them.

find . -maxdepth 1 -not -name 'filename.gif' -name '*.gif' -delete

I've used the -not operator for readability, but if POSIX compliance is important--if you're not using GNU find, or if this is for a script you intend to redistribute to others or run on a variety of systems--you should use the ! operator instead:

find . -maxdepth 1 ! -name 'filename.gif' -name '*.gif' -delete

One handy thing about find is that you can easily modify the command for case-insensitivity, so that it finds and deletes files with extensions like .GIF too:

find . -maxdepth 1 -not -name 'filename.gif' -iname '*.gif' -delete

Please note that I've used -iname in place of -name for the search pattern *.gif but I have not used it for filename.gif. Presumably you know exactly what your file is called, and -iname will match alternate capitalization not just in the extension, but anywhere in the filename.

All these solutions only delete files residing immediately in the current directory. They don't delete files not contained in the current directory, and they don't delete files that reside in subdirectories of the current directory.

If you want to delete files everywhere contained within the current directory (that is, including in subdirectories, and in subdirectories of those subdirectories, and so forth--files contained within the current directory or any of its descendants), use find without maxdepth -1:

find . -not -name 'filename.gif' -name '*.gif' -delete

Be careful with this!

You can also set other values with -maxdepth. For example, to delete files in the current directory and its children and grandchildren but not any deeper:

find . -maxdepth 3 -not -name 'filename.gif' -name '*.gif' -delete

Just make sure you never put -delete first, before the other expressions! You'll see I've always put -delete at the end. If you put it at the beginning, it would be evaluated first, and all the files under . (including files not ending in .gif and files in deep sub-sub-sub...directories of .) would be deleted!

For more information, see the manual pages for bash and sh and for the commands used in these examples: mv, rm, [, and (especially) find.


You can run the panel from a terminal, so any informational output is displayed in the terminal (or you could redirect it to a file, using shell redirection).

$ # replace extant panel
$ gnome-panel --replace

You can run applets from the command line as well. First, remove from the panel, then run the applet binary (perhaps having first used 'ps' prior to removal to see what the binary is). Once you've started the binary, then use the panel "Add to panel..." to run it. Its output will then be displayed in the terminal. You can also run applets using gdb in this way.


what is the difference between snap and apt/apt-get?

Both snap and apt are package management systems. Apt was designed to work with Debian distributions, like Ubuntu, while snap is universal and used on various range of Linux distributions. Apt simply installs contents of the package in a location specified in the package description, and software installed in this way may require system or 3rd party libraries, while snaps are self-contained, run in a sandbox and do not communicate directly with the host system.
Also apt is free and is the part of the Debian project, while snap was created commercially.


Installation Error for MySQL Server on 16.10

Try starting over utilizing a "LAMP" tutorial to guide you. The sources below pertain to Ubuntu 16.04. There may now be new posts for Ubuntu 16.10.

  LAMP Server is a collection of open source software used to create a
  web server. The collection consists of:

Linux – the operating system
Apache server – the server
MySQL – the database system
PHP – the programming language

Quote above from: SudoJuice

To install the default LAMP stack in Ubuntu 10.04 and above
Install Apache, MySQL, PHP (LAMP) stack on Ubuntu 16.04
Install Lamp Server on Ubuntu


Access Ubuntu Webserver from behind DHCP Router

It's pretty straight forward.  You'll need a static IP set on your ubuntu server, this IP will sit within your LAN.

For example...

Virgin Media Superhub - 192.168.0.1
Ubuntu Web Server - 192.168.0.5

You will need to enable port forwarding on your superhub to point to your Ubuntu server IP.  If you're looking just to host http, you'll only need to forward port 80, tcp.  If you want to also use SSL, forward 443 tcp.

The next thing you'll need is to select a Dynamic DNS provider.  This service sits and listens for requests from your Ubuntu server, your server will report it's public IP address to the service, and then the service will assign a dynamic DNS entry to point at your public IP.  When your IP changes, the service will be aware of that change and then reassign to your new IP.

I won't go into detail about the selection, becuase Ubuntu has a community wiki page that will continue being maintained with the latest and greatest.

That information can be found here.  https://help.ubuntu.com/community/DynamicDNS


Blinking Cursor and black screen when booting from USB - Lubuntu

I Have the same issue. Check bios settings, I find that the reason it does not boot is the bios is set to limit the interpretation of USB as floppy, which is quite common for old machines I guess, changing it to be hdd solved the issue


How to set a default option for dpkg --configure -a?

That's a job for yes, if you always want the answer N:

yes N | dpkg --configure -a

Or Y (works without an argument):

yes | dpkg --configure -a

Or over the dpkg options, see dpkg --force-help:

[...]
[!] confnew            Always use the new config files, don't prompt
[!] confold            Always use the old config files, don't prompt
[!] confdef            Use the default option for new config files if one
                       is available, don't prompt. If no default can be found,
                       you will be prompted unless one of the confold or
                       confnew options is also given
[...]

Use then (for example):

dpkg --configure -a --force-confnew


I just came across this googling, so I might be a bit late to the party, but it says you're using 10.04, which means that the ubuntu repositories ship a very outdated version of love.

My ppa (the official one) ppa:bartbes/love-stable provides up to 0.7.1, which, too is outdated. I have, however, heard that the dependency that was once lacking, might be available in 10.04 now, using the backports, so it might be worth grabbing a newer deb and seeing whether that works.


I can't open nautilus after executing rm -rf ~/.ddd/

You ran a completely wrong command

rm -rf ~/ .ddd/

It removed your home directory ~/.

The correct command was

rm -r ~/.ddd/

You added a space there. You seem to be a bit careless with adding spaces.

Since your home directory is gone, I suggest re-installing the system.

Beware that you lost all your files. Be careful in the future.


I want to know if Ubuntu will work better than Windows XP on my Dell inspiron 1300

Definitely have a try on linux! XP including all necessary updates and Service Packs makes an old Notebook like that much to slow to use. The next big blocker is the year 2014. Microsoft will not deliver any updates for XP anymore beginning with April 9th. After that date you can be sure to get more and more viruses and trojans after security holes have been discovered in windows libraries used by newer versions and XP.

2GB of RAM should be ok for working with ubuntu/kubuntu/lubuntu/xubuntu etc.... but don't expect a fast system like using new hardware.


Avidemux can do this. Install it from - http://avidemux.sourceforge.net


How Do I Fix Unmet dependencies Linux-Image-Generic etc

Fire this at command line:

 $ sudo apt-get install -f

This checks your lib and if it finds unmet dependency, it'll fetch the needed files and install them.

Meanwhile - that dependency version of image-generic told me that you are running on 12.04.  Perhaps this case will do the trick:

    $ sudo apt-get install syslinux-themes-debian-wheezy
    $ sudo apt-get upgrade && sudo apt-get dist-upgrade
    $ sudo dpkg-reconfigure -a


This post

https://unix.stackexchange.com/questions/149451/install-r-in-my-own-directory

says:

$ wget http://cran.rstudio.com/src/base/R-3/R-3.4.1.tar.gz
$ tar xvf R-3.4.1.tar.gz
$ cd R-3.4.1
$ ./configure --prefix=$HOME/R
$ make && make install

Maybe you didn't do step 3, cd.

configure should run for several minutes, probing your system. It creates a lot of output. If configure stops with an error, I cannot help you further, unfortunately.


I always set up my swap to be as large as my RAM. This is required for hibernation, but I don't use it.

So, in your case you should have a swap partition that is 6GB.


Tried to reset Admin PW, but Ubuntu isn't recognizing Admin account. How do I fix this?

passwd doesn't take the full name of your account; it takes the username (and AFAIK, in Ubuntu, usernames can't start with a capital letter). You can get the corresponding a full name's corresponding username with this command:

grep ':PUT FULL NAME HERE' /etc/passwd | cut -d: -f1

(replacing PUT FULL NAME HERE with the full name you want to search for)

Alternatively, if you don't know the full name you want, you can get a list of usernames and their corresponding full names, seperated by a :, with this command:

cut -d: -f1,5 /etc/passwd | cut -d, -f1

In this case, your username is probably aviator (with a lowercase 'a').

P.S. Ubuntu 15.04 is EOL. It shouldn't affect passwd, but you should upgrade to the latest version (currently 16.04), or at least go to 14.04 or 12.04 if you can.


If your Intel Core Duo 1.83 GHz is a T2400, try this:
Refind:
Is a boot manager that will allow you to choose between Mac OS X, Gnu/Linux, and other operating systems when you boot your computer.
Installing rEFInd makes the dual-boot process easier.
Go to the rEFInd page on SourceForge to download the latest refind-bin-0.8.7.zip file:
Download site
Open a Terminal window by pressing Command + Space and, typing Terminal, and pressing Enter.
Drag and drop the install.sh file from the downloaded zip file into the terminal window and press Enter to run it.
After it was installed successfully.
Shut down your Mac — a full shut down, not a restart.
You should see the rEFInd boot manager screen.
You’ll need to download an Ubuntu ISO file:ubuntu-14.04.2-desktop-i386.iso
Download site
Burn the ISO to disc or follow Ubuntu’s official instructions to create a bootable USB drive from the ISO file.
Instructions Here
Restart your computer and rEFInd will appear.
Select the USB or disc drive containing the Ubuntu system and boot it on your Mac.
Launch the Install Ubuntu application from the desktop and install Ubuntu as you normally would.
Be sure to select the Install Ubuntu alongside Mac OS X option instead of overwriting your Mac OS X system with Ubuntu.
The installation process should otherwise be normal.
Whenever you boot your computer, you’ll have the ability to choose between Mac OS X and Ubuntu on the rEFInd boot manager screen.


Error while installing virtual box (secure boot on)

Maybe a Kernel issue,
First install mainline here
Then downgrade the kernel to 5.4 by:
installing it
edit sudo vim /etc/default/grub as follow
GRUB_DEFAULT="**gnulinux-5.4.112-0504112-generic-advanced-06ee5ff5-b952-4d40-858f-869172f710ce**"

GRUB_TIMEOUT_STYLE=hidden
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=lsb_release -i -s 2> /dev/null || echo Debian
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""
Update grub sudo update-grub then sudo reboot
After reboot sudo apt remove virtualbox-dkms and then sudo apt install virtualbox-dkms to rebuild for the 5.4 kernel
then sudo modprobe vboxdrv
done!


How to open or convert .GPK (audio) files?

It seems that wavelab is only avaiable on Windows and MAC. You could try to use wine or a virtual machine with windows on it. I've found no other application that opens/converts this type of files.


ubuntu 16.04 installed on second physical drive

the /dev devices are actually linked to physical devices so

/dev/sda=sata port1
 /dev/sdb=sata port2
 ..

the numbering starts from the first non empty port; so to have the ssd as sda instead of sdb you have to physicaly change its port in front of hdd

as noted in comments chmod works for linux type file systems; you could trick NTFS by editing /etc/fstab and adding uid=xxx,gid=xxx,dmask=xxx,fmask=xxx
in the mount options; so every folder/files will have these attributes/id's

uid=user id
gid=group id
dmask=directory mask
fmask=file mask

see man mount or https://linux.die.net/man/8/mount for details


Ubuntu is already installed in parallel to windows, how do I replace Windows entirely?

If you have Ubuntu and Windows already installed in separate partitions (that is, Ubuntu was not installed using Wubi), I think it's just a matter of booting into Ubuntu and from there (1) reformat the Windows partition(s) using your filesystem of choice (ext4 for example) and (2) run sudo update-grub to automatically remove Windows from the GRUB list.

In your question, I don't understand why you're trying to boot from CD. If Ubuntu is already installed then there should be no need. Maybe I'm missing something?
Anyway, if the boot sequence goes straight to GRUB, it could be that:

booting from CD is not enabled in your BIOS settings, or it's after the HDD in the sequence
the CD is damaged


Adding shared folder to onedrive through terminal

I would like to add a shared folder (onedrive folder that somebody else shared with me).

What account type are you using? Personal? Business/Office365?
If Personal, you add the 'shared folder' using the OneDrive web interface, by using the add to my OneDrive, then the 'shared folder' will automatically sync without further configuration.
If you are syncing a Business/Office365 shared folder, you need to configure this functionality as per https://github.com/abraunegg/onedrive/blob/master/docs/BusinessSharedFolders.md
As you are also running Ubuntu, make sure you are using either the Ubuntu PPA or building the client from source. Simply installing via 'apt install onedrive' will install an older client version. Be sure to check your client version with 'onedrive --version' and compare this to https://github.com/abraunegg/onedrive/releases. Latest release currently is v2.4.5 with v2.4.6 due by end of September 2020.


I believe a sudo apt-get autoremove will help you with that and sudo apt-get autoclean

If you are not using something older then 12.04


How to change the title of the current terminal tab using only the command line

from @Maythux, this one works for my needs to disregard my auto-prompt current-directory on terminal.

PROMPT_COMMAND='echo -en "\033]0;New terminal title\a"'

Instruction

Change the string on "New Terminal Name" with $("pwd"):

PROMPT_COMMAND='echo -en "\033]0; $("pwd") \a"'

This will automatically change the title even when you add a new tab.

I use the setting below which looks better, you can also play bash programming and set your own.

PROMPT_COMMAND='echo -en "\033]0;$(whoami)@$(hostname)|$(pwd|cut -d "/" -f 4-100)\a"'

Add this setting to your ~/.bashrc.


ssh is the client application.  If you want to start the service to accept ssh connection, that is sshd.  Try

sudo service start sshd

If that doesn't work, make sure openssh-server is installed.  If not, install it and then try the above.

Hope this helps.


How do I get IP of installed network printer

Using lpoptions

lpoptions  -p <printer_name> | awk '{for (i=1; i<=NF; i++) {if ($i ~ /device-uri/) {print $i}}}'

Example

$ lpoptions  -p TOSHIBA_e-STUDIO2330C | awk '{for (i=1; i<=NF; i++) {if ($i ~ /device-uri/) {print $i}}}'
device-uri=socket://192.168.20.43

To get an overview lpinfo

Example

$ lpinfo -v | grep -P '://'
network dnssd://HP%20LaserJet%201022n._pdl-datastream._tcp.local/
network dnssd://TOSHIBA%20e-STUDIO2540C-07279076._printer._tcp.local/
network socket://192.168.20.201
network socket://192.168.20.203
network socket://192.168.20.204
network socket://192.168.20.205
network socket://192.168.20.206
network socket://192.168.20.207
network socket://192.168.20.43

or nmap

nmap -sT <adress_or_address_range>

and grep the service printer

Example

$ nmap -sT 192.168.20.43

Starting Nmap 6.47 ( http://nmap.org ) at 2015-07-03 08:38 CEST
Nmap scan report for 192.168.20.43
Host is up (0.0017s latency).
Not shown: 991 closed ports
PORT     STATE SERVICE
21/tcp   open  ftp
25/tcp   open  smtp
80/tcp   open  http
139/tcp  open  netbios-ssn
445/tcp  open  microsoft-ds
515/tcp  open  printer
631/tcp  open  ipp
8080/tcp open  http-proxy
9100/tcp open  jetdirect


Whenever I encounter error messages about missing drivers / files / shared libraries, I will try to find out which deb package the file can be found in:
apt-file search swrast_dri.so
--> libgl1-mesa-dri: /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so

Then I will install that package
sudo apt install libgl1-mesa-dri

and try again.
If apt-file isn't installed, you can install it by typing
sudo apt install apt-file
apt-file update

That being said, anki is one of the very few packages I'm downloading directly from their website apps.ankiweb.net because it's a very active project. Installation instructions are provided on the same page. If you do this, make sure to remove the packaged version from your system beforehand: sudo apt remove anki


How do I get a  UDTT704D USB tv tuner working?

http://linuxtv.org/wiki/index.php/Main_Page is the authoritative resource for TV on Linux.

See if you can spot your device being supported at http://linuxtv.org/wiki/index.php/Hardware_Device_Information

If not then I'm afraid it's game over unless you can find someone to write you a driver (not trivial) :)

My initial quick scan of that site and the general Internet suggests no, it's not supported.

(I realise it's not optimal to just link to answers but copying a Wiki into Ask Ubuntu isn't a productive use of time either) ;)


Try running:

sudo grub-install /dev/sda

If that doesn't work, boot from a live CD, and run the bootrepair program.


The graphic experience is how you will experience the desktop environment

If you're on standard it means that you can run Unity 3D on your computer

It used to be a different changeable option before 10.10(?). It had 3 modes determining the amount of effects used in Compiz

Related: How can I get my graphics card to be recognized in System Info?


Ubuntu Terminal Command "cd -" makes a Loop!

If you want to go 1 level higher in directory tree, you do

cd ..

So if you are at home/dir1/dir2/dir3/mydir this command will take you to home/dir1/dir2/dir3.

Same command another time to home/dir1/dir2.

If you want to go from home/dir1/dir2/dir3/mydir to home/dir1/dir2, you do

cd ../..

The command you tried cd - takes you to previous directory.


ppa-purge removes the PPA and downgrades the packages:

Start the rescue mode in GRUB
Start the network
Start the root shell
Run apt-get install ppa-purge
Run ppa-purge ppa:xorg-edgers/ppa
Run exit
Reboot


Go to System Settings->Printers, then move your mouse pointer over the bar at the top of the screen to make the menu appear and select Server->Settings.  Select Publish Shared Printers ..., Allow printing from internet and Allow users to cancel any job ...


GNOME Bottom pannel missing (Ubuntu 14.04)

Try to reinstall the GNOME desktop packages. Login to Unity (or to another desktop environment of your choice like KDE or press Ctrl-Alt-F1 to go to the tty1 session which is a CLI/Command Line Interface) , open a Terminal window (or go to tty1 as I said above) and run this command:

sudo apt-get install --reinstall gnome

Since the GNOME Panel files are corrupted, you need to reinstall the GNOME packages because you don't know what files are corrupted. So, a reinstallation is recommended.

Hope this helps. If you need more, feel free to contact me.


Ubuntu 9.04 not starting after Installation

I don't know what is wrong and how can I help, but You should know that support for 9.04 version is until 23 October 2010, so I recommend upgrade of Ubuntu version.


Multiple problems: Wine Counter Strike freezes AND Transfer of big files stucks when transferred to PEN DRIVE

Issue 1: As already mentioned in the comments, use the native version of Counter Strike. (It should be in your Steam games library already!)

Issue 2: You've probable got MLC pen drives that are really slow, so Ubuntu copies the data to the cache and then doesn't freeze, but keeps writing from the cache to the pen drive until it's finished.

If you want fast pen drive performance, you should buy SLC ones...  (they're 2-4 times more expensive then the cheap ones though, but they last longer)

Issue 3: You should write one question per issue because no one knows everything about Ubuntu (for the record: nor do I) and the more issues in one question, the less likely you are of finding a solution to your issues.


ext4 - Bulk File Storage Only - Journal Enabled vs Disabled?

I'm going to assume that your question is ( and it isn't clearly stated so you should edit that ) whether ext4 on a bulk storage volume, and more specifically the journal feature provides a benefit over either ext2 or ext4 but without the journal.

The benefit of the journal specifically is that you don't have to run e2fsck on the volume to try and recover it after an unclean unmount or shutdown ( i.e. sudden powe r failure ).  That is a pretty good reason to use it in general.  ext4 also introduces several other features that make it a much better filesystem than ext2, even if you otherwise format it for ext4, then disable the journal ( with tune2fs ).  In particular there is the extents feature that allows the filesystem to list large ranges of blocks that belong to a file as a group rather than having to allocate many, many indirect, double indirect, and triple indirect blocks to list every single one.


'Failed to download file' error when trying to download Ubuntu 18.10 in Rufus 3.3

The "Failed to download file." error is thrown when running an old version of Rufus. Download the 3.5 (or current) version to fix the issue.

If the download feature in Rufus 3.5+ doesn't work, download the Ubuntu .iso file manually from the official ubuntu.com website, and then browse in Rufus to the Ubuntu .iso file that you downloaded instead of downloading it from Rufus.

In Ubuntu, there is a built-in terminal program named wget that allows the user to resume interrupted downloads from the same place where the download was interrupted without needing to download the whole file again from the beginning. There are also web browser extensions and download managers for Windows that have a resume interrupted downloads feature.


Ubuntu / Bash recognising "export PATH=$PATH:~/..." but not "export PATH=$PATH:/home/..."

Your home directory is probably not /home/, it's probably something like /home/sibow/. Do this to see for yourself: echo ~ and ls /home

–  glenn jackman Jan 10 '15 at 14:42


Ok, solved. I have now internet access and ping/ssh access from my local machine in the Ubuntu 20.04 VM.

My following simplest as hell netplan configuration in my Ubuntu 20.04 VM machine is:

network:
   ethernets:
      enp0s3:
        dhcp4: true
      enp0s8:
        addresses: [192.168.56.102/24]
   version: 2

I guess, by parallelism, the enp0s3 interface of my Ubuntu 20.04 VM, which IP is 10.0.2.15 (the same as my eth0 interface in my Ubuntu 14.04 VM), is the one used for internet. So I guess it will take the NAT conection of VirtualBox to access to the internet, and the enp0s8 (I took that name because I remember after a fresh install of the VM I saw that interface) will take the host-only interface, as eth1 does in my Ubuntu 14.04 VM.

I didn't set any other config because I guess the DNS resolution of the second interface will take the default of the system, or will reuse the one of the interface used for internet access, the gateway will be automatically deduced from the static IP, and the rendered will probably be networkd by default, or maybe the default in servers.


I pretty much solved this by moving to Kubuntu and Dolphin. It was a deal-breaker for me and the error message was as useless as the common Windows' Something happened.


The apt-get install codeblocks command doesn't install the latest version of codeblocks.

I installed using the PPA from the website and it worked


You can download Ubuntu here.

During the install you will be asked what language you would like to install Ubuntu in.

Ubuntu Installer

Even if you somehow manage to mess that up you can always fix that later.

Go to 'System Settings' >>> 'User Account' >>> 'Language

Settings


If you have no icons on your desktop, then it is likely that your desktop is not being drawn by the file manager.

To fix this, install gnome-tweak-tool, and from there, enable the option to allow the file manager to draw the desktop:


This laptop is Nvidia optimus enabled. Unfortunately Nvidia doesn't support it on linux. So you need to install bumblebee. This will enable you to turn off your Nvidia GPU to save battery and use only when required.

Installation Instruction

Type the following in terminal,

sudo add-apt-repository ppa:bumblebee/stable
then
sudo apt-get update
To install Bumblebee using the proprietary nvidia driver:

sudo apt-get install bumblebee bumblebee-nvidia
(change $USER to your username) in following commmand

sudo usermod -a -G bumblebee $USER
Reboot.

If you just want to disable nvidia card, no need to learn followings

Usage Instruction :

To run a program with nvidia card, use optirun command prefixed in terminal.
Like to run glxspheres with nvidia card type

optirun glxspheres

To run firefox type : optirun firefox &

Note: If you intend to run 32-bit programs like Wine and using Ubuntu 11.10 Oneiric or later, install 32-bit libraries with:
sudo apt-get install virtualgl-libs:i386 libgl1-mesa-glx:i386 libc6:i386


Ubuntu partition does not turn on, but Windows partition works fine

Use Shift + F2 after choosing ubuntu from bootloader to show boot messages.
Alternative would be to boot from usb drive (as a live system) and backup your data before you try to repair your ubuntu from usb drive.


Extend Ubuntu partition when no other partitions are available

In order to resize a partition, the partition must be unmounted, that means that you cannot resize from your current installation. You will need to boot with a live CD/USB (such as the one you used to install ubuntu)

Boot into a live ubuntu and fire up gparted (it should already be installed in any live cd/USB) and resize the partition from there. gparted is a simple, graphical and intuitive program used to create/delete/resize partitions.


You need to install the VBox guest utilities to add support for the virtualised graphics hardware.

sudo apt-get install virtualbox-guest-utils virtualbox-guest-x11 virtualbox-guest-dkms

Previously you might have needed the "ose" versions:

sudo apt-get install virtualbox-ose-guest-utils virtualbox-ose-guest-x11 virtualbox-ose-guest-dkms


How to setup ethernet on Ubuntu Server 16.04

I suggest that you amend your interfaces file to include DNS nameservers and to clean it up a bit:

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto enp5s0
#iface enp5s0 inet dhcp

iface enp5s0 inet static
      address 192.168.0.130
      netmask 255.255.255.0
      gateway 192.168.0.1
      dns-nameservers 192.168.0.1 8.8.8.8

Restart the interface:

sudo ifdown enp5s0 && sudo ifup -v enp5s0

Did you get the requested address?

ifconfig enp5s0

Are you connected?

ping -c3 www.ubuntu.com


Eclipse 4.2 (Juno) crashes on Ubuntu 12.04 (Precise)

There could be a bug that has been fixed.
You can try and run an update on Eclipse:
Click on the menu Help, then on Check for updates.

You will then wait a bit and if there are updates, a list of packages will come up. Just follow the instructions on the screen.


‘Install Ubuntu’ not showing allocated space or ‘delete Windows and install Ubuntu’ option

Here's the official LiveUSB download-and-create tutorial and the official installation tutorial. You should follow and complete the first before starting the second.

In the installation, you will not see "Delete Windows and install Ubuntu", it's "Erase disk and install Ubuntu" as shown in this step of the install tutorial. However, since you altered the disk partitions in Windows, you should choose "Something Else" and then look for a spin box at upper right which lets you select which drive you will install to.


Octave-4.0.0 Configuration step warnings in Ubuntu 15.04 (HDF5/jni.h not found)

If you try to define multiple CPPFLAGS variables on the command line, only the last one will apply. Instead, you should be able to combine both include directives into a single variable as a quoted string:

CPPFLAGS="-I/usr/include/hdf5/serial -I/usr/lib/jvm/java-7-openjdk-amd64/include"

e.g.

./configure \
  CPPFLAGS="-I/usr/include/hdf5/serial -I/usr/lib/jvm/java-7-openjdk-amd64/include" \
  LDFLAGS=-L/usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)/hdf5/serial


Would a Unity lens written for Unity 3D also work in Unity 2D?

Yes, lenses are interchangeable between 2D and 3D.

Once installed on a system a lens will show up on either desktop. From a development standpoint you don't need to worry which one a user is using, Unity itself handles all that stuff for you.


List all MAC addresses and their associated IP addresses in my local network (LAN)

You can use the Nmap utility for this. Nmap is a free network scanner utility.

Try just:

sudo nmap -sn 192.168.1.0/24

Please substitute your network identifier and subnet mask.

How to find a network ID and subnet mask

Use command ip a:

bash~$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host valid_lft forever preferred_lft forever
2: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
    link/ether c4:85:08:94:ee:9a brd ff:ff:ff:ff:ff:ff
    inet 192.168.3.66/24 brd 192.168.3.255 scope global wlan0
    inet6 fe80::c685:8ff:fe94:ee9a/64 scope link valid_lft forever preferred_lft forever

Here at point 2, I have the wlan0 device. It says inet 192.168.3.66/24 brd 192.168.3.255 scope global wlan0, IP address: 192.168.3.66, subnet mask: 24. Network ID is 192.168.3.0, just substitute the last number by 0.

Or as man nmap says:

sudo nmap -sn 192.168.1.0/24

Here is a little quote from the man page, nmap(1):

-sn (No port scan)

  This option tells Nmap not to do a port scan after host discovery, and only print out the available hosts that responded to the scan. This is often known as a “ping scan”, but you can also request that traceroute and NSE host scripts be run.

This is by default one step more intrusive than the list scan, and can often be used for the same purposes. It allows light reconnaissance of a target network without attracting much attention.

Knowing how many hosts are up is more valuable to attackers than the list provided by list scan of every single IP address and host name.

  Systems administrators often find this option valuable as well. It can easily be used to count available machines on a network or monitor server availability. This is
  often called a ping sweep, and is more reliable than pinging the broadcast address because many hosts do not reply to broadcast queries.

  The default host discovery done with -sn consists of an ICMP echo request, TCP SYN to port 443, TCP ACK to port 80, and an ICMP timestamp request by default.

When executed by an unprivileged user, only SYN packets are sent (using a connect call) to ports 80 and 443 on the target.

When a privileged user tries to scan targets on a local ethernet network, ARP requests are used unless --send-ip was specified. The -sn option can be combined with any of the discovery probe types (the -P* options, excluding -Pn) for greater flexibility.

If any of those probe type and port number options are used, the default probes are overridden. When strict firewalls are in  place between the source host running Nmap and the target network, using those advanced techniques is recommended. Otherwise hosts could be missed when the firewall drops probes or their responses.

  In previous releases of Nmap, -sn was known as -sP.


How to prevent Ubuntu from deactivating "Other software" repository after upgrade?

You can't (or shouldn't) prevent third part repositories to be disabled during upgrade.

They are disabled to ensure that they do not interfere with the update process. As part of the preparation to the upgrade note down what third part repositories you have, and after update enable them again.


Unity 3D editor window filled with pink color

Have same problem with Intel HD 4000 and OpenGL 4.2 (Core Profile) Mesa 18.3.6 trying to run Unity3D 2019.3.0a2 and 2019.2.0b2 under Debian.

Found the problem on Unity3D forum: https://forum.unity.com/threads/everything-pink-in-unity-2019-1-0f2-linux-editor-except-menu-bar.663277/

Intel HD 4000 specific issue and they won't fix it (there is quote from support in the post). Based on posts, works with Unity3D 2018.X but not 2019.X . Also should work under Windows.

Unity3D 2018.4.0f1 is markes as LTS (Long Term Support) so I would need to stick with it until I get newer machine (and recommend you to do the same).
Working with integrated graphics is not good (especially with one which does not support 4K like mine).


Modifying the numerical values with awk in a file , following a matching pattern only

I don't think there's a simpler way to do this in awk than to iterate over the fields:
$ awk '{for(i=1;i<NF;i++){if($i == "-period") $(i+1) *= 0.9}} 1' inputfile.txt
clock -period 4.5 -name clk1
clock -name txclk2 -period 9
clock -period 6.3 -name clk3
input_delay -clock clk1 4.0

If you want the specific floating point format, then
$ awk '{for(i=1;i<NF;i++){if($i == "-period") $(i+1) = sprintf("%.2f",0.9*$(i+1))}} 1' inputfile.txt
clock -period 4.50 -name clk1
clock -name txclk2 -period 9.00
clock -period 6.30 -name clk3
input_delay -clock clk1 4.0

Note: I omitted -F, and OFS="," since your files as shown are whitespace delimited.


Why some non-root program can be executed by double-click while others not?

Simple reason is that file manager recognizes the file type. If you double-click /usr/share/applications/firefox.desktop or any other .desktop file for that matter, the file manager will execute it as application. Otherwise, file manager looks up which filetype corresponds to which application.

And that's were /usr/lib/firefox/firefox comes in. It is compiled as shared object.

$ file   /usr/lib/firefox/firefox
/usr/lib/firefox/firefox: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=d2a4bfe9dbe1aadd5480a6b5612b7a3fc1fd01a2, stripped

This type of file has been touched on in detail in kos's answer, but basically shared object is an executable file, which can be used as library. Libraries usually are included into other software, hence Nautilus can ignore and has no default program assigned to it. By contrast, to shell (or rather kernel, to which execve() call will pass the path to that file) recognizes that as executable file just fine.

Now, what gets executed when you execute firefox.desktop ? That's /usr/bin/firefox.sh - a wrapper script which does a few checks and replaces itself with /usr/lib/firefox/firefox later on. In this case, shell script is detected as filetype and Nautilus happily spawns that. There's a lot of other things that happen behind the scenes, but that's the general gist of it all.


Ubuntu 16.04 LAMP MySQL dpkg install problems

I had this exact issue. Look in your /etc/mysql/ directory for a file with a "deb10flag" in the filename. (I can't remember exactly what the file  was named when I did this as it was a month ago.) I resolved it by removing the file with the debian10flag. This setting generated by the MariaDB installation (it sets the deb flag to version 10). I deleted /etc/mysql/ and cleaned out any trace of it from the bin. After doing all of that, there's a dependency issue with the mysql setup in the package repository. mysql-cli and mysql-server both depend on mysql-common. This is fixed (I think) by installing them in this order: (1) mysql-common, (2) mysql-cli, (3) mysql-server.

**I know this isn't clear. I'll reply with the exact steps that I used to fix   this (soon). But the issue concerns the deb10flag and the dependency issues.

https://askubuntu.com/a/766094/407584Same issue


Check you are in same directory where it downloaded. If not, go to the directory where it downloaded using the cd command.
Give execute permission to the file using the command: chmod u+x file
Now try to execute ./example-file
If asked for root permission, prefix the command with sudo


How to specify caps lock and control key mapping on a per-keyboard basis?

I've tried to solve a different problem, but I think it could have spin-offs for you. The writeup is here:
https://github.com/bjohas/Ubuntu-keyboard-map-like-OS-X

My concrete suggestion would be to use xkb instead of xmodmap. xmodmap seems to be the older technology, and it's slow. I've had more success with xkb. There are examples for remapping modifiers. (While xkb is faster and perhaps more reliable, it - unfortunately - is not really user configurable. So I keep my configuration to hand, so that I can restore it after upgrades.)

Hope this helps!


Right click anywhere in the terminator window and choose "Preferences", your desired option should be found under "Profiles"->Background":


Ubuntu 16.04 Asus Mediatek MT7630E doesn't work

This driver (on GitHub) works pretty well for me:

Installation

You need kernel headers to build the driver

As an example, on Debian and derivatives, assuming you're on an amd64 system:

sudo apt install build-essential linux-headers-amd64

That's all for dependencies.

First give some file execution permission:

chmod u+x install test uninstall bpatch

Now to install it, run:

./install

To test it without installing, run:

./test

To uninstall, run:

./uninstall

To install with dkms:

sudo make dkms

The driver will automatically load at startup.


How to execute a command after a certain period of inactivity, triggered by keyboard & mouse activity and full screen window?

Running a command after idle time, triggered by both full screen and mouse/keyboard activity

Hi Paranoid Panda, the script below should do as you describe.

The issue was that both having a (any) window full screen, as well as mouse- or keyboard activities should reset the "real" idle time. Since xprintidle cannot be reset from command line, I solved it by subtracting the idle time from itself on the occasion of a full screen window:

In a loop, the scripts looks up the current idle time
if any window is maximized (checking if any window is as large as the screen's resolution, using both xrandr and wmctrl -lG), the current idle time is subtracted from the idle time, resulting in a correct "real" idle time, even when the window is not full screen any more.

The script

#!/usr/bin/env python3
import subprocess
import time
import sys

idletime = int(sys.argv[1])
command = sys.argv[2]

get = lambda cmd: subprocess.check_output(cmd).decode("utf-8").strip()

def get_res():
    xr = [s for s in get(["xrandr"]).split() \
          if "+0+0" in s][0].split("x"); xr[1] = xr[1].split("+")[0]
    return xr

res = get_res()

def check():
    front = [l for l in get(["xprop", "-root"]).splitlines() \
             if "_NET_ACTIVE_WINDOW(WINDOW):" in l][0].split("#")[-1].strip()
    front = front[:2]+(10-len(front))*"0"+front[2:]
    try:
        wdata = subprocess.check_output(
            ["wmctrl", "-lG"]
            ).decode("utf-8").splitlines()
        match = [l for l in wdata if front in l][0].split()[4:6]
        if match == res:
            return True
        else:
            return False
    except subprocess.CalledProcessError:
        pass

minus = 0; real_idle = 0; t1 = 0; due_1 = False
while True:
    time.sleep(1)
    fscreen = check()
    t2 = int(int(get(["xprintidle"]))/1000)
    if t2 < t1:
        minus = 0; real_idle = 0
    else:
        if fscreen == True:
            minus = t2
    real_idle = t2 - minus
    due_2 = [real_idle > idletime][0]
    if all([real_idle > idletime, due_1 != due_2]):
        subprocess.Popen(["/bin/bash", "-c", command])
    due_1 = due_2
    t1 = t2

To use

the script needs wmctrl and xprintidle:

sudo apt-get install xdotool xprintidle

Copy the script into an empty file, save it as run_ontime.py
Run it by the command:

python3 /path/to/run_ontime.py <seconds> <command>

where the command needs to be between quotes if it contains spaces. I tested it for example with:

python3 /path/to/run_ontime.py 10 "firefox askubuntu.com"

which did the job :)

Note

The command is executed once every time the time passes idle time.


Graphics card crippled after upgrade to 21.04

The driver to use should be 460 at the time of this writing: https://www.nvidia.com/Download/driverResults.aspx/172376/en-us (for reference only, do not install from here, all the required drivers are available at the Ubuntu rpeository)
Experimenting with different driver versions without properly deleting all remains of the previous version often results in conflicts.
Using Additional Drivers at all times should prevent the aforementioned problem but generally such "experiments" are strongly discouraged. Install the proper version and don't touch it, the system will automatically install updates when and if needed.
In order to assure the correct and best driver is installed without conflicts please do the following, in terminal:
sudo apt-get purge nvidia*
sudo ubuntu-drivers autoinstall


Which graphics cards are supported by the new AMDGPU driver in Ubuntu 16.04?

I believe your answer can be found from the command line.

$ man -k amd
amdgpu (4)           - AMD RADEON GPU video driver
pamdeinterlace (1)   - remove ever other row from a PAM/PNM image
pamdice (1)          - slice a Netpbm image into many horizontally and/or vertically
radeon (4)           - ATI/AMD RADEON video driver

man radeon gives a list of supported hardware, as well as a link to their wiki:

SUPPORTED HARDWARE
       The radeon driver supports PCI, AGP, and PCIe video cards based on the following ATI/AMD chips
       (note: list is non-exhaustive):

       R100        Radeon 7200
       RV100       Radeon 7000(VE), M6, RN50/ES1000
       RS100       Radeon IGP320(M)
       RV200       Radeon 7500, M7, FireGL 7800
       RS200       Radeon IGP330(M)/IGP340(M)
       RS250       Radeon Mobility 7000 IGP
       R200        Radeon 8500, 9100, FireGL 8800/8700
       RV250       Radeon 9000PRO/9000, M9
       RV280       Radeon 9200PRO/9200/9200SE/9250, M9+
       RS300       Radeon 9100 IGP
       RS350       Radeon 9200 IGP
       RS400/RS480 Radeon XPRESS 200(M)/1100 IGP
       R300        Radeon 9700PRO/9700/9500PRO/9500/9600TX, FireGL X1/Z1
       R350        Radeon 9800PRO/9800SE/9800, FireGL X2
       R360        Radeon 9800XT
       RV350       Radeon 9600PRO/9600SE/9600/9550, M10/M11, FireGL T2
       RV360       Radeon 9600XT
       RV370       Radeon X300, M22
       RV380       Radeon X600, M24
       RV410       Radeon X700, M26 PCIe
       R420        Radeon X800 AGP
       R423/R430   Radeon X800, M28 PCIe
       R480/R481   Radeon X850 PCIe/AGP
       RV505/RV515/RV516/RV550
                   Radeon X1300/X1400/X1500/X1550/X2300
       R520        Radeon X1800
       RV530/RV560 Radeon X1600/X1650/X1700
       RV570/R580  Radeon X1900/X1950
       RS600/RS690/RS740
                   Radeon X1200/X1250/X2100
       R600        Radeon HD 2900
       RV610/RV630 Radeon HD 2400/2600/2700/4200/4225/4250
       RV620/RV635 Radeon HD 3410/3430/3450/3470/3650/3670
       RV670       Radeon HD 3690/3850/3870
       RS780/RS880 Radeon HD 3100/3200/3300/4100/4200/4250/4290
       RV710/RV730 Radeon HD 4330/4350/4550/4650/4670/5145/5165/530v/545v/560v/565v
       RV740/RV770/RV790
                   Radeon HD 4770/4730/4830/4850/4860/4870/4890
       CEDAR       Radeon HD 5430/5450/6330/6350/6370
       REDWOOD     Radeon HD 5550/5570/5650/5670/5730/5750/5770/6530/6550/6570
       JUNIPER     Radeon HD 5750/5770/5830/5850/5870/6750/6770/6830/6850/6870
       CYPRESS     Radeon HD 5830/5850/5870
       HEMLOCK     Radeon HD 5970
       PALM        Radeon HD 6310/6250
       SUMO/SUMO2  Radeon HD 6370/6380/6410/6480/6520/6530/6550/6620
       BARTS       Radeon HD 6790/6850/6870/6950/6970/6990
       TURKS       Radeon HD 6570/6630/6650/6670/6730/6750/6770
       CAICOS      Radeon HD 6430/6450/6470/6490
       CAYMAN      Radeon HD 6950/6970/6990
       ARUBA       Radeon HD 7000 series
       TAHITI      Radeon HD 7900 series
       PITCAIRN    Radeon HD 7800 series
       VERDE       Radeon HD 7700 series
       OLAND       Radeon HD 8000 series
       HAINAN      Radeon HD 8000 series
       BONAIRE     Radeon HD 7790 series
       KAVERI      KAVERI APUs
       KABINI      KABINI APUs
       HAWAII      Radeon R9 series
       MULLINS     MULLINS APUs

Reference: http://xmodulo.com/how-to-check-graphics-card-on-linux.html

This is a good tutorial to view information about your GPU.  I especially like lspci | grep -E "VGA|3D" and sudo lspci -v -s ##:##.# (using the numbers you found from the previous command).


How to get laptop lid to suspend & resume, and wifi to reconnect with Ubuntu 16.04

To get ACPI to perform suspend create /etc/acpi/events/lidbtn and /etc/acpi/lidbtn.sh as below.

sudo sh

cat <<. >/etc/acpi/lidbtn.sh
#!/bin/sh
# Initiate suspend mode when the lid has been closed.

# Only act on a lid close event
if grep -q open /proc/acpi/button/lid/LID0/state
then
    dbus-send --system --print-reply --dest=org.freedesktop.login1 /org/freedesktop/login1 "org.freedesktop.login1.Manager.Suspend" boolean:true
fi
.

cat <<. >/etc/acpi/events/lidbtn
# Laptop lid event triggered.  Call /etc/acpi/lidbtn.sh

event=button[ /]lid
action=/etc/acpi/lidbtn.sh
.

exit

I also tried /usr/sbin/pm-suspend and sudo /lib/systemd/systemd-sleep suspend as alternatives to the dbus-send line, but these resulted in wifi not authenticating reliably after resume.  I found /etc/default/acpi-support to be helpful background reading, stating that acpi-support is deprecated and dbus-pm, dbus-hal, or pm-utils are the current methods.

Other reference links: power-closelid, running-script-before-suspending-while-using-dbus, UPower


Does the ntfs-3g driver still corrupt disks/files/folders?

No. If such cases still happen they are documented already. Remember that the ntfs-3g driver is mostly a reverse engineering effort to make NTFS partitions readable and writeable in Linux-based OS's.

There's a list of known issues in the Tuxera support page.


"[drm] nouveau 0000:04:0.0: PFIFO_DMA_PUSHER" in the kernel.log file and the boot freezes

Looks like there is a problem with either your card or (more likely) the drivers. You are using Noveau, the open source drivers. You can try to install the proprietary drivers to check that they work.

As the computer hangs as soon as you get into graphical mode you will need to install them from the command line. There are two ways in which you can obtain a command line:

When the computer is hanged try to hit CTRL + ALT + F1, if you are lucky this will take you to a text only mode where you can login.
In the boot menu, select safe mode.

Now you will need to install the drivers. This command should do it:

sudo apt-get install nvidia-current

Reboot(*) and hope that it works. If it doesn't you can try an older driver, just boot again to the command line and type:

sudo apt-get remove nvidia-current
sudo apt-get install nvidia-173

or:

sudo apt-get remove nvidia-173
sudo apt-get install nvidia-96

(*)To reboot from the command line, use:

sudo reboot


How to change console language in Ubuntu 20.04

From Ubuntu 18.04 upwards, you should issue localectl status to see the current locale and change it with sudo localctl set-locale en_US.UTF-8.
From the manual: This takes one locale such as "en_US.UTF-8", or takes one or more locale assignments such as "LANG=de_DE.utf8", "LC_MESSAGES=en_GB.utf8", and so on. If one locale without variable name is provided, then "LANG=" locale variable will be set. See man locale for details on the available settings and their meanings. Use list-locales for a list of available locales.
Reboot is required.


Upgrading Ubuntu versions, keep files but remove programs

This will be a little tricky since you don't have an external drive to copy your files to, but it shouldn't end up terribly. I still think you should get at least a >32GB flash drive as a temporary backup in case things go badly.

I think the best plan is to downsize your current Ubuntu partition as much as possible (you can resize it further during the installation, but it's good to at least start) and then use that partition as your data partition. The data partition will be integrated, so there will be no need for manual copying.

Here's the procedure:

Preparation

Create your installation media. I recommend a USB stick instead of a DVD. There are countless tutorials on how to burn to a USB, so I won't provide instructions here.
Create a backup of /home somehow. You don't have to do this, but I strongly recommend it. /home will be big, so you'll need a big flash drive.

Setup

Install Gparted so you can resize your partitions:

sudo apt-get install gparted

Open Gparted and find the partition of your Ubuntu installation. It shouldn't be hard to find; it should be the big ext4 partition, provided you don't have a multi-boot situation.
Right click this partition and choose the Resize/Move option. Resize the partition from the right until there's about 10GB free space
Hit OK and then the Apply button (the green checkmark).

More setup

Boot into your Ubuntu installation: choose the Try Ubuntu option, as there is some more setup needed.
Search for and open Gparted. It's already installed in the Live Environment.
Create a new ext4 partition in the free space you created before and apply the operation.
Once the operation is finished, open the file browser and click the partition in the sidebar to mount it.
Right click the partition and choose the Properties option. Record the UUID or name given there.
Now, open a terminal. Run:

sudo cp -pr /home /media/ubuntu/THENAMEYOUCOPIEDEARLIER/

That should copy everything in your Home directory to the other partition.

Once the copying is finished, go back to Gparted.
Now, format the Ubuntu installation partition as ext4. Make sure it isn't the data partition.
Now, downsize that installation partition even more. Make it 40-60GB, depending on how big your hard drive is.

You want your data partition to be bigger than the installation partition.

Unmount the data partition and move it to the left to fill the newly-created free space.
Resize it to fill the free space.
Apply the operation. It might take a while, so give yourself some time.
Remount the data partition and find your user folder there. Rename it to something else. username1 is fine if you want.

Installation

Open the installer and go through the steps until you reach the installation location options.
Choose Something Else... and continue.
Right click the installation partition and go into the properties.
Choose to use it as an ext4 partition and mount it at /.
Do the same for the data partition, but mount it as /home.

Make sure that the Format option is not checked for this partition. The other one doesn't matter.

Proceed with the installation.

Post-Install

When the installation finishes, don't restart. Instead, open the file browser and mount the data partition.
Run:

sudo cp -pr /media/ubuntu/THATUUIDYOUCOPIEDEARLIER/THEUSERFOLDERYOURENAMED/ /media/ubuntu/THEUUIDAGAIN/THEUSERFOLDERTHEINSTALLATIONCREATED/

That will copy the files from your old user folder into the new one.

Now you can reboot into Ubuntu.

Conclusion (I guess?)

Hopefully, this will give you a full data transfer, but also a fresh reinstall.

To save space, I recommend deleting the old user folder.

Again: Please be careful. I REALLY recommend that you at least copy what you need to a flash drive. Ubuntu can always go crazy, as with any OS.

If you want to be cautious and need any more explanation for something, please ask. I'll be happy to help.


/etc/amavis/conf.d/20-debian_defaults http://pastebin.com/5xuvNVtD

Change line 36 to something like this:

$sa_tag_level_deflt  = -999;  # add spam info headers if at, or above that level

After saving and restarting of the service or reloading the configuration, all the emails should have the x-spam-status header.


How can I make a .deb file from a bash script?

You would need to make a package from scratch using the packaging guide to create the package.  You'd have to make sure the package is compliant with Lintian as well, all this is outlined in that guide.  Either that, or have someone package it and put it in a PPA for you.


Ubuntu 14.04 for high performance computing cluster

Short answer is yes you can install OpenStack and MaaS on 3 computers. You will have to manually install it, as the automated script requires 7 computers in total. Otherwise, and you may have to anyways, you will have to build containers on each device. See https://help.ubuntu.com/lts/clouddocs/en/Intro.html


ubuntu not booting after fixing windows and vice versa!

You need to turn off Fast Startup in Windows.


apache2 virtualhost .htaccess file doesnt seem to work

Try to edit mysite.se.conf:

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    DocumentRoot /home/felix/job/fello
    ServerName test.fello.se
    ServerAlias www.test.fello.se
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
    <Directory "/home/felix/job/fello">
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>

And check path to you site /home/felix/mysite or /home/felix/job/fello ?


Can I make deb files for documents and other non-binary content?

If the package do not publish in public space, but that is only for your own local use, you can make the deb package by the below steps.

In this example, Package name: doc-sample, Package version: 0.1, the final installing directory is /usr/share/doc/doc-sample/sample-docs.

Step1: Prepare directories to make the deb package.

The name of directory need to include version number.

mkdir -p doc-sample-0.1/sample-docs
cd doc-sample-0.1

Then, add the documents which you want to install , in doc-sample-0.1/sample-docs directory.

Step2: Prepare debian directory in default form.

Run the below command in doc-sample-0.1 directory.

dh_make -n -s -e (mail_address)

(mail_address): ex. user@example.com

If it is the form of a mail address, it does not matter even if it is not the mail address actually used anything.

Step3: Remove unneccesary texts.

rm debian/*.ex debian/*.EX debian/README.Debian debian/README.source

Step4: Make the setting file named "(package_name).install" to install documents.

nano debian/doc-sample.install

Describe using the form: (documents_directory_name) space (install_directory)

sample-docs  usr/share/doc/doc-sample

When you install the final deb package, the sample-docs folder will install to /usr/share/doc/doc-sample directory in this case. (Caution: each files are compressed in .gz form)

Step5: Building deb package.

If you will build the deb package only for your own local use, you can skip promptings for the GPG signatures on the .dsc file and the .changes file.

Run the below command in doc-sample-0.1 directory.

dpkg-buildpackage -us -uc

So, you can get the deb package named doc-sample_0.1_i386.deb in upper directory.

If you want to publish in a public space (ex. PPA), you need to consider the license of a document, and sign the .dsc file and the .changes file by using GPG key.

For details, please refer to the documents for developers.


How to keep an external hard drive spinning?

I had been looking for that answer for a Seagate  FreeAgent drive, the 2 answers I found were 1) use the Seagate utility on a Windows machine to disable auto-spindown, or this page which explains how to do the same on Linux using sdparm. (but as psusi pointed out, when the drive goes into auto-spindown it shouldn't unmount, at least on recent kernels.


Is there a way to active 3d on a Geforce Go 7400?

You need to add UNITY_FORCE_START=1
It's Explained how to do that here: Geforce Go 7300/7400 Blacklisted, Can I Still Run Unity?
Also, make sure you have the drivers installed (go to additional drivers and see if there are any for download)


In Nautilus (the file browser), select File > Connect to ... and select WebDAV. Enter the information you need, such as a host name, a directory, port and username. Check the box to create a bookmark, and you'll find it in your Files and Folder lense and in the left pane in Nautilus.

You'll be able to use your WebDAV share as if it were a local folder.


Why is the dock icon for ukuu so distorted?

Here is the solution

That because StartupWMClass option is missing in desktop-file. To fix that run a few commands:

cp /usr/share/applications/ukuu.desktop ~/.local/share/applications/
echo 'StartupWMClass=ukuu-gtk' >> ~/.local/share/applications/ukuu.desktop


Trying to boot from Windows CD goes to GRUB

If you are trying to boot a Windows CD, then you should change the boot device order in the BIOS. It has nothing to do with the GRUB boot-repair. If it's not booting then it's a problem with your Windows CD or the system hardware.

To change the boot device order in your BIOS, you should press Esc or some function key based on your system at the beginning of the boot process.


I have 4029 bad sectors. Should I worry?

First of all you should take a backup.

Now should you worry! Mmmm. Ok let's first define a bad sectors.

There are two types of bad sectors — often divided into “physical” and “logical” bad sectors or “hard” and “soft” bad sectors.

A physical — or hard — bad sector is a cluster of storage on the hard drive that’s physically damaged. The hard drive’s head may have touched that part of the hard drive and damaged it, some dust may have settled on that sector and ruined it, a solid-state drive’s flash memory cell may have worn out, or the hard drive may have had other defects or wear issues that caused the sector to become physically damaged. This type of sector cannot be repaired.
A logical — or soft — bad sector is a cluster of storage on the hard drive that appears to not be working properly. The operating system may have tried to read data on the hard drive from this sector and found that the error-correcting code (ECC) didn’t match the contents of the sector, which suggests that something is wrong. These may be marked as bad sectors, but can be repaired by overwriting the drive with zeros — or, in the old days, performing a low-level format.

Ok now how to repair these bad sectors in Linux:

Open a terminal window.

Type the following command:

 sudo e2fsck -cfpv /dev/sdXX

Replace "sdbX" with your actual device name, this can be an entire drive, such as "sda" or a partition, such as "sda1. "

The parameters have the following meanings:

"c" searches for bad blocks and adds them to the list
"f" forces a check on the file system
"p" repairs anything that can be safely repaired
"v" is verbose mode so you can see the command progress.

The "e2fsck" command can take a long time to run, even several hours on a particularly large drive.

Exit the terminal after the "e2fsck" command is finished.

Now it's better to run e2fsck on unmounted disks, so I advise you to do it using a live CD.

Learn more about e2fsck man e2fsck

source


Error while upgrading to 12.04 --Trouble fetching files

These are 'extras' for Ubuntu 11.04 ('Natty').

This release reached end-of-life recently, and is no longer supported for security and other updates.

See: Ubuntu 11.04 (Natty Narwhal) reaches end-of-life on October 28, 2012

If you need to be using a long-term-support release, you should be using 12.04 LTS (or possibly 10.04 LTS on very old equipment).

If you are currently using 11.10 (Oneiric):

Is there any reason you still have Natty-specific resources in your setup? Otherwise, removing these two lines will solve this error.

If you are still on 11.04 (Natty):

You should not be attempting to upgrade directly to 12.04, but instead first upgrade to 11.10.

Note: As you have not already done so, and may not be up-to-date, it would be better to do a clean install of 12.04 LTS instead (after backing-up all settings and user data). Any issues you may have with upgrading from 11.04 are not supported, as 11.04 is no longer supported.


Is Zenity progress bar affecting variables

Increment and everything seems to be absolutely fine. But all the increments are taking place inside a subshell that is being passed to zenity. This is the reason why you are not getting the changes when you echo them outside the subshell. I am using your script, only adding something to print the variables inside do while loop on zenity popup window. To know more about the syntax of zenity progress dialog see the gnome help page. Run the script below and see the result,

#!/bin/bash
i=0
p=0
(while [ $i -lt 100 ]
do
    i=$[$i + 10]
    echo $i ; sleep 1
    echo "#  now i is $i and p=$p"
    p=$[$p + 1]
done) | zenity --progress --title="test" --text="test"
echo "i: $i p: $p"

I changed increment of i to 10 as i will be used to make the increment of progress bar and used sleep 1 to make the progress perceptible.

Observation:
Though the value are showing to be incremented on zenity pop-up. It is showing to be unchanged on terminal, i: 0 p: 0

Hope this would be helpful.

How to Use subshell variables outside

  The parent shell can not use variables from its subshell. You could find more about subshell here . But you can always write variables from subshell to a temporary file for its parent to read. It may not be the best of the ways but it works.

#!/bin/bash
..
(while [ $i -lt 100 ]
do
    ...
    ...
done
echo "p=$(echo $p)" > tmp
echo "i=$(echo $i)" >> tmp
) | zenity --progress --title="test" --text="test"
. tmp
rm tmp
echo "i: $i p: $p"

Now it will show up in the terminal like, i: 100 p: 10 so you an use them at your wish. And as you asked in last part, it is not the while loop rather it is subshell. It is custom to put contents of subshell inside parentheses.


Ubuntu Gnome 14.10 - desktop performance degraded when certain apps are running

If you have Integrated Intel graphics, you could try

sudo apt-get install xserver-xorg-video-intel

then rebooting. This worked for me on a Dell XPS laptop - everything became smooth again.  Source: https://bugs.launchpad.net/ubuntu-gnome/+bug/1385764

If you subsequently have problems with

optirun glxgears

giving "Can't open secondary"...

Try,

 sudo apt-get install nvidia-331-updates

then

 gksudo gedit /etc/bumblebee/bumblebee.conf

Under the section [bumblebeed] change the Driver: Driver=nvidia

Under [driver-nvidia] change references in this section from nvidia-current to nvidia-331-updates.  That's in the KernelDriver, XorgModulePath and LibraryPath.

Then reboot, and try

optirun glxgears

Source: http://mylinuxexplore.blogspot.co.uk/2014/03/solved-nvidia-cant-access-secondary-gpu.html


On downloading Ubuntu Desktop, the .iso files gets converted to a zip file

The Ubuntu iso file did not get converted to a zip file. WinRAR associated the iso file type to be opened with its zip unzip utility. To prevent this from happening install 7-Zip free, open-source file archiver in Windows 10 instead of WinRAR.


'~/.bashrc' vs ' /etc/skel/.bashrc'. Why are there two '.bashrcs'?

Every file in /etc/skel gets copied to a (new) users $HOME directory when your create a new user. If they are the same you either have not made any changes to your file (most likely) or you copied your custom file to /etc/skel.

See:

How do I set up new users with skel

http://www.linfo.org/etc_skel.html

http://www.linuxhowtos.org/Tips%20and%20Tricks/using_skel.htm


A routine update wrote Grub in the MBR; how do I undo it?

Go to the "BCD Deployment" menu in EasyBCD.  Then click the "Write MBR" button.

Reboot, and you're all set!


Reloading .bashrc after setting variables -- shell script

A couple of things:

The default .bashrc does nothing if the shell isn't interactive:

# If not running interactively, don't do anything
case $- in
    *i*) ;;
      *) return;;
esac

Your script is using /bin/sh. Don't source .bashrc. Any bash-specific stuff could cause problems. And as steeldriver notes, /bin/sh doesn't have source:

$ sh -c 'source ~/.bashrc'
sh: 1: source: not found

Why not just export the variable in addition to adding to .bashrc?


How do I install Flashtool 0.91 on Ubuntu 14.04 LTS?

Check first if Java is already installed:

java -version

If the reply states a positive one (as shown below)

java version "1.7.0_51"
Java(TM) SE Runtime Environment (build 1.7.0_51-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.51-b03, mixed mode)

Then you're in luck mate! You can continue to the next step

If not,then;  (I use WebUpd8 Team's PPA for ease of installing)

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

After installing Java7,extract the FlashTool tar.gz,then the tar to some folder (In this case,I will use Desktop)

sudo bash
cd Desktop
cd FlashTool
./ FlashTool

enjoy and remember - Exit the terminal after exiting Flashtool


Should I install Ubuntu as UEFI or Legacy?

To prevent needless complication, I would advise that you install Ubuntu in the same fashion that Windows is currently installed.

So, if Windows is installed as UEFI, it would be best to install Ubuntu under UEFI such that you don't need to swap bootloader modes or reinstall Windows to change OSes. Similarly, if Windows is in Legacy mode, install Ubuntu in the same.

If it really doesn't matter to you, though, I'd highly suggest using UEFI. It offers many more features that can come in handy on modern systems, and can allow for better compatibility with graphics and hardware stacks on modern systems. All in all, though, it really doesn't matter after you get past the bootloader.


sed -e 's/ /\&nbsp;/g'

Note the \ before the &. Escape your characters.


tab computation is not working after installation of c shell in ubuntu 14.04

The space, tab, and new-line-character are used by the C shell to indicate the end of one argument, and the beginning of the next.

It does not have "tab completion" nor does it accept arrow keys.

If you want those use another shell. bash, tcsh, zsh for instance all support tab completion. I would use tcsh:

tcsh  is a Unix shell based on and compatible with the C shell (csh). It is essentially the C shell with programmable command-line completion, command-line editing, and a few other features.


After nvidia driver update screen is 640x480. How to undo?

If it was the nvidia current or current updates driver that was installed, you can remove them with:

sudo apt-get remove nvidia-current

and

sudo apt-get remove nvidia-current-updates

respectively.  If neither of these packages can be removed then try the following command to install the nouveau driver as I believe it will make it current in any case.  To remove a driver other than nvidia-current or nvidia-current-updates we will need to know exactly what it was that you installed.

If you want to make sure the current open source nouveau driver is installed, do

sudo apt-get install xserver-xorg-video-nouveau

Since you're still having trouble, re-install the current driver then see if you can set a better resolution with nvidia-settings.

sudo apt-get install nvidia-current

then type 'nvidia settings' into the dash and click on the icon it finds.  Resolution can be found under the tab 'Xserver Display Configuration'  If that works save the settings.

If it doesn't work, then repeat the exercise but install nvidia-current-updates then run nvidia-settings again.


nvidia drivers not working on ubuntu 20.04 with Nvidia quantum rtx 4000

The problem, as usual, is having Secure Boot enabled in UEFI and unsigned drivers (Nvidia's).
Either disable Secure Boot in UEFI (easy) or use mokutil to enable "trust" for the Nvidia's driver modules (not easy).


CommandNotFound.db.creator import DbCreator on ubuntu

You have problem with python-apt package.Try sudo apt-get remove --purge python3-apt and sudo apt autoremove then install: apt-get install python3-apt


Ubuntu & Netplan - Example of blackhole or unreachable routes

network:
  version: 2
  renderer: networkd
  ethernets:
    lo:
      match:
        name: lo
      addresses: [ 127.0.0.2/32 ]
      routes:
        - to: 10.0.0.0/8
          via: 0.0.0.0
          metric: 240
          type: unreachable
        - to: 192.168.0.0/16
          via: 0.0.0.0
          metric: 240
          type: unreachable
        - to: 172.16.0.0/12
          via: 0.0.0.0
          metric: 240
          type: unreachable
        - to: 169.254.0.0/16
          via: 0.0.0.0
          metric: 240
          type: blackhole

Tip: without "address 127.0.0.2" or without "via 0.0.0.0" netplan silently ignores the configuration.


can't seem to generate a valid netplan YAML enough to connect to wifi

In a Ubuntu Desktop installation, you should be using NetworkManager, not netplan, to manage wireless connections.

Your /etc/netplan/*.yaml file should look like this...

network:
  version: 2
  renderer: NetworkManager

then:

sudo netplan --debug generate # generate script files

sudo netplan apply # apply new configuration

In a Ubuntu Server installation, you should be using netplan, and examples of netplan scripts can be seen here.

Minimal example...

network:
  version: 2
  renderer: networkd
  wifis:
    wlxxxxxx: # change this to the correct wireless interface name
      dhcp4: yes
      access-points:
        "network_ssid_name":
          password: "**********"

then:

sudo netplan --debug generate # generate script files

sudo netplan apply # apply new configuration


Fully remove PlayOnLinux and any files left behind

No. The .playonLinux directory is where POL stores its virtual drives. (Where it runs the Windows programs) If you did not have WINE installed beforehand, you will also need to run sudo apt-get purge wine. If you are still suspicious you can search for "playonlinux" in the dash/Nautilus.


How to connect my Ubuntu Server to internet

You dont have an ip address. see https://help.ubuntu.com/14.04/serverguide/network-configuration.html

I couldnt find a good primer on ipv4 or routing to link you to. this one should get you started, http://computer.howstuffworks.com/internet/basics/question549.htm also look up how routers, and nat (network address translation) works.

you'll want to forward to traffic to your new server if you intend to reach it from outside your home network. the docs at netfilter.org can tell you how to do this.


17.10 upgrade spikes processor temp and crashes out video

Upgraded to 18.04LTS and it seems to be less 'taxing' on the processor (and/or more gentle on the video demand) - I'd read somewhere that 17.10 was found to be hard on processors, and that 18.04LTS would address this - so far the display hasn't 'crashed' and the 'spikes' in temperature, paralleling the spikes in processor use and memory demand, don't seem to be as severe. No more version upgrades for this laptop!


Probably the postgresql service is not running (either it crashed or it is not configured to start at boot time, since you rebooted the server).

Depending on the version of Ubuntu you are using, you should try to start it with command

sudo service postgresql start

or with

sudo /etc/init.d/postgresql start

If the service starts without error, the application should be running fine.


vnstat - combine WiFi and Ethernet usage together

This bash script will add up vnstat totals for multiple interfaces:

#!/bin/bash

# NAME: vnall
# DESC: Add up multiple interfaces of vnstat into totals for today,
#       yesterday, current week and current month.
# PARM: "today", "yesterday", "week" (current), "month" (current)
# DATE: September 2, 2019. Modified September 4, 2019.

# To discover interfaces `lshw -c network` then place names below
# aInterfaces=( "enp59s0" "wlp60s0" )
# Use automatic discovery if you are unsure of names or don't want to look up
Interfaces=( $(lshw -c network 2>/dev/null | grep name: | cut -d':' -f2) )

Tally () {
    Ktot=0     # Totals in KiB, MiB and GiB
    Mtot=0
    Gtot=0
    # Tally all interfaces
    local i Interface Line Raw ThisNum
    for (( i=0; i<${#aInterfaces[@]}; i++ )) ; do

        Interface="${aInterfaces[i]}"
        if [[ "$vnstatParm" == "" ]] ; then
            Line=$(vnstat -i "$Interface" | grep "$GrepString")
        else
            Line=$(vnstat -i "$Interface" "$vnstatParm" | grep "$GrepString")
        fi

        [[ $Line == "" ]] && continue   # No data collected yet
        if [[ $vnstatParm == "" ]] ; then
            Raw=$(echo "$Line" | awk '{print $8 substr ($9, 1, 1)}')
        else
            Raw=$(echo "$Line" | awk '{print $9 substr ($10, 1, 1)}')
        fi

        ThisNum="${Raw::-1}"    # Number without suffix
        case ${Raw: -1} in      # Decide on last character K, M or G
            K)
                Ktot=$(echo "$Ktot + $ThisNum " | bc) ;;
            M)
                Mtot=$(echo "$Mtot + $ThisNum " | bc) ;;
            G)
                Gtot=$(echo "$Gtot + $ThisNum " | bc) ;;
            *)
                echo "Unknown Unit: ${Raw: -1}" ;;
        esac
    done

    [[ $Gtot != "0" ]] && { echo "$Gtot G" ; return ; }
    [[ $Mtot != "0" ]] && { echo "$Mtot M" ; return ; }
    [[ $Ktot != "0" ]] && { echo "$Ktot K" ; return ; }
    echo "N/A"
} # Tally

Init () {
    GrepString="$1"     # Create defaults for "today" and "yesterday"
    vnstatParm=""
    if [[ $1 == week ]] ; then
        GrepString="current $GrepString"
        vnstatParm="-w"
    fi
    if [[ $1 == month ]] ; then
        GrepString=$(date +"%b '%y")
        vnstatParm="-m"
    fi
} # Init

Init "$@"
Tally

Automatic vs Manual interface names

Notes this section of code:

# To discover interfaces `lshw -c network` then place names below
# aInterfaces=( "enp59s0" "wlp60s0" )
# Use automatic discovery if you are unsure of names or don't want to look up
Interfaces=( $(lshw -c network 2>/dev/null | grep name: | cut -d':' -f2) )

The fourth line automatically discovers the interface names (in my case enp59s0 and wlp60s0) and builds the array of interfaces (aInterfaces). If you prefer to manually specify the names in your script then place a comment (#) at the beginning of the line and uncomment the second line by removing the # line prefix.

Conky code shrinks considerably

Because the new vnall script automatically creates parameters as needed, the conky code is a lot smaller than before:

${color}${goto 5}Today ${goto 100}Yesterday ${goto 225}Week ${goto 325}Month ${color green}
# vnstatd updates database every five minutes
${execi 300 vnall "today"} ${goto 110}${execi 300 vnall "yesterday"} ${goto 220}${execi 300 vnall "week"} ${goto 315}${execi 300 vnall "month"}

Conky Image


Will Ubuntu run well on this low-spec Lenovo IdeaPad 110-15IRB

Ubuntu will definitely run better than windows on your machine. However, I've had issues with it being slow on my old netbook with 1gb of ram, but 2gb should be fine!

If you install Ubuntu and it does run a little slow, you can always find a more light weight flavor (version) of Ubuntu.


How to close terminal from a bash script

I'll assume that you're running those commands in a script.

Keep in mind that $$ is the pid of the running bash process. If you're running a script, that script's bash process is a child of your current interactive shell. If you kill $$ in the script, you're killing the script, not the parent shell.

Bash stores the parent pid in the $PPID variable, so you want

#!/bin/bash
gnome-terminal &   # launch a new terminal
kill $PPID         # kill this script's parent

I'm assuming that the parent shell is the one spawned from the terminal, and that you haven't changed the terminal's default behaviour of closing when its shell exits.

As an aside, instead of

echo -n "Type new terminal name > "  # displays messagebox
read text                            # load messagebox input

do

read -p "Type new terminal name > " text


No reaction on service mysql start, init script works

Try this:

sudo service mysql start

or:

sudo service mysql stop && sleep 3s && sudo service mysql start

or again:

sudo service mysql restart


Unable to repartition non-mounted SD card

Use sudo partprobe /dev/sdb to "inform the OS of partition table changes".

For more info, check man partprobe or http://manpages.ubuntu.com/manpages/bionic/man8/partprobe.8.html.


why is 219 running before the gnome login on my computer?

219 is your systemd version.

% apt-cache policy systemd
systemd:
  Installed: 219-7ubuntu6
  Candidate: 219-7ubuntu6
  Version table:
 *** 219-7ubuntu6 0
        500 http://archive.ubuntu.com/ubuntu/ vivid-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     219-7ubuntu3 0
        500 http://archive.ubuntu.com/ubuntu/ vivid/main amd64 Packages

systemd is one of the first things which are activated at startup.

  systemd is a system and service manager for Linux. It provides
  aggressive  parallelization capabilities, uses socket and D-Bus
  activation for starting  services, offers on-demand starting of
  daemons, keeps track of processes  using Linux control groups,
  supports snapshotting and restoring of the system  state, maintains
  mount and automount points and implements an elaborate  transactional
  dependency-based service control logic.

This is absolutely normal if the splash and/or quiet kernel parameters are removed...


Working Solution Strange appearance of text/background in gedit from Alberto González Palomo

Just solved this issue after months of annoyance, by removing the line run_im xim from ~/.xinputrc thanks to the people commenting on Ubuntu's issue tracker at https://bugs.launchpad.net/ubuntu/+source/gedit/+bug/1620806
I have another line there for disabling the touch screen but that one is fine.
Now why would the setting of the input method handler affect the background redrawing, I can't even imagine.


What is the best/most correct way to prepare the HDD for a dual boot?

The way I 'd do it is install windows from scratch on the PC formatting the whole HDD. Then I would use the windows disk management utility to shrink the windows partition to 100 Gb. (The last stems from the rule of a thumb: Use windows programs for Windows stuff and linux programs for linux stuff.) Leave the 900 gb as unallocated space. After that I would install Ubuntu. Install Ubuntu alongside windows will handle everything like a charm. The only 'problem' is that this way it will probably not create the 10 gb swap you want, so you may have to manually do it.


If you go to System Settings -> Displays, you can set the default monitor from there.

Fire up the remote monitor and hopefully Ubuntu will detect it.

Then set that monitor to the default one.

Reboot with the PC monitor off.

Ubuntu should come up on the remote screen and work fine.

Hope this helps!


Switching from Ubuntu GNOME 17.04 to another distribution and skipping over a release when upgrading will be difficult to do successfully. Waiting until 18.04 is released in April, 2018 and making a clean install is clearly the easiest way to do it, and it will save you a lot of time and wasted effort in the long run.

To install a new release over an old release follow the instructions in How do I reinstall Ubuntu?. Because you are installing a different release I recommend backing up the personal data in your /home folder, and then when it comes to the Installation type section of the Ubuntu Studio installer select the option to overwrite the existing operating system and replace it with the new one. Selecting the first option, Upgrade Ubuntu GNOME 17.04 to Ubuntu Studio 18.04, may not work properly because you would be skipping over releases when upgrading.


How to install Ubuntu from a Ubuntu installation?

If you have an sd slot or a dvd, both of those can be made bootable pretty easily. Assuming you don't have either of these the best way would be to ssh into your computer from another and install it on a system that does have a mouse. While I'm sure what you are asking does have a solution, installing from another computer is probably easier.


How to remove duplicate imagemagick icons

It is normal, both desktop files are installed with it:

$ dpkg -S desktop | grep imagemagick
imagemagick: /usr/share/applications/display-im6.desktop
imagemagick-6.q16: /usr/share/applications/display-im6.q16.desktop

Two options here:

If you do not need ImageMagick you may remove its packages with
 sudo apt-get purge imagemagick imagemagick-6.q16
(but it may remove essential packages from system such as CUPS)
Try to hide icons with alacarte (easy GNOME menu editing tool).


Why is my machine shutting down overnight?

First, save any unsaved work before you start.

Open a terminal and type the following command:

sudo pm-hibernate

The system should hibernate. Now, power the machine back on and if the machine powers back up properly with no issues, you should be able to enable hibernation (disabled by default) with no more issues after long periods of inactivity.

Here's how to enable hibernation.

Open a terminal and execute the following command (you can use any text editor here: gedit, leafpad, mousepad, nano, vim, etc.):

gksu gedit /var/lib/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla

and copy/paste the following into the file:

[Re-enable hibernate by default in upower]
Identity=unix-user:*
Action=org.freedesktop.upower.hibernate
ResultActive=yes

[Re-enable hibernate by default in logind]
Identity=unix-user:*
Action=org.freedesktop.login1.hibernate
ResultActive=yes

Save the file and exit. Then, reboot for the changes to take effect.

Click here for more info.

This may help as well.

Now, set up a script to automatically enable hibernation after suspending.

Open the new file with gedit using the following command:

gksu gedit /etc/pm/sleep.d/0000rtchibernate

Copy and paste the following into the contents of the file:

#!/bin/bash
# Script name: /etc/pm/sleep.d/0000rtchibernate
# Purpose: Auto hibernates after a period of sleep
# Edit the "autohibernate" variable below to set the number of seconds to sleep.
curtime=$(date +%s)
autohibernate=3600
echo "$curtime $1" >>/tmp/autohibernate.log
if [ "$1" = "suspend" ]
then
    # Suspending.  Record current time, and set a wake up timer.
    echo "$curtime" >/var/run/pm-utils/locks/rtchibernate.lock
    rtcwake -m no -s $autohibernate
fi

if [ "$1" = "resume" ]
then
    # Coming out of sleep
    sustime=$(cat /var/run/pm-utils/locks/rtchibernate.lock)
    rm /var/run/pm-utils/locks/rtchibernate.lock
    # Did we wake up due to the rtc timer above?
    if [ $(($curtime - $sustime)) -ge $autohibernate ]
    then
        # Then hibernate
        rm /var/run/pm-utils/locks/pm-suspend.lock
        /usr/sbin/pm-hibernate
    else
        # Otherwise cancel the rtc timer and wake up normally.
        rtcwake -m no -s 1
    fi
fi

Save the file before closing gedit.

Next, make the file executable and place a copy into /usr/lib/pm-utils/sleep.d/ with the following two commands:

sudo chmod +x /etc/pm/sleep.d/0000rtchibernate
sudo cp /etc/pm/sleep.d/0000rtchibernate /usr/lib/pm-utils/sleep.d/0000rtchibernate

Reboot for the changes to take effect.

Click here for more info and to check out the source.


How to create local account on NIS clients?

OK, this should work for you (make a backup of /etc/nsswitch.conf). Change the passwd: and group: entries like this:

passwd: nis [NOTFOUND=return] files
group:  nis [NOTFOUND=return] files

Add a user that's in the NIS database, then shutdown the NIS client and test. This should force NIS to be the first lookup, then fallback to local  /etc/passwd if it's not found. Gotta admit, though - it's been decades since I've used NIS.


Error: bad username; while reading /etc/crontab

The specification of cron jobs in the system-wide /etc/crontab file is different from that in regular user crontabs. As noted in man 5 cron:

   The system crontab (/etc/crontab) uses the same format, except that the
   username  for  the  command is specified after the time and date fields
   and before the command. The fields may be separated by spaces or  tabs.
   The maximum permitted length for the command field is 998 characters.

Note that the username must come immediately after the time specification. So assuming you want to run the rsync command as user admindp:

*/5 * * * *     admindp     rsync -r /var/log/tomcat8/sensiproscheduler-app.log /shared_ftp/


A partition does not have rw permissions

The partition /dev/sda6 has the 'ext4` file system. This is a linux file system, and you can manage the ownership and permissions individually for each directory and file.

I suggest that you do a basic configuaration:

Create a directory in the partition at the mountpoint /media/ubu... (use the complete path).

sudo mkdir /media/ubu.../data

Set the desired owner of this directory, for example "$USER".

sudo chown "$USER":"$USER" /media/ubu.../data

Maybe change the permissions of this directory, but the defaults might work for you, when you own it.

chmod ...  /media/ubu.../data

Now you should be able to read and write in this 'data' directory in your partition /dev/sda6.

If there are still problems, please describe them, and I will try to help ...


Error while installing VirtualBox-guest-additions?

Unless you really need features only available with 4.3.20, I would suggest to use the guest additions from the Ubuntu repositories:

sudo apt-get install virtualbox-guest-dkms virtualbox-guest-utils

Restart your VM to apply the changes.


Easy solution, do:

sudo apt-get install gnome-tweak-tool

then open tweak tool, go to Fonts and there you can select what kind of antialiasing you want to use.

PS. This will change antialiasing for the entire system, not just gedit.


Which version of Ubuntu will work out of the box on Intel 82845G Board?

Unfortunately, the hardware you use falls into the category of "abandoned by the vendor". i8xx chips have been causing xserver lockups for years, with Intel unable or unwilling to provide fixes. There is a good overview of the predicament in the i8xx unsupported wiki. I wish there had been a solution, but it is highly unlikely that anyone will ever bother fixing it. As far as I know, none of the modern desktop distos will work with Intel's i810. You could try using it as a server with no X, or get a supported PCI graphics card.

There seems to be a vicious pattern with some of Intel's hardware. First, it works reasonably well, then, as the Linux kernel evolves, and regressions creep in, things start breaking, and Intel guys either completely ignore the problems, or disable the features that caused them (like hardware acceleration).


GZip of drive image created by using `dd` command

If the disk is almost full, there is no sense in compressing the image; it will take ages with no practical effect. And restoring will be much slower too.

dd copies physical, byte-by-byte partitions or disks. It works by reading N bytes from the input and writing them to the output, and then repeating. N is by default 512 bytes.

To copy a disk/partition physically, use

dd bs=10M if=/dev/sda of=/path/to/dest/image.img

this will read blocks of 10Mbytes at a time. If you have plenty of RAM you can up that number too. The size of the file will be exactly the same as the size of the disk/partition used (but it can occupy less disk sometime --- dd can create sparse files).

You can check the progress in another terminal with

ls -lh /path/to/dest/image.img

which will give you the size of the image file (more or less --- it will be in chunks, really).

Triple check (with mount) that no partition of the disk to copy is mounted or used anywhere, or the created image will be invalid (and worst things can happen, too). Be careful about swap areas, too.

You can mount the image to check if it's ok with a loopback filesystem and a bit of tricks.

Anyway, there are also tools that helps the tasks: How to make a disk image and restore from it later?

If your system is not recent (the system from where you are booting, I mean), be warned of this bug --- fixed from 14.04 onward, but still there for older kernels.


System Settings - Appearance - Wallpapers: you can choose a default wallpaper from 13.04.
Also the default wallpapers from 12.10 are still available.


Incorrect value of environment variable java_home

You need to run:

source /etc/environment

so that the variables declared on the /etc/environment are available on the current shell and you will get the value of the variable set from the current shell. To make the variable available to all child processes of the shell, export it after source-ing:

export JAVA_HOME

Otherwise you have to logout from the current session and login again to have the variable as environment variable set in the /etc/environment file.

On the other hand, if you want to set this only for yourself, you can set it in ~/.bashrc too by doing:

echo -e "\nexport JAVA_HOME=/usr/lib/jvm/jdk1.6.0_31" >> ~/.bashrc && source ~/.bashrc


Multitouch Gestures in 12.10: disabling four-finger-swipe + re-configuring generally

Karhan, how did you manage to activate the Touchpad / Trackpad in Ubuntu 12.10? I'm very, very interested in this, because I could not figure it out at all.
I own a 13" Retina too, installed 12.10 with the two possibities, EFI-Boot and the dd+ alt method to boot from a memory stick a ubuntu amd64+mac.iso.
In any case, the Touchpad/Trackpad only works as a mouse with only 1 key :-(
I'll spend you a beer, if you can help me out - or two :-)

Regards
Dirk


Difficulty installing program through makefile: "Are the same file"

It turns out the issue was the bin location.  Changing the bin path allows the make to complete, and the codes will run as long as they are called using a path (i.e. ../codes/ises).


You can't. That's not an actual partition, it's an "extended" partition. These are special partitions that only exist to contain other partitions. They are a trick to allow more than the maximum number of logical partitions the classic MBR partitioning scheme can understand.

In your case, your extended partition sda2 contains two logical partitions: sda5 and sda6. You have both of these mounted, one at / and the other as a swap partition. There's nothing left for you to mount.


How to find files between two dates using "find"?

Bash find files between two dates:

find . -type f -newermt 2010-10-07 ! -newermt 2014-10-08

Returns a list of files that have timestamps after 2010-10-07 and before 2014-10-08

Bash find files from 15 minutes ago until now:

find . -type f -mmin -15

Returns a list of files that have timestamps after 15 minutes ago but before now.

Bash find files between two timestamps:

find . -type f -newermt "2014-10-08 10:17:00" ! -newermt "2014-10-08 10:53:00"

Returns files with timestamps between 2014-10-08 10:17:00 and 2014-10-08 10:53:00


Cannot access internet until visited once in an IP with browser, DNS-problem?

I've encountered the same problem (Ath9k driver. Wireless connects, but no internet until I visit an IP address). Other devices (android phone, PS3) using the same wifi router did not encounter this issue.

Managed to resolve it using two different methods:

1) Turn off Wireless N on the router

My problem only started when I switched from a B/G only router to a B/G/N router. I suspected the problem may be due to wireless N, so I disabled it on my router (the ath9k driver don't allow you to disable this). Everything works fine after that.

2) Update router firmware

I'm using an ASUS RT-N56U, with firmware version 1.0.1.8t. I realized that the latest version of the firmware is 3.0.0.4.374.979, and that the changelog includes "2.4Ghz compatibility issue for some specific devices". After updating to the latest router firmware, the internet connection works normally even with Wireless N.


What the make install command does depends on how the Makefile is written and what it consists.

The most generic way of finding out what binaries, libraries, man pages, etc. your make command produces so that you can modify your Makefile could be like the one below. I assume you're in the top of your build directory.

touch /tmp/tstamp
make clean
./configure [your options]
make
find . -newer /tmp/tstamp

This should give you a list of files that have been modified since you've created the /tmp/tstamp file.

Compare the list of files being installed with make install with the list  obtained by using the find command and add the desired remaining files to your Makefile.

If you get that list and just want to make it work (in a quick and dirty manner), moving them to proper target locations should be a matter of a simple for loop one-liner, bearing in mind the --prefix (if any) you've specified during the build configuration stage.


my ubuntu system crashed after changing ownership of use directory and I am unable to change back ownership to root

Simply boot in recovery mode, drop to root shell then change ownership again.
In details:

Switch on your computer.

Wait until the BIOS has finished loading, or has almost finished.

Quickly press and hold the Shift key, which will bring up the GNU
GRUB menu.

Select the line which starts with "Advanced options".

Select the line ending with "(recovery mode)", probably the second
line, something like:
 Ubuntu GNU/Linux, with Linux 3.8.0-26-generic (recovery mode)

Press Return and your machine will begin the boot process.

After a few moments, your workstation should display a menu with a
number of options. One of the options (you may need to scroll down to
the bottom of the list) will be "Drop to root shell prompt". Press
Return with this option highlighted.

The root partition is mounted read-only. To mount it read/write,
enter the command
 mount -o remount,rw /

Now change ownership again to root
 chown -R root:root /usr


Accidently deleted boot efi fat32 how to make one for old ubuntu install?

If you installed another UEFI boot with its efi boot files and you have the same version of grub, you can just edit the grub.cfg in the efi partition with the new UUID.

Back up ESP - Efi System Partition before making any changes. You can just copy files back and it should work. Otherwise you have to run repairs to restore efi boot files.

In your /boot/efi/EFI/ubuntu should be a small grub.cfg. This is mine, which has the UUID of the main install and drive, partition of that install. Change to your main install's UUID and partition number.

search.fs_uuid 45de38c8-6748-4634-b207-628d9aa8b42b root hd0,gpt3
set prefix=($root)'/boot/grub'
configfile $prefix/grub.cfg

To see UUIDs

sudo blkid -c /dev/null -o list


How to remotely display my Android on my PC?

Scrcpy

Scrcpy is an open source alternative that sounds promising, but I get across this bug. I didn't want to use TeamViewer, LogMeIn or AirDroid.

This alternative also let you remotely use the phone from Ubuntu.

Install adb: sudo apt install adb
Install scrcpy (if you meet the requirements): sudo snap install scrcpy
Enable adb debugging, the device should be listed on adb devices. Maybe you need to move to PTP and little more.

When you get the message the Allow USB debugging? The computer's RSA key fingerprint is: [a fingerprint] is possible to check it with following command (the public key might be in ~/.android or ~/snap/scrcpy/current/.android/):

cut -d" " -f1 adbkey.pub | openssl base64 -A -d -a | openssl md5 -c

Also, scrcpy --help:

Tap BACK, HOME and APP_SWITCH with these shortcuts.
scrcpy 1.9+: Ctrl + o turn device screen off (keep mirroring). Bidirectional shared clipboard.
scrcpy 1.10+: use it wirelessly.
scrcpy 1.12+: Ctrl + r rotate the screen.

The project is very active, keep track of releases and update often.

If you like GUIs try guiscrcpy (source), a scrcpy front-end written in Python pip3 install --upgrade guiscrcpy --user. Maybe some day will be the open source alternative to Microsoft's Your Phone.

LiveScreen

Easy and no sign up crap. Just install it and on the app switch screen sharing on:

Then on your browser (hopefully Firefox) pointing to your mobile's IP:

Screen Stream over HTTP

Screen Stream over HTTP is a nice open source alternative, also on F-Droid.

Nice related AskUbuntu post


Need to convert a video file from mp4 to xvid

If you're just looking for conversion, you might want to try arista or transmageddon instead of Openshot. Arista Transcoder and Transmageddon are applications focused on just doing the conversion and nothing else. Especially Arista Transcoder contains a lot of presets, of which one is xvid. Install them using the command sudo apt-get install arista transmageddon.


Binfmt config not persisting after booting

binfmt formats are typically handled by binfmt-support package. When mono is installed in Ubuntu, it adds a cli format specification in /var/lib/binfmts/cli.

binfmt-support is configured to start automatically at boot. I'd suggest checking, that you have binfmt-support and mono-runtime packages in your system.