Transferring large files between an Ubuntu machine and a windows machine I have two computers, one with Ubuntu 14.04 (PC1), the other one with Windows-7 (PC2). I have a >2GB file to transfer from PC1 to PC2 and I got a timeout message by using the usual way, i.e. using the menu of gnome-classic (network, windows icon, etc). Therefore I did this in my home directory:

sudo mount -t cifs //PC2/PARTAGE/ Windows/ -o  username=USERNAME,rw,user,file_mode=0777,dir_mode=0777

And that works ! The directory ${HOME}/Windows of PC1 is mounted on //PC2/PARTAGE (partage = share in English, it is the name of my shared folder)

BUT the transfer rate is about 14MBytes/s, instead of 50-70MBytes/s as usual (PC1 and PC2 are related to each other by a gigabit switch, I never reach 100MBytes/s probably because of the ethernet cables).

Why is this method slower ? It is my question. What is wrong in this method ?

This issue may be that you are mounting it as a filesystems etc, which is more complicated - using FTP (File Transfer Protocol) would be ideal for this, as it just transferring a file. To use it you first need to install a server (probably easiest on the Ubuntu machine)  - you can do that with:

sudo apt-get install vsftpd

You then need to edit the security settings so not anyone can log in - you can do this by running sudo nano /etc/vsftpd.conf, and replacing anonymous_enable=YES with anonymous_enable=NO. You may also want to set the write_enable entry,  depending on whether you want to allow files to be created over FTP or not. You can then save (Ctrl+O) and exit (Ctrl+X).

You then need to restart vsftpd (I think this is the right command...)

sudo /etc/init.d/vsftpd restart

You then need a FTP client (on the Windows machine) to access the FTP server - for Windows FileZilla is good, but is hosted on Sourceforge, which now sadly has many ad fake download links, and now has adware installers for some of the more popular apps12 (I don't think the version FileZilla_3.9.0.6_win32-setup.exe here has this issue (though it did - looks fine under Wine anyway)) - basically don't use the installer if it looks like this:

You can then enter the IP address and login details of the Ubuntu machine, and transfer the files.

NOTE: Note if you want something potentially more secure you can use SFTP - this can be done by using a SSH server on the Linux machine (using the openssh packages), and sftp in Filezilla.

Install sftp package on Ubuntu machine:

sudo apt-get update

sudo apt-get install vsftpd

Now it's working fine.


Trelby not installing in 16.04 Trying to install trelby by using sudo dpkg -i trelby_2.2_all.deb produces this error:

Selecting previously unselected package trelby.
(Reading database ... 267174 files and directories currently installed.)
Preparing to unpack trelby_2.2_all.deb ...
Unpacking trelby (2.2) ...
dpkg: dependency problems prevent configuration of trelby:
 trelby depends on python-wxgtk2.8; however:
  Package python-wxgtk2.8 is not installed.

dpkg: error processing package trelby (--install):
 dependency problems - leaving unconfigured
Processing triggers for gnome-menus (3.13.3-6ubuntu3) ...
Processing triggers for desktop-file-utils (0.22-1ubuntu5) ...
Processing triggers for mime-support (3.59ubuntu1) ...
Errors were encountered while processing:
 trelby

It clearly looks like a dependency issue, but I don't know how to resolve this.

Any ideas?

I had the same dependency problem with the .deb package on Ubuntu 17.04, but installing Trelby from source was fairly simple.

Install python-lxml and python-wxgtk3.0 from the repository:

sudo apt install python-lxml python-wxgtk3.0

Download and extract the Zip file or clone the Git repository. Example:

sudo apt install git
git clone https://github.com/oskusalerma/trelby.git
cd trelby

Navigate to the trelby folder and enter:

sudo python setup.py install

Done, you can now type, or add a shortcut pointing to, /opt/trelby/bin/trelby to start Trelby

Try this: sudo dpkg -i trelby_2.2_all.deb --force-depends


dvd movie not working I have ubuntu 12.10 and I can't play dvd movies. I tried every kmplayer vlc gnomeVLC could not read the file (Input/output error).

File reading failed:
VLC could not read the file (Input/output error).
File reading failed:
VLC could not read the file (Input/output error).
Your input can't be opened:
VLC is unable to open the MRL 'dvd:///media/ahsidddiqui/Ubuntu%20OEM%2012.10%20amd64%20UALinux/'. Check the log for details.
Your input can't be opened:
VLC is unable to open the MRL 'dvd:///media/ahsidddiqui/Ubuntu%20OEM%2012.10%20amd64%20UALinux/'. Check the log for details.

This might be caused by not having the correct codecs installed. To be able to play DVDs on Ubuntu, there are a few things you need to do first:

Install ubuntu-restricted-extras, either through the software center or the terminal using the following command: sudo apt-get install ubuntu-restricted-extras
Install libdvdcss using the following command in the terminal:
sudo /usr/share/doc/libdvdread4/install-css.sh

You can read more about playing DVDs on the Community Help Wiki

You need Medibuntu for this - here is documentation - what to do :

https://help.ubuntu.com/community/Medibuntu


sh: 0: getcwd() failed: No such file or directory I am trying to compile ARM code in Ubuntu 12.04.

Everything is working fine when I put my code in local directory. But when I put the code in cited mount directory this error happens:

sh: 0: getcwd() failed: No such file or directory
sh: 0: getcwd() failed: No such file or directory

Here is my mount command:

sudo mount -t cifs -o username=wx,passwd=wx,auto,nounix,noserverino,file_mode=0777,dir_mode=0777,uid=user,gid=users,noperm,rw,uid=1002,gid=1002 //192.165.54.18/prj_9330  /home/dongjw/work_dir/work_9330

I am using Ubuntu 12.04 64bit

What would cause this error?

I got this error using jshint through a python subprocess on Ubuntu 12.10 64 bit.

node.js:464
var cwd = process.cwd();
                  ^
Error: ENOENT, no such file or directory
    at Function.resolveArgv0 (node.js:464:23)
    at startup (node.js:51:13)
    at node.js:555:3

It is caused because you deleted or moved a directory out from underneath it and the current directory can't be determined.

How to tell if you are having this problem:

Run the command cd .   (If you get this error then you have this problem).

el@apollo:~/foo$ cd .
cd: error retrieving current directory: getcwd: cannot access parent
directories: No such file or director

You tried to change directory into your current dir, and could not.

How to reproduce the error:

jshint is affected by this error.  Make a directory foo, cd into it, make a file called myjavascript.js

cd /home/el
mkdir foo
cd foo
touch myjavascript.js
jshint myjavascript.js

jshint runs correctly, it says there are no errors which is correct.

Open a 2nd terminal, and rm -rf the directory /home/el/foo out from underneath.

rm -rf /home/el/foo

Run the jshint myjavascript.js again from your first terminal and you get an error:

el@apollo:~/foo$ jshint myjavascript.js

    node.js:464
        var cwd = process.cwd();
                      ^
    Error: ENOENT, no such file or directory
        at Function.resolveArgv0 (node.js:464:23)
        at startup (node.js:51:13)
        at node.js:555:3

The directory is gone!  And even if you were to replace it with the same contents, it has a different signature and the terminal can't recover, the method getcwd can't know what the current directory is.

Three Solutions:

The terminal is confused about what the current directory is because its gone or it's signature has changed.  Do one of these to fix it:

Run the command cd .. until you stop getting errors.  This re synchronizes the terminal with the filesystem.  Then cd back into your directory.  Try again.  The error goes away.
Use su youruser in the terminal, enter the password.  It refreshes and brings you back to the same directory.
Close and reopen the terminal which flushes away the stale directory signatures.  Or send a nastymail to whatever program (jshint) or the thousands of other programs which can't tolerate or recover from stale directory signatures.

Even i was having the same problem with python virtualenv.
It got corrected by a simple restart

sudo shutdown -r now


Which default programs can be safely uninstalled? Which programs installed by default in Ubuntu are generally regarded as safe to uninstall?

I'm mostly thinking of things like social networking, E-mail, you know. Bonus stuff.

You can uninstall anything you want. At work we even delete gdm and anything GUI related but that is because we have a command line fetish.

Open up Ubuntu Software Center and have a look at the list that shows installed.

Anything in here, except for uncategorized and themes and tweaks since these might contain some software you do want to keep, should be safe for removal and should be standalone packages. This includes firefox, thunderbird, totem, libreoffice. The list goes on and on so you will not get a perfect answer to your question.

Anything in the software center is safe to uninstall. but the synaptic is the better way to do it. just look through your menu for items you don’t want then type it in synaptic and remove.

Wattos is already very light I know this for sure but if you are trying to uninstall drivers for scanners printers etc. it can be a lot lighter. My wattos is under 1000 packages and it started at about 1800, but mine is very very minimal I had to be careful.

My suggestion is to keep a live CD handy to reinstall again if you mess up.
Learning is the best part.


Battery drains so fast I have an HP laptop. It is a 64 bit machine. But I have installed 32 bit Ubuntu 12.04 presently. My problem is, once the battery is fully charged and start using Ubuntu it gets drained completely within less than two hours. The interesting fact is that, I don't run any heavy tasks during this time. Watching a movie or surfing Internet causing such quick battery drain.

I have Windows also in my machine on which i get almost three and a half hours of battery backup. Can someone help me? Is this normal with Ubuntu? Or is it because of the installation of 32 bit OS on 64 bit machine?

install TLP Battery saving tool  :- sudo add-apt-repository ppa:linrunner/tlp

sudo apt-get update && sudo apt-get install tlp tlp-rdw

After installation type :-

sudo tlp start

Since, your machine is of 64bit, it would be better to install a 64bit OS. I am not saying that a 32bit OS can not run in a 64bit machine rather if you install 64bit OS, there will be a lesser amount of battery consumption. Plus since you are using two OS s simultaneously, the drainage of battery would obviously be higher.


Compatible version of "Adobe Shockwave Player?" Is there a Ubuntu compatible version of the "Adobe Shockwave Player?" I'm running Firefox and when I try to bring up one of my School's websites it says missing plugin. When I click on "Install missing plug-in" it says none found, so when I click on manually install plug-in it takes me to Adobe Shockwave Player installation, but there is no ubuntu version to install??? On the Firefox plug-in finder service it says "Unknown Plugin (application/x-director)

The Shockwave player is only available for Windows. You can use mozplugger(a program that lets you "embed" other programs in your web browser.) along with wine and windows version of firefox

First, install the wine and mozplugger packages (from the software center).
Now download and install the Windows version of Firefox . Download it from Mozilla's web site. Now double click it and install it .
Run the windows version of firefox .
Now go to a web site that requires Shockwave, and choose to get the missing plugin. Again, follow the on-screen instructions, and when the plugin has installed and is working, you may close Firefox.
Now you need to configure mozplugger to use the Windows version of Firefox for Shockwave files. Press Alt + F2 and type:

gksudo gedit

then open the /etc/mozpluggerrc file

Add the following two lines to the end of the file:

application/x-director: dir,dcr,dxr,cst,cct,cxt,w3d,fgd,swa: Macromedia Director file
        swallow(firefox.exe) fill stream: wine "C:\\Program Files\\Mozilla Firefox\\firefox.exe" -chrome "$file"

Now open a Terminal ( Ctrl + Alt + T ) and paste

rm ~/.mozilla/firefox/*.default/pluginreg.dat

Now run the native version of firefox and test the shockwave player by visting this site .

Modified From Here

Alternatively, use Chromium web browser - this works for sites which fail in Firefox.


Adding root privileges to a bash script I am in need of adding root privileges to a bash script which uses sudo; so that whenever we run the script from the terminal; irrespective of the fact that the user is root or not it should not prompt for password. Please help! Doing Run Bash Script as Root did not help.

The best solution would be use visudo (this tool was made for that and will avoid the exposition of root password), I suggest you to dig what are going wrong with that.

As a workaround, you can run this:

echo <password> | sudo -S some-script

(start the command with a space so it won't be saved in bash history).

Regards.

Have you tried setting a sticky bit on the file, so when it's run it'll run as root?

You can run chmod 2777 on the file and chown root on the file to give it to root.

Now, anyone who executes the file will be running it as root.


difference between bash.bashrc and /etc/environment file Till date I used to set my environment variables in the bash.bashrc file. Recently I was told to use the /etc/environment file. Well, both work fine.

So, what is the difference between them?

I googled this and I found "bashrc is used for particular user and environment, system wide". What is meant by system wide here? /etc/bash.bashrc is also applying changes system wide I guess. Correct me if I am wrong. Any kind of help will be appreciated..

One difference is that /etc/environment contains only variable definitions and doesn't appear to go through any sort of variable expansion/interpolation. Thus, you can't reference variables in definitions. This for instance won't work:

A="else"
B="something $A"

B will literally be something $A, not the expected something else.

See this question.

By the way, the answer you found through Google appears to be referring to a user's ~/.bashrc, rather than the system-wide /etc/bash.bashrc. That may be causing your confusion.

The difference between the two is that the /etc/enivironment file will work for all of the users while the bash.bashrc file will particularly work for that user only. And if you do anything wrong in the /etc/environment file then the consequences may be severe while you can easily undo the changes in the bash.bashrc file by copying the contents of the /etc/environment file. But the first preference is give to the bash.bashrc file and then to /etc/environment file. It is not that if you make changes in the bash.bashrc file then the terminal will give first preference to the local user file (i.e., bash.bashrc) and then to the main file (i.e., /etc/environment).


Webmin no route to host Using Webmin → Network Configuration, I added a new DNS address to the existing server (10.100.200.300). While I saved the new configuration, I lost access to webmin and ssh to this server.

How can I retrieve access?

I pinged 10.100.200.300 and its dead.

When I tried to login with ssh it says: error no route to host. I usually log in to webmin the server IP address and port 10000 but now I cannot.

Any help to go back to my previous state?

I think you should not use addresses out of range: address 10.100.200.300 is not valid, every octet can be in range 0 to 255 only.

you should not use webmin. It is well known to break easily systems. For instance, "in one clic" webmin blasted your network configuration. And the worse is that changing DNS under any linux is really easy : you just need to edit the file /etc/resolv.conf

You must log in localy (keyboard and screen) to your server. You lost your network connection. It seems that you lost your routes.

Maybe your network is down and you just need to do a service networking restart

What is sure is that you will not be able to do anything remotely.


GLIBCXX_3.4.20 not found, how to fix this error? Whey I try to run the program Layout Editor (available on this site) on Ubuntu 14.04.1 64-bit LTS I get the following output in the terminal:

$ layout
layout: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by layout)

I tried the command strings on /usr/lib/x86_64-linux-gnu/libstdc++.so.6 as following and here is the input and the output:

$ strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBCXX
GLIBCXX_3.4
GLIBCXX_3.4.1
GLIBCXX_3.4.2
GLIBCXX_3.4.3
GLIBCXX_3.4.4
GLIBCXX_3.4.5
GLIBCXX_3.4.6
GLIBCXX_3.4.7
GLIBCXX_3.4.8
GLIBCXX_3.4.9
GLIBCXX_3.4.10
GLIBCXX_3.4.11
GLIBCXX_3.4.12
GLIBCXX_3.4.13
GLIBCXX_3.4.14
GLIBCXX_3.4.15
GLIBCXX_3.4.16
GLIBCXX_3.4.17
GLIBCXX_3.4.18
GLIBCXX_3.4.19
GLIBCXX_DEBUG_MESSAGE_LENGTH

How can I resolve this issue I somehow guess that it is related with GCC but cannot figure out how to fix the problem. Furthermore, I have tried a PPA as suggested on How do I use the latest GCC on Ubuntu? and there is a similar question for an older version of Ubuntu at GLIBCXX_3.4.15 not found. However, after I ran sudo update I get numerous warnings and the list I obtained with the strings command did not have new entries after installing gcc 4.9, so I purged the PPA(Toolchains Test Builds) with ppa-purge. Any help, suggestions on how to proceed are greatly appreciated.

I was having the same problem when trying to run other program, and found a solution on StackOverflow.

Basically, just do the following commands:
Firstly, install:

sudo apt-get install libstdc++6

This should already be installed by default, but try it anyway.
If it doesn't solve it, just do the following:

sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade

I didn't perform the "dist-upgrade" command, but the ones before solved it for me

I had the same issue while installing Ubuntu 18.04 in Virtualbox with the live-server image. I'm not sure what I did wrong but got the same error
"apt-get: symbol lookup error: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: undefined symbol: , version GLIBCXX_3.4.11"

I was using 64-bit and had to download this file by using
wget http://security.ubuntu.com/ubuntu/pool/main/g/gcc-8/libstdc++6_8.4.0-1ubuntu1~18.04_amd64.deb

and installed using dpkg -i.
Then everything runs normal with APT.
Then did an apt-get upgrade to make sure all is well.


LXC Is it possible to run a 12.04 container on 14.04 Other than the kernel only, is it possible to emulate an older install of Ubuntu?

I looked in /usr/share/lxc/templates and it only has "lxc-ubuntu".

A little more info, this fixed my problem:

sudo lxc-create -t download -n [YOURNEWCONTAINERNAME] -- --dist ubuntu --release precise --arch amd64

I figured this out by reading the template script. There's probably other options available.


How do I set default display brightness? Is it possible to set the default display brightness so you don't have to re-adjust it everytime you reboot? My laptop display is killing my eyes at the login screen already because it starts at 100% brightness every time.

Review of solutions and offering a (hopefully) better one

Previous solutions

/sys/-based : good for console

@gan

This works echo 5 > /sys/class/backlight/acpi_video0/brightness but does not play well with X. More specifically, X is not aware about your preferred settings and you may end up needing to set the brightness manually again at least once, similar to bug #1042359 .

setpci-based : system-dependent, dangerous

@erickjohncuevas

Solutions based on things like setpci -s 01:00.0 F4.B=50 are dangerous. There, 01:00.0 is actually an ID targeting a particular board on the PCI bus. And it is system-dependent. That means blindly following this may write configuration registers on some other boards where it may mean anything, from just nothing to crashing the system at some point in the future. Anyway it does not play well with X either.

Proposed solution

Advantages/drawbacks

The solution below has these advantages:

plays nice with X which is fully aware of the settings chosen
is more readable, thus maintainable
does not contain system-specific address, etc, and as a result may work on a wider range of hardware (e.g. where kernel does not know about backlight, or that don't even use PCI-based video board, think Ubuntu for ARM )

It assumes: Ubuntu using lightdm (that is 11.10 and beyond)

It only sets backlight when lightdm starts. But it can be combined with the /sys-based solution above if you really need to set backlight earlier.

The solution

Copy-paste of these commands should do what you need (sudo will probably ask your password).

Install xbacklight if it is not already installed (it is a small
package).

sudo apt-get install xbacklight

You should test xbacklight on the command-line to see if it works.
For example:

xbacklight = 100 ; sleep 2 ; xbacklight = 30

Try to figure out a suitable value for your hardware and lighting
conditions.
Create a small script running xbacklight.
You can change the =30 into another value if you wish.
The || true ensures that if xbacklight fails for any reason, X can
still start.

sudo bash -c '{
    echo "#!/bin/bash"
    echo "xbacklight =30 || true"
} >> /etc/lightdm/display-setup-script.sh '

Make the script executable

sudo chmod a+rx /etc/lightdm/display-setup-script.sh

Instruct lightdm to run the script when starting X.
Specifically, this adds a line display-setup-script in a lightdm
configuration file, but only if there is not one already.

if grep -ri ^display-setup-script /etc/lightdm/
then
  echo "There may be already a display-setup-script. It may already do what you need. Else please adjust manually" ;
else
  if [[ -d /etc/lightdm/lightdm.conf.d ]]
  then
    # Ubuntu 13.10 and above have lightdm.conf.d. 14.04 *only* has lightdm.conf.d.
    DEST_CONF_FILE=/etc/lightdm/lightdm.conf.d/20-default-brightness.conf
  else
    # Ubuntu 12.04, 12.10, 14.10 do not have lightdm.conf.d, so we change main configuration file
    DEST_CONF_FILE=/etc/lightdm/lightdm.conf
  fi
  echo "Writing into $DEST_CONF_FILE"
  sudo bash -c "{
      echo '[SeatDefaults]' ;
      echo display-setup-script=/etc/lightdm/display-setup-script.sh ;
  } >> $DEST_CONF_FILE" ;
fi

May be tested by restarting lightdm from a root session on the console.  Or, more simply, by rebooting.

Tested on Ubuntu 12.04, 12.10, 13.10, 14.04, 14.10, 16.04.

Please provide feedback about your experience.

This should do the trick:

System settings -> Screen -> Brightness

Use the slider to adjust default setting.


Starting Pre-cache and pre-load apparmor profiles fails on boot I found really few topics on the whole internet about this failure, so I couldn't debug or investigate much. During the boot process I started to see the error some months ago:

* Starting Pre-cache and pre-load apparmor profiles                     [fail]

I couldn't say if it started after a particular upgrade.
I'm on Ubuntu 14.10.

cat /var/log/upstart/apparmor.log

Skipping profile in /etc/apparmor.d/disable: usr.bin.firefox
AppArmor parser error for /etc/apparmor.d/usr.bin.mediascanner-service-2.0 in /etc/apparmor.d/usr.bin.mediascanner-service-2.0 at line 14: Could not open '/usr/share/apparmor/hardware/audio.d'
Skipping profile in /etc/apparmor.d/disable: usr.bin.firefox
AppArmor parser error for /etc/apparmor.d/usr.bin.mediascanner-service-2.0 in /etc/apparmor.d/usr.bin.mediascanner-service-2.0 at line 14: Could not open '/usr/share/apparmor/hardware/audio.d'
Skipping profile in /etc/apparmor.d/disable: usr.sbin.rsyslogd
Skipping profile in /etc/apparmor.d/disable: usr.bin.firefox
AppArmor parser error for /etc/apparmor.d/usr.bin.mediascanner-service-2.0 in /etc/apparmor.d/usr.bin.mediascanner-service-2.0 at line 14: Could not open '/usr/share/apparmor/hardware/audio.d'
Skipping profile in /etc/apparmor.d/disable: usr.bin.firefox
AppArmor parser error for /etc/apparmor.d/usr.bin.mediascanner-service-2.0 in /etc/apparmor.d/usr.bin.mediascanner-service-2.0 at line 14: Could not open '/usr/share/apparmor/hardware/audio.d'
Skipping profile in /etc/apparmor.d/disable: usr.sbin.rsyslogd

This is a bug in mediascanner2.0 and I have filed bug 1443693 for you.

As a workaround, you can run:

sudo mkdir -p /usr/share/apparmor/hardware/{audio,graphics,video}.d

or alternatively purge the mediascanner2.0 package if you don't need it (assuming that this is a desktop and not a phone).

Try downgrading to 14.04, that should work.

If you want 14.10, try backing up all your data and then doing a CLEAN INSTALL using a CD or a Flash Drive.


How do I configure swappiness? I need a step-by-step, simple and easy way to configure swappiness.

The Linux kernel provides a tweakable setting that controls how often the swap file is used, called swappiness.
A swappiness setting of zero means that the disk will be avoided unless absolutely necessary (you run out of memory), while a swappiness setting of 100 means that programs will be swapped to disk almost instantly.
Ubuntu system comes with a default of 60, meaning that the swap file will be used fairly often if the memory usage is around half of my RAM. You can check your own system's swappiness value by running:
one@onezero:~$ cat /proc/sys/vm/swappiness
60

As I have 4 GB of RAM I'd like to turn that down to 10 or 15. The swap file will then only be used when my RAM usage is around 80 or 90 percent. To change the system swappiness value, open /etc/sysctl.conf as root. Then, change or add this line to the file:
vm.swappiness = 10

Apply the change.
sudo sysctl -p

You can also change the value while your system is still running with:
sysctl vm.swappiness=10

You can also clear your swap by running swapoff -a and then swapon -a as root instead of rebooting to achieve the same effect.
To calculate your swap Formula:
free -m (total) / 100 = A

A * 10

root@onezero:/home/one# free -m
             total       used       free     shared    buffers     cached
Mem:          3950       2262       1687          0        407        952
-/+ buffers/cache:        903       3047
Swap:         1953          0       1953

so total is 3950 / 100 = 39.5 * 10 = 395

So what it mean is that when 10 % (395 MB) of ram is left then it will start using swap.

                                          Help . Ubuntu . Swap
                                           What is swappiness
The swappiness parameter controls the tendency of the kernel to move processes out of physical memory and onto the swap disk. Because disks are much slower than RAM, this can lead to slower response times for system and applications if processes are too aggressively moved out of memory.

swappiness can have a value between 0 and 100.
swappiness=0:

Kernel version 3.5 and newer: disables swapiness.
Kernel version older than 3.5: avoids swapping processes out of physical memory for as long as possible.

swappiness=1:

Kernel version 3.5 and over: minimum swappiness without disabling it entirely.

swappiness=100:

Tells the kernel to aggressively swap processes out of physical memory and move them to swap cache.

See http://en.wikipedia.org/wiki/Swappiness.
The default setting in Ubuntu is swappiness=60. Reducing the default value of swappiness will probably improve overall performance for a typical Ubuntu desktop installation. A value of swappiness=10 is recommended, but feel free to experiment.

Example
Started using swap at 91%:

As I have configured my system & vm to make use of RAM at 90%, at 90% there was no swapping.
After that I opened  some applications like Firefox & Shutter, and it started swapping because RAM usage is above 90%.

For ZRAM swap without any actual swap partitions/files, use 100. It'll pre-compress everything what can be pre-compressed, leaving cache intact and quickly decompress data as needed (also, without real swap you'll need to increase admin_reserve_kbytes x2 or even x4 to avoid whole system freezing on low RAM instead of dropping a hungry application).

For SSD with actual swap partition, use 1. It'll prevent from swapping as long as possible, sacrificing the cache (but cache can be easily re-read from SSD).


How to load unity-launcher in standalone session? I want to auto-start unity-launcher in a stand alone session without loading the top panel with it, like in this picture:

So how to do this?

That setup is actually using the Unity 2D launcher. The Unity launcher and top panel are tied together in a Compiz plugin and can not be used separately. Luckily, the 2D launcher aims to be nearly identical to the normal one.

In order to use the Unity 2D launcher with a different panel, you need to create a custom session which you will load a login time.

First you need to create a desktop file that LightDM will read. Open your new file with a terminal using:

gksu gedit /usr/share/xsessions/custom-session.desktop

Then add this text:

[Desktop Entry]
Name=Custom Session
Comment=This is my custom desktop
Exec=/usr/local/bin/custom-session
Type=Application

This will add a new login option to the login screen. It will run the contents of /usr/local/bin/custom-session Now create that file:

gksu gedit /usr/local/bin/custom-session

Add:

#!/bin/bash
if test -z "$DBUS_SESSION_BUS_ADDRESS"; then
eval `dbus-launch --sh-syntax --exit-with-session`
fi
compiz --replace ccp & wmpid=$!
sleep 1
if [ -f ~/.custom-session ]; then
source ~/.custom-session &
else
xterm &
fi
wait $wmpid

This will launch a compiz and run the contents of ~/.custom-session which will define the other programs you want to have started. But first, lets make this executable:

sudo chmod 755 /usr/local/bin/custom-session

Now we'll create ~/.custom-session:

gedit ~/.custom-session

Now we'll add the programs that need to run on login:

#!/bin/bash
gnome-settings-daemon &
unity-2d-panel &
nautilus -n &
nm-applet &

You'll also need to add what ever program you want to provide the top panel to that file.

Why i didn't think of this before ?

I have replaced unity-2d-panel & with unity-2d-launcher & and it works,

But how to replace it with unity-3d launcher (I thinks it can't happen as @andrewsomething says

  The Unity launcher and top panel are tied together in a Compiz plugin and can not be used separately

then how to control unity 2d-launcher in this session?


How do I set up an MTS MBlaze modem? I have a new MTS MBlaze Broadband modem USB and it is not getting detected in my Ubuntu 10. 04. It is getting detected as an USB but not as MODEM as result I am not able to create a MOBILE BROADBAND connection

How to use MTS MBlaze modem on Ubuntu?

There two ways to setup MBlaze USB Modem in Ubuntu:

Using driver software which included in the modem itself.
(Recommended)
And without any driver software.

Using recommended driver software

The modem itself contains the driver software for both RPM and DEB based GNULinux distros, Mac OS and Windows. From these, we Ubuntu users, have to install CrossPlatformUI-V2.1.2-SSTL-i386-ubuntu.deb package. If you are using 32 bit Ubuntu then it is not going to be a big headache. Just install it after connecting the USB Modem. But, if you have 64 bit Ubuntu then this one is not going to work as it is build for 32 bit systems only. For that we need to re-build this 32 bit only into 64 bit also driver software.

For Non-advanced users

If you are not familiar with executing commands in terminal or do not want to spend your valuable time, simply download the package provided below which we had re-built ourselves.

Download CrossPlatformUI-V2.1.2-SSTL-ALL-ubuntu.deb

And install this after connecting the modem. It will work for sure because we are using it right now.

For Advanced users

First we need to install Dpkg. Dpkg is a terminal based application
that help to install, remove, unpack, build the *.deb package files.
To install Dpkg, connect to Internet and execute sudo apt-get
install dpkg in terminal.
Extract CrossPlatformUI-V2.1.2-SSTL-i386-ubuntu.deb file.
Open extracted directory->DEBIAN and open control file in a text
editor.
Now replace the Architecture from i386 to all.
Save the file and close it.
In terminal, execute sudo dpkg -b <extracted directory name> <deb
filename>
For example, sudo dpkg -b CrossPlatformUI-V2.1.2-SSTL-i386-ubuntu CrossPlatformUI-V2.1.2-SSTL-ALL-ubuntu.deb

You may now find a new CrossPlatformUI-V2.1.2-SSTL-All-ubuntu.deb file has built along with the extracted directory. This is the same one which we have provided above to download. Install this driver package after connecting the USB Modem.

And remember, you can also use this package for any other Ubuntu based distros.

Without any driver software

MTS MBlaze USB Modem also can be used without installing driver software since latest version of Ubuntu (or any other GNULinux distro) support this modem by default. It should be at least 10.04 or greater version of Ubuntu.

Connect the modem with the PC. The system will detect the device
automatically.
Look out for the notification saying Device recognized USB Modem,
ONDA Communication S.p.A., then click on the icon of Network
Connections in system tray.
You will find an option New Mobile Broadband (CDMA) Connection,
click on it.
A new window will open to setup a mobile broadband connection. Click
Forward button
Select India as country, then Forward,
Select MTS MBlaze from the providers’ list, Forward,
And then click Apply,
Now Disconnect the connection which is trying to connect
automatically. Because it is not going work until we provide
username and password.
Open Edit Connections->Mobile Broadband (Tab)->Select MTS MBlaze
Connection and click on Edit.
Under Mobile Broadband, type internet@internet.mtsindia.in as
 username and MTS as password.
Check Available to all users and Connect automatically if you want.
Save it and close Network Connections.
Now take off the modem from the port and reconnect it.
After the modem get recognised by the system, try to connect
 Internet.
If everything goes right, you will see that your Internet
 connection will get connected.

Happy Browsing. :)

Source: How to setup MTS MBlaze USB Modem in Ubuntu GNULinux

When your modem gets detected, add a new mobile broadband connection.
Username: internet@internet@mtsindia.in
Password: 777
Number: #777

I did this and it works
Good Luck!


How to remove jre1.8.0.72? There is an error during install jre1.8.0.72. How should I remove it? I get an error during purge:

sudo apt-get purge jre1.8.0-72

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
  jre1.8.0-72
0 to upgrade, 0 to newly install, 1 to remove and 26 not to upgrade.
1 not fully installed or removed.
After this operation, 126 MB disk space will be freed.
Do you want to continue [Y/n]? y
(Reading database ... 454719 files and directories currently installed.)
Removing jre1.8.0-72 ...
/var/lib/dpkg/info/jre1.8.0-72.postrm: line 586: /usr/sbin/alternatives: No such file or directory
dpkg: error processing jre1.8.0-72 (--remove):
 subprocess installed post-removal script returned error exit status 127
Errors were encountered while processing:
 jre1.8.0-72
E: Sub-process /usr/bin/dpkg returned an error code (1)

If you installed Java using Webupd8 script, then to uninstall Java do the following:

sudo apt-get remove --purge oracle-java8-installer

If you installed Java from Ubuntu repositories, then you can remove it by typing:

sudo apt-get remove --purge openjdk-*

This error /usr/sbin/alternatives: No such file or directory can be solved to create a empty file.


Is there anybody using 2x Client? I need to use the app: 2X Client for work. I can get it to work, make connection to the server and work with it but as soon as I open the terminal screen it goes full screen and the only thing I can do is log out to get back to my desktop! There's no other way for me at this point.

I come from a windows environment and there's a so called connection-bar on top of the screen where I can minimize/window the terminal screen so I can work with the Ubuntu desktop. This bar is missing with my.

Does anybody have a solution for this?

You just need to set up display size in properties for your remote desktop connection.

Open Connection Properties for your connection to remote server -> Display -> General Options -> Size and select size you want.

@user187631: Same problem here.
Tip from my colleagues: use Windows key + (left) Alt key + M to minimize your window (and access your local desktop).

For myself, also being unable to set my own preferred screen size, I found unchecking 'Span desktop across all monitors' somewhat helpful too (Connection Properties -> Display -> Desktop Options). Using version 10.5 (build 1359).


Can't find "Documents on {username}'s iPad" in 12.04 with an iPad mini I found this question for 13.10 : Mounting ipad in ubuntu 13.10 , can't find "Documents on iPad" device

I solved my "trust-loop" issue as the link in that question suggested, by upgrading to libimobiledevice2 1.1.6 , but that completely broke down with a lot of errors when i connected my iPad.

So I downgraded back to 1.1.1-4 . Now when I connect my iPad, the "trust-loop" bug is gone, but I can only find the "{username}'s iPad" folder and not the "Documents on {username}'s iPad" folder. A post suggested rebooting my iPad which I did, with no success.

Please help! I really want to put some songs and movies on my iPad soon!

EDIT:

Ok! I reboot my laptop, and the "Documents" folder shows up, but the "trust-loop" problem is back again. :(

Looks like you should reinstall libmobiledevice again. "Documents on [user] iPad" reappears after rebooting the ipad.


SD card won't mount for no reason I'm trying to mount my SD card to /media/SD using the terminal command sudo mount, but this happens:

$ sudo mount -t vfat /dev/mmcblk1 /media/SD
mount: /dev/mmcblk1 is already mounted or /media/SD busy

I delete and replace /media/SD and it still doesn't work

$ sudo rm -r /media/SD
$ sudo mkdir /media/SD
$ sudo mount -t vfat /dev/mmcblk1 /media/SD
mount: /dev/mmcblk1 is already mounted or /media/SD busy

the SD card is not mounted

$ sudo umount /dev/mmcblk1
umount: /dev/mmcblk1: not mounted

the SD card is stored as /dev/mmcblk1

sudo fdisk -l
Disk /dev/mmcblk1: 59.5 GiB, 63864569856 bytes, 124735488 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00000000

also the kill command does work either

You don't have a partition table on the SD card, so if in the unusual case that you put a filesystem on the unpartitioned device, you need the loop option, -oloop in the mount command.  If you have nothing on the card and you want to use it normally, add a partition to it with fdisk, then make a filesystem on it with mkfs.vfat.  If you actually have data on the card, you should not make a new filessytem on it, but try a recovery tool like testdisk.
  Learning to use a new tool, start with the "man" pages,(manual),

man fdisk

Insert another usb stick beside the sd card  at the same time

Then type lsusb and see if it still exist

If you have a gui:
 try formatting the usb stick  through    the file manager
 a window will aber
select your sdcard and mount it


Ubuntu 16.04 /usr/bin/gnome-software --gapplication-service 100% CPU consumption From time to time process /usr/bin/gnome-software --gapplication-service starts consuming 100% of one of my cores. It is fixed if I reboot, or kill it with kill.

Is there a way to understand why this is happening? I want to create bug report. I could not find anything related in /var/log/.

I think you need to look into the file /var/log/kern.log its about the internals.

I have had one VM log some errors there, I snapshotted my VM and redeployed it the errors never happened again.

You may have a faulty core or overheating CPU, just my best guess.

Among all the desktop environments, gnome is one of the most cpu power consuming desktop environment. Try removing the unnecessary daemons of gnome from /etc/init and restart you device. If this does not show any improvement then try switching to other desktop environments like XFCE or KDE.


Ubuntu 15.04 OpenStack Kilo Swift and Horizon Install I've installed Ubuntu 15.04 and am in the process of installing OpenStack Kilo as described in OpenStack Kilo on Ubuntu 14.04 LTS and 15.04 – Single machine setup – Free and Open Source Software Knowledge Base. The instructions include the installation of KeyStone, Glance, and Nova. I also want to install the Horizon dashboard and Swift. Could you send me a link for their installation?

Well, it's a very old question and possibly you have already installed and used Openstack Kilo but I'll still paste the resources for some users that may stumble upon this while wandering on Google:

Complete documentation for installation of all components on Ubuntu 14.04. No reason why it wouldn't work on Vivid. Did I tell 15.04 comes with a pre-installed version of Openstack Kilo? Yes you just install Ubuntu and access it using Horizon in a browser.
This dude isn't very talkative but if you aren't a linux noob, you could easily follow what he's doing, i.e. installing Openstack Kilo in a distributed environment on Ubuntu 15.04 server systems.


Enable favicon on Apache 2 with SSL After moving from HTTP to SSL in Apache configs I cannot anymore access the favicon on the server.

The part of responsible config looks like:

<VirtualHost *:443>

        DocumentRoot /home/ubuntu/project/project/

        Alias /favicon.ico /home/ubuntu/project/static/favicon.ico
        Alias /static/ /home/ubuntu/project/static/

        <Directory /home/ubuntu/project/static>
                Require all granted
        </Directory>
   </VirtualHost>

Folder exists and favicon is located in it.

When I am trying to access favicon.ico I get 403:

  Forbidden You don't have permission to access /favicon.ico on this
  server.

How can I solve it?

Here is the output of:

namei -lx /home/ubuntu/project/static/favicon.icof:

/home/ubuntu/project/static/favicon.ico
Drwxr-xr-x root   root   /
drwxr-xr-x root   root   home
drwxr-xr-x ubuntu ubuntu ubuntu
drwxrwxr-x ubuntu ubuntu project
drwxrwxr-x ubuntu ubuntu static
-rw-rw-r-- ubuntu ubuntu favicon.ico

use

chmod +rx favicon.ico

in your var/www/html folder

Your favicon.ico file has not sufficient permission.

I would set favicon.ico file with :

  chmod 505 favicon.ico

Then save again favicon.ico with now new permissions.


When will Trusty be available in old-releases? I have a bunch of legacy servers still running on 14.04 that are in the process of being migrated. Do we know when will the updates be available in old-releases so I can plan to update the sources beforehand ?

Trusty is now available on http://old-releases.ubuntu.com.

Ubuntu 14.04 user now will have to switch to old-releases.ubuntu.com to be able install software, perform update etc— though they won't get any further Security/Bug-fix updates from Ubuntu.


bin/bash: ruby command not found. Ruby not in sudo path I can't seem to run any code on ruby with any text editor. This error is returned when code is run

/bin/bash: ruby: command not found
[Finished in 0.0s with exit code 127]
[shell_cmd: ruby "/home/user/Resume/ruby/WebScraper/redditscrape.rb"]
[dir: /home/user/Resume/ruby/WebScraper]
[path: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/user/.rvm/bin]

I found a similar question on stackoverflow sudo: ruby: command not found after ssh

As user terdon explains it's caused by ruby not being in the sudo path. So I tried sudo-ing my type ruby but nothing happened. How do I fix this? Thanks in advance!

if this helps my type ruby is  /home/user/.rvm/rubies/ruby-2.2.2/bin/ruby

and my echo path is

/home/user/.rvm/gems/ruby-2.2.2/bin:/home/user/.rvm/gems/ruby-2.2.2@global/bin:/home/user/.rvm/rubies/ruby-2.2.2/bin:/home/user/.rvm/bin:/usr/local/heroku/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games

Try reinstalling ruby maybe?

sudo apt-get install --reinstall ruby


How to remove Gnome desktop environment? I had installed Ubuntu-gnome-i386 in my laptop. It is working fine but I don't need gnome environment anymore. How can I completely remove Gnome desktop environment and get back my Unity.

Try this: sudo apt-get autoremove gnome-shell -y


Why Touchpad of Zenbook UX31 not working? The capabilities of the touchpad on the new ASUS UX31 Zenbook leave much to be desired. The touchpad works like a mouse, but no vertical or horizontal scrolling. I contacted a developer who works for Sentelic. He said:

  Unless driver does some non-trivial works based on coordinates output,
  I'm afraid that it won't have scrolling support at this moment.

and

  Windows driver does scrolling in driver where current Linux driver
  doesn't have such feature, yet.  Additionaly, given that the resource
  is quite limited at this moment, I'm afraid that there is no firm
  schedule for scrolling support in Linux driver.

How can we get this driver to do some "non-trivial works based on coordinate output"?

Hardware: Asus Zenbook UX31
Touchpad: Sentelic

i've installed Linux Kernel 3.2 rc2 today on my ASUS UX31 Zenbook and the Elantech Touchpad i've built in gets detected correctly and works as expected.

it seems that there  are two versions of the zenbook, one with Sentelic and one with Elantech touchpad.

See this thread: http://ubuntuforums.org/showthread.php?t=1865577&page=55


Why do some open applications appear as "question marks" in the Unity launcher? I'm having a problem with a couple of programs that have launchers in unity but then create a separate icon after launched.  Is is possible for the launcher to track the windows it spawns to organize better?  Or is this a bug in Unity itself?

It might not matter but this specific program is a mono program, and the icon spawned is listed as the panel.

What's happening

Problems like this relate to Unity's application matching framework. To simplify the technical details, program windows and applications are two separate things to Ubuntu. Ubuntu needs to 'guess' which application owns a particular window. And sometimes that guess fails, and a question mark appears in the launcher.

The failure may be due to:

A bug in BAMF (the application matching framework mentioned above).
A faulty application description (aka '.desktop' file).
The lack of any application description at all. Executables that launch windows do not inherently have this metadata.

The application shown in the question (KeePass2) suffers from a type 1 problem that has been reported to the appropriate bug tracker.

Examples of problems

The below examples are technical, aimed at programmers who want their own application displaying properly in the Ubuntu launcher.

Problem 3 – No application description

In order for an application to integrate with Unity—that is to say, be searchable in the Dash and placed in the launcher—it needs to have a desktop entry. Such entries are placed in the /usr/share/applications/, /usr/local/share/applications/, and $HOME/.local/share/applications/ (the latter two being for third party software, system-wide and user-only respectively). They end with a .desktop extension and follow this basic format:

[Desktop Entry]
Type=Application
Name=My Application's Name
Icon=/file/path/of/my/icon
Exec=/file/path/of/my/executable

This entry starts a program by calling the Exec executable. Whenever that program displays a window or dialog, Unity will notice that its executable "belongs" to this application description, and use the given Name and Icon in the launcher.

This is a barebones example. The formal specification covers many advanced features.

Problem 2 – Faulty application description

Let us assume that my_app.desktop exists in a valid application directory, but:

/file/path/of/my/icon does not exist in the filesystem.
/file/path/of/my/icon is not an image.
the entry uses some incorrect syntax or invalid tags.

In any of the above case, Ubuntu will be unable to properly list the application window in the launcher.

Problem 1 – A bug in BAMF

As of Ubuntu 11.10, BAMF has a number of bugs that prevents correct application matching. Common (temporary) pitfalls include:

The Exec path being a symbolic link rather than a regular file
The executable being a script that launches the main executable.

In these cases, programmers have no option but to use a workaround, such as removing the symbolic link abstraction, or linking to the executable directly. Neither of these are required by the desktop entry specification itself.

I had a few issues with 16.04 including the greyed out icons and sometimes the touchpad would become erratic (Acer V15 nitro) also the software centre (maybe other icons too) would not open from the icon (only from a terminal command) . I found a recommendation somewhere to uninstall and reinstall the gnome software. Since I did this the whole system has been 100% stable no more greyed out icons and works perfectly. It looked scary initially when I rebooted after this change - lots of system messages on reboot- so do it at your own risk.

sudo apt-get autoremove gnome-software && sudo apt-get install gnome-software


How Can I Modify GRUB? how can i make it so my GRUB does not show safe modes, does show memory sticks, and if possible has a hotkey to boot windows?

Just to complete the previous reply, here is how you install grub-customizer:

sudo add-apt-repository ppa:danielrichter2007/grub-customizer
sudo apt-get update
sudo apt-get install grub-customizer

Just Go to the terminal .

Then Log on as Super User.

Then open the File vi /etc/boot/grub/grub.conf

There you can modify your grub

I hope it will help you my friend


Chkconfig alternative for Ubuntu Server? I've become very accustomed to managing service startups on Redhat/RHEL platforms using chkconfig though that doesn't appear to be the Debian/Ubuntu way - How do I update runlevel information for system services on Ubuntu?

Ultimately looking for the equivalents of:

chkconfig --add <service>
chkconfig --level 345 <service> on
chkconfig --del <service>

The equivalent to chkconfig is update-rc.d

The equivalents you seek are

update-rc.d <service> defaults
update-rc.d <service> start 20 3 4 5
update-rc.d -f <service>  remove

See this useful page for more information or check out man update-rc.d

Lets walk from ZERO to Goal - how to do it with step by step.

Step 1: lets write a hello world

cat >> /var/tmp/python/server.py <<\EOF
#/usr/bin/python
import time
while True:
  print "hello> YES Bello"
  time.sleep(30)

EOF

Step 2: lets make our hello world application server.py automated

cat >> /var/tmp/myserver.sh <<\EOF
#!/bin/sh
script='/var/tmp/python/server.py'
export DISPLAY=:0.0 && /usr/bin/python $script &

EOF
chmod +x /var/tmp/myserver.sh

cat >> /etc/init.d/myserver <<\EOF

#! /bin/sh
PATH=/bin:/usr/bin:/sbin:/usr/sbin
DAEMON=/var/tmp/myserver.sh
PIDFILE=/var/run/myserver.pid

test -x $DAEMON || exit 0

. /lib/lsb/init-functions

case "$1" in
  start)
     log_daemon_msg "Starting feedparser"
     start_daemon -p $PIDFILE $DAEMON
     log_end_msg $?
   ;;
  stop)
     log_daemon_msg "Stopping feedparser"
     killproc -p $PIDFILE $DAEMON
     PID=`ps x |grep server.py | head -1 | awk '{print $1}'`
     kill -9 $PID
     log_end_msg $?
   ;;
  force-reload|restart)
     $0 stop
     $0 start
   ;;
  status)
     status_of_proc -p $PIDFILE $DAEMON atd && exit 0 || exit $?
   ;;
 *)
   echo "Usage: /etc/init.d/atd {start|stop|restart|force-reload|status}"
   exit 1
  ;;
esac

exit 0

EOF
chmod +x /etc/init.d/myserver
chmod -R 777 /etc/init.d/myserver

Step 3:

$ update-rc.d myserver defaults
update-rc.d: warning: /etc/init.d/myserver missing LSB information
update-rc.d: see <http://wiki.debian.org/LSBInitScripts>
 Adding system startup for /etc/init.d/myserver ...
   /etc/rc0.d/K20myserver -> ../init.d/myserver
   /etc/rc1.d/K20myserver -> ../init.d/myserver
   /etc/rc6.d/K20myserver -> ../init.d/myserver
   /etc/rc2.d/S20myserver -> ../init.d/myserver
   /etc/rc3.d/S20myserver -> ../init.d/myserver
   /etc/rc4.d/S20myserver -> ../init.d/myserver
   /etc/rc5.d/S20myserver -> ../init.d/myserver

So in step 3, the system on boot, will automatically execute the server.py as daemon and make it easy to automate

Hope it helped.


How do I move the "Show Applications" icon in Ubuntu Dock? Ubuntu 17.10 introduces the GNOME Shell with the Ubuntu Dock (based on Dash to Dock GNOME Shell extension) and it allows you to put the Dock on the bottom of the desktop:

However, there is no easy way to move the Show Applications icon (shown on the right) to the left of the Dock. There is no such setting in GNOME Control Center. There is already a bug filed, but does anybody know any workaround until it gets fixed by Ubuntu Dock developers?

If you don't like to run command then open dconf-editor( by simply click show applications icon and search dconf) then go to

    org > gnome > shell > extensions > dash-to-dock

and search for the show-apps-at-top and make it on

See screenshot for your reference:

There is a way but the dock will be like in middle.

Download and install gnome-tweaks.
Go to any browser and go to extensions.gnome.org
Click on click here to install browser extension.
Go ahead and install it.
After it's done again go to extensions.gnome.org
Search for dash to dock.
Click it and toggle its ON position.
Go to tweaks app (search for it in app menu)
Go to extensions tab.
Go to dash to dock.
Toggle it on (if not already on).
Click the Gear icon on the right side dash to dock option. Then there will be option for changing the place of launcher in LAUNCHERS tab
Tick mark the Move the application button at the beginning of dock option


Ubuntu 16.04 doesn't suspend when idle On my laptop Asus the system doesn't go to sleep when inactive. In settings, the sleep is set to 10 minutes for battery and AC power when inactive.
Yet, Ubuntu can into suspend when closing the lid ; the command systemctl suspend work without root and the updates are up to date. Only the suspend when idle doesn't work.

Kernel version and others data to help :
https://pastebin.com/1bzCCZJe

I had this same issue on an Ideapad U530.
Solved it by setting the below inactive keys manually in org.gnome.settings-daemon.plugins.power:
sleep-inactive-ac-timeout (I set this to 600)
sleep-inactive-ac-type (I set this to 'suspend')

This solved the inactive sleep issue when the system is plugged in, but I'm still having this problem when on battery power...

Most likely you have what I think of as a "restless mouse."  If your mouse or other pointing device isn't perfectly still, it'll prevent the computer from being "idle", and it'll never idle-suspend.  There are other kinds of "user input" types of activity that can also do this, but in my experience, an optical mouse with a one-mickey jitter is the most likely cause.  Try disconnecting the external mouse or, if you don't use one, disabling the touchpad or J-mouse (use an external mouse while testing, and unplug that during the idle test).

Once you know what's causing the problem, you can pursue either a software or a hardware solution.


How to make /sbin/shutdown, /sbin/reboot etc. require sudo again in 16.04? For whatever reason, we do no longer need to be root (or using sudo) to run /sbin/shutdown, /sbin/reboot etc.

This seems to be because those executables are now symlinks to /bin/systemctl which handles everything as normal user.

However, what if I want shutdown and reboot to require root authentication again? How can I achieve this?

Systemd does indeed handle the shutdown, reboot and other commands, and the default privileges assigned are permissive. To change this, you need to create a Polkit rule. Create a .pkla file in /etc/polkit-1/localauthority/50-local.d (say, confirm-shutdown.pkla) containing:

[Confirm shutdown]
Identity=unix-user:*
Action=org.freedesktop.login1.*
ResultActive=auth_admin_keep

The various shutdown, reboot, etc. commands are, in Polkit terms,  actions in org.freedesktop.login1, for example, org.freedesktop.login1.power-off, org.freedesktop.login1.reboot, etc. The specific problem here is the default configuration, which is in /usr/share/polkit-1/actions/org.freedesktop.login1.policy:

<action id="org.freedesktop.login1.power-off">
        <description>Power off the system</description>
        ...
        <defaults>
                <allow_any>auth_admin_keep</allow_any>
                <allow_inactive>auth_admin_keep</allow_inactive>
                <allow_active>yes</allow_active>
        </defaults>

Note that it allows the active user to power off, reboot, etc.

You can make a script that checks if user is running it with root permissions or not.
Then it will run systemctl command or return error.

#!/bin/bash
if [ "$(whoami)" != "root" ]; then
    echo "Sorry, you are not root."
    exit 1
else
    (systemctl shutdown command)
fi

Source


Trying to repair LVM disk with fsck I'm on Ubuntu 16, and I'm trying to repair my startup disk. I have followed the instructions here, but once I'm at the root access of Recovery mode, it still says that the disk is mounted and it can't run.
If I try sudo fsck -f /dev/sda3, it just replies:

fsck from util-linux.
Anyone know why it might do that? According to this question, when fsck reports this command, you have to use fsck.ext4. However, when I do that, I still get a message about the volume being in use.

I see there's another question about this on Ubuntu 18, but there's no answer.

Most answers suggest using a Live Disk, but Etcher isn't working on MacOS at the moment, and it's surely not unreasonable to get this done from the recovery command prompt.

It's a vanilla Ubuntu install on a Dell Inspiron laptop.

Performing umount /dev/sda3 gives me "/dev/sda3 not mounted."
Performing fsck.ext4 -f /dev/sda3 gives me "/dev/sda3 is in use".

The output of lsblk /dev/sda gives:

sda                     disk
   sda2                 part
   sda3                 part
      ubuntu--vg-root   lvm   /
   sda1                 part

(obviously, I'm typing this in on another computer) I've left out the sizes, hope that's clear.

I've also tried umount -lf /. After doing that, when I run fsck, I get a message that it cannot check if the filesystem is mounted due to missing mtab file.

To check the LVM it is done with the following steps.
First we can see our drive layout with lsblk:
# lsblk
NAME                 MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
sda                    8:0    0    20G  0 disk
└─sda1                 8:1    0    20G  0 part
  └─xubuntu--vg-root 253:0    0    19G  0 lvm   /
sr0                   11:0    1  1024M  0 rom

as we can see the LVM is named xubuntu--vg-root, but we cannot run fsck on this name as it will not find it.  We need to get the whole name.  To do this we are going to run the lvm lvscan command to get the LV name so we can run fsck on the LVM.
The following commands should be ran as sudo or as a root user.
# lvscan
  inactive          '/dev/xubuntu-vg/root' [<19.04 GiB] inherit
  inactive          '/dev/xubuntu-vg/swap_1' [980.00 MiB] inherit

As we can see our name to check is /dev/xubuntu-vg/root so we should be able to run fsck on that name
If the /dev/xubuntu-vg/root is not ACTIVE, we need to make it active so that we can run the check on it
lvchange -ay /dev/xubuntu-vg/root

Now it should look like this:
# lvscan
  ACTIVE            '/dev/xubuntu-vg/root' [<19.04 GiB] inherit
  inactive          '/dev/xubuntu-vg/swap_1' [980.00 MiB] inherit

Now we can run the fsck on the LVM volume.
fsck /dev/xubuntu-vg/root

or to run a forced check with assume yes
fsck -fy /dev/xubuntu-vg/root

Adding a screen shot since VirtualBox will not let me copy and paste.

Hope this helps!

You can try this command:

sudo fsck.ext4 -f /dev/sda6

assuming Ubuntu is on /dev/sda6.


Can I keep using my computer during 20.04 upgrade install? I got a notice just now as part of my regular upgrade that it can also install 20.04. So I said ok, BUT...
Then I got the notice that this could take several hours. It does not say so but the implication is I won't be able to use my computer during that time. So my question is just to make that explicit, because if so, then clearly this install will have to wait until tonight.
Second, just a gripe / rant that I also got this report about literally hundreds of packages that are going to be removed - but there is no way to save the list for later review, which makes no sense to me.

Yes you can work on your machine, when it is going to upgrade. but as @heynnema it is not a good idea.
second answer, if you want to see all installed package list, you can see that with the following command.
open you terminal and run this.
apt list --installed
this will show all the installed package list of your machine.
Thank You

While I agree, it may not be the "best" idea to be using your computer, I think it is a bit overkill to believe the answer is simply "NO" it should not be used. I highly doubt that everyone checks to see if unattended-upgrades are running and then stops using their PC if they are.... which (i believe) happen to run everyday by default. And if there is an "in-the-know-best-practice" configuration that deviates from the default, I doubt everyone is using that. In layman's speak, most of us (unwittingly) use ubuntu while upgrades are happening.
A version upgrade - I'd be cautious and not touch it...
Any other daily or weekly updates/upgrades - I've always used it concurrently and never gave it a second thought... whether that has caused some mysterious problem... yet to be determined, and probably won't ever.


systemd-timesyncd.service won't start ● systemd-timesyncd.service - Network Time Synchronization
   Loaded: loaded (/lib/systemd/system/systemd-timesyncd.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Sat 2019-08-17 04:32:34 PDT; 11min ago
     Docs: man:systemd-timesyncd.service(8)
  Process: 4629 ExecStart=/lib/systemd/systemd-timesyncd (code=exited, status=238/STATE_DIRECTORY)
 Main PID: 4629 (code=exited, status=238/STATE_DIRECTORY)

It still says this after I created /var/lib/systemd/timesync/.

It's working now.

    # chmod 700 /var/lib/private
    # rm -r /var/lib/private/systemd
    # systemctl start systemd-timesyncd
    # timedatectl status
                      Local time: Wed 2019-08-28 17:55:15 PDT
                  Universal time: Thu 2019-08-29 00:55:15 UTC
                        RTC time: Thu 2019-08-29 00:55:15
                       Time zone: America/Los_Angeles (PDT, -0700)
       System clock synchronized: yes
systemd-timesyncd.service active: yes
                 RTC in local TZ: no
    # ls -ld /var/lib/private/systemd/timesync
    drwxr-xr-x 2 systemd-timesync systemd-timesync 4096 Aug 28 17:51 timesync/


Desktop SMS client in Ubuntu Hi I am looking for some kind of script/software that can help me to send SMS from my Ubuntu machine  . A desktop client/application actually by using web services which we use to send sms like way2sms.com or 160by2.com etc.

Here you go. Create an account at 160by2.com and install php on your system.

sudo apt-get install php5-cli php5-curl curl

Paste your number and password where i've mentioned and run this script:

<?php
echo"Phone: ";$phno=trim(fgets(STDIN));
echo"Message: ";$msg=trim(fgets(STDIN));
echo"Message Length: ".strlen($msg)."\nSending...";
$yournumber=''; //your number inside the single quotes
$yourpassword='';//your password inside the single quotes
$cur=curl_init("http://160by2.com/re-login");
curl_setopt($cur,CURLOPT_POST,1);
curl_setopt($cur,CURLOPT_POSTFIELDS,"username=$yournumber&password=$yourpassword");
curl_setopt($cur,CURLOPT_COOKIESESSION,1);
curl_setopt($cur,CURLOPT_COOKIEJAR,"cookie");
curl_exec($cur);
curl_close($cur);
$cur=curl_init("http://160by2.com/SendSMSAction");
curl_setopt($cur,CURLOPT_POST,1);
curl_setopt($cur,CURLOPT_AUTOREFERER,1);
curl_setopt($cur,CURLOPT_COOKIEFILE,"cookie");
curl_setopt($cur,CURLOPT_POSTFIELDS,"mobile1=$phno&msg1=$msg&action1=sa65sdf656fdfd");
$x=curl_exec($cur);
curl_close($cur);
echo"\nSent!";

Save the script as sms.php.Then on terminal run php sms.php

DONE!

Here is a link for downloading .deb files for both 32-bit and 64-bit versions of sendsms / gsendsms. Sendsms is open source software published under a GNU/GPL license.

https://www.cs-networks.net/index.php/products/toolsandutils/linux-sendsms

It will allow you to send messages from the terminal / or simple GUI under GNOME.


apt-get really slow but no internet problems I'm running into an issue where running apt-get update and apt-get install are really slow. It's relatively quick (~600 KB/s) for the first 5 seconds but then slows down to 4 KB/s or less. I don't have any internet problems, though. Here's the result of a speed test:

My /etc/apt/sources.list file is pointing to http://us.archive.ubuntu.com. I thought maybe it was a problem with the mirror, but downloading a file from http://us.archive.ubuntu.com is fast:

$ wget http://us.archive.ubuntu.com/ubuntu/dists/trusty-updates/Contents-amd64.gz
--2015-08-17 14:46:53--  http://us.archive.ubuntu.com/ubuntu/dists/trusty-updates/Contents-amd64.gz
Resolving us.archive.ubuntu.com (us.archive.ubuntu.com)... 91.189.91.14, 91.189.91.15, 91.189.91.13, ...
Connecting to us.archive.ubuntu.com (us.archive.ubuntu.com)|91.189.91.14|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 14723021 (14M) [application/x-gzip]
Saving to: ‘Contents-amd64.gz’

100%[==========================================================================================================================================================>] 14,723,021   832KB/s   in 17s

2015-08-17 14:47:10 (845 KB/s) - ‘Contents-amd64.gz’ saved [14723021/14723021]

What could be going on here?

EDIT: For what it's worth, I'm running Ubuntu in a VirtualBox VM.

I am afraid it might not be your computer, but your ISP. They are probably throttling your connection when it notices that you are downloading a file. I have heard some ISP's do that to prevent piracy and downloading torrents (and to reduce their bandwidth cost), but this forum isn't about this so I recommend talking with your ISP and explaining to them that you are trying to get packages for your operating system and that you're not downloading movies or something.

Hope this helps!


WINE outputs short static sound I'm having issues with Wine 1.4 in Ubuntu 11.10. To be honest, I don't know if it ever worked on this hardware (relatively new computer, had it for a few months), seeing as the Wine app I use the most hardly uses sound, but now that I tried another app, it's giving me problems. When I do an audio test in Wine Config, I get a short static sound. The selected driver appears to be winealsa.drv, do I need to change that and if so, how would I do that? I have all the input and output devices set to default, I don't think I have to change that. I also shouldn't have to restart ALSA with sudo /sbin/alsa force-reload because it seems to work fine with my other applications (unless that's all on PulseAudio?), but even when I do run that command to restart ALSA, the test sound in Wine Config is still the same short static. I thought  In the one application I just tried that uses sound a lot, sound plays but insanely fast, making it practically as useless as if sound didn't work at all. Sound works perfectly from anything outside of Wine.

I think I've found the problem, though. When I go in Regedit to HKEY_CURRENT_USER/Software/Wine/, there's no Drivers key, nor Audio key. I created a Drivers key and added an Audio string with alsa as a value, didn't change anything. Edit: if I set the value to anything else, Wine Config tells me the audio driver is unavailable.

I've tried searching for a solution, went through forums (and I'll keep searching), I briefly looked at the Wine AppsDB but I don't think the problem is application-specific

Please help!

Edit: getting the debs from this place (from the Launchpad bug) tells me it has unmet dependencies, and if I try to install that dependency, Synaptic tells me it has to remove a whole lot of packages! Not willing to do that.

Ok I believe to have found the solution. I did delete my .wine folder and regenerated it by launching wine config but I think what solved it was rebooting my computer. I tried running the command wineboot but that didn't suffice for some reason, maybe that command would require a parameter to work.

What I know won't work is trying to install OSS from Synaptic. Having OSS packages installed will disable sound in Ubuntu.

I can confirm- same problem on Ubuntu 13.04, solved by running "wineboot" and then restarting (both were necessary btw).


Windows can't access linux made folders in external hdd I have an external hdd with 3 partitions - 2 ntfs and 1 fat32 file systems. In linux I made folder in one of ntfs partitions, downloaded some stuff, and wanted to access through Win7; but windows can't SEE those folders. Other folders are still there. How can I access those folders made by linux? BTW, I use Ubuntu 11.10 with gnome and Windows 7

(320GB is my external hdd).

  sudo fdisk -l

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders, total 312581808 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xbe2dbe2d
Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048      206847      102400    7  HPFS/NTFS/exFAT
/dev/sda2          206848    61646847    30720000    7  HPFS/NTFS/exFAT
/dev/sda3        61646848   225486847    81920000    7  HPFS/NTFS/exFAT
/dev/sda4       225488894   312580095    43545601    5  Extended
/dev/sda5       225488896   233299967     3905536   82  Linux swap / Solaris
/dev/sda6       233302016   312580095    39639040   83  Linux

WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted.
Disk /dev/sdb: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders, total 625142448 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x73696d20

Device Boot      Start         End      Blocks   Id  System
/dev/sdb1              63    65529134    32764536    b  W95 FAT32
/dev/sdb2        65529135   625137344   279804105    f  W95 Ext'd (LBA)
/dev/sdb5        65529198   270325754   102398278+   7  HPFS/NTFS/exFAT
/dev/sdb6       270325818   625137344   177405763+   7  HPFS/NTFS/exFAT

  cat /etc/mtab

/dev/sda6 / ext4 rw,errors=remount-ro,user_xattr,commit=0 0 0
proc /proc proc rw,noexec,nosuid,nodev 0 0
sysfs /sys sysfs rw,noexec,nosuid,nodev 0 0
fusectl /sys/fs/fuse/connections fusectl rw 0 0
none /sys/kernel/debug debugfs rw 0 0
none /sys/kernel/security securityfs rw 0 0
udev /dev devtmpfs rw,mode=0755 0 0
devpts /dev/pts devpts rw,noexec,nosuid,gid=5,mode=0620 0 0
tmpfs /run tmpfs rw,noexec,nosuid,size=10%,mode=0755 0 0
none /run/lock tmpfs rw,noexec,nosuid,nodev,size=5242880 0 0
none /run/shm tmpfs rw,nosuid,nodev 0 0
binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc rw,noexec,nosuid,nodev 0 0
gvfs-fuse-daemon /home/vindzigelskiu/.gvfs fuse.gvfs-fuse-daemon rw,nosuid,nodev,user=vindzigelskiu 0 0
/dev/sdb1 /media/1D06-2AB4 vfat rw,nosuid,nodev,uid=1000,gid=1000,shortname=mixed,dmask=0077,utf8=1,showexec,flush,uhelpe    r=udisks 0 0
/dev/sdb5 /media/Adata\04097GB fuseblk rw,nosuid,nodev,allow_other,blksize=4096,default_permissions 0 0
/dev/sdb6 /media/Adata\040169GB fuseblk rw,nosuid,nodev,allow_other,blksize=4096,default_permissions 0 0

Firstly, can you reproduce?

Run these commands in a terminal:

umount /dev/sdb5
mount /dev/sdb5 -t ntfs /mnt
echo "hello world" > /mnt/bar0.txt
mkdir /mnt/foo
echo "hello world" > /mnt/foo/bar1.txt
sync
umount /mnt

Now boot into windows.

Can you open file bar0.txt?
Can you open folder foo?
Can you open file bar1.txt from inside folder foo?

If you can't reproduce

Something went fubar during your original operation. Try reproducing with your original dataset. If you still can't reproduce, chalk it up to an anomaly until you can. That is to say, there isn't enough evidence to say what went wrong. If you're curious, try breaking it. Deliberately do things wrong until your actions reproduce the problem. Maybe the problem only manifests when the ntfs needs checking..

If you can reproduce

Gather logs. Look in /var/log for anything interesting, and especially dmesg. Pinpoint when/where the error happens. Is it when you create a file? Is it when you create a folder? Is it when you create a file in a folder? Is it when you don't run sync before umounting? Is it when you interrupt a large copy leaving broken files?

Secondly, some thoughts

Do the folders exist? When you boot back into linux, can you see the folders in question?
Are the folder names weird? There are a number of characters windows can't use in file names.
Does linux have the reverse problem? If you create a new folder in windows, can you see it in linux?

I found a work around: attach the HDD to the windows machine create the folder there then put all of your sub folders into it. Annoying but you can access the sub folders.


Lvmetad is not active yet After upgrade to Ubuntu 16.04, it is showing the following message during the boot:

lvmetad is not active yet; using direct activation during sysinit

lvmetad is not active yet; using direct activation during sysinit

/dev/mapper/server--vg-root: clean xxx/xxx files, xxx/xxx blocks

The Xs refers to a big sequence of numbers. After this message appears, the login screen is shown and I can log in to the system.

How can I solve this problem?

Don't worry, there is no danger, follow this little guide to resolve the problem.

These messages are not dangerous, after a while LVM (a software abstraction over your disk) will scan the partitions and your system will boot normally. There is a delay due to the lack of optimization, since lvmetad is a system service (daemon) that caches the LVM condition to prevent useless disk accesses and it does not start soon enough (probably for a bug or misconfiguration).

Ubuntu Desktops doesn't need it to work.

Solution

Open a Terminal (CTRL+ALT+T or search in Dash), write sudo -H gedit /etc/lvm/lvm.conf and press ENTER (insert your user credentials).
In the editor find:

use_lvmetad = 1

...and change the line to:

use_lvmetad = 0

Do not make other changes, you only need to change a single number and save the file. After this, you may close the Terminal or log-off from the VT.

This will disable any attempt to use the lvmetad daemon and if your disk configuration is simple enough your boot will be faster and any LVM command will not try a new connection to the system bus of lvmetad. You may notice more disk activity, this is a normal behavior.

The warnings will remain, this is the right behavior and it doesn't have side affects.

Please note: this is a good but temporary solution, future GNU/Linux versions will not need this procedure.

Optimization

After the edit, you may also execute (in the same type of Terminal) the command sudo systemctl disable lvm2-lvmetad.service to disable lvmetad completely.

This is not necessary and you should contact your system administrator before doing it.

What NOT to do

Never boot with the nomodeset option enabled, because it WILL disable many GPU features and your graphics card may not work correctly. Ubuntu Desktops will not work correctly with this option enabled, because Unity (and successive GUIs) and many applications need the graphic acceleration and the advanced GPU features.
This option must be only used to debug graphic drivers or to start a system without the right graphic drivers.
Important: on some systems the user may need to disable this option in GRUB to login, while other systems will simply be slower but usable.

EDIT (10/03/2017): after disabling the service and upgrading one of my Debian machines (Ubuntu is based on Debian) I noticed that the warning disappeared. The upgrade installed the kernel Linux 4.9.0-0.bpo.2 for AMD 64 (64-bit). It can be temporary or limited to some architectures, but it is a step forward, also because Ubuntu can inherith the change.
I suppose that a developer saw this message and they are working on the problem. Well done FOSS.

Fell free to comment under here if you need more help and don't forget to press the left UP arrow and accept the answer.

I managed to resolve this for my machines by adjusting the grub configuration like so:

In /etc/default/grub, change:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

to

GRUB_CMDLINE_LINUX_DEFAULT="nomodeset"

Then add this line: GRUB_TERMINAL_INPUT="console serial"

Run update-grub and reboot for the changes to take effect.


Alienware m14x r2 Drivers? So I just bought a brand new Alienware M14xR2 and I love the thing to death.

I decided to install Ubuntu 12.10 64bit on it and I was surprised how smoothly the install went, but when I went to check the additional drivers tab it couldn't find anything.

Everything seems to be working fine on my laptop right now but it doesn't have any graphics drivers and the fans seem to kick up more on my Ubuntu partition than my Windows partition.

I downloaded the install file for the official nVidia drivers but I'm holding off installing until I know that's the right answer.

Also if anyone knows a way to control the Alien FX lights on Ubuntu that would be nice but I don't care as much. Thanks so much!

Specs:

3rd Generation Intel® Core™ i7-3630QM (6MB Cache, up to 3.4GHz w/ Turbo Boost 2.0) 2 GB GDDR5
NVIDIA® GeForce® GT 650M with Optimus™ 8GB of RAM
256 SSD

http://www.martin-juhl.dk/2011/05/optimus-on-linux-problem-solved/
a link

https://wiki.ubuntu.com/Bumblebee and install from this link

I was searching for similar things and found this program for the lighting.

http://forum.notebookreview.com/alienware/458528-alienfx-lite-linux-windows-alienfx-tool.html


Command for taking all files in sub directories and putting them in parent directory I have a directory that contains around 100 subdirectories. I want to take all the files from this directories and add them to the first directories then delete them all. Is this possible?

Call me old-fashioned, but I'm usually using Midnight Commander for this :) You can install it using

sudo apt-get install mc

then start it by typing

mc

then hit Esc, Ctrl-?, enter your search criteria, click [ Panelize ] button - voila, you can do anything you want with your files - copy, move, delete... the nice thing about using mc is that you can review the list of files and manually select only some of them... i.e. sort the result by size and delete only the 10 largest files, for example, or select files by size so they fit on a CD as close as possible, etc.

Execute the following in the root directory: find -exec mv {}/* . \;

This puts all files from all subdirectories in the directory in which you execute it.


Problem with partitions after reinstallment I originally had Windows10 installed on my laptop.

I did partitioning, installed Ubuntu 14.04, had a low-graphics mode problem but couldn't solve it and then tried to reinstall Ubuntu.

In this process, I think I have erased the Windows10 and have instead installed Ubuntu, again.

When I log in to Ubuntu, I see two disks, each with /boot folder in it.
And the below is the information of my partitioning:

Disk /dev/sda: 2000.4 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders, total 3907029168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x000e299b

Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2046  3906437119  1953217537    5  Extended
Partition 1 does not start on physical sector boundary.
/dev/sda5            2048     7999487     3998720   82  Linux swap / Solaris
/dev/sda6         8001536   398620671   195309568   83  Linux
/dev/sda7       398626816  3906437119  1753905152   83  Linux

Disk /dev/sdb: 256.1 GB, 256060514304 bytes
255 heads, 63 sectors/track, 31130 cylinders, total 500118192 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0f838f59

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *        2048   498127989   249062971    7  HPFS/NTFS/exFAT
/dev/sdb2       498128896   500115455      993280   27  Hidden NTFS WinRE

Is my understanding of partitioning correct? That is, is the Windows deleted?

If so, is there a way for me to fix the problem having two partitioned Linux system and make it into one?

Any answer would be helpful. Thanks.

I see that there is an NTFS partition. If you see two disks and you have only one disk that means there is a partitioning problem on the OS just sees it like that. Anyway, the NTFS partition means that there is Windows 10 or the partition has at least part of it. Either way, try booting up to Windows 10. Go to the boot menu in your system. If Windows 10 is there, you haven't deleted it. Or else if it's not there, you've deleted the partition (or Windows 10 is corrupt or having a problem.)

From my view, you have a laptop and there is a partitioning error seen by the OS you are using or there is a HDD error in the disk. Little information is found about this problem. /dev/sdb means there is a second disk. If this is an error, I don't think you can fix it unless you reformat the hard disk (or any other storage device) and reinstall Windows 10 and Ubuntu 14.04. (If you decide to do this, make sure to do a complete backup.) Another solution is to get another HDD/SSD and reinstall Windows 10 and Ubuntu.

GParted can help you to reformat the disk. Make sure to burn it to a CD or make a bootable flash drive with it. Some suggested software is Etcher and GNOME disks (Sometimes GNOME disks comes with your Ubuntu installation, or you have to install it via command line.) Then boot it up on your computer.

Alternately (and risky,) if the same error happens, you reinstall Ubuntu (I know you have installed it 2 times,) from CD or USB (Do not use Reset Ubuntu 14.04 to Factory settings in GRUB) and during the installation, choose Something else and select the Linux partition and wipe it out. During the process Windows 10 may become unbootable, but if you want to take the risk, do it.

Make both partitions LVM (Logical Volume Manager) partitions (I mean sda and sdb.) Then they may merge together and make one disk: sda. See this link: How To Merge Multiple Hard Drives- Unix And Linux. Once you've done this, if Windows does not boot up, reinstall Windows. I hope you did a backup before doing all this. If this helped, let me know.

-Linuhackz


18.04 boots to black screen I have a little problem. I recently bought an Asus X541UVK, with an Intel core I3-7100U, and a GeForce 920MX, with 4GB RAM. I tried to install ubuntu 18.04 on this machine, but after the installing finished succesfully, at first boot, after splash screen, the screen turns off. Ctrl+alt+f1 doesn't work. I also tried fedora, which has gnome too, but after login, even a simple action like opening the activities or turning WiFi on, completely frozens the desktop. I also tried other distros, like kde neon or deepin which works fine. What's happening? Sorry for my English, this is not my native language.

buddy, you must do one thing:
Try to clean up all disk before installing Ubuntu 18.04. I also have faced  that issue like that but ultimately it worked. Try to make a bootable pendrive by RUFUS latest version, if it is helpful to you.


Screen brightness control not working on Lenovo T530 My brightness control doesn't work with a fresh install of 12.10 (brand new laptop). It is set to the brightest setting when I boot up and when I try to change it, I see the notification bar come up but the brightness doesn't actually change. I've tried all the solutions I could find around the Internet but none of them work. Things I have tried include:

  Editing /sys/class/backlight/acpi_video0/brightness

  In /usr/share/X11/xorg.conf.d/10-brightness-control.conf: Option
  "RegistryDwords" "EnableBrightnessControl=1"

  In /etc/default/grub: GRUB_CMDLINE_LINUX_DEFAULT="quiet splash
  acpi_osi=Linux acpi_backlight=vendor"

There is no xorg.conf file in 12.10 that I have found, so the solutions that suggest editing that file don't do me a whole lot of good.

I am currently using the Nouveau driver, but switching to the Nvidia proprietary drivers made no difference.

Any other ideas? When is this bug going to be fixed? With all the reports I've come across I would think it would get a lot of attention. Thanks.

I had a similar problem on my thinkpad W530.  I finally found a solution here:
http://blog.pearce.org.nz/2012/08/enabling-external-monitor-on-lenovo.html

These days X automatically configures itself, so you can't just edit the xorg.conf file, you instead need to add a section to a file in /usr/share/X11/xorg.conf.d/ and X will include that section in the configuration that it automatically generates.
So to get the screen brightness keys working with your Nvidia graphics card, create a file in the xorg.conf.d directory, e.g:

sudo gedit /usr/share/X11/xorg.conf.d/10-nvidia-brightness.conf

Paste the following into the file:

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "Quadro K1000M"
    Option         "RegistryDwords" "EnableBrightnessControl=1"
EndSection

This is kind of a workaroun, but you can try setting the brightness via command line using:

xbacklight -set 100

If that works, trying binding a global keyboard shortcut to

xbacklight -inc 5

and

xbacklight -dec 5


What framework should I use in my manifest file I'm writing an application for Ubuntu for Phones and need to know what framework goes in the manifest.json file. I submitted an app but got this back:-

'ubuntu-sdk-13.10' is obsolete. Please use a newer framework

What are the supported frameworks?

You can see the up-to-date list of supported frameworks here: https://docs.google.com/a/canonical.com/spreadsheets/d/1t_JGpg4r8BLluzfzmqa-gAbcKUjKUOufSCTSdPpFc5g/edit

Supported frameworks are :-

'ubuntu-sdk-14.04-dev1'
'ubuntu-sdk-14.04-qml-dev1'
'ubuntu-sdk-14.04-html-dev1'

I was also facing the same issue, and 'ubuntu-sdk-14.04-dev1' worked for me.
But remember, if you are changing framework to 14.04 in manifest.json file then you must have to change 'policy_version' from 1 to 1.1 in (projectName).json file.

do not forget to make this change otherwise it wont work.


Two Ethernet Network connection icons in Lubuntu 14.04 Is there a reason why I have two Ethernet Network Connection 'Wired Connection 1' active icons on the panel in Lubuntu 14.04? This appeared a few weeks ago, and I tried to delete one of them, but it didn't work. Can anyone help me out?

I recently had the same issue after an update. I believe the update may have fixed the bug that required nm-applet to be manually added to the autostart list. I removed my addition to the startup list, then logged out and back in and the extra panel icon was gone. (My automatic updates seem to have been fixed as well).

try

sudo kill -9 nm-applet

then

sudo nm-applet


Broken fonts in Emacs over SSH I'm having a problem with Emacs when I SSH from my Ubuntu 12.04 laptop to another Linux machine.  FWIW, I believe the remote machine is using SUSE Enterprise Server 10 SP2, which is possibly quite old.  I connect using ssh -X <server>.  When I run Emacs, I get the error messages

Warning: Cannot convert string "-*-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-*" to type FontStruct
Warning: Cannot convert string "-*-helvetica-medium-r-*--*-120-*-*-*-*-iso8859-1" to type FontStruct

and Emacs is full of boxes instead of text characters, as shown below.

I've tried flushing my local font cache with sudo fc-cache -f -v but that didn't help.  Ideas?  Thanks in advance!

I found that this solved my emacs problem

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


Couldn't upgrade Ubuntu After recover /var/lib/dpkg/status I couldn't upgrade my ubuntu system.

Log is here:

Preconfiguring packages ...
Setting up debconf (1.5.58ubuntu2) ...
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
ImportError: No module named site
dpkg: error processing package debconf (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 debconf
E: Sub-process /usr/bin/dpkg returned an error code (1)

Could you please coordinate me in fixing the issues.
I tried everything that I was able find in google, but result is same.
Thank you advance for help.

so after

dpkg -l | egrep -v '^ii|rc'

I have:

Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
+++-=======================================-==========================================-============-===============================================================================
rF  debconf                                 1.5.58ubuntu2                              all          Debian configuration management system
iU  debconf-i18n                            1.5.58ubuntu2                              all          full internationalization support for debconf

If I try :

sudo dpkg --configure -a

I have :

dpkg: dependency problems prevent configuration of debconf-i18n:
 debconf-i18n depends on debconf (= 1.5.58ubuntu2); however:
  Package debconf is not configured yet.

dpkg: error processing package debconf-i18n (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 debconf-i18n

Force install (Method 2):

dpkg: error processing package debconf-i18n (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                          Errors were encountered while processing:
 debconf
 debconf-i18n
E: Sub-process /usr/bin/dpkg returned an error code (1)

Method 3

0 upgraded, 0 newly installed, 0 to remove and 220 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up debconf (1.5.58ubuntu2) ...
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
ImportError: No module named site
dpkg: error processing package debconf (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of debconf-i18n:
 debconf-i18n depends on debconf (= 1.5.58ubuntu2); however:
  Package debconf is not configured yet.

dpkg: error processing package debconf-i18n (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                          Errors were encountered while processing:
 debconf
 debconf-i18n

wget -c http://mirrors.kernel.org/ubuntu/pool/main/d/debconf/debconf_1.5.58ubuntu2_all.deb

Try to install it directly with

sudo dpkg -i debconf_1.5.58ubuntu2_all.deb

if this works

sudo dpkg --configure -a && sudo apt -f install

Try to reconfigure dpkg (Method 1)

sudo dpkg --configure -a

Use force install (Method 2)

sudo apt-get install -f

Try removing the troublesome package (Method 3)

sudo apt remove

Let me know if above methods works!


I can't download Java or WINE due to similiar error I've been trying to download Java Oracle 8 and WINE and I keep getting the same problem.

  W: Failed to fetch http://dl.google.com/linux/chrome/deb/dists/stable/Release  Unable to find expected entry 'main/source/Sources' in Release file (Wrong sources.list entry or malformed file)

I get this when I try installing both and I've been searching for a solution, but I can't find one. Then there's this problem:

  dpkg: error: failed to open package info file `/var/lib/dpkg/available' for reading: No such file or directory

What's that mean and ho do I fix it?

Ok, it doesn't show that error anymore, thank you to all of you. I really appreciate the help. I have a next question though...

You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 liboxideqtcore0 : Depends: oxideqt-codecs (= 1.0.0~bzr501-0ubuntu2) but it is not going to be installed or
                            oxideqt-codecs-extra (= 1.0.0~bzr501-0ubuntu2) but it is not going to be installed
 wine1.7 : Depends: wine1.7-amd64 (= 1:1.7.19-0ubuntu2~trusty2) but it is not going to be installed
           Depends: binfmt-support (>= 1.1.2) but it is not going to be installed
           Depends: wine1.7-i386 (= 1:1.7.19-0ubuntu2~trusty2) but it is not installable
           Recommends: gnome-exe-thumbnailer but it is not going to be installed or
                       kde-runtime but it is not going to be installed
           Recommends: ttf-mscorefonts-installer but it is not going to be installed
           Recommends: fonts-horai-umefont but it is not going to be installed
           Recommends: fonts-unfonts-core but it is not going to be installed
           Recommends: ttf-wqy-microhei
           Recommends: winetricks but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

I did the command and it said something about /var/lib/dpkg/lock, so I go there and can't open the file. I am trying to install WINE 1.7 for Ubuntu 14.04 64-bit.

this message means that you some broken URLs in packages list, you have to edit the list and remove those URLs, to do that open: /etc/apt/sources.list and save the file after editing it. then try to update again.

to understand apt-get command more follow http://manpages.ubuntu.com/manpages/saucy/en/man8/apt-get.8.html

That error means you've screwed up the packages lists. Find the line in /etc/sources.list with dl.google.com on it and delete the whole line. Make sure to run sudo apt-get update afterwards, or it won't work.


How to safely copy home folder from a 10.04 desktop to a new ubuntu 12.04 installation on a notebook? Recently I've bought a new notebook.
I'm going to install ubuntu 12.04 next to win8 with dual boot config.
Is it that simple and safe to just copy my home folder from an old desktop with Ubuntu 10.04 to a new 12.04 installed system? Or should I do that other way?

Yes, just copy over your home directory. These are the steps I would follow:

Make a proper archive on the old system.

cd /home
sudo tar -zcf username-archive.tar.gz username

Make sure that you use the same username on the new system.
Copy over the archive to the new system outside the home directory where we will unpack it to of course.
(Re)boot up the new system, but don't log in yet. This will make sure nothing will be running under your user account, depending on the contents of your homedir.
Press Ctrl+Alt+F1 to go to a virtual terminal.
Log in, then become root fully, e.g.

sudo su -

Backup the almost empty homedir, e.g.

mv /home/username /home/username-old

Unpack it, e.g.

cd /home
tar -zxf username-archive.tar.gz

You must copy your Home folder content in a Home Folder in new notebook by open nautilus in terminal :sudo nautilus
and Use a removable drive or Connect to Harddisk together.

Then You must change User owner of files to user in your new notebook by:

cd ~
sudo chown -R YourUsername *

you can copy most application setting that is in your old home folder and they are hide with began their name by '.'.

Don't copy all of hidden folder in home like .config . it may crash your os because their version isn't same. just copy all you need.


FFMPEG installed but not found I'm trying to install pHash , but when I execute ./configure this message is returned:

...

*** Configuring video Hash ***

checking whether FFmpeg is present... checking for avcodec_alloc_frame in -lavcodec... no
configure: error:

*** libavcodec not found.
You need FFmpeg. Get it at <http://ffmpeg.org/>

But FFMPEG is correctly installed, in fact executing ffmpeg it returns:

ffmpeg version 3.0.2 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04.1)
  configuration:
  libavutil      55. 17.103 / 55. 17.103
  libavcodec     57. 24.102 / 57. 24.102
  libavformat    57. 25.100 / 57. 25.100
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 31.100 /  6. 31.100
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...

Use -h to get full help or, even better, run 'man ffmpeg'

Why this happens?

UPDATE:

libavcodec-dev is already installed:

luca@luca-OptiPlex-7040:~/Downloads/pHash-0.9.6$ sudo apt-get install libavcodec-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
libavcodec-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 74 not upgraded.

and:

luca@luca-OptiPlex-7040:~/Downloads/pHash-0.9.6$ whereis libavcodec
libavcodec: /usr/local/lib/libavcodec.a /usr/include/libavcodec /usr/share/man/man3/libavcodec.3.gz

pHash looks like a dead project and has not been updated since 2013.

It references avcodec_alloc_frame which for years has been deprecated for av_frame_alloc, so it is likely incompatible with the current FFmpeg API.

You'll either have to use an ancient FFmpeg version (not recommended), or update the pHash source to use the current FFmpeg libraries properly.

If you do not need support for perceptual video hashes, then configure pHash with --enable-video-hash=no and it will omit the FFmpeg dependency.

If you're looking for audio fingerprint functionality, I recommend Chromaprint instead since FFmpeg supports it.

When you are compiling a software, what you need is the development libraries and not the runtime libraries/tools. Specifically what you are missing here is the libavcodec-dev package. Install it as usual with apt and then run ./configure again. You will likely bump into another error saying you are missing another library. Use apt-cache search or the web to find which package you need to install, then iterate until there is no more error.