How to compile c & c++ programs? I read somewhere that I need to install 'build essential packager' & so I tried:

sudo apt-get install build-essential
Reading package lists... Done
Building dependency tree
Reading state information... Done
build-essential is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

But the file still wont compile or run...

gcc -Wall -W -Werror factorial.cpp -o factorial.

gives me:

gcc -Wall -W -Werror factorial.cpp -o factorial.
factorial.cpp:3:22: fatal error: iostream.h: No such file or directory
compilation terminated

This is my piece of code:
//WAP to demonstrate static member for calculating factorial

    #include<iostream.h>
    #include<conio.h>
class fact
{
int i;
    static int count;
    public :
    void calculate()
    {
        long int fact1=1;
        count++;
        for(i=0;i<=count;i++)
        {
            fact1=fact1*i;
        }
        cout<<"\nFactorial of"<<count<<"="<<fact1<<"\n";
    }
};
int fact :: count;
void main()
{
    int i;
    clrscr();
    fact f;
    for(i=1;i<=15;i++)
    {
        f.calculate();
    }
    getch();
}

What shoud I do..???

There are several issues with your test source package.

My guess is that you are trying to compile using slightly older C++ standards (gcc instead of g++) and probably based on a Windows routine (using conio).

I've tidied up the test program for you:

#include <iostream> /* dont need .h */
using namespace std; /* use a namespace */
/* #include <conio.h>   this is a windows header - dont need */

class fact
{
int i;
    static int count;
    public :
    void calculate()
    {
        long int fact1=1;
        count++;
        for (i = 2; i <= count; i++)
        {
            fact1 *= i;
        }
        cout << "\nFactorial of " << count << '=' << fact1 << '\n';
    }
};
int fact :: count;

int main(void) /* you had an invalid main declaration */
{
    int i;
    /* clrscr();  not necessary */
    fact f;
    for (i = 1; i <= 15; i++)
    {
        f.calculate();
    }
    /* getch(); not necessary */

    return 0; /* need to return a standard value */
}

then compile using

g++ factorial.cpp -o factorial

Try another one just to test because it says No such file or directory. Or maybe the source file is corrupted.


Can i have ubuntu 15.10 with linux kernel of 3.14 I have Ubuntu 15.10 installed in my system with kernel  of 4.2, I want to know can i change the kernel of it to 3.14 without any serious problem such as hardware or graphically problems or any security weakness ?

p.s. My laptop is N56VM-A

You could use any version of kernel if you want.
Here are two ways. Pick up one of them is enough:

A. use apt to install kernels for you.

B. manually install mainline kernels by dpkg

Steps for A:

command in terminal: apt-cache search linux-image
you will see the kernel list. pick up the one you want. For example,

linux-image-3.16.0-36-generic
command in terminal: sudo apt-get install . For example,

sudo apt-get install linux-image-3.16.0-36-generic
reboot the system once the installation of apt is done. That is!

Steps for B:

go to here http://kernel.ubuntu.com/~kernel-ppa/mainline/
pick up the kernel version you want
download those kernel *.deb you want
install the *.deb you just downloaded by

sudo dpkg -i *.deb

(optional) you might want to use this script to help to download those *.deb


Install extension to all Firefox profiles in my Ubuntu user account? There are 2 Ubuntu user accounts.

I have about 6-7 Firefox profiles in my Ubuntu user account.

I want to install an extension into all of them but not into Firefox profiles of the other Ubuntu user account.

How do I?

Start Firefox with every profile and install the extension...firefox -P  or firefox -ProfileManager


How much data do I need to download to upgrade to a new version of Ubuntu? I have a limited download plus upload at full band width then it drops to 68 Kb/s.

What is the total size downloaded when I upgrade to a new Ubuntu version?  Will I be able to do it with 8 Gig left for this month or should I wait till next month when I am given more than 30 Gig?

The size depends on what you have installed.

I didn't do much testing but

awk '/^Installed-Size:/ {size+=$2} END {print size/(1024*1024)}' /var/lib/dpkg/status

should tell you the sum of the installed sizes of all packages. As that's the uncompressed size you can expect the download size to be less than this.

sudo apt-get update && sudo apt-get upgrade

This will show you the size it will download and also will tell you what would be size required after downloading. If it is not in you bandwidth limit and you do not wish to upgrade, simply press 'no' and it will cancel the upgrade. you can also press ctrl+c to cancel.

I agree to what Eliah commented below. Thanks for correcting.


Problems after installing Skype 4.3 just installed Skype 4.3 on my laptop (Dell Inspiron N5110) running Ubuntu 14.10 following all the instructions from every possible source  but when I try to launch it absolutely nothing happens.

What can I do to get it working? Here's what I get:

andi@Andi:~$ skype
skype: error while loading shared libraries: libGL.so.1: cannot open shared object file: No such file or directory

Open a terminal window and try to start Skype with this command (copy and paste):

LD_PRELOAD=/usr/lib/i386-linux-gnu/mesa/libGL.so.1 skype

If that's successful, I suggest that you check out this answer to get a persistent solution.

If others like me ends up here trying to solve this problem, the solution could be to reinstall bumblebee with the following:

sudo apt-get install bumblebee-nvidia --reinstall


alternative to unetbootin for memtest86+ image I installed unetbootin from Ubuntu Software Center. It's a simple utility so it was hard to get wrong. I Flashed the ISO image of memtest86+. It didn't work in that it did not start memtest86+. Booting it shows a title of "unetbootin" and a countdown to boot the "default" and nothing happens and the countdown repeats.

I verified that the USB port is bootable and that the BIOS is expecting to boot an external USB Flash drive by booting an old Flash drive that has the Ubuntu 14.04 image.

The Windows version of unetbootin has worked for me in the past (probably to create an Ubuntu installer and I'm not sure about other applications) but I prefer an all Ubuntu method of creating the bootable Flash drive.

Addendum: I saw on the unetbootin website that they recommend FAT32 so I reformatted and reFlashed. The result is "worse" in that an attempt to boot results in the prompt "No default or UI configuration directive found!" and the exclamation mark is in the original text.

The memtest86+.iso should be used to boot only from CD/DVD

To create a bootable USB you need to download the appropriate image from here :

To download it through the browser , choose the Image for creating bootable USB Drive under Linux/Mac Downloads:

Or use the command line:

wget http://www.memtest86.com/downloads/memtest86-usb.tar.gz

Uncompress it:

tar xvf memtest86-usb.tar.gz

Use the command dd to create a bootable USB ( you don't need an alternative to unetbootin):

sudo dd if=memtest86-usb.img of=/dev/sdb

Change /dev/sdb with yours , it depends on the output of sudo fdisk -l.

I used Ubuntu's Nautilus to make a bootable DVD from the memtest86+ ISO image. It seems to want to create a "data" disk from the "CD/DVD Creator" window that pops up when a blank DVD is inserted. There did not appear to be a way to burn an ISO image. I don't know if this is a bug or just an intentional omission. The "help" identifies this program as "Files"; not "Brasero" and not "CD/DVD Creator".

Using Nautilus, and right-clicking produces a menu that shows a possibility of producing an ISO image on DVD. The dialog indicates the ability to burn an "image" which is a strong clue that this would be burning an ISO image. Nautilus also identifies itself as "Files".

Addendum: This method takes less time than creating a USB Flash drive image with unetbootin because that utility seems not to work for memtest86+. The DVD method I described will work. If you burn the disk from the window that pops up when a blank DVD is inserted and find that it works it will take even less time but since I suspect it will be a "data" disk (not an ISO image) I guessed that it wasn't worth trying.


How to figure out whether a package is already installed? I installed Ubuntu 14.04.1 as a guest on a windows host.
Before installing GCC, I need to make sure that the following packages are installed:

GMP, MPFR and MPC

I checked the Ubuntu package site and I think they correspond to:

libgmp10, libmpfr4 and libmpc3

How do I find out whether the packages have already been installed?
If they haven't been installed, how do I install them?

Thanks.

You can list all installed packages via dpkg like this

dpkg -l

You can then pipe that through grep to only find the things you are interesting in:

dpkg -l | grep libgmp10

Or you can be less specific in your grep

dpkg -l | grep libgmp

Grep will find any line in the output with that string.

Installing is easy also

sudo apt-get install <package>

Not sure of the package name? Tab complete works in the apt-get install command also, or you can use:

sudo apt-cache search <string>

For saving the entire output of dpkg -l to a file:

dpkg -l > ~/Desktop/packages

and open with a text editor:

nano ~/Desktop/packages


How are the various ulimit values for a process set? How are the various ulimit values for a process set? I am especially interested in the number of open file descriptors. How is that set for a given process? If it is based on the user who started the process then how is it set for the user?

How can I set these limits for a particular user?

If you have not changed the value of any resource shown by ulimit, it would use the default value which is what you see while running the shell built-in ulimit -a. Note that the system call inolved in getting the value is getrlimit(2).

Again if you need to change the value you need to use setrlimit(2) system call, ulimit does exactly this while setting a new resoure limit for processes.

The resource limits shown in ulimit are applied on individual processes, not users.

To set the new value for the number of open file descriptors (default is 1024) per process, you can use :

ulimit -n 512

Note that you can check the hard limit and soft limits with ulimit -Hn and ulimit -Sn respectively. You can decrease to any value and increase upto the hard limit.

To increase the limit beyond current hard limit (1024) you need to be root.

Note that you can not increase the value beyond kernel specified maximum.

Now there is a file /etc/security/limits.conf that is used by pam specifically pam_limits.so upon start of each user session, you can set values here to take permanent effect as ulimit set values only for the running session.

Although you need to set the values on this file on a user/group basis the limits are applicable on per process under that user/group apart from some items like maxsyslogins, maxlogins. /etc/security/limits.conf has sufficient description within the file to get you started.

Also check help ulimit, man 2 setrlimit to get more idea.

It's POSIX - see man 3 sysconf

NAME
       sysconf - get configuration information at run time

SYNOPSIS
       #include <unistd.h>

       long sysconf(int name);

DESCRIPTION
       POSIX  allows  an  application  to  test at compile or run time whether
       certain options  are  supported,  or  what  the  value  is  of  certain
       configurable constants or limits.

       At  compile time this is done by including <unistd.h> and/or <limits.h>
       and testing the value of certain macros.

       At run time, one  can  ask  for  numerical  values  using  the  present
       function  sysconf().   One can ask for numerical values that may depend
       on the filesystem a  file  is  in  using  the  calls  fpathconf(3)  and
       pathconf(3).  One can ask for string values using confstr(3).

       The  values  obtained  from  these  functions  are system configuration
       constants.  They do not change during the lifetime of a process.

       ...<snip>...

       OPEN_MAX - _SC_OPEN_MAX
              The  maximum number of files that a process can have open at any
              time.  Must not be less than _POSIX_OPEN_MAX (20).


Installing a VM using VBoxManage commands fails with NS_ERROR_FAILURE I'm trying to set-up a VirtualBox VM, so that at the end of the process, an installation of Linux will start from the virtual DVD. Alas, at the end of the set-up process I get an NS_ERROR_FAILURE error:

openstack@ubuntu:~$ VBoxManage createvm --name openstack101 --ostype Ubuntu_64 --register
Virtual machine 'openstack101' is created and registered.
UUID: 2a0fee1a-98c0-4f7d-9344-90eefcf75f05
Settings file: '/home/openstack/VirtualBox VMs/openstack101/openstack101.vbox'
openstack@ubuntu:~$ VBoxManage modifyvm openstack101 --memory 2048 --nic1 nat --nic2 hostonly --hostonlyadapter2 vboxnet0 --nic3 hostonly --hostonlyadapter3 vboxnet1
openstack@ubuntu:~$ VBoxManage modifyvm openstack101 --nic1 nat --natpf2 ssh,tcp,,4400,,22
openstack@ubuntu:~$ VBoxManage createhd --filename openstack101.vdi --size 204800
%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Disk image created. UUID: 37e1ed19-8a3a-45b9-b0a3-a8af101ea165
openstack@ubuntu:~$ VBoxManage storagectl openstack101 --name "SATA Controller" --add sata --controller IntelAHCI --hostiocache on --bootable on
openstack@ubuntu:~$ VBoxManage storagectl openstack101 --name "IDE Controller" --add ide --controller PIIX4 --hostiocache on --bootable on
openstack@ubuntu:~$ VBoxManage storageattach openstack101 --storagectl "IDE Controller" --type dvddrive --port 1 --device 0 --medium ~/shared/images/ubuntu-12.04.5-desktop-amd64.iso
openstack@ubuntu:~$ VBoxManage modifyvm openstack101 --boot1 dvd
openstack@ubuntu:~$ VBoxManage modifyvm openstack101 --vrdemulticon on --vrdeport 3390
openstack@ubuntu:~$ VBoxManage startvm openstack101 --type gui
Waiting for VM "openstack101" to power on...
VBoxManage: error: The virtual machine 'openstack101' has terminated unexpectedly during startup with exit code 0
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component Machine, interface IMachine, callee
openstack@ubuntu:~$

Googling for this error message suggests that instead of VBoxManage startvm openstack101 --type gui, one should use VBoxManage startvm openstack101 --type headless.

When I did that, I did receive:

openstack@ubuntu:~$ VBoxManage startvm openstack101 --type headless
Waiting for VM "openstack101" to power on...
VM "openstack101" has been successfully started.

But do not see any Ubuntu installation starting.

Can you suggest what should I do differently - to succeed in installing a VM using VBoxManage commands?

You have your VM been up and running, but you need a viewer to "see" it.  Here is the command to bring up a viewer,

rdesktop -a 16 -N [host server ip]:3390

Alternatively, power on your VM with the following command, and you will find the port number which VRDE server will be listening

VBoxHeadless --startvm openstack101

Then, run rdesktop command above with the proper port number (3390 or others)

See VirtualBox User Manual, Chapter 7: Remote virtual machines.

I had similar problem. I was resolved with same version the VBox and guest additions. If not  equals uninstall guest additions and install correct versions.


How to fix "Package is in a very bad inconsistent state" error? I can't update my system because it freezes while installing a third-party update (zramswap-enabler)!
Sometimes I get the following message in Update manager:

Could not initialize the package information An unresolvable problem occurred while initializing the package information.
Please report this bug against the 'update-manager' package and include the following error message:
E:The package zramswap-enabler needs to be reinstalled, but I can't find an archive for it.

I tried to remove the zramswap-enabler, but it's impossible because I get the following message:
dpkg: error processing zramswap-enabler (--remove):
 Package is in a very bad inconsistent state - you should
 reinstall it before attempting a removal.
Errors were encountered while processing:
 zramswap-enabler
E: Sub-process /usr/bin/dpkg returned an error code (1)

Actually I would really reinstall that package, but it is unable to do it! If I remove this third-party PPA then the system is warning me about a very very serious problem.
So why can I not install/reinstall/remove/update this package and why freezes the updater if I try to update?

Edited out of the question and added as an answer.

Make sure that your PPA is set up.
Remove the broken package via the following command:

sudo dpkg --remove --force-remove-reinstreq zramswap-enabler

Install the package again:

sudo apt-get install zramswap-enabler

After restart (not necessary), you are able to install the updates correctly!

Actually you can fix any "Package is in a very bad inconsistent state” issues with this solution!

I used this to fix this same issue:
apt reinstall [package]


Does TP-Link TD-W8968 has print support for ubuntu TP-Link TD-W8968 advertises print server support for Win and Mac OS. Does it support printing with Ubuntu OS?

No, it does not support linux distribution for print server.

Ps. I have one of this and i run ubuntu.


How do I run PHP file in Ubuntu and fix the permission denied? When I try to save the file of PHP in Ubuntu I get that error:
unable to save /var/www/html/script.php
Error permission denied

How can I fix this error and save/run the PHP file?

the problem that I faced was in permissions so, I have to change the chmod of a directory which I working on so, in this case, I should write the following command:
$ sudo chmod  o+w /var/www/html

The o stands for other and the + adds the permissions w is write.
at this moment the mode of the whole directory will change from reading to writing mode

how do you edit this file and try to save it?
It seems you have no permission to write in the folder /var/www/html/
try "sudo nano /var/www/html/script.php" it should save the file after editing.
with "ls -la /var/www/html" you can show the user an the rights for the directory and files. probably "root:root" so there you cant write with normal user. You need root rights, where you can get with "sudo".


Running Skype on PlayOnLinux Ok, so many may be wondering why I want to do this and not use any of the alternatives or the web based chat. One of the reasons is that few want to change. The other is because of MS's notorious database I want to make sure I have my own local chat history. And why on Linux? Because I don't trust Windows to run 24/7 (I'm anyways turning my 32-bit Ubuntu 14.04 into a server, so).

So what's wrong with Skype 4.3 for Linux? Well, just recently whenever I launch Skype and when it is trying to sync the chat logs it crashes.

I tried to follow the following tutorial: https://askubuntu.com/a/722140/195219

The only problem is that I cannot access the link to that particular version of Skype needed. I wanted to ask about it as a comment but I have far too few reputation points for that. I thought I'd break a rule and ask about it as an answer but it was deleted and recommended that I ask a new question.

So after all that the question becomes, does anyone have a copy of this particular version of Skype so I can get it running on PlayOnLinux? Or ask Galgalesh to fix the link?

Do not try run Skype on PlayOnLinux and install Skype for Linux Alpha. I think it's more comfortable and easier.

here you can find the respective winehq.org-entries on skype:

https://appdb.winehq.org/objectManager.php?sClass=application&iId=1592

And here is an older skype.community entry on older versions:

https://community.skype.com/t5/Windows-archive/Getting-older-version-of-skype/td-p/99846


Wireless connection not working BCM4318 The wireless card in the Acer 3000 is Broad com BCM4318
PCL-ID 14e4:4318

supported
yes
Chip ID Bcm4318

modes a/b/g

phy version G

I am new user and typed in sudo apt-get install-b43 fwcutter firmware -b43-installer.
The wireless card is recognized by computer and I can select the home network in settings but nothing activates to apply settings and connect wireless. Running Kubuntu 18.04
Have no idea how to proceed.

Driver was installed.  Go to settings and open connectivity. At bottom click on add. Click on wireless. Screen pops up where you answer question about wireless connection.  did not know what I was doing but got the right combination. had to go to top left of screen and clicked on un boarder. this allowed me to see place where you input security code and the save was active and hit that. Wirless was not active.the whole process was more luck than anything


KWin's wobbly windows do not work any more since I tried `i915_rc6_enable=1` I recently tried to boot my Kubuntu 12.04 LTS on my Sandy Bridge Laptop with i915.i915_enable_rc6=1, i915.i915_enable_fbc=1 and i915.lvds_downclock=1. I had some issues with 3D performance where somebody suggested using those options.

Since the resolution was not set correctly, I just tried it again with i915.i915_enable_rc6=1, i915.i915_enable_fbc=1. Then I rebooted and did not set any options manually, so everything should be reset. But since then, some KWin effects, especially wobbly windows does not work any more.

I also tried to boot some older kernel, but that did not have any effect.

How can I get it back to work?

kwin will disable desktop effects when it detects issues with drivers or hardware.

To re-enable them you can go to KDE's system-settings. Or you may be able to just hit Alt+Shift+F12.


Wireless Card Behaving Oddly on an HP Pavilion dv6 I'm not sure what kind it is, it doesn't use a propriety driver, it runs out of the box. In 10.04 it worked fine, in 10.10 it'll work, but randomly lose connection, though it won't state it, then it'll work again, and then stop working, very on-and-off behavior.

The laptop is an HP Pavilion dv6.

Sounds like a problem I had with my Dell laptop, and according to the HP web site it is mostly a Intel based 802.11 ABGN wireless card which my Dell had.

My Dell laptop had a problem with it losing connection with a wireless access point using 802.11n. This problem is a known issue with the iwlagn driver, and the best workaround is to disable 802.11n on the card. To disable 802.11n on this card create/edit your /etc/modprobe.d/options.conf file:

sudo gedit /etc/modprobe.d/options.conf

And add the following to it:

options iwlagn 11n_disable=1 11n_disable50=1

It's an outside chance but have you considered whether external factors may have changed? It might be worth rechecking: signal strength; sources of interference; alternative channel number.


Which lightweight Terminal Emulators supports Transparency? I know that gnome-terminal and the kde terminal both support transparency, but I'm looking for something lighter on resources than those. What other xterminal emulators support transparency?

Guake Terminal may work for you

sudo apt-get install guake

http://www.guake.org

xfce4-terminal and eterm also support transparency (although eterm is just pseudo-transparency IIRC).


How to Determine which is your TouchScreen Driver So many unrecognized options come up when typing the command lsusb, but how do we determine which one is actually for our specific touchscreen?  Thanks.

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 003 Device 002: ID 0eef:790a D-WAV Scientific Co., Ltd
Bus 001 Device 003: ID 147e:2020 Upek
Bus 001 Device 004: ID 0a5c:21e6 Broadcom Corp.
Bus 001 Device 005: ID 04f2:b315 Chicony Electronics Co., Ltd

Bus 003 Device 002: ID 0eef:790a D-WAV Scientific Co., Ltd  is the driver


How can I enable audio system on Envy 15t-3200 I just received my HP Envy 15 (June 2012 model) and I cannot get my audio system to fully function.

This laptop has 6 speakers.

1.)  2 speakers on the front of the laptop (Stereo).
2.)  2 speakers above the keyboard, just before the LCD hinges.
3.)  2 Subwoofer speakers underneath the battery cover facing downward.

Only the 2 speakers in the front are working.

This is a "Beats" audio system.  There have been many beats audio laptops before this one, so maybe if someone has experience with those, it might translate to this device.

This link could help u .. http://h10025.www1.hp.com/ewfrf/wc/document?cc=us&dlc=en&docname=c01912228&lc=en&os=4063&product=5278243&sw_lang=


How to successfully restart a network without reboot over SSH? In Ubuntu 14.04 neither sudo service networking restart nor sudo /etc/init.d/networking restart do anything any more. They also both exit with code 1. Something has obviously changed (or half changed) but I can't find what. This obviously causes problems with remote network reconfiguration and tools like Ansible.

$ sudo bash -x /usr/sbin/service networking restart
[sudo] password for wirehive:
++ basename /usr/sbin/service
+ VERSION='service ver. 0.91-ubuntu1'
++ basename /usr/sbin/service
+ USAGE='Usage: service < option > | --status-all | [ service_name [ command | --full-restart ] ]'
+ SERVICE=
+ ACTION=
+ SERVICEDIR=/etc/init.d
+ OPTIONS=
+ '[' 2 -eq 0 ']'
+ cd /
+ '[' 2 -gt 0 ']'
+ case "${1}" in
+ '[' -z '' -a 2 -eq 1 -a networking = --status-all ']'
+ '[' 2 -eq 2 -a restart = --full-restart ']'
+ '[' -z '' ']'
+ SERVICE=networking
+ shift
+ '[' 1 -gt 0 ']'
+ case "${1}" in
+ '[' -z networking -a 1 -eq 1 -a restart = --status-all ']'
+ '[' 1 -eq 2 -a '' = --full-restart ']'
+ '[' -z networking ']'
+ '[' -z '' ']'
+ ACTION=restart
+ shift
+ '[' 0 -gt 0 ']'
+ '[' -r /etc/init/networking.conf ']'
+ which initctl
+ grep -q upstart
+ initctl version
+ case "${ACTION}" in
+ stop networking
stop: Job failed while stopping
+ :
+ exec start networking
start: Job is already running: networking

What is the correct way to restart networking in Ubuntu 14.04 Server remotely?

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

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

I fix problem with this script :
please add this script on "/etc/network/if-down.d"

cd /etc/network/if-down.d
vim ifdown

content :

#!/bin/bash

for I in /sys/class/net/*
do
        ifname=$(basename $I)
        if [ $ifname != "lo" ] ; then
                ip addr flush $ifname
        fi
done

and finally :

chmod +x ifdown

now you can change ip address and restart networking service with systemctl or service command .
NOTE : this script is too simple and DO NOT HANDLE vm,tap,bridge,... interfaces . actually flush all interfaces exclude lo (loopback) .


How can I rotate a video? Is there a way to change the rotation angle of a video file?

I have a couple of videos in the wrong direction so all I wanted is to correct it.

You can also use ffmpeg and the commandline (taken from Rotating videos with FFmpeg):

  Rotate 90 clockwise:

ffmpeg -i in.mov -vf "transpose=1" out.mov

  For the transpose parameter you can pass:

0 = 90CounterCLockwise and Vertical Flip (default)
1 = 90Clockwise
2 = 90CounterClockwise
3 = 90Clockwise and Vertical Flip

And to flip it horizontally (ffmpeg documentation):

  Flip the input video horizontally.

  For example to horizontally flip the video in input with `ffmpeg':

ffmpeg -i in.avi -vf "hflip" out.avi

Nota bene 1

Older versions of Ubuntu supplied avconv instead of ffmpeg. In this case just change ffmpeg to avconv:

avconv -i in.mov -vf "transpose=1" out.mov

Nota bene 2

If the output is a .mp4 video you has to add strict -2 before the output file to avoid error message :

ffmpeg -i in.mp4 -vf "transpose=1" -strict -2 out.mp4

A simple tool that can also rotate is transmageddon. Install it with

sudo apt install transmageddon

then load your file into it and choose the rotation position


SSH and VPN Cisco connection working on one laptop but not on another. Both laptops using Ubuntu 14.04. Where is the difference? I'm trying to SSH to our university server using VPN and WIFI connection.

The bug is similar to this one, although different in details.

The problem is as follows:

Me and my colleague are using Ubuntu 14.04 on two different laptops.

I can SSH to the server using his laptop and my SSH login details, but not with my laptop and my SSH login details. We are both using VPN connected to the same WIFI (eduroam) network and we are in the same office. Configuration files /etc/sysctl.conf and /etc/ssh/ssh_config are identical on both laptops. Both of us are using Cisco VPNC plugin, which is required to connect to our VPN network.

WIFI and VPN connections work fine on both laptops. Both laptops say that VPN is successfully established, and the lock appears on the WIFI icon on the top-right corner of the screen.

But when I try to ssh to the cluster from my laptop I get the following message:

ssh: connect to host “xxx” port 22: Connection timed out

More information which may be useful to describe the problem:

My laptop can ssh to the required server when it is connected via
LAN to the local network, but again cannot connect to the cluster
when it is connected via WIFI and VPN.
I can successfully ping to the server from my laptop while using
WIFI connection, both with and without using VPN.
My colleague cannot ssh to the cluster using his SSH details and my
laptop. He gets the same message port 22: Connection time out.
My laptop can successfully SSH to another server while using my WIFI
(eudoram) connection. But this server is different from the one I want
to SSH and it belongs to another university which does not require
VPN.
I have tried to reinstall packages network-manager-vpnc and openssh-client. None of these helped. Restarting did not help.

nmap Gives:

Starting Nmap 6.40 ( http://nmap.org ) at “xxx”
Note: Host seems down. If it is really up, but blocking our ping probes, try -Pn
Nmap done: 1 IP address (0 hosts up) scanned in 3.06 seconds

nmap -Pn Gives:

Starting Nmap 6.40 ( http://nmap.org ) at “xxx”
Nmap scan report for ...
Host is up.
All 1000 scanned ports on “xxx” are filtered

Nmap done: 1 IP address (1 host up) scanned in 201.43 seconds

ssh -vvv “xxx” Gives

OpenSSH_6.6.1, OpenSSL 1.0.1f 6 Jan 2014
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to “xxx” [“xxx”] port 22.
debug1: connect to address “xxx” port 22: Connection timed out
ssh: connect to host “xxx” port 22: Connection timed out

What is wrong with the configuration of my Ubuntu?
What other configuration files (such as /etc/sysctl.conf or
    /etc/ssh/ssh_config) can I compare with the files of my colleague's
    laptop to find out what is different?
How can I test that the VPN connection works apart from seeing the
    lock on the top-right corner indicating that the VPN is active?

To connect to vpnc without using the vpnc manager install vpnc using

sudo apt-get install vpnc

Then create a file mycnf.conf containing the following information

IPSec gateway xx.xx.xx.xx
IPSec ID xxx
IPSec secret xxx
Xauth username xxx.xxx
Xauth password xxx

where xxx need to be replaced by your network and account details.
You may not need to use all the settings (all the lines),
or you may need to add more settings (more lines) into that file.
This depends on your network properties.

Then replace the default vpnc configration file by running

sudo mv mycnf.conf /etc/vpnc/default.conf

Then connect with

sudo vpnc-connect

To disconnect use

sudo vpnc-disconnect

This does not give the answer to the question, but it provides a solution to the problem. Apparently, there is something going wrong with the vpnc manager based on package network-manager-vpnc. Unfortunately, I was not able to find what. Also, note that this answer has already been posted here: CISCO VPN configuration steps. What is new here is that network-manager-vpnc may not work whereas vpnc may do.

No idea.
There are lots. man ssh lists some (~/.ssh/config comes to mind). Others can be discovered using e.g. dpkg -L network-manager-vpnc, which lists all the files installed by that package. You'll have to figure out which ones are config files.
Try https://dnsleaktest.com/. I think it's mainly aimed at people trying to steal movies safely, but I think it'll work for you.


How to list all variables names and their current values? How to list all variables names and their current values?

Including not only $HOME, $PWD etc but any other you have defined.

For bash: (the standard shell in Ubuntu)

Enter the following command in a terminal to print all the environment variables:

printenv

For further information about this command, read the printenv man page.

To show a list including the "shell variables" you can enter the next command:

( set -o posix ; set ) | less

This will show you not only the shell variables, but the environment variables too.

For more information related with this topic read:

How to list variables declared in script in bash? from SO and
How to print all environment variables defined (but not necessarily
exported) in bash from
UnixSE
Environment variable vs Shell variable, what's the difference?

For zsh: (an advanced shell)

Use the following command:

( setopt posixbuiltin; set; ) | less

For more information about ZSH options, see zshoptions man page.

printenv only lists exported variables,
command+alt+$
( "\e$": complete-variable )
will list all variables.


My local ubuntu server is not updated I am from Nepal and it's faster to download apps from server for nepal using through ubuntu software center. But when i use np.archive.ubuntu.com server. There is no updated softwares and few softwares and nvidia driver are outdated. for e.g. i cannot even install openshot when i user server for nepal. It provides error which cannot be solved.

I want to know how can the server for nepal be updated frequently with us.archive.ubuntu.com. i use ubuntu 12.10. and i want to use server for nepal since the download speed faster than 2x than from us server.

I have the same issue too as I belong to Nepal as well. However, the following link shows that the server for Nepal which is supposed to provide download up to 100kbps is currently not updated... search for Nepal's server section in the address and see the details there.... so it's better we choose another mirror.. maybe of Indonessia or other until the server gets updated..

Requesting server update procedure may be by informing the owner of the server i.e. Kshitiz Shrestha that the server is outdated...

https://launchpad.net/ubuntu/+mirror/ubuntu.ntc.net.np-archive

https://launchpad.net/ubuntu/+archivemirrors

Update:

Bro, the server is updated now... you can use Nepal's server now... enjoy downloads..:)

Happy Linuxing

Isn't 12.10 the most recent version, or do you mean the program updates?

If that's the case, then this may help.


How can I have a screen saver in Ubuntu? How can I have a screen saver in Ubuntu? Is there something I need to install to get it back?

sudo apt-get install xscreensaver xscreensaver-data-extra xscreensaver-gl-extra

will install xscreensaver and a few cool packages.

If I remember well, using:

xscreensaver-demo

Will activate the daemon, then your screen will lock typing:

xscreensaver

or pressing CTRL+ALT+SUPPR.

Nothing beats xset dpms force off.xscrensaver is the worst screensaver, it's old, it's ugly and above all it's not saving anything with its Windows-like energy wasting animations!


Google Chrome Drop Down Menus not Working I just recently noticed that some drop down menus on Google Chrome act funny whenever I try to use them.

(Seriously, I need reputation points to post an image? That has got the be the dumbest thing I've ever seen for a help forum. I have show what's going on. Now I need to link off-site...)

They do that and if the menu is long enough to scroll, scrolling tends to jumble the words around much like the highlighted bar that you see in the pic.

I tried going to the Google forums first, but they don't seem to know what's happening, so I'm wondering if the problem may be related to Ubuntu/Linux somehow. Whenever I start Chrome via the terminal, it starts, but all of this appears for me:

ATTENTION: default value of option force_s3tc_enable overridden by environment.
[9:24:0112/205123:ERROR:webgraphicscontext3d_command_buffer_impl.cc(279)] Context dead on arrival. Last error: 5
[22388:22388:0112/205123:ERROR:command_buffer_proxy_impl.cc(153)] Could not send GpuCommandBufferMsg_Initialize.
[22388:22388:0112/205123:ERROR:webgraphicscontext3d_command_buffer_impl.cc(200)] CommandBufferProxy::Initialize failed.
[22388:22388:0112/205123:ERROR:webgraphicscontext3d_command_buffer_impl.cc(217)] Failed to initialize command buffer.
ATTENTION: default value of option force_s3tc_enable overridden by environment.
[22388:22388:0112/205124:ERROR:command_buffer_proxy_impl.cc(153)] Could not send GpuCommandBufferMsg_Initialize.
[22388:22388:0112/205124:ERROR:webgraphicscontext3d_command_buffer_impl.cc(200)] CommandBufferProxy::Initialize failed.
[22388:22388:0112/205124:ERROR:webgraphicscontext3d_command_buffer_impl.cc(217)] Failed to initialize command buffer.
[9:24:0112/205124:ERROR:command_buffer_proxy_impl.cc(153)] Could not send GpuCommandBufferMsg_Initialize.
[9:24:0112/205124:ERROR:webgraphicscontext3d_command_buffer_impl.cc(200)] CommandBufferProxy::Initialize failed.
[9:24:0112/205124:ERROR:webgraphicscontext3d_command_buffer_impl.cc(217)] Failed to initialize command buffer.
ATTENTION: default value of option force_s3tc_enable overridden by environment.
[22388:22388:0112/205124:ERROR:command_buffer_proxy_impl.cc(153)] Could not send GpuCommandBufferMsg_Initialize.
[22388:22388:0112/205124:ERROR:webgraphicscontext3d_command_buffer_impl.cc(200)] CommandBufferProxy::Initialize failed.
[22388:22388:0112/205124:ERROR:webgraphicscontext3d_command_buffer_impl.cc(217)] Failed to initialize command buffer.
[22388:22473:0112/205124:ERROR:get_updates_processor.cc(240)] PostClientToServerMessage() failed during GetUpdates
[22388:22388:0112/205125:ERROR:extension_downloader.cc(699)] Invalid URL: '' for extension pbnmelddedlommnmllmfhoephaidddmk

It also does this after a little while:

[22388:22388:0112/210337:ERROR:browser_main_loop.cc(209)] Gdk: gdk_window_set_user_time called on non-toplevel

And it just keep bringing that same message up again and again and doesn't seem to stop. Any help on what's going on and how to fix it would be greatly appreciated.

Uninstall Chrome completely.

After you have done so, goto the Ubuntu Software Center and search "Chromium".

Chromium is an open source version of Chrome and it is pretty much the same thing.

I know this does not solve your problem, but it is easier than fixing the issue.


Create bootable partition and storage partition on external SSD I recently bought a 512 GB Samsung Portable SSD T7 Touch.

I would like to create 3 partitions:

One bootable partition containing Ubuntu 18.04 (of about 100 GB).
One swap partition for Ubuntu (of about 10 GB).
One storage partition

The goal is to have the first 2 partitions to work as a portable external Ubuntu that any computer can boot to (by entering the BIOS and asking to boot to external SSD). The third partition is for storage, which can be accessed from any computer using Windows, Ubuntu, and also can be accessed by the Ubuntu on the first partition.

That way, I can access the information on the third partition at any time no matter what computer I'm on, and if I ever need Ubuntu I can just access it easily.

Is this possible, and if so how?

Also, the SSD comes with password protection and fingerprint. Does that need to be turned off in order to be able to boot on it?

Thank you.

This is possible using Gparted. Since you want it to be a portable bootable disk, I would recommend to use MBR partition for backward compatibility.


How to read file starting from a specific number of line within the "while read "? All what i want is to specify a certain number of line like this lineNumberIs=3 and to tell while read to start out of this third line or what ever line number and fetching lines after wards to execute some commands later on the fetched lines
Something like that

 while read line from $lineNumberIs
    do
    **some commands not just echo nor printing on the screen**
    done < $dataFile

while IFS= read -r line; do
    # ...
done < <(tail -n "+$lineNumberIs" $dataFile)

tail -n +K (with the plus sign) tells tail to start at the specified line number (see the man page).

The <(...) bit is a process substitution. It lets you specify a command sequence and let bash read from it like a file. It's very handy when you want to avoid the effect of the subshell created in a pipeline.

IFS= read -r is used to read the line exactly s it appears in the file, with no spaces or escape sequences removed.

Very simple solution -

tail -n +K filename

where K = line number from where you want to read file. This will start reading file from Kth line to the end.


How to start Terminator on a different monitor? I have 3 monitors, and when I start terminator it opens on monitor 1 which is to my left, but I would like it to open on monitor 3, to my right.

I do not wish to simply swap monitor 1 for 3 in my monitor configuration as monitor 1 has other significance.

Is there a command I could use on the terminal that starts an application on a different monitor?

The answer is the use of position variable of the specific Window configuration on the terminator config.

For example, in a case with two monitors (1920x1080), the following layout configuration will open a terminal window on the second monitor in fullscreen mode.

[[[Window]]]
type = Window
parent = ""
fullscreen = True
position = 1700:0
size = 500, 500
[[[Term]]]
type = Terminal
parent = Main
...

with CompizConfig Settings Manager you can act on windows placement.

Install ccsm :

sudo apt-get install compiz compizconfig-settings-manager compiz-fusion-plugins-extra compiz-fusion-plugins-main compiz-plugins

Launch it : ccsm
Select "Windows Management"
Select "Place Windows"
Change the placement mode

select "Windows Management"


Desktop can't delete file because thunar was replaced by nautilus (Xubuntu 12.04) My problem is really simple:

I've replaced Thunar with Nautilus in my Xubuntu 12.04 installation (64 Bit); I removed Thunar completely. Everything works fine in the computer except for the desktop: If I try to delete a file that is in the desktop for example, The attempt fails complaining of Thunar not being installed on the system. If I reinstall thunar everything works as expected, but I don't want to keep thunar on the system. How to Fix This?

Thanks!

Research indicates that there are issues between Thunar and Nautilus.

Replacing Thunar with Nautilus?:

  The desktop component doesn't play well yet with the filemanager because it is using the dbus interface of thunar directly.

Thunar File Manager:

  It does not play nice (at all) when copying out of it's own Thunar window and into the Nautilus window.

My own experience is that I cannot cut/copy/drag files directly from the desktop to a Nautilus window.  I get the following 2 errors:

Error while moving "New Folder ".
There was an error moving the file into /home/****/From Desktop.
Error moving file: No such file or directory

Error while moving.
There was an error getting information about "".
Operation not supported

I get exactly the same errors when attempting to copy/cut/drag from a Thunar window to a Nautilus window.

Workarounds:

Use the Thunar file manager when working directly with the desktop (cut/copy/drag)
Do all of your file operations from within Nautilus itself

So even if Thunar has been completely removed from the system, you should still be able use workaround #2.

Applies to:

Xubuntu 12.04
Nautilus 3.4.2
Thunar 1.2.3

Try uninstalling the xubuntu-default-settings package. That did it for me.

You can also get rid of parole (the Xfce movie player) and leafpad and mousepad (Xfce text editors) and use totem and gedit instead.


My computer boots to a black screen, what options do I have to fix it? I am trying to boot Ubuntu on my computer.  When I boot Ubuntu, it boots to a black screen.  How can I fix this?
Table of Contents:

If you are trying to install Ubuntu
If you have a dual boot system
If an update or something else caused your problem

If you are trying to install Ubuntu

1. Ensuring your CD/DVD or USB flash drive burned/written correctly and not damaged:

How to MD5 test Ubuntu ISOs. See also: Where to find the checksums of Ubuntu ISO images? or MD5 hash for ubuntu .iso (14.04 through 17.04)
Check out these steps to see how to check your CD once you boot into it to make sure it's ready to go.
Verify the integrity of the burned CD/DVD or written USB flash drive (this also checks that it's accessible by the computer on which you wish to install).

2. Black/purple screen when you try to boot the LiveCD

The Ubuntu installer's startup portion is sometimes incompatible with certain graphics cards. Fixing it and getting to the Ubuntu Desktop to try or install it can often be surprisingly easy fix: the nomodeset parameter. To see if it works for you:

Boot from the Desktop Live CD and press the ↓ key when you see the below:

Press Enter and select English:

Press F6, use the ← ↑ → ↓ keys to go down to nomodeset, and press Enter. An x will appear to its left. Then press Esc, and press Enter to "Try Ubuntu without installing."

You can also try acpi = off and nolapic if nomodset also shows up as a black screen.

3.  Black screen

or

"you need to load kernel first" and "can not read file/cd0" errors

when installing to an UEFI capable machine:

Ubuntu's installer 'when attempting to run in UEFI mode) will hang and stop due to different manufacturer's implementations of the UEFI specification and will hang in different ways.
To identify if your machine is booting in installer UEFI mode you will see

REF: UEFI Community Ubuntu Documentation Section 2.4

If your machine is CSM capable (which is a full UEFI implementation with an emulated BIOS layer) after selecting any option from the grub list the system will hang at a black screen.

The picture above actually only confirms your DVD/USB booted using UEFI and there will be some means in firmware settings to ensure drives are booted in order to make the UEFI installer run (a solution may possibly be as simple as ensuring SATA is set to AHCI) -  check your vendors manual!  Also check the UEFI Community Documentation Section 2.3 for more details.

What you need to do first is to disable SECURE BOOT in the firmware settings.
If that does not get the Ubuntu installer running, try disabling anything mentioning UEFI in the firmware settings.
Or
If you cannot find UEFI settings then enable CSM - this will disable the UEFI booting of the installer and then allow a legacy/BIOS install of Ubuntu.
Installing grub-efi afterwards will allow UEFI to be re-enabled.  Again refer to UEFI Community Ubuntu Documentation at Section 4

Some machines use a full BIOS with an emulated UEFI layer which may throw errors as described ie "you need to load the kernel first" and "can not read file/cd0"

Not all of these machines implement Secure Boot.  Simply selecting UEFI in the BIOS settings will configure UEFI mode on hard drives. There is no solution for these errors and the workaround is to disable UEFI to enable the Ubuntu installer to run in legacy mode; after which boot-repair can be used to install grub-efi which then allows/needs UEFI switched back on before Ubuntu will boot using UEFI.  Once again refer to the UEFI Community Ubuntu Documentation at Section 4

Black/purple screen after you boot Ubuntu for the first time

This usually happens because you have an Nvidia or AMD graphics card, or a laptop with Optimus or switchable/hybrid graphics, and Ubuntu does not have the proprietary drivers installed to allow it to work with these.

The solution is to boot Ubuntu once in nomodeset mode (your screen may look weird) to bypass the black screen, download and install the drivers, and then reboot to fix it for ever.

Start your computer, and press the Right Shift when booting up, to get the Grub menu. Use the ← ↑ → ↓ keys to navigate/highlight the entry you want (usually the first one).

Press e to edit that entry, which will show you the details:

Find the linux entry as shown above, use the ← ↑ → ↓ keys to get to it, and then  press the End key to get to that line's end (which may be on the next line!).

Enter nomodeset as shown, and press Ctrl+X to boot to where you can successfully install your graphics drivers.

If you are running Ubuntu 12.04 or 12.10, and have a ATI/AMD graphics card, you have to follow the instructions here, otherwise you will run into this problem every time you restart your computer.

LUKS encryption

In case you've installed Ubuntu with LUKS encryption / LVM option, it could be that Ubuntu just asks you for your password - and you cannot see it.
If you have a black screen, try pressing Alt+← and then Alt+→ to switch your tty, this may bring back the password query and turn backlight back on.

If you have a purple screen (maybe you need to set the nomodeset-option also?) and you have encrypted your complete Ubuntu installation, try to just type your encryption/LUKS-password after waiting some seconds (or minutes, just to be sure) and continue with a press on Enter. If this is successfull, you should see your Login-screen just a few seconds later.

Try the Alternate Installer - this is a text based installer that might work better than the liveCD depending on your hardware.
If you do this, you may get a black screen before you even hit grub. A simple Ctrl+Alt+Del gets some users to a usable grub screen
If you have an Nvidia Optimus card you should NOT install nvidia drivers, just use the built in driver, see here:

Is a NVIDIA GeForce with Optimus Technology supported by Ubuntu?

After selecting boot options you have the opportunity to edit the boot flags manually using your keyboard. Replace quiet splash with no splash to get an idea of what step your system is failing at. Using that information search the forums or the internet for answers from the community.
If you still can't install Ubuntu then unfortunately you've probably run into a hardware specific bug, please see here: How do I report a bug?

If you installed from a USB drive, check whether it boots with the flash drive plugged in and if so, this may help.


Is there a single line command to do `su`? I can do an su with su <username> and it asks for my password. Is there a password parameter for su such that i wont be prompted for a password?

e.g. su <username> -p <password>

If you want to write a script that runs as a different user something like this works, though it dows output the word "password" without a newline to standard out

su - username <<!
enterpasswordhere
enter commands to run as the new user
!

if you have a user named fred with a password of 1234 and want to get an ls of fred's home directory as fred, without the password string displayed, it would look like

su - fred <<! >/dev/null 2>&1
1234
whoami > /dev/tty
ls > /dev/tty
!

If you want to execute some specific commands as a new user, use the following command:
sudo -u {username} {command to be executed as the new user}


Can I take a screenshot and directly open it in Gimp? Common use case for me and printscreen:

Hit printscreen and save .png
Open up Gimp
Find file I've saved
Edit file (crop and highlight regions)

It seems like the first three steps could be combined into a single key bind, e.g. printscreen auto opens Gimp, ready to edit. Is that possible?

Quick version

Literally doing what you asked; in one action:

Take a screenshot
Save it in your preferred directory
Opening it with Gimp

The script

#!/bin/bash

picsdir=~/Pictures/out.png
gnome-screenshot -f "$picsdir"
gimp "$picsdir"

How to use

Copy the script into an empty file, save it as take_ashot.sh
Set your preferred directory to save the files in, in the line:

picsdir=~/Pictures/out.png

I'd leave it as it is if your system is English, else you'd need to change the Pictures folder name.
Test-run it by the command:

/bin/bash /path/to/take_ashot.sh

If all works fine, add it to a shortcut: Choose: System Settings > "Keyboard" > "Shortcuts" > "Custom Shortcuts". Click the "+" and add the command:

/bin/bash /path/to/take_ashot.sh

Note

Since you mentioned not to save the source file in most cases, I made the script overwrite previous files. If you don't want that, we'd need to build in a few renaming- lines.

For Linux Mint version Mate, just run the commands below to configure your system once and press the PrtScn on your keyboard.

sudo apt install scrot
gsettings set org.mate.Marco.global-keybindings run-command-screenshot "disabled"
dconf write /org/mate/desktop/keybindings/custom0/action \'"scrot -e \"gimp \$f\""\'
dconf write /org/mate/desktop/keybindings/custom0/binding \'Print\'
dconf write /org/mate/desktop/keybindings/custom0/name \'PrintScreen\'

The screenshot will be saved in your home folder at ~/ if you don't want them there, you can always use this below to move the screenshot in the /tmp folder:

dconf write /org/mate/desktop/keybindings/custom0/action \'"scrot -e \"mv \$f /tmp; gimp /tmp/\$f\""\'


How to change the Unity Launcher's icon theme? Does anyone know how to change Unity icon-theme? For instance I use Faenza in my desktop session, but unity does not use it, both in panel and panel apps (applications and documents). So, anyone?

That's a 100$ question dude. Apparently Unity is just stuck on Humanity icons set. I just don't know why. Maybe you should follow this launchpad entry:

https://bugs.launchpad.net/unity/+bug/663524

In the application menu, choose Appearance.
At the bottom of the "Theme" tab, select Edit, then change your icons in the "Icons" tab.

However I don't know if this will change the icons on the left dock.


C/C++ Compiler for Ubuntu like Dev-C++ Need a good c/c++ compiler for Ubuntu. I like coding or programming.

I used Dev-C++ on Windows. Is there any good compilers like Dev-C++?

I tried code::blocks ide but it seems a little buggy for me.

For C++, you can install g++:

sudo apt-get install g++

For C, you can install gcc:

sudo apt-get install gcc

If you need an IDE you can install NetBeans:

sudo apt-get install netbeans

I like very much "Sublime text"

For SUBLIME text2 :

sudo add-apt-repository ppa:webupd8team/sublime-text-2
sudo apt-get update
sudo apt-get install sublime-text

For SUBLIME text3

 sudo add-apt-repository ppa:webupd8team/sublime-text-3
 apt-get update
 sudo apt-get install sublime-text-installer


No Admin User on fresh Wubi Install I just installed Wubi fresh (Win 7; Ubuntu 12.10).

After booting into Ubuntu for the first time, my first instinct is to:

sudo apt-get update && sudo apt-get upgrade

However, I'm quickly prompted with:

[user] is not in the sudoers file.  This incident will be reported.

I checked user settings and it appears that there are NO admin accounts:

How can I resolve this? And why did Wubi set me up with a non-admin account?

I'd recommend filing a bug and attaching your logfile (from the %TEMP% directory in Windows: wubi-12.10-rev273.log.

You could try to fix it manually by booting into the Recovery menu: hold the Shift key after selecting Ubuntu, select Advanced options and then Recoverymode. Once you see the recovery menu select the root prompt.

First you need to remount the drive read/write:

mount -o remount,rw /

And then add yourself to the sudo group and reboot:

usermod -a -G sudo nathanbrauer
reboot

I've never heard of this problem before on a Wubi install, so don't know if this will fix it or whether there is some other underlying problem. But it's probably quicker to try than reinstalling. I do recommend filing that bug report though.

you can type
sudo su -
Enter your user password now you are in a root user then you can change your root password by typing
passwd
it will ask for password and re-enter it again


Get flash drive to cache disk reads to primary partition Basically I'm looking for a way to mimic Windows' ReadyBoost.

I asked this question on Unix.SE to get an idea of whether this was even possible and it seems like it is. Appparently there is a cachefs filesystem I can use to do this.

Flash drive: /dev/sdc1 (fs: vfat)
Main partition: /dev/sda5 (fs: ext4)

How can I configure Ubuntu to do this?

Unfortunately, this is not currently possible.  CacheFiles has only been implemented for NFS so far.  Another upcoming possibility is CleanCache.  Currently CleanCache only has two backends: one for xen tmem, and one for storing cached pages in compressed ram.  Hopefully a third backend will be written to store the cached pages on block devices like flash drives.

Actually, it looks like it might be fairly easy.  apt-get install cachefilesd and read the documentation.


How can I deactivate Bluetooth on system startup? How can I deactivate Bluetooth on system startup?

For Ubuntu 20.10
For this ubuntu edit /etc/bluetooth/main.conf and find the line
AutoEnable=false

and replace it with:
AutoEnable=true

18.04+
18.04* users who don't naturally have a /etc/rc.local, you'll need to create one and make it executable. To make things slightly easier, you can just paste the following command into a terminal:
sudo install -b -m 755 /dev/stdin /etc/rc.local << EOF
#!/bin/sh
rfkill block bluetooth
exit 0
EOF

Run sudoedit /etc/rc.local and add this before line with exit 0:
rfkill block bluetooth

You should still be able to enable Bluetooth through the top bar applet.
This should work for most systems but it looks like there are a few bugs lurking in the kernel's ACPI for Thinkpads. If you're on a Thinkpad, add the following to /etc/rc.local:
echo disable > /proc/acpi/ibm/bluetooth

Or check out ibm-acpi - IBM ThinkPad ACPI Extras Driver -- some reports suggest that ibm-acpi includes bluetooth control (amongst other nice things). But I don't have the hardware so I'm completely unable to verify these claims. Good luck.

You need to disable it from the Start Up Applications list in System Settings.

Click on the cog in the top right hand side of the menu bar and then select System Settings.

Click on Start Up Applications then scroll down until you find the bluetooth setting, take the tick from the box and you all done.


How to use vsftpd to set up an FTP server and how to access that server from another computer? Possible Duplicate:
  GUI FTP Server Recommendation

This is my first attempt at using any Linux based system. This is also my first attempt at setting up an FTP server. I'm running Ubuntu 12.04 on a 10 year old desktop that I hope to use as a server for transferring files between myself and my friends who use both Windows and Mac sytems.

I've vsftpd installed and I think I've configured my /etc/vsftpd.config file to require users to log on (meaning no anonymous users) and have it set up to require SSL (whatever that means, everyone just says to do it to prevent people from sniffing your password since FTP isn't encrypted by itself). However, It would be great if someone could give me a set of layman's instructions on how to configure the server to require a user name and password to access it, since I have no idea if the configuration I have setup right now will work.

Now comes the part that I really don't understand. How do I now turn vsftpd on and make the server start working? How do I know that it IS on? (The lack of a GUI makes all this very difficult for me.) How do I connect to the server from another computer? Is it possible to use a web browser or do I have to use a program like Filezilla to access the server?

You need a few things to get an ftp server to work...

Configuration - I suggest you read the man pages for the software you are going to use:

man vsftpd
man vsftpd.conf

Firewall - outside computers must be allowed to talk to your server: you must allow incoming connections on port 21. Have a look at "firestarter" for a nice program to manage that.
If you want to access the computer from the outside world you may need to tell your router to pass incoming connection on port 21 on to your server as well. Look into the configuration of the router, usually a local address like 192.168.1.254 (on my router).
vsftp is started for you when you install it, but you can use the program "bum" to manage services, or stop/start it from the command line like so:

sudo service vsftpd stop
sudo service vsftpd start

After this you should be able to connect to your server from an ftp client or use a web browser: ftp://yourserver/

Hope that helps :)

You can use SFTP over SSH.

Just connect to your home IP address on port 22 with your Ubuntu username and password. You only need to install SSH:

sudo apt-get install openssh-server

Alternatively, you can look into webmin.


Chrome not opening in lubuntu 16.10 Story

I've checked various older guides on how to install Google Chrome until I finally got it working, but once I finally got it installed (after much trouble manually installing some missing packages) it didn't open, not even once.

Computer

HP Notebook, pretty old.
2 GB RAM
AMD CPU Dual Core 1700 MHz
Running LUbuntu 16.10 64-bit

Chrome Installation

I downloaded the file from the official Google page for Ubuntu 64-bit, then I installed it through GDebi, while having to install missing packages manually.

Problem

Chrome doesn't open, never has since installed.

Diagnosis

$ google-chrome
/usr/bin/google-chrome: line 55: /opt/google/chrome/chrome: cannot execute binary file: Exec format error
/usr/bin/google-chrome: line 55: /opt/google/chrome/chrome: Success

And nothing happens (same for google-chrome-stable).

$ whereis google-chrome-stable
google-chrome-stable: /usr/bin/google-chrome-stable

Installing the file:

$ sudo apt install ./google-chrome-stable_current_amd64.deb
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'google-chrome-stable:amd64' instead of './google-chrome-stable_current_amd64.deb'
The following NEW packages will be installed:
  google-chrome-stable:amd64
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/46,2 MB of archives.
After this operation, 180 MB of additional disk space will be used.
Selecting previously unselected package google-chrome-stable:amd64.
(Reading database ... 194730 files and directories currently installed.)
Preparing to unpack .../google-chrome-stable_55.0.2883.87-1_amd64.deb ...
Unpacking google-chrome-stable:amd64 (55.0.2883.87-1) ...
Processing triggers for mime-support (3.60ubuntu1) ...
Processing triggers for desktop-file-utils (0.23-1ubuntu1) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up google-chrome-stable:amd64 (55.0.2883.87-1) ...
update-alternatives: using /usr/bin/google-chrome-stable to provide /usr/bin/x-www-browser (x-www-browser) in auto mode
update-alternatives: using /usr/bin/google-chrome-stable to provide /usr/bin/gnome-www-browser (gnome-www-browser) in auto mode
update-alternatives: using /usr/bin/google-chrome-stable to provide /usr/bin/google-chrome (google-chrome) in auto mode

Suggestions from David Foerster

$ readlink -f /usr/bin/google-chrome
/opt/google/chrome/google-chrome

And

$ file /opt/google/chrome/chrome
/opt/google/chrome/chrome: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.26, BuildID[sha1]=77d30c39976a4947b23b12abb107e28f66637823, stripped

I saw another thread (Google chrome not opening in ubuntu 16.04 LTS) that spoke about the same thing (only in 16.04), but it has been dead for the last 2 days...

Try uninstalling Google Chrome sudo apt remove --purge google-chrome-stable. When Google Chrome has been'uninstalled, download a new Google Chrome .deb file. The next step is to move the newly downloaded .deb file into your home directory. Now open up a terminal and type sudo apt install ./[NAME-OF-THE-DEB-FILE].


Are there still plans for a new sound theme? Let me quote from Mark's blog almost one year ago:

  March 5th, 2010 at 7:19 pm
  Mark, will there be an update to the sound theme to match the updated visual brand?

  Mark Shuttleworth: Gack, I completely forgot about that. A very good point. Would you see if you can rally a round of community submissions for a sound theme inspired by light?

Let's keep it short and sweet: What are the current considerations for the Ubuntu default sound theme?

Update, October 5 2011

This question was "answered" before the release of Natty. However, it proved to be wrong in the mean time. So the legacy continues, and I am reopening this one.

Update, February 15, 2012

Something is rolling! Looks like there will be a new sound for 12.04. Only a start-up sound however, no complete theme.

http://design.canonical.com/2012/02/sound-theme-update/

Update, April 30, 2012

It seemed to look good, but for some reason the sound did not make it into 12.04. There have been no announcements as to why, however. The sound theme remains a mistery...

Update, May 2, 2012

Mark Shuttleworth made a statement on IRC recently saying that it simply "was not perfect yet." It will maybe be in 12.10 then.

Update, December 6, 2012

Not in 12.10, either. But - there's still hope for 13.04!

As of the last update, the bug report for getting a new sound theme has been marked as Confirmed (but not In Progress) with the last comment posted October 31, 2011.

Update, September 11, 2013

Won't be in 13.04, and neither in 13.10. However, an interesting proposal has popped up. The composer of the "Mass Effect" soundtrack offered to make  a startup sound for Ubuntu on this mailing list.

http://www.omgubuntu.co.uk/2013/09/mass-effect-composer-ubuntu-14-04-start-up-sounds

Discussion on Reddit here.

There will be a new startup sound for 12.04, chosen from one of the 4 finalists. Listen to them here and fill out this survey to help decide the new startup sound for Ubuntu 12.04.

While I was testing Ubuntu 11.04 when you log into the desktop there is no start up sound that usually goes off. So maybe they have removed the old sound to get ready for the new one. I hope so.


Permission denied when downloading with transmission daemon I installed Xubuntu and transmission daemon, set the download path to my home/user/TV shows, and get a permission denied when trying to download torrents through the transmission.
I tried chmod -r 777 on this folder without success.
Please help!
Following is the output of ps -ef | grep transmission
chen@htpc:~$ ps -ef | grep transmission
109       1023     1  1 21:46 ?        00:00:35 /usr/bin/transmission-daemon --config-dir /var/lib/transmission-daemon/info

chen@htpc:~$ ps aux | grep transmission
109       1023  3.2  0.4  47684 16620 ?        Ssl  21:46   1:20     /usr/bin/transmission-daemon --config-dir /var/lib/transmission-daemon/info
chen      1852  0.0  0.0   4200   772 pts/0    S+   22:27   0:00 grep --color=auto transmission

enter code here

Assuming the path to the download folder is /home/chen/TV shows, run the following:

add chen to the debian-transmission group

sudo usermod -a -G debian-transmission chen

change the folder ownership

sudo chgrp debian-transmission /home/chen/TV\ shows

grant write access to the group

sudo chmod 770 /home/chen/TV\ shows

Stop the deamon with

sudo service transmission-daemon stop

The last thing to do is change the file creation mask, so that the downloaded files would be writeable by chen.

sudo nano /etc/transmission-daemon/settings.json

… and change "umask": 18 to "umask": 2. Hit Ctrl+O to save and Ctrl+X to exit.

Start the daemon with

sudo service transmission-daemon start

I had same issue, and that was a mistake I had made when sym-linking the transmission download directory to my home/user/ directory, I changed the ownership of the sym-linked file which by consequence also changed the ownership of the transmission 'download' directory...

I just chowned back to 'debian-transmission' ownership and it worked like a charm (without need to restart service)

#chown debian-transmission:debian-transmission /var/lib/transmission/downloads

(well, you'll have to check according your own linux distribution what is the right owner and eventually also your right path to the downloads directory)


Ubuntu 18.04 Won't Wake From Sleep/Suspend/Lid Closed Around half the time when I open the lid, the screen is blank and won't respond to keyboard/mouse input. I've already looked through all the forums and nothing I tried has worked. I've also recently reinstalled Ubuntu, so I'm pretty sure it's not something I installed.

For reference I'm using a Lenovo Thinkpad X1 Carbon 6th gen on Ubuntu 18.04.

Interesting: The keyboard backlight responds (Fn + space) and the FnLock light turns on and off, but the only way to use my laptop is to force reboot by holding the power button.

This small but plaguing issue is seriously making me consider switching to Windows/Mac :(

I had the same problem on an old Thinkpad SL510: suspend would leave the machine with a blank screen (but the fan was still on, so it was not a proper suspend) and only force-reboot would work.

Running PM_DEBUG=true pm-suspend produced a log without anything suspicious (all sleep.d scripts reporting "success").

Uninstalling package "tlp" (which also uninstalled "tlp-rdw") fixed the problem.

I always have this problem. I think that Ubuntu just cannot deal with ThinkPad/Intel power states like Windows could 25 years ago... Tried to uninstall TLP to see if it is fixed.


Cannot Install Mono (Depends Errors) I cannot install Mono.  I have the PPA added.  After doing 'sudo apt-get update' and 'sudo apt-get upgrade', I then try 'sudo apt-get install mono-complete' and I get this:

owner@Linux:~$ sudo apt-get install mono-complete
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 mono-complete : Depends: mono-devel (= 4.2.2.30-0xamarin1) but it is not going to be installed
                 Depends: mono-4.0-service (= 4.2.2.30-0xamarin1) but it is not going to be installed
                 Depends: libmono-cil-dev (= 4.2.2.30-0xamarin1) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
owner@Linux:~$ dpkg --get-selections | grep hold
owner@Linux:~$

So nothing is held back.  I even went to Software & Updates and unchecked all the default sources and the ones I added only leaving these three enabled:

http://download.mono-project.com/repo/debian wheezy main
http://download.mono-project.com/repo/debian wheezy-apache24-compat main
http://download.mono-project.com/repo/debian wheezy-libjpeg62-compat main

Another 'sudo apt-get update' and 'sudo apt-get upgrade', I then try 'sudo apt-get install mono-complete' and get the same error.

Thanks to a comment to my question by xangua, I saw I had added a PPA that was not meant for Ubuntu.  If you follow their instructions at http://www.mono-project.com/docs/getting-started/install/linux/#debian-ubuntu-and-derivatives, be sure to not accidentally add the libgdiplus PPA.

Add the repository for mono extras (do the following as sudo)

echo "deb https://d2nlctn12v279m.cloudfront.net/repo/mono/ubuntu bionic main" | tee /etc/apt/sources.list.d/mono-extra.list

apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys CB2DE8E5

apt-get update


Accidentally deleted /etc/apt/apt.conf.d I accidentally deleted the apt.conf.d folder and can’t install (use the apt-get) anything.

When I try to locate the apt.conf.d in the apt folder, it’s no longer there, only sources.list can be found.
So that means that the apt.conf.d is not the only thing missing in the folder.

The main question is:
How can I recreate/restore/retrieve the whole apt folder?

Additional:

While using apt-get in the terminal, I always get the error:

W: Unable to read /etc/apt/apt.conf.d/ - DirectoryExists (2: No such file or directory)
W: Unable to read /etc/apt/preferences.d/ - DirectoryExists (2: No such file or directory)

I'm using Ubuntu 12.04.

It’s not in the trash because I used root access via terminal (so it’s deleted permanently, unfortunately).

EDIT:
The apt.conf.d folder has been recreated but how about the preferences.d? What type of file should I recreate? (What is the default content of the preferences.d and apt.conf.d?)

According to bug 578446 on debian this also happens when you change distribution from command line using chdist. And it also states that recreating the directory should be enough.

touch apt.conf

and then

sudo vi apt.conf

Next add the proxy,

edit the file and make sure in the below format:

Acquire::http::proxy "proxy:port-number/";


Automount separate disk I have installed system on the /dev/sdb1, now I want auto mount /dev/sda1. I tried to do it with disk name:

$ echo "/dev/sda1 /home/alex/olddisk ext4 defaults,noatime 0 1" >> /etc/fstab

And also with UUID:

$ echo "UUID=2949d1df-f311-4068-b0c8-c40437738250 /home/alex/olddisk ext4 defaults,noatime 0 1" >> /etc/fstab

But I don't se it in the olddisk. Moreover, after reboot I even not see grub menu and got grub rescue> error.

p.s I noted that disks are mounted. But problem in the grub. It shows me grub rescure and such device not found after reboot.

I have had same problem, and you have to type this in the terminal:

        sudo amount -a
        sudo gedit /etc/fstab

and type it in manual enter this:

        uuid=2949d1df-f311-4068-b0c8-c40437738250              ext4      defaults    errors-noremount-ro
    1

and save the file, and then type this in the terminal:

         sudo mount -a

and it might work fine this way.


Problems with COMODO update I have COMODO anti virus. I have been having problems updating it. I start to update, but then it tells me that it has failed and to check the internet connection. Everything with the connection is ok especially since I can post this question. Is anyone else having problems? If so what can be done. I have tried to reinstall it, and it does. Could it be that the COMODO site is the problem?


How to change CPU fan speed on ThinkPad? I checked this post on AskUbuntu, but like the OP my BIOS does not have a setting for 'smart fan'. My BIOS though has something similar called 'Thermal Performance' wherein it's already set to maximum performance.

But using Hardware Sensors Indicator my fan speed barely reaches 3000 RPM (it's usually stuck around 2600 to 2700 RPM) compared to the indicated RPM of my laptop which is 5400 RPM.

There is a fan control setup for 10.04 specifically for Thinkpad here but I don't want to risk it since it's meant for a rather outdated distro already.

Is there a way change the fan speed if I can't access it through BIOS?

I'm using ThinkPad R61i 12.04 64-bit, 160 GB HDD, Intel T5870, 4 GB RAM.

If you want direct control via the ThinkPad driver then the following wiki page is very helpful:

http://www.thinkwiki.org/wiki/How_to_control_fan_speed

The link above has a perfect solution to the issue. I'm reproducing the link here:

http://staff.science.uva.nl/~kholshei/thinkfan_guide/

Follow all the instructions in the guide of the above link. Then in the /etc/thinkfan.conf file, make the following entry at the end:

(5,    0,     40)

(7,    38,    45)

(64,    44,    60)

Only the above three statements in the matrix are enough. Delete or comment the previous matrix entry. Reboot, and now the fan runs at full speed when temperature rises to 45C and drops to the previous speed at 44C. You may change the values slightly to suit your PC.


Kernel Update from 4.2.0-30-generic to 4.4 I recently created a partition on my Macbook Pro (late 2013 release) to run Ubuntu, following this tutorial.

I managed to have it running smoothly, but I need to update the Kernel to 4.4.  I've been following this website's instructions but once I reboot my computer and log back in and run uname -r, the Kernel is still 4.2.0-30-generic. I've also tried pressing Esc to see GRUB, but the apparently installed Kernel 4.4 doesn't appear on the list.

Any ideas?

UPADTE 1:

After Hyltixa helped me, it seems that GRUB is the problem here. After running sudo update-grub this shows up:

Generating grub configuration file ...
Warning: Setting GRUB_TIMEOUT to a non-zero value when GRUB_HIDDEN_TIMEOUT is set is no longer supported.
Found linux image: /boot/vmlinuz-4.4.0-040400-generic
Found initrd image: /boot/initrd.img-4.4.0-040400-generic
Found linux image: /boot/vmlinuz-4.2.0-30-generic
Found initrd image: /boot/initrd.img-4.2.0-30-generic
Found linux image: /boot/vmlinuz-4.2.0-27-generic
Found initrd image: /boot/initrd.img-4.2.0-27-generic
Found Mac OS X on /dev/sda5
done

which shows that the files did in fact get installed. But GRUB is not showing them as options when booting

UPDATE 2

Here's a snapshot of the grub-customizer tool:

Dunno if it should work any different for Ubuntu users than Elementary OS, but to upgrade from 4.2 (or whatever kernel) to the released "LTS" version of 4.4, you can use:

sudo apt-get install linux-generic-lts-xenial

Use : apt-cache search linux|grep xenial to check what is available. If nothing is found, you have to select the correct sources for your distro :)

I did that on my elementaryOS and it worked fine! Just make sure you get the right files when you download them, AND you install them in this order.

linux-headers-4.4.0-xxx_all.deb
linux-headers-4.4.0-xxx-generic_xxx_i386/amd64.deb
linux-image-4.4.0-xxx-generic_xxx_i386/amd64.deb


Problem with restarting Apache 2 I'm trying to restart Apache 2:

sudo service apache2 restart

But get the below error:

* Restarting web server apache2

AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1.

Set the 'ServerName' directive globally to suppress this message

I've tried to change

sudo gedit /etc/apache2/httpd.conf

A blank file appears, and I'd added this:

ServerName localhost

But that error doesn't disappear!

How can I fix this problem?

I found this: How do I restart/reload Apache when it can't determine the domain name?

  Good news! Apache is restarting successfully. Apache just isn't sure
  where you want serve from, so it's choosing your localhost (127.0.0.1)
  by default. To prevent this message from appearing, clarify that you
  want to serve from localhost (127.0.0.1) by adding the following line
  into your /etc/apache2/apache2.conf file:

ServerName localhost

Here is another Solution:
Before:
[root@centos ~]# /etc/init.d/httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd: httpd: apr_sockaddr_info_get() failed for centos.wks.local
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
                                                           [  OK  ]

Added 192.168.226.131                centos.wks.local in /etc/hosts file
Note: 192.168.226.131 is my Apache server IP address.
After:
[root@centos ~]# /etc/init.d/httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd:                                            [  OK  ]


How can I encrypt my internet traffic so I can use public wifi securely? I have moved to a hostel and they provide WiFi network. I would like to be safe on that public WiFi network. Is there any way to encrypt my data transmission to and from the router ? I am a bit consumed by the hype of “How unsafe public WiFi is” slogan.

Remote access

Most public wireless access points (encrypted or not) use client isolation so there's no way another network client can communicate with your device. If clients can communicate, just make sure to (temporarily) disable or secure all network services running on you device (like httpd, ftpd, sshd, smbd), as you will likely not need them during your stay in the hostel anyway. If you consider yourself a “layman“ as per your comment, you don't need to worry, because Ubuntu doesn't have any network services enabled by default. Of course a more savvy friend could have enabled them per your request, but I suspect you would know about that.

Wireless packet sniffing

Since the network is encrypted with WPA2, an encryption protocol without publicly known vulnerabilities, you're safe from wireless packet sniffers too, because the wireless access point assigns a different session key to every client. Even if all clients share the same password, they won't be able to decrypt each other's network traffic (with reasonable effort). This part is only true for WPA2-EAP.

I have since learned that an attacker with knowledge of the pre-shared secret (likely for a semi-public wireless network) and a record of the WPA2-PSK authentication handshake (reauthentication can be provoked with a deauthentication attack which only requires knowledge of the PSK) can decrypt all subsequent traffic.

Conclusion: Don't rely on the privacy of public wireless networks encrypted with a pre-shared secret. Refer to the following sections for solutions.

Upstream wire tapping

If you're concerned that the hotel staff abuses their access to the unencrypted “upstream“ network (i. e. between the wireless access point (AP) and their internet service provider (ISP)), you need to use HTTPS/TLS¹ or a VPN to encrypt your network traffic throughout that section depending on you needs. See my first comment for things to consider and update your question accordingly, so I can go into the correct details.

VPN

To set up a VPN you need to find a VPN provider that offers VPN protocols with Linux support – preferably with setup instructions, even better when they're for Ubuntu. An alternative would be a public peer-to-peer based VPN like Tor or I2P. Find or ask another question if you encounter problems with either of those, since this would lead a bit too far from the original question.

¹ Most popular web sites use HTTPS by default or optionally to protect against session stealing and man-in-the-middle attacks. Many more do so at least during authentication to protect your password.

If you are worried about privacy from others on the wireless (which you should be) you can be using a VPN like cyberghost. You should also have a strong firewall like zonealarm

If you are using WPA2 or not if the attacker is on the wireless they can still access the package data, I am not sure why it is said you can't. I am not going to get in to that here.

The best option is using a strong firewall and vpn at the same time. That will keep others out of your computer, and your packet data encrypted with a software program other than that of the router itself.


Vlc media player full screen black rectangle Whenever I change to full screen I see a small black shape of a rectangle for a split second.
Plz help, I am new to UBUNTU 20.04
I use acer aspire e5 and I completely erased windows
I only have Ubuntu 20.04
I have amd Radeon graphics card of 2gb and 4gb ram.
The processor is amd a8

@LE VAN DEES
rather uninstall and reinstall VLC.
1: unistall

Method 1 - Open Terminal and type: sudo apt-get remove vlc
Method 2 - Open Ubuntu software - Install applications tab - find and remove VLC

2: reinstall

Method 1: Launch Terminal and type - sudo snap install VLC
Method 2: Open your browser and type in the URL   apt://vlc and follow instructions

Remember to update and upgrade your system before and after:
sudo apt-get update && sudo apt-get upgrade


Rendering Problems: Android Nougat requires the IDE to be running with Java 1.8 or later When I tried to create new application in Android Studio I am got a problem in my layout page, design part getting the following error.

Rendering Problems
Android Nougat requires the IDE to be running with Java 1.8 or later

API24 selected automatically when opened it.
And its working fine, when I select API23 manually.

The problem is I have already installed JDK 1.8 in my system and when open Project Structure it's shows correct directory of my JDK 1.8 path as shown below,

I am using Ubuntu 16.04 to run Android Studio, and when I check Java version am getting version as 1.8,

arul@arul-pc:~$ java -version
java version "1.8.0_77"
Java(TM) SE Runtime Environment (build 1.8.0_77-b03)
Java HotSpot(TM) 64-Bit Server VM (build 25.77-b03, mixed mode)

How to solve this ?

You can install a later version of Java with:

$ sudo add-apt-repository ppa:webupd8team/java
$ sudo apt-get update
$ oracle-jdk8-installer


The command could not be located because '/sbin' is not included in the PATH environment variable I have a severe problem today: when I type ifconfig it does not show ip configuration on ubuntu 12.04. Can anyone help me on this?

Here is the result of ifconfig:

Command 'ifconfig' is available in '/sbin/ifconfig'
The command could not be located because '/sbin' is not included in the PATH environment variable.
This is most likely caused by the lack of administrative privileges associated with your user account.
ifconfig: command not found

You can do either of the following:

Open your ~/.bashrc file and write the following to the end:

export PATH=$PATH:/sbin

and then do source ~/.bashrc or open a new terminal instance.

or open your /etc/environment and add /sbin to end of the PATH variable, so that is as follows:

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

Try this command :

sudo ln -s /sbin/ifconfig /usr/bin/ifconfig


About How to install Ubuntu on portable external Hard Drive? Thank you @chaskes for your explanation in this question
I tried to add this question as comment beneath you answer but I don't have 50 reputation
They are 6 questions about your answer

Will this Ubuntu on external Hard Drive work normally as if installed on a laptop as normaly OS?
Can I move this Ubuntu from the external Hard Drive to the Hard Disk of a new laptop and make this Ununtu as if installed initially on the new laptop?
Every time I run this Ubuntu on external Hard Drive on a another laptop not the usual one will I need to install the drivers of the adapters of the other laptop?
If I have external Hard Drive with 1TB how much the swap should I choose?
Does Ubuntu nowadays still in no need for any Antivirus?
If I run Ubuntu on external Hard Drive on a laptop can I access the the hadr disk of the laptop?

And thank you very much

I hope that @chaskes will find your question and give you an answer :-)

But I will also try to answer your questions, starting with a reference to my answer to a corresponding question,

Boot Ubuntu from external drive

  Will this Ubuntu on external Hard Drive work normally as if installed on a laptop as normaly OS?

Yes, except that

it might be slower than if connected internally via SATA. USB3 is quite fast, but USB 2 is rather slow
discard (for an SSD) does not work via USB

  Can I move this Ubuntu from the external Hard Drive to the Hard Disk of a new laptop and make this Ubuntu as if installed initially on
  the new laptop?

Yes, but check that

the target drive has the same size or is bigger (not one single byte smaller), if you want to clone it
the physical sector sizes are the same on the source drive and the target drive
if proprietary drivers, that they match the target computer.

Otherwise you should copy at the file level, install the bootloader and do some other fixes, or simply make a fresh installation, if you think the fixes are too complicated. In this case you can copy the /home directory to a 'home' partition for the fresh installation.

  Every time I run this Ubuntu on external Hard Drive on a another laptop not the usual one will I need to install the drivers of the
  adapters of the other laptop?

If no proprietary drivers are installed, the free linux drivers are used. If the target computer, 'the other computer', works with the free drivers, you need not install any drivers. But some hardware, for example new and powerful nvidia graphics cards and Broadcom wifi cards need proprietary drivers.

  If I have external Hard Drive with 1TB how much the swap should I choose?

It depends on how you use the computer.

If you want to hibernate, you need as much as the RAM (in gibibytes) and a little bit more, for example 4 GiB RAM ~ 4.3 GB RAM --> 5 GB swap,
otherwise it is probably enough with 2 GB swap unless you know, that you need a lot of swap for some particular application.

  Does Ubuntu nowadays still in no need for any Antivirus?

That has not changed.

  If I run Ubuntu on external Hard Drive on a laptop can I access the hard disk of the laptop?

Yes, but

if Windows is hibernated or semi-hibernated (fast startup), then linux stays away from it to avoid corruption. So if you want access to Windows partitions, please avoid hibernation and turn off fast startup in Windows.

yes it will run like it was installed on a HDD
No, it is generally not portable because during installation decisions have been made
depending on the current hardware. Live USB systems are portable.
Probably yes unless the hardware is the same
The needed size of the swap depends on usage and the
size of the memory.
I will not even try to answer this question.
Yes, if you mount it and if the laptop's operating system allows it
(e.g. a hibernated windows will not permit writing on its disk).

NB: You should only ask one question per "question" here.


Why is there no Chromium for 64 bit Ubuntu Mate? I tried installing 64 bit Ubuntu MATE 18.04 on RPi3B+ but there was no package available for it in Software Boutique. Is there no 64 bit version of Chromium for 64 bit Ubuntu MATE 18.04?

Software boutique only contains a handfull of software chosen by the ubuntu mate developers because of how well those applications integrate in the mate desktop environment. If you want a graphical way to install all applications I suggest installing gnome software.

You can install chromium in 64 bit Ubuntu MATE by using following commands :

sudo add-apt-repository universe
sudo apt-get install chromium-browser


Blank updates in Software Updater in 18.04 I have 18.04 installed, but just recently I noticed my updates are shown as blank and pre-downloaded even though I have configured updates as notifications only. I find this very odd and a little disconcerting, but I'm resigned to the fact that something has probably gone slightly screwy. How to fix this, so that the updater display the updates, or not show up if there is nothing to update?

Even though there is nothing listed, I can't be certain if anything is being installed, hence I can't help but feel slightly paranoid. Do you have any ideas?

I put off the update for over a week, it included some primary components, lib kits, etc... (requires admin) but mostly (size-wise) was firefox package. I don't use that browser. None the worse for it so far, and the "remind me later" nag notice is gone.


upgrade error : illegal package name `doc-base/noawait' I cannot download anything or upgrade my system. I get the following error message:

dpkg: file triggers record mentions illegal package name `doc-base/noawait' (for interest in file `/usr/share/doc-base'): character `/' not allowed (only letters, digits and characters `-+._')
E: Sub-process /usr/bin/dpkg returned an error code (2)

I also cannot use USB creator to do fresh install as my system fails to load bootloaders.

Please help

Try this code:

#!/bin/bash

OLDCONF=$(dpkg -l|grep "^rc"|awk '{print $2}')
CURKERNEL=$(uname -r|sed 's/-*[a-z]//g'|sed 's/-386//g')
LINUXPKG="linux-(image|headers|ubuntu-modules|restricted-modules)"
METALINUXPKG="linux-(image|headers|restricted-modules)-(generic|i386|server|common|rt|xen)"
OLDKERNELS=$(dpkg -l|awk '{print $2}'|grep -E $LINUXPKG |grep -vE $METALINUXPKG|grep -v $CURKERNEL)
YELLOW="\033[1;33m"
RED="\033[0;31m"
ENDCOLOR="\033[0m"

if [ $USER != root ]; then
  echo -e $RED"Error: must be root"
  echo -e $YELLOW"Exiting..."$ENDCOLOR
  exit 0
fi
clear
echo -e $YELLOW"Cleaning apt cache..."$ENDCOLOR
aptitude clean

echo -e $YELLOW"Removing old config files..."$ENDCOLOR
sudo aptitude purge $OLDCONF
clear
echo -e $YELLOW"Removing old kernels..."$ENDCOLOR
sudo aptitude purge $OLDKERNELS

echo -e $YELLOW"Emptying the trash..."$ENDCOLOR
rm -rf /home/*/.local/share/Trash/*/** &> /dev/null
rm -rf /root/.local/share/Trash/*/** &> /dev/null

Save it as troubleshooter.sh.
Then, use these commands:

chmod 700 troubleshooter.sh
sudo ./troubleshooter.sh

Let me know what happens after that.


Restore panel in Ubuntu 14.04 gnome-session-fallback I am running Ubuntu 14.04 gnome. To make it more classic I installed the gnome-session-fallback. It worked fine, but accidentally I deleted the top panel. When I search for a solution, answers from Ubuntu 7-8 come up like this Re-add the default top panel

However, it does not work for me as there is no ~/.gconf/apps/panel I believe this is because the panel is not native to the system, rather it is through gnome-session-fallback. I have tried uninstalling and reinstalling gnome-session-fallback, but it did not work. I am trying to find the files that I can reset to get my top panel back to default.

Also, if it helps, the panel is fine if I log in as another user, so the setting files probably are in the home drive (I guess). Any ideas?

I finally figured out that the file containing information on panels etc. is ~/.config/dconf/user So I just copied this file from another user and the panels are back to default ones.

RUn the command:

gnome-panel --replace

man gnome-panel

DESCRIPTION
       The gnome-panel program provides the panels of the the GNOME desktop.

       The  panels  are  the  areas  on  the desktop that contain, among other
       items, the applications menu, application launchers,  the  notification
       area and the window list.

       Small  applications  called applets can also be embedded in the panels.
       The applets usually provide quick access to specific features.

OPTIONS
       --replace
              Replace an already running panel.


How can I install the Equinox theme? I'm following the instructions on this page:

sudo add-apt-repository ppa:tiheum/equinox
sudo apt-get update
sudo apt-get install gtk2-engines-equinox equinox-theme

But I'm getting:

E: Unable to locate package equinox-theme

Equinox is not available for 11.10, and it will only show up in the PPA for 11.04 and below.

The reason it is not available is because the entire equinox engine would need to be ported to GTK+ 3.x, which is not a trivial matter. It will probably be a while if it ever happens at all.

I believe this may help you:
http://www.linuxnov.com/equinox-theme-with-faenza-icon-theme-how-to-install-on-ubuntu-11-10-oneiric-ocelot/

Let us know if it worked!


Nvidia Drivers in Ubuntu I have Nvidia Quadro FX 3500. I install Ubuntu but when I install Nvidia Linux Long Lived Drivers after downloading from Nvidia website, then after restarting my computer, is shuts down the screen. I don't know what to do. I don't have widescreen monitor and I was using 1024 x 768 resolution before. Screen shuts after logo screen. But after installing drivers, graphic card stopped screaming.
What can I do to fix this problem?? Is there any other driver which will be helpful to make graphic card work OK without making too much noise. Or, is there any other option to use the same drivers and see the screen.
I am using 304.88 Linux X64 drivers.

While installing Nvidia drivers, I have somehow blacklisted old drivers and I don't know how to remove them from blacklist. Now, my display is on 640x480 resolution. Can anybody help me to solve this problem. Or if you can help me to let me install Nvidia drivers for 1024x768 resolution.

You installed the wrong driver for your NVIDIA Quadro FX 3500 graphics card. The driver you installed is for the NVIDIA Quadro 4000 graphics card which has 2GB built-in memory. Your NVIDIA Quadro FX 3500 graphics card has only 256MB built-in memory, so you need to uninstall the NVIDIA 304.88 driver and install the NVIDIA Legacy driver.

Uninstall all proprietary NVIDIA drivers from your computer, but don't uninstall the default built-in nouveau driver.
Download the NVIDIA Linux Display Driver Version 71.86.15 from here.
Using the cd command, change directories to the directory containing the NVIDIA-Linux-x86_64-71.86.15-pkg2.run driver that you downloaded from the official NVIDIA website.
Run the following commands:

sudo chmod a+x NVIDIA-Linux-x86_64-71.86.15-pkg2.run
sudo ./NVIDIA-Linux-x86_64-71.86.15-pkg2.run
sudo reboot

I don't know why are you asking this question.But there are two options:

1.You only have to press the super key and type additional drivers. Then click on the icon of the additional drivers program and scan for drivers. It will automatically show you the available drivers.
2.Go to the graphics engine website (nvidia.com) and download the driver.