Root crontab not running For some reason, my root crontab does not seem to be running.

Trying to reboot the device every night at midnight.

Should be the following as root:

crontab -e

Then add:

0 0 * * * /sbin/shutdown -r now

When I test using some values close current time, nothing happens. I installed NTP and made sure the time zone is correct. I am also specifying using the 24-hour clock. For example, to test this line right now (5:35 PM) I try entering the following:

36 17 * * * /sbin/shutdown -r now

I have checked the time with date -R. The time for the crontab to run comes and goes and the system does not reboot. What am I missing here?

I have three solution suggestions for you.

Invoke the crontab with crontab -e -u root
Make sure that you have an empty line at the end of the cronjob file, meaning that every line ends with a newline.
You might need to redirect the output to devnull: shutdown -r now > /dev/null

Here are two helpful webpages for cronjobs:

CRON Tester

CRON Generator

You can also handle the cronjobs neatly with webmin.

Other than that, you have at least two more ways for restarting your computer at midnight.

One is to run the shutdown command as a script automatically at login but with specific time as a parameter instead of "now":

shutdown -r 00:00

However, this will yield a broadcast message of upcoming shutdown at every login (might not be a bad thing at all). Well you can also make this be run at boot time by adding the script in init.d, still yielding the message, though.

Another is to use atcommand:

at 0am

Enter command shutdown -r now and save it with ctrl+d or do a script for the command and do:

at -f restart_script.sh 0am

Hope these help you to get the result you wanted.

36 17 * * * etc ..

36 17 is not a way to specify the right time in your cron.

check via date command to see if your system is working in US time or Europ time

use 17 36 if europ time and if your system use 24 H time
or
5 36 if your system use US TIME and 12 H time


keyboard layout EN after boot I can't believe this bug has still not been solved with Ubuntu 14.04 ?
On my 2 laptops, Acer and Asus, on a random basis, the keyboard layout switch from FR to EN.

This is very frustrating when you type a password and can't see the letters.

How to solve that for good ?

This should fix the problem in 13.10 and 14.04:

In the ubuntu software center, install "dconf Editor" (dconf-editor) (if you don't already have it). Open it, then open desktop -> ibus -> general. Now enable the property "use-system-keyboard-layout". (You want it to have a checkmark next to it.)

Source: https://bugs.launchpad.net/ubuntu/+source/indicator-keyboard/+bug/1240198

Just run the following command line in a terminal and configure your keyboard layout correctly:

sudo ibus-setup

then reboot and enjoy. :)


I have recently installed Ubuntu 12.04 to dual boot with Windows 7, but upon startup, the grub menu does not appear and boots into Windows 7 I am running a single SSD. My motherboard has UEFI bios, though I'm not sure that helps.  I've tried holding shift on multiple startups without success.

Boot from your Ubuntu Live DVD and try this tool-
Boot Repair

I would guess that you chose the wrong place to install grub. Try to install it in the mbr of your drive. I do not know what your bios lets you choose to boot from (drives or also partitions), but since you have only one drive it should be okay. But it should work if you should reinstall grub using a livecd.

Maybe you could provide more information. What is the holding shift part about? Are you trying to get into the BIOS?

Best solution would probably to use Rescatux. This distro is designed to solve problems like yours.

Hope I could help you,
Phil


How do I get a colored bash? How can I get the bash to look colored like this?

Open ~/.bashrc in text editor and uncomment line:

#force_color_prompt=yes

to be:

force_color_prompt=yes

save then execute source ~/.bashrc

If you are using Termux then you can Install zshell which will change everything in your terminal, You can read this post fo the installation.https://www.learntermux.tech/2020/02/how-to-install-z-shell-best-theme-for-TERMUX-2020.html


How to restart samba server? Sorry this is a little embarassing but I'm trying to set up my own server for the first time.  I found great tutorial online.

http://www.intac.net/build-your-own-server/

I'm stuck at the 2nd to last line of step 4.  Apparently there is no samba directory in init.d.

Why isn't there a samba directory in init.d?

Would the following work?

# sudo restart smbd
# sudo restart nmdb

Start

sudo service smbd start

Stop

sudo service smbd stop

Restart

sudo service smbd restart

On RHEL you start smb and nmb:
systemctl start smb
systemctl start nmb

Next, check if they started:
ps -elf | grep smbd
ps -elf | grep nmbd


list of wifi connections disappears after kernel update, kubuntu 16.04 I have issues with wifi driver on my Kubuntu 16.04. bcmwl works fine with 4.4.0-31-generic (the oldest version of kernel on my system), but when kernel updates to different version list of wifi connections disappears. Previously i've fixed this by loading 4.4.0-31-generic and reinstalling bcmwl-kernel-source from pool on Ubuntu installation stick. After reboot on newer kernel version Wifi worked like a charm, but now this trick did not work. I thought about restricting dkms to rebuild bcmwl during the upgrade, but do not know how to do it. Any ideas how to fix this?

Maybe the issue is about that kernel in particular?
Why don't you try updating to the latest kernels? like 4.8 or 4.9?
The application: Ukuu (Ukuu kernel update utility)


Slack shows opened links to browser as another slack instance in task bar If I open a link sent to me on Slack, the new browser window opened shows up as 'another' Slack window. Is there any way to have it correctly group the new browser window with the existing browser windows? I'm on Ubuntu 18.04 running gnome.

Firefox users have this workaround:

In Slack, click on a web link
In the new Firefox browser instance opened by Slack, go to "about:profiles"
Change the profile used as default to your regular profile

Thanks to Michev for the comment on the snapd bugtracker:
 https://bugs.launchpad.net/snapd/+bug/1835024/comments/13

After removing Slack via the Software Center, open your terminal and run:

$ wget https://downloads.slack-edge.com/linux_releases/slack-desktop-4.0.2-amd64.deb
$ sudo apt --fix-broken install ./slack-desktop-*.deb
$ sudo apt install ./slack-desktop-*.deb


Ubuntu 20.4 virtualbox Kernel driver not installed (rc=-1908) The VirtualBox Linux kernel driver is either not loaded or not set up correctly. Please reinstall virtualbox-dkms package and load the kernel module by executing'modprobe vboxdrv'
as root.If your system has EFI Secure Boot enabled you may also need to sign the kernel modules (vboxdrv, vboxnetflt, vboxnetadp, vboxpci) before you can load them. Please see your Linux system's documentation for more information.where: suplibOsInit what: 3 VERR_VM_DRIVER_NOT_INSTALLED (-1908)  - The support driver is not installed. On linux, open returned ENOENT.

I tried certain commands like
sudo modprobe vboxdrv

showing this error
Could not insert 'vboxdrv': Operation not permitted

How can I solve this?

Am having the same issue over here, upgraded from 18.04 to 20.04 and am having trouble with virtual box, it says the same thing as the original post says


Having trouble booting into Ubuntu on macbook air (mid-2012) so I am extremely new to all this, so please excuse my ignorance:)

I have a macbook air (mid 2012) and I'm trying to dual boot Ubuntu 14.04 via usb and I'm having trouble with it all.

I've installed rEFInd and have a live usb made through mac linux usb loader, but when I try to boot into Ubuntu it gives me a "you must install the kernel first" error, then continues to boot later telling me that no live usb host could be found.

Anyone have any advice on the subject? Not sure what to do next.

Make sure you have downloaded the Ubuntu AMD 64 bit image and then use the instructions on the Ubuntu download page to write the ISO onto the USB drive using OS X.

It's all command line, but I find that way always works. Refind picks it up. If it doesn't, just hold option for the Mac boot loader to find it.


Thunar takes a long time to open and close windows in Xubuntu 20.04 Thunar takes 20 seconds to open windows in Xubuntu 20.04. I had Xubuntu 18.04 installed on the same machine and Thunar opened windows with no delay. I tried changing /usr/share/gvfs/mounts/network.mount/AutoMount=true to AutoMount=false but it didn't solve the problem. Noticing that as root there is no delay opening and closing windows with Thunar, I changed the permisions to the home folder, but it didn't help either. Any solution please?

Edit: The above mentioned problem ocurred in an old laptop with a Pentium Dual-Core CPU T4200. After that I installed Xubuntu in a (also old) desktop machine with a Intel Core I3 CPU, and Thunar worked well. Another difference: while in the laptop when pressing the link in Thunar side panel to Search the Net I get an error message saying the specified location is not supported, in the desktop machine there is not such error message.

If you have multiple workspaces, with multiple Thunar windows open across them, a crash in one of those windows might cause a delay in any attempt to open another Thunar window in another workspace. This was my experience. I was not aware that Thunar had crashed in another workspace.
So check your open Thunar windows. Close [x] any that have crashed - you won't be able to close the window, but you will be given an option to terminate the application. Do so. And you may find it works as normal, while your other open Thunar windows stay open as they were. Not that such a crash happens often, but if it does, it will add a good 30 seconds to any attempt you make to open another Thunar window.

Maybe one of the Google answers can help you:
https://forum.xfce.org/viewtopic.php?id=5959
https://www.reddit.com/r/archlinux/comments/5a76i8/thunar_slow_on_startup/
https://ubuntuforums.org/showthread.php?t=1816298
Good luck!


Secure boot back on? After completing a dual boot, can I turn secure boot back on? Or do I have to keep it off for the entirety of the time I have the dual boot on my system?

Without discussing the merits of secure boot, IMO the advice to disable secure boot is poor. More likely than not you can keep secure boot enabled.

If you use 3rd party unsigned kernel modules you would either need to sign them yourself or disable secure boot. Examples would be ndivia or ATI graphics drivers, wireless drivers, and perhpas virtualbox.

To self sign modules see

https://computerlinguist.org/make-dkms-sign-kernel-modules-for-secure-boot-on-ubuntu-1604.html

How to sign kernel modules with sign-file?

https://insights.ubuntu.com/2017/08/11/how-to-sign-things-for-secure-boot/

https://wiki.ubuntu.com/SecurityTeam/SecureBoot

https://www.kernel.org/doc/html/v4.10/admin-guide/module-signing.html

Although IMO it is easy to sign modules, most people (erroneously) advise you disable secure boot. See first link to automate - https://computerlinguist.org/make-dkms-sign-kernel-modules-for-secure-boot-on-ubuntu-1604.html


How to install VidyoDesktop on Ubuntu 16.04 LTS? I recently moved to Ubuntu 16.04 LTS and I noticed that VidyoDesktop was no longer available on my system. I tried to install it from the deb package using dpkg but I received the following error:

$ sudo dpkg -i VidyoDesktopInstaller-ubuntu64-TAG_VD_3_6_3_017.deb
[...]
dpkg: problemi con le dipendenze impediscono la configurazione di vidyodesktop:
 vidyodesktop dipende da libqt4-gui (>= 4.8.1); comunque:
  libqt4-gui not installed.

I've noticed that libqt4-gui is not present in Ubuntu 16.04 repository. Does anyone know how to fix this?
Thank you

Edit:
My question is different from "How to install a deb file with dpkg". In fact I was asking how to install a specific package with a missing dependance.

The solution provided by Andrea works, but I'd like to report the exact command:

 sudo dpkg -i --ignore-depends=libqt4-gui VidyoDesktopInstaller-ubuntu64-TAG_VD_3_6_3_017.deb

I suggest to manually download libqt4-gui and its following dependent packages from URL.

libqt4-designer
libqt4-opengl
libqt4-svg
libqtgui4


Some text display on my terminal when I open my terminal following text display on it.

bash: alias: -o: not found
bash: alias: allow_other: not found
bash: alias: /media/GalaxyS: not found
bash: alias: -u: not found
bash: alias: /media/GalaxyS: not found

I use Ubuntu 16.04. How can I solve this problem?

There are errors in .bashrc (or .bash_aliases or .profile) in your home directory. Find the line(s) containing 'alias' and correct the error.


Application that can send files from ubuntu to windows? Instead of using usb and copy my files, rebooting, go to windows and paste it, I want an application that can send files to windows from ubuntu WITHOUT INTERNET AND REBOOTING.

I'm using lubuntu 12.04 and windows xp.

Please give me solutions of applications like how i described it.

Any answer is appreciated.

Just mount your windows drive in your Linux system.

Find out which drive (partition) you are interested in. You can do this by running  sudo lsblk -f which will list all available partitions and greping for ntfs. For example, on my system, I get

sudo lsblk -o NAME,FSTYPE,SIZE | grep ntfs
├─sda2 ntfs     14.7G
├─sda3 ntfs     78.1G

From the output above I know that it's either sda2 or sda3. In this case, I know that the drive I am after is the 78G one so I needsda3. In all of the instructions below, make sure to replacesda3` with whatever you get for this step.
Create a mount point for the partition

sudo mkdir /media/windows

Mount the drive

sudo mount /dev/sda2 /media/windows

You should now be able to copy things to/from your drive just like any other location on your system.
Make it happen automatically.

Edit /etc/fstab and add this line (as always, change sda3 to whatever you found in step 1):

 /dev/sda3  /media/windows ntfs rw,errors=remount-ro    0   0

That's it, the drive will now be mounted automatically at /media/windows and you can use it just like any other directory.

Linux Reader is a free application to read ext filesystems from Windows. There's also another free application, called Paragon Extfs, which is able to read and write files on ext partitions, but it's known to break some Linux installations.


How to play a webm video file? I have tried vlc, Banshee and Totem but none of them recognize the webm format. Even the system does not recognize its mime-type. How do I play it ?

You will have add the PPA ppa:gstreamer-developers/ppa

To do that

Open Update Manager.
Click on Settings.
Go to 'Other Software' Tab.
Click 'Add'
Paste ppa:gstreamer-developers/ppa and click add source.
Click close , Reload when asked.
Install Updates.

Now you can view webm in the default media player(totem) .

Additionally if you want to make it automatically open in totem,right click and select open with other application and select Movie Player and tick 'Remember this application for webm documents'

Source

Same via the command line:

sudo add-apt-repository ppa:gstreamer-developers/ppa
sudo apt-get update && sudo apt-get upgrade
# fixing a weird gstreamer installation error
sudo apt-get -f install

# now "totem <your .webm file>" will do the right thing )

Source

I simply right clicked on the icon, selected "open with" and found msplayer. Clicked on Msplayer and the video went on like a charm


Cannot install cmake on Ubuntu 14.04 I'm having issues getting cmake installed onto my machine. Here is what I am running:

sudo apt-get -f install cmake

And here is the output:

Reading package lists...
Building dependency tree...
Reading state information...
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help resolve the situation:

The following packages have unmet dependencies:
 cmake : Depends: libjsoncpp1 but it is not installable

I have tried running apt-get update but it doesn't seem to help. Please let me know what I should try. Would be happy to provide more information.

Thanks! :)

Edit: The output of "apt-cache policy cmake" is as follows:

    cmake:
  Installed: (none)
  Candidate: 3.5.2-2ubuntu1~ubuntu16.04.1~ppa1
  Version table:
     3.5.2-2ubuntu1~ubuntu16.04.1~ppa1 0
        500 http://ppa.launchpad.net/thomas-schiex/blender/ubuntu/ trusty/main amd64 Packages
     3.2.2-2~ubuntu14.04.1~ppa1 0
        500 http://ppa.launchpad.net/george-edison55/cmake-3.x/ubuntu/ trusty/main amd64 Packages
     2.8.12.2-0ubuntu3 0
        500 http://ca.archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages
        100 /var/lib/dpkg/status

Thanks!

Update: Thanks! I was able to install cmake. However, I can't seem to make anything with it. I'm running

cmake ../

in an empty directory which I created inside the project I'm trying to make. Here is the output:

CMake Error: Could not find CMAKE_ROOT !!!
CMake has most likely not been installed correctly.
Modules directory not found in
/usr/bin
CMake Error: Error executing cmake::LoadCache(). Aborting.

Would anybody have any idea on what to do next? I have tried uninstalling and reinstalling as well as apt-get update. Again, I can post more information on here if needed.

Thanks!

You can install cmake from main repository by specifying its version:

sudo apt-get install cmake=2.8.12.2-0ubuntu3

If it fails, try one of the following methods:

remove PPAs from system with their packages and then install version from main repository

sudo ppa-purge ppa:thomas-schiex/blender
sudo ppa-purge ppa:george-edison55/cmake-3.x
sudo apt-get install cmake

temporary disable PPAs, install cmake then enable PPAs:

sudo add-apt-repository -r ppa:thomas-schiex/blender
sudo add-apt-repository -r ppa:george-edison55/cmake-3.x
sudo apt-get update
sudo apt-get install cmake
sudo add-apt-repository ppa:thomas-schiex/blender
sudo add-apt-repository ppa:george-edison55/cmake-3.x

Then you can try to build simple cmake example. Fast googling gave me the cmake-example.git repository. I do not know what is this, but it compiles fast and runs normally:

sudo apt-get install cmake git build-essential gfortran
git clone https://github.com/bast/cmake-example.git
cd cmake-example/
mkdir build
cd build
cmake ..
make

You can test it by executing compiled programs:

./hello.x
./main.x
./unit_tests

If it fails then you have other problems in your system.

There is an unofficial repository that has a version for 14.04.

sudo add-apt-repository ppa:mantid/mantid
sudo apt-get update


Status bar icon indicators disappear when waking from suspend So, when I wake up from suspend, this happens:

The missing icons are Skype and Mega. When I close one of those programs, the other icon appear, like this:

How can I fix this or make a script that refreshes the status bar?

As a temporary solutions until the bug is fixed, you can create a file f.e. icons.sh (dont't forget to give it execution rights with chmod +x) at any location:

#!/bin/bash

dbus-monitor --session "type=signal,interface=com.canonical.Unity.Session,member=Unlocked" |
  while read MSG; do
    LOCK_STAT=`echo $MSG | awk '{print $NF}'`
    if [[ "$LOCK_STAT" == "member=Unlocked" ]]; then
        killall unity-panel-service
        /usr/lib/x86_64-linux-gnu/unity/unity-panel-service&
    fi
  done

After saving the script, open Ubuntu Startup Applications from Apps menu and configure this script to run after you login:

Every time you unlock the screen, unity panel service will be automatically killed and started, keeping your icons in place.

killall unity-panel-service
/usr/lib/x86_64-linux-gnu/unity/unity-panel-service&

solves it to me, but I'm too lazy to get where to put it for autorestart on waking up. At least we know who is in charge for this :-)


What do the last two fields in fstab mean? The last two fields on each line in fstab (dump and pass) are some numbers (usually, 0).
What do these numbers mean?
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    nodev,noexec,nosuid 0       0
UUID=030ccf66-5195-4835-ba3e-f5d7a5403c05 /               ext4    errors=remount-ro 0       1

Copy/paste from man fstab:

  The fifth field, (fs_freq),  is  used  for  these  filesystems  by  the
  dump(8)  command  to determine which filesystems need to be dumped.
  If the fifth field is not present, a value of zero is  returned  and
  dump will assume that the filesystem does not need to be dumped.

  The  sixth field, (fs_passno), is used by the fsck(8) program to determine
  the order in which filesystem checks are done at reboot
  time.  The root  filesystem  should  be specified with a fs_passno of 1, and
  other filesystems should have a fs_passno of 2.  Filesystems within  a
  drive will  be checked sequentially, but filesystems on different drives
  will be checked at the same time to utilize  parallelism  available  in
  the hardware.   If  the sixth field is not present or zero, a value of
  zero is returned and fsck will assume that the filesystem does not
  need to be checked.

Simple blockhead answer is , first field determines if it should be dumped, second field determines if it should be checked during startup and in what sequence. Check the manual for the rest!


Set variable in .desktop file Is there a way to set the enviroment variable in .desktop file?
I'm trying to run application (eclipse) with custom gtk style, so basically I want to get the following result by runing a .desktop file:

GTK2_RC_FILES=gtkrc.custom /path/to/eclipse

I've tryied to put it in a bash script and run it from the .desktop file, but then it does not integrate well with the Unity launcher.

You can add an environment variable to an application by editing its .desktop file. For example, to run "digiKam" with the environment variable APPMENU_DISPLAY_BOTH=1, find the corresponding digikam.desktop file and add the setting of the variable, via the env command, to the entry "Exec":

Exec=env APPMENU_DISPLAY_BOTH=1 digikam -caption "%c" %i

In your case:

Exec=env GTK2_RC_FILES=gtkrc.custom /path/to/eclipse

An alternative to modify the .desktop file is to put a wrapper script in e.g. ~/bin.

$ cat ~/bin/eclipse
#!/bin/sh
export GTK2_RC_FILES=gtkrc.custom
exec /usr/bin/eclipse "$@"

This way the customization won't be overwritten next time the application package is updated.

Edit:

A hint about why this works can you see by checking out what the PATH variable contains. In my case:

$ echo $PATH
/home/gunnar/bin:/home/gunnar/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin

~/bin is the first folder in the list, and thus is looked at before /usr/bin.


How can I highlight or annotate PDFs? Currently I need to highlight certain sections in PDFs, or add annotations (comments/notes). These modifications would need to be saved.

What tools are out there to do this on Ubuntu?

Okular supports PDF annotations.
To save the highliting/annotations directly in the PDF document, choose "File" -> "Save as..." and create a new PDF which will contain your edits.
How to edit in Okular
You can choose Tools > Reviews to get other options like adding

pop-ups notes
inline notes
freehand line drawing
highlighter
stamp and other features.

Edit: Inkscape supports PDF editing (one page at a time) and most people seem not to be aware of this so I'm adding it to the answer.

I got good results when annotating and editing PDFs online using PDFescape. There's a limitation on file size (10MB) and number of pages (100) though.


zoneminder on 13.10 cannot click on add new monitor I've installed zoneminder on 13.10, however, when I access the browser interface (localhost/zm) I cannot click on "add new monitor". It's like this feature is disabled or something. When I click on "add new monitor", nothing happens. Absolutely useless.

Solved!

sudo apt-get install python-software-properties
sudo add-apt-repository ppa:iconnor/zoneminder
sudo nano /etc/apt/sources.list.d/iconnor-zoneminder-saucy.list

change 'saucy' to 'precise', ctrl-o to save, ctrl-x to exit

sudo apt-get update
sudo apt-get install zoneminder

select 'I' to overwrite existing file and 'y' to convert tables to InnoDB

May be you need to disable option 'OPT_USE_AUTH' in 'Options --> System'. After that, restart ZoneMinder and Bingo!


How can I quickly copy a GPT partition scheme from one hard drive to another? On a non GPT partition table I can do

sfdisk -d /dev/sda | sfdisk /dev/sdb.

But sfdisk doesn't support GPT partition tables. What can I use instead?

I'm looking for a one or two command solution, not just using GNU parted to output the partition sizes and then manually making them again.

Install gdisk which is available in the Ubuntu Universe repositories.

Then use the sgdisk command (man page here) to replicate the partition table:

sgdisk /dev/sdX -R /dev/sdY
sgdisk -G /dev/sdY

The first command copies the partition table of sdX to sdY (be careful not to mix these up). The second command randomizes the GUID on the disk and all the partitions. This is only necessary if the disks are to be used in the same machine, otherwise it's unnecessary.

I just tried replication with sgdisk and it works just fine - you just have to follow readline syntax rules:

   sgdisk --replicate=/dev/target /dev/source

or

   sgdisk -R/dev/target /dev/source

and everything works.


What is the default password of user and guest in Ubuntu 12.04 I am working on Ubuntu 12.04 using VMware.
While working in that, VMware suddenly hung and Ubuntu restarted. It's asking me to log in as user and guest session.
I have tried using password as the password for user, but it didn't work.
I can't enter without password.
Can anyone help me out?

By default the password for any guest user is disabled. So you don't have to enter any password for guest.

Also, by default, Ubuntu doesn't have any user named "user", only if you created one with this name and only you should know the password for this account in this case. If you don't remember it, see: How do I reset a lost password (using recovery mode requires me to type the password)?

I had the same experience. In my case I tried and the default administrator's password was "ubuntu".


Increase partition size on which Ubuntu is installed? I have Ubuntu installed on a drive. The problem is it is running low on disk space. This is installed on vmware. I expanded the virtual drive and booted into ubuntu. But when I opened gparted(sudo gparted), the move/resize option is unavailable. This is the partition Ubuntu is installed on, but I need to resize it. Any ideas? I am comfortable using command line

As a matter of fact, you CAN enlarge the root filesystem while Ubuntu is running (I learned this recently myself here) - this sounds incredible but it's true :)

Here's the list of steps for a simple scenario where you have two partitions, /dev/sda1 is an ext4 partition the OS is booted from and /dev/sdb2 is swap. For this exercise we want to remove the swap partition an extend /dev/sda1 to the whole disk.

As always, make sure you have a backup of your data - since we're going to modify the partition table there's a chance to lose all your data if you make a typo, for example.
Run sudo fdisk /dev/sda

use p to list the partitions. Make note of the start cylinder of /dev/sda1
use d to delete first the swap partition (2) and then the /dev/sda1 partition. This is very scary but is actually harmless as the data is not written to the disk until you write the changes to the disk.
use n to create a new primary partition. Make sure its start cylinder is exactly the same as the old /dev/sda1 used to have. For the end cylinder agree with the default choice, which is to make the partition to span the whole disk.
use a to toggle the bootable flag on the new /dev/sda1
review your changes, make a deep breath and use w to write the new partition table to disk. You'll get a message telling that the kernel couldn't re-read the partition table because the device is busy, but that's ok.

Reboot with sudo reboot. When the system boots, you'll have a smaller filesystem living inside a larger partition.
The next magic command is resize2fs. Run sudo resize2fs /dev/sda1 - this form will default to making the filesystem to take all available space on the partition.

That's it, we've just resized a partition on which Ubuntu is installed, without booting from an external drive.

I succeeded in enlarging my primary ext4 partition using the methodology described here.

Some notes from my personal experience:

The link example is for shrinking partition, hence the order is resize2fs first and then fdisk. When enlarging partition (as in my case) the order should be fdisk first, reboot and then resize2fs. Also, when using fdisk, the primary as well as the  extended partitions should be removed and re-defined.
I booted the Ubuntu from another drive and then worked on this drive which actually was mirror (using dd) of the older drive. Made it bootable using GParted
The current version of resize2fs (I am using Ubuntu 12.04LTS) support ext4 - no need to do the actions described in the link of changing it the ext2.


Where to get ubuntu linux kernel source package? Where to get Ubuntu Linux kernel source package from? Not a Debian package.
Is there any repository which has tar/bz2 package of complete kernel sources of every version release.

There is a git repository for Ubuntu kernels.

It is http://kernel.ubuntu.com/git/ubuntu/

To get sources using git run

git clone git://kernel.ubuntu.com/ubuntu/ubuntu-xenial.git

For instance you can get Ubuntu 16.04 kernel sources from http://kernel.ubuntu.com/git/ubuntu/ubuntu-xenial.git

17.04 sources are at http://kernel.ubuntu.com/git/ubuntu/ubuntu-zesty.git

The answer to your question, you can find the Linux Kernel Archives at the following site.

https://www.kernel.org/

You can download the tarball.


Why does my computer run slower on ubuntu than on Windows? I recently installed Ubuntu and am multi-booting with Windows 7, but I would like to switch over to Linux full time. Now I am seeing that it runs a lot slower; I have a few examples:

I've tried playing Euro truck Simulator 2 and now I can't even run it when before it would run fine on max settings, also when I open up a web browser it takes forever to load up. I do have 8GB of RAM and 3.6GHz CPU, so I don't think that that is the problem.

I'm quite new to Ubuntu so i could just be something stupid, but this is a problem.

It's generally a matter of whether your CPU and/or GPU is better optimized on Windows or Linux kernel you are using. In addition, there may be performance differences b/w Windows and Ubuntu on the device drivers with your peripherals or GPU.  Manufacturers usually provide-optimized device drivers to Windows (e.g., Nvidia).

Is it a laptop or a stationary system? I've seen weird laptop configurations where your cpu will scale up but not enough to trigger the underlying system to increase it's performance.  To see if that's the issue do sudo apt-get install turbostat && sudo modprobe msr && sudo turbostat. Use the system for a bit and look at the ghz column, it should scale up to what you expect (including turbo boost).

What's more likely though is that it's a GPU issue. What kind of GPU do you have in the system?


Mendeley Desktop processing loop on Ubuntu 18.04 So I use mendeley for school, and I just forced an upgrade to ubuntu 18.04 because I royally screwed my kernel when I was running 16.04 (total noob messing with stuff) and wanted a fresh start. Since I upgraded mendeley has been stuck in a processing loop and is functionally frozen because it takes so much processing power. Anyone else having this problem?

I already tried updating it, uninstalling and reinstalling the new version, and leaving it alone to try and finish and nothing so far is working.

Have you tried using the linux generic version of mendeley desktop? Just run the executable python binary in the bin folder and this should work before a debian version for Ubuntu 18.04 becomes available. That is what I am using.

I solved the problem. I downloaded Mendeley for the generic versions here the instructions: https://www.mendeley.com/guides/download-mendeley-desktop/linux/instructions

  Open the downloaded archive
  Extract the contents to any folder
  Run the application. Within the extracted folder, open a terminal and run the following command:

./bin/mendeleydesktop


trackpad script not working on startup / login The issue at hand

My aim is to enable natural scrolling on system start (or session start), which - up until now - could be easily achieved using a startup script, but since migrating from 12.04 (32 bit) to 13.04 (64 bit) I'm not able to automate this task.

Here's the script used:

#!/bin/sh
xinput set-prop 12 273 -25 -25

it works when running independently, so it seem to be overridden by a later call. How to resolve this?

What have I tried?

Adding an entry in the Startup Applications for the trackpad script
Using a @reboot flagged entry in crontab to call the xinput command
Calling the trackpad script in .bash_login, or in .profile
Adding a .conf file in /etc/init
I think at some point I even tried to mess around with sequencing directories and sequencing file names under /etc/rc*
Including a call in various scripts under /etc/pm (that actually got things working for the boot phase, but any subsequent suspend/sleep would deactivate the trackpad custom settings, again).

Environment

Dell XPS 13, Ubuntu 13.04 64 bit.

This doesn't explain why it is happening, it's just a workaround.

You could automatically reset the property whenever it changes. Use this script:

#!/bin/bash
while true; do
  xinput list-props 12 | grep -q "Synaptics Scrolling Distance (273):.*-25, -25" || xinput set-prop 12 273 -25 -25
  sleep 5
done

I recently installed Ubuntu 13.04 on a Dell Inspiron 17R, and my touchpad was only recognized as a PS/2 mouse.  I found a post on the Ubuntu Forums that contained a custom driver to enable the touchpad features.  Once I installed it, Ubuntu's System Settings > Mouse and Touchpad settings  listed the touchpad options.  And then a post on how to enable Natural Scrolling using dconf-editor.  I hope this helps.


Check cd,disk for defect option Let's say that i want to make a test. And i try to download and burn iso of Ubuntu on win7 that have avast anti virus, and that pc is maybe illegally activated... What will happen? Will it Check cd,disk for defect option work and really check state of media(check is it the live cd as it should be)?

I wonder what will happen if we have any unofficial change in Ubuntu live disk(viruses,errors etc), will it " Check cd/disk for defect " see as error and OS will not be able to install from cd? Or this option only check state of physical mistakes but not the data on that media or it check both!?
Could it that copy of Ubuntu still be good and official or it is corrupted ...

Please do not delete part of post, all this is hypothetical question...

fsck.ext4 [-panyrcdfvtDFV] [-b superblock] [-B blocksize]
        [-I inode_buffer_blocks] [-P process_inode_size]
        [-l|-L bad_blocks_file] [-C fd] [-j external_journal]
        [-E extended-options] device

Emergency help:
 -p                   Automatic repair (no questions)
 -n                   Make no changes to the filesystem
 -y                   Assume "yes" to all questions
 -c                   Check for bad blocks and add them to the badblock list
 -f                   Force checking even if filesystem is marked clean
 -v                   Be verbose
 -b superblock        Use alternative superblock
 -B blocksize         Force blocksize when looking for superblock
 -j external_journal  Set location of the external journal
 -l bad_blocks_file   Add to badblocks list
 -L bad_blocks_file   Set badblocks list


Upside-down question mark I'm using Ubuntu 12.04[1] with a Dvorak keyboard layout. I need to write a bunch of emails in Spanish on a daily basis and I really really need a keyboard shortcut to the inverted question mark glyph (¿), but I just can't find any. So far I've been either copying and pasting it from the character map (which is, seriously, a pain in the ass) or just not bothering with it (which I tend to avoid because it makes me look sloppy). Is there a way of defining a key combination (e.g., Ctrl + Shift + ?) that inputs this character?

[1] Yes, yes, I know it's 2014 and all that. I'm happy with 12.04 and I don't see the need to upgrade just because, so please don't tell me to.

Press CTRL+SHIFT while keeping them pressed, press and release U then type in 00BF, release CTRL+SHIFT, then you will have your ¿.

Source:W3

Press hold Alt + numpad 168. Press hold Alt + numpad 168.


Cannot remove Dropbox I am using Ubuntu 12.04

I tried to install Dropbox using Ubuntu Software centre but it stopped at some point

Now I cannot remove the partial installation. If I try using the Software centre it hangs.

At terminal

sudo apt-get remove dropbox

I get

E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.

What can I do?

try this...

sudo apt-get remove nautilus-dropbox

Still going!

Is it safe to assume it's not going to install? :)

Answers like the above often get deleted very quickly unless you include some sort of answer in the answer, so here are some links that might help.

How do I uninstall Dropbox?
Why does the Software Center hang while trying to install Dropbox? And how can I make it stop hanging? -- Dropbox install stuck at 99%, how do I fix it? (and any dpkg errors)
How to install Dropbox?. There are different answers to this question for different versions of Ubuntu, so select an answer for Ubuntu 12.04.


How to setup Java-Home and Path in Ubuntu 12.04 we are new to Ubuntu.Recently we changed my server OS to ubuntu 12.04 from windows 7 . every one have their own login details. one of my college installed Open-Jdk7. I asked him, where you installed JAVA, then he suggested to switch the following directory

su root
cd /usr/lib/Jvm

Totally 3 folders are there in JVM folder. names are.

java-1.7.0-openjdk-amd64
java-7-openjdk-amd64
java-7-openjdk-common

generally, If you install Java in Windows, we will get 2 folder. 1 folder is for JDKand another points to JRE.

but, in Ubuntu we have 3 folders. is it right?

for my conformation, whether he installed correctly or not. I open Terminal. I run the following 2 commands

 javac
 java -version

both commands are working fine.

now I want to set-up Java-Home and Path for all users at same place.because everyone is working on Application server.

Can anyone explain step-by-step.

Thanks.

Installation of Oracle Java:

Donwload the tarball from Oracle website
unzip it using this command:

sudo tar -xvpzf fileName -C /installation_folder_name`

change the files permission and ownership
add the following two lines in /etc/profile

export JAVA_HOME=/home/abu/Java/jdk1.8.0_45/
export PATH=$JAVA_HOME/bin:$PATH

restart the machine and check by java -version and javac -version

sudo gedit /etc/environment

then add these lines

JAVA_HOME = ":usr/lib/jvm/java-7-openjdk-amd64/bin"
CLASSPATH = ":usr/lib/jvm/java-7-openjdk-amd64/bin:/home/something etc whatever you want etc" ( separated by semicolon )


No write-access to samba share I have two notebooks (Notebook 1 with Ubuntu 10.04 and Notebook 2 with Ubuntu 10.10) in a home network and I want to share a folder on notebook 1 with samba. Notebook 2 should be able to read/write/delete content of the folder.

I installed the packages samba and system-config-samba and I added a user and the share with read/write access to samba with the Samba Configuration GUI.

When I enter

smb://notebook_1/folder

in Nautilus on notebook 2 I can enter username and password. But then I can only read the content of the folder. Changing files is not allowed. Can somebody help me?

edit: Here is the part of my smb.conf, where the share is defined:

[Images]
    path = /home/user1/Images
    writeable = yes
;   browseable = yes
    valid users = avahi, user1

Do I need to add a semicolon in front of writeable...?

Try to login to the share with a user which has read/write permissions on the system where the folder is shared. Also make sure that that particular user has rights to access the samba share.

If possible, it is always a good idea to go for NFS sharing. As long as you do not need to connect from a Windows box you will be happy with NFS. If you want to continue with NF have a look at the quick start section of this official Ubuntu documentation.

Try to change the permission to the directory. if your directory sharing path is /home/user1/Images then run chmod 777 /home/user1/Images.

Hope this helps.


How can I enable the wifi connection on HP Pavilion Notebook 8216 83.13? I can't find the wifi option in my Ubuntu system.

$ iwconfig
lo     no wireless extensions
eno1   no wireless extensions

I have tried:

Installing new Ubuntu updates. (This only enabled bluetooth access)
Tried additional-drivers: it has NVIDIA updates only.
I read somewhere to check rfkill list all command and it shows results for bluetooth only. So I couldn't do anything further
I disabled secure boot, no change

Hardware:

$ lspci -knn | grep -iA3 net
03:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8101/2/6E PCI Express Fast/Gigabit Ethernet controller [10ec:8136] (rev 0a)
    DeviceName: Realtek PCIe FE Family Controller
    Subsystem: Hewlett-Packard Company RTL8101/2/6E PCI Express Fast/Gigabit Ethernet controller [103c:8216]
    Kernel driver in use: r8169
    Kernel modules: r8169
05:00.0 Network controller [0280]: Intel Corporation Device [8086:24fb] (rev 10)
    DeviceName: Intel Dual BandWireless-AC 3168 802.11 ac 1x1 WiFi + BT 4.0 Combo Adapter
    Subsystem: Intel Corporation Device [8086:2110]

ensure index of packages/drivers up to date

sudo apt update

update Ubuntu PCI IDs

sudo update-pciids

find your driver and then

sudo apt install (package name)

in my case for my broadcom wireless adapter

sudo apt install bcmwl-kernel-source

but the BIG problem, with a simple solution was to ensure that in bios 'secure boot' was DISABLED, otherwise no wireless network options appeared and sometimes for some reason bios reset to enabled so I had to check 'secure boot' was disabled.  If you have tried all the previous solutions then I would check the secure boot option is disabled.


I have a hardware detection problem, what logs do I need to look into? I am trying to ask a question about getting my hardware to work but I don't know what information to add to my question to get help, what do I need to do?

Related if you don't have access to a GUI:

How do I get information from the logs on my computer when I only have access to the command line?

The most important information you can give is what you've done, what you expected to happen, and what you observe has happened.

This question is a particularly fine example of a hardware-detection problem with a USB device.

Other examples of this could be:

  I installed Ubuntu 10.04 Desktop on my Dell Optiwhatever 312 laptop.  When
  I log in, my wireless card isn't visible in the Network Manager popup menu,
  although the wired network shows up there.

or

  I have Ubuntu 10.04 Netbook edition on my System76 laptop.  When I plug my
  headphones into the socket, the sound comes out the headphones but also
  out the speakers.

or

  I'm using Ubuntu 10.04.  I used the “Additional Drivers” program to install the
  current nVidia drivers for my GeForce FX 5200.  Now when I boot the system stops
  with a black screen after the Ubuntu boot splash is finished.

After this general problem description, what other information is interesting depends on what sort of hardware you're having problems with, and what problems you're having.

In general:

sudo lspci -nn will list all the PCI devices in your system.  This will include all the expansion cards (Video cards, WiFi, etc) in your system, whether or not the kernel has a driver for them.  This information is useful if you're not sure precisely what hardware you have.
lsusb will list all the USB devices connected to your system.  Again, this is useful if you're not sure precisely what hardware you have.  It's also useful to check that the device is actually plugged in correctly!
/var/log/udev and /var/log/dmesg will have information about what devices the kernel has detected.  These logs are generally very big - unless you know what parts of the log are interesting it's not a good idea to include these in your question, although a link to them could be useful (you can use http://paste.ubuntu.com for large logs)
sudo lshw --class X pr sudo lshw -C X can also give a bit of valuable hardware info on the specifed class X - examples classes include cdrom, communication, core, cpu, display, isa, medium, memory, multimedia, network, pci, scsi, serial, storage and usb - so for instance you can use sudo lshw -C network to show info on the network cards the computer can detect.

For Video problems:

/var/log/Xorg.0.log is the X server log file.  This is useful for all video problems. This file can get long so feel free to just put it on http://paste.ubuntu.com. Be sure to give a link to your "paste" so we can find it when we need to.
LIBGL_DEBUG=verbose glxinfo will display information about 3D acceleration support, useful for problems with 3D or desktop effects.
lspci -nn | grep VGA will list all the video cards in your system, useful if you are not sure what type of video card you have.
/usr/lib/nux/unity_support_test -p should be used for compiz and other Unity compatability issues.

For Audio problems:

cat /proc/asound/cards will list the audio devices that have been detected.  You should include this.
cat /proc/asound/card0/codec#0 will contain information about the first sound card, including information about the input/output ports connected to it.  If you have a problem with plugging in a microphone, headsets, or external speakers, include this.  You may also have more than one sound device.  In that case, there will be more than one /proc/asound/card??? directory.
Wiki: Debugging Sound Problems

A general problem-solving hint

I've noticed that I often collect data to diagnose a problem by:

First, identifying the problem - what did I do, what did I expect to happen, and what seemed to happen? Can I repeat the problem?

Then, causing the problem to happen, and listing the system's logs in reverse order of modification time:
    ls -lrt /var/log,
    tail -n 25 on recently modified log files (for reasonable values of 25), and
    dmesg.
Read, wonder, think, guess, test, repeat as needed


Missing Firefox app icon I'm using Ubuntu 11.04 (upgraded from LTS 10.04) and Firefox (version 11) doesn't show it's icon in the Window List panel, in the Firefox window top left corner (system menu) nor when using ALT+TAB to switch applications.

I'm using unity 2D since I'm running ubuntu as a guest in a VMWare virtual machine (Host is windows 7)

Instead of the Firefox icon I get what appears to be a generic icon that looks like an app window in the window list and a black rectangle with a curl in the bottom right corner in the ALT+TAB window.

How do I fix this so that the proper Firefox icon gets displayed?

EDIT: Depending on the icon set chosen in the Appearence settings window sometimes I get the icon, sometimes I don't. When using Ubuntu classic none of the icon sets provide the icon for Firefox.

EDIT: I tried creating a new profile, didn't help. Also, if I run firefox from a terminal (using ubuntu classic), I get the following message 'failed to create drawable' and the browser does show up the proper icon. Is there a way what drawable failed? The message shows up even if I only bring up the command line parameters help (firefox -h), altho it shows in the middle of the output.

Alright, figured out how to solve the issue, although not quite 'why' it happened.

Seems I had installed a stand-alone version of Firefox (a Mozilla build probably, from mozilla.org). After a while the Ubuntu-supported version made it's way to the computer, not sure if during one of the OS upgrades.

So when I ran Firefox I was running the version installed in my user home folder (which had updated to 11, the current version at this point in time), which for some reason had trouble displaying the icon. (when running this version from a terminal there are a bunch of gtk error messages).

When I ran Firefox from the command line, the version that ran was the version by Ubuntu Mozilla Team. This version managed to display the icon, despite the error message (which now I believe is not related). Both Firefox's used the same profile data, hence the confusion.

So the solution is to just use the right version. Although still don't know exactly why the moz build had issues with icons.

Press Ctrl+Alt+T to open a terminal then

unity --reset


How do I convert a x86 RPM to a x86 DEB within a x64 system? In my case the software I am trying to convert is the Lacie lightscribe labeler.

1.- I renamed the RPM

mv LaCie\ LightScribe\ Labeler\ 1.0\ Linux.rpm lacie-lightscribe-labeler-1.0.rpm

2.- Convert the package with alien

sudo alien lacie-lightscribe-labeler-1.0.rpm

Error:

lacie-lightscribe-labeler-1.0.rpm is for architecture i386 ; the package cannot be built on this system

I know that:

I could do this in a x86 system and then copy it from there.
Use the simple labeler

I'm curious about how to do this conversion in general.

The process is quite easy, in short you need to modify the control file and that's it.

sudo alien -g package-name.rpm
cd package-dir/
sudo vi debian/control

Now change the architecture (i386 in my case) to be the one you need. For example,
I added the amd64 archicture and this is how the line ended up:

Architecture: i386, amd64

Last step:

sudo debian/rules binary

This will produce the .deb file.

References:

Using Alien to convert .rpm packages to lpia .deb

$sudo apt-get install alien

$sudo alien

check out this post from link for the complete details with example and screenshot
http://www.tecgeeks.com/howtos/how-to-convert-rpm-file-into-deb-file-on-ubuntu/


Where, in Ubuntu's files, is stored the full name of a user? Usually the users have a full name associated to them, where is that stored?

The full names are stored in /etc/passwd.

On the command line you can change it using the command chfn (needs sudo if you want to change other user's names).

you could also try

grep -R "$user_name" .

from your root directory


Why can't I synchronize Pictures folder with Ubuntu One? When I right click the Pictures folder, and go to Ubuntu One->Synchronize This Folder, nothing happens.

As this page shows, the option should change to "Stop Synchronizing This Folder", but it doesn't.

Also, if I enter the folder (with Nautilus), and click on the top check box Synchronize This Folder, it keeps loading forever and nothing happens (my computer is a quadcore, and the connection is more then 1MB, it's not a computer performance issue).

Am I doing anything wrong to synchronize? My Pictures folder contains 36.8 MB of files.

You might want to choose the option and let it go for a while. I know you have a fast connection but it could be that it works by transaction, synching the whole folder before you see a status change.

Also, try refreshing the page or leave and come back to see if the status has changed?

If after refresh and waiting time nothing happens, go for ubuntu one support:
https://one.ubuntu.com/help/contact/

I bought a song recently which never got into my cloud... So these things happens it seems.

Have you tried doing a soft link?

ln -s [source folder] [destination folder]

For instance:

ln -s ~/Pictures ~/Ubuntu\ One


Does having a jpg for a desktop background decrease battery time to 'fully discharged'? I thought I had read that having a desktop background as a jpg from the pictures folder made no difference to power consumption compared to running the standard Ubuntu background.

However a few short experiments with powertop seem to show an increased wattage being used with a picture background. I am running 18.04 on an Asus laptop.

Edit:

On second observations, I'm not sure now that it does increase power usage. The question remains though, should it?

Edit 2:

I think this, is what I remember reading. On the face of it, the background appears to make no difference to power usage.

It needs more power for the illumination system of your screen (especially laptop screen) when you have a bright image shown or you have a bright software running. So, for power saving reasons, use a dark background image or change to a dark software design (if possible..).
Style and complexity of an image has no impact and of course same is it on mobile phones.


Asus zenbook UX303UB does not resume from suspend (ubuntu 14.04) when charging I've just purchased Asus Zenbook UX303UB which came with Windows10. I replaced the original system with Ubuntu 14.04.03 LTS and now I have one issue - the laptop does not resume from suspend when I open the lid & it's charging (on battery everything works fine). However, the suspension works from the menu or with the power button. In system setting I have "suspend" in both AC and DC mode.

I haven't found any solution and as I'm quite new to this system, I will be grateful for any help:)

Update - the same problem is on battery, even "suspend" from the menu does not work.

Update - suspend does not work from the menu and when closing the lid. It works only if I use a shortcut in the taskbar.

I had the very same problem with an Inspiron Dell, the solution was to swotch from the Open graphic card drivers to proprietary ones (you can choose them from "additional drivers" from the Bash)

I had the same problem but am dual-booting off GRUB. In the end, the solution that worked for me was to boot to Windows 10, open a command prompt, and give it a powercfg /h off to disable hibernate mode. Probably also toggleable in the BIOS?


Unable to run any systemd services in WSL None of the systemd commands are working inside WSL( Ubuntu Bash 18.04).
When I ran sudo systemctl is-active kubelet, error is
output: System has not been booted with systemd as init system (PID 1). Can't operate.
: running command: sudo systemctl is-active kubelet

How to enable systemd feature in WSL? Whats the way to get rid of System has not been booted with systemd

cron is a systemd service which you can still run in WSL. See this answer as a guide for how you might setup your kubelet application:

How can I run services in WSL

To expand on this link, you can modify Windows startup to load WSL with the background services minimized:

WSL Tips: Starting Linux Background Services on Windows Login

There is a cool workaround to enable systemd in WSL. Worked for me. Please refer here
Also, for Docker, make sure you have the latest version of it installed and WSL2 is running at least on Windows version 2004. Also make sure to enable WSL2 support in Docker settings.


How do I reset a lost administrative password? I'm working on a Ubuntu system, and my client has completely forgotten his administrative password. He doesn't even remember entering one; however it is there.

I've tried the suggestions on the website, and I have been unsuccessful in deleting the password so that I can download applets required for running some files. Is there a solution?

By default the first user's account is an administrative account, so if the UI is prompting you for a password it's probably that person's user password. If the  user doesn't remember their password you need to reset it. To do this you need to boot into recovery mode (see also offical docs: RecoveryMode).

Boot up the machine, and after the BIOS screen, hold down the left Shift key (note that for UEFI BIOS you might need press ESC instead). You will then be prompted by a menu that looks something like this:

I've noticed on some systems that timing when to hit the left Shift key can be tricky, sometimes I miss it and need to try it again.

Hit the down arrow until you select the 2nd entry from the top (the one with the recovery mode in the description) and then hit Enter.

Now you should see this menu:

Using the arrow keys scroll down to root and then hit Enter.

You should now see a root prompt, something like this:

root@ubuntu:~#

At this stage you should have a read-only filesystem. You have to remount it with write permissions:

mount -o remount,rw /

Now we can set the user's password with the passwd command. (In this example I will use jorge as the example, you need to substitute whatever the user's username is):

root@ubuntu:~# passwd jorge
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
root@ubuntu:~#

Type in what you want the new password to be at the prompt. After it's successful reboot the machine and the user will be able to log in with their new password.

Recovery Mode documentation
Lost password documentation

There is concern about this being a security vulnerability. It is not. You need to have physical access to the machine to do this. If someone has physical access to your PC, they could do far worse than change a password. When it comes to physical access, the battle for security is lost. Be wary of who you let on your PC.

Even setting a root password will not be successful, as one can simply boot with init being /bin/sh and have full root access. Again, given physical access, anyone with computer knowledge can do ANYTHING to your computer.

Password Recovery

Step 1: Go to Safe mode by holding Shift or pressing Escape key while booting

Step 2: Press E to edit command
Step 3: Search for "linux" and change ro to rw (It should be at bottom)

Step 4: Add init=/bin/sh at end of current line

Step 5: Press Ctrl + X to Reboot

You might need to remove  splash $vt_handoff if present.

Now you should get a CLI shell

type nano /etc/shadow

remove all value from $ to : of the account you want to access.

Save the file and then reboot.

You should be able Log in without password.

P.S.
I have tried it on Ubuntu 16.04, not sure if it works on 18.04
Note: This has nothing to do with your BIOS, we are tweaking the GRUB
Good Luck!


I can't start a new project on Netbeans The issue:

When I open the "add new project" dialog (screenshot below), I can't create a new project. The loading message (hourglass icon) stays on forever. Except for "cancel", the other buttons are disabled.

It was working fine a few days ago, I haven't changed any setting prior to the issue appearing. I ran the internal update feature, but the issue persists.

The info:

My OS version: Ubuntu 12.04.2 LTS 64 bits

Netbeans version:

Help -> about

Product Version: NetBeans IDE 7.2.1 (Build 201210100934)
Java: 1.6.0_27; OpenJDK 64-Bit Server VM 20.0-b12
System: Linux version 3.2.0-49-generic running on amd64; UTF-8; pt_BR (nb)
User directory: /home/user/.netbeans/7.2.1
Cache directory: /home/user/.cache/netbeans/7.2.1

What I tried:

Changing the Look and Feel with the --laf command-line option. The look-and-feel does change, but the issue persists.
Using the internal update command, a plugin got updated but the issue persists.
Downloading and installing the latest version (7.31), it imported the settings from the previous version and the issue persists.
Removing the settings folder ~/.netbeans/7.3.1, restarting netbeans, choosing not to import settings and rather have a new clean install

Just posted the same question here ... the solution for me was to downgrade OpenJDK from 6b27 to 6b24 (look at the link for details).

My NetBeans was looking excactly like in your sreenshot and also had some other strange problems.

I would suggest you do java -version if this shows that you have 6b27 installed and cat /var/log/dpkg.log | grep openjdk shows that you recently received the OpenJDK update you can try to fix the problem reverting to 6b24 using this command:

apt-get install openjdk-6-jre=6b24-1.11.1-4ubuntu2 openjdk-6-jre-headless=6b24-1.11.1-4ubuntu2 icedtea-6-jre-cacao=6b24-1.11.1-4ubuntu2

****edit****

As I discovered some other problems (SSH connection wouldn't establish within NetBeans) I finally took the step to upgrade to Oracle JDK7. To start NetBeans with another JDK you have got to edit ./netbeans-7.X/etc/netbeans.conf and change the line netbeans_jdkhome="/usr/lib/jvm/java-7-oracle/jre" (I guess this gets generated in the NetBeans installation process). Otherwise it will still use your old JDK no matter what java -version says.

Try changing your Netbeans' Swing Look and Feel to Nimbus.


Error message: unable to mount location Ubuntu 12.10 When trying to open the internal hard drive, the error message:

  unable to mount location, can't mount file appears.

Note: Ubuntu was installed over windows

Probably its because Windows uses NTFS partition, so , you need install ntfs-3g for access to location sudo apt-get install ntfs-3g


Installing Nvidia Drivers Breaks Computer After I installed the Nvidia drivers my screen resolution dropped and I can't log in. When I try logging in my screen thinks for a bit, turns black with the message /drv/sda2: clean, X/Q files, Y/Z blocks (x, y, q, z are big numbers) and then just returns to the login screen. How do I fix this? I made sure to install the correct drivers, I've tried this three separate times but I keep getting this issue. I have a GTX 690, and I couldn't find any questions with a similar issue.

Try ctrl+alt+f1 before logging in graphically. It will bring up a terminal. In that terminal after you type your login name and password type startx and it should display any errors causing you not to be able to log in. If you are able to log in I would definitely consider opening up synaptic and reinstalling your Nvidia driver. sudo dpkg --configure -a (configure pending packages) at the terminal before login might help in this case as well.

restart your computer
enter into recovery mode
terminal will open, enter your credentials
just run:

      sudo apt-get remove --purge nvidia*
      sudo apt-get install ubuntu-desktop
      sudo apt-get autoremove
      sudo rm /etc/X11/xorg.conf
      echo "nouveau" | sudo tee -a /etc/modules
      sudo reboot


How can I remove "Show Desktop" from the Alt-Tab (application) switcher? Is it possible to remove "Show Desktop" from the Alt+Tab application switcher?

13.04 and newer
For 13.04, 13.10 and 14.04, to enable or disable the "Show desktop" option in application switcher you can use unity-tweak-tool

12.10
For 12.10, a new setting has been added to CCSM to enable or disable the "Show desktop" option in application switcher.
Run this command in a terminal to install CCSM:
sudo apt-get install compizconfig-settings-manager

Now open CCSM and go to Ubuntu Unity plugin.

Switch to Switcher tab. Then tick the check box next to Disable Show Desktop in the switcher option.

Warning: I got this to work exactly once. When I restarted, I had two instances of unity running, and couldn't figure out why or how. killing them didn't work, and uninstalling reinstalling didn't help.

I resolved it by installing 13.10. I'll use the other fixes listed here.

I couldn't get this to work in 12.04, the package provided in another answer wasn't new enough (version 5.14), and the guide wasn't quite flawless. (though it was very helpful)
Here's how I managed to apply the fix for unity 5.20

1) Download the source:

sudo apt-get source unity

2) Change the source:

diff -ru org/plugins/unityshell/src/LauncherController.cpp patch/plugins/unityshell/src/LauncherController.cpp
--- unity-5.20.0/plugins/unityshell/src/LauncherController.cpp  2013-04-12 04:24:42.000000000 -0400
+++ unity-diff/plugins/unityshell/src/LauncherController.cpp    2013-12-23 12:22:50.154961579 -0500
@@ -761,7 +761,7 @@
 {
   std::vector<AbstractLauncherIcon::Ptr> results;

-  results.push_back(pimpl->desktop_icon_);
+  //results.push_back(pimpl->desktop_icon_);

   for (auto icon : *(pimpl->model_))
   {
diff -ru org/plugins/unityshell/src/unityshell.cpp patch/plugins/unityshell/src/unityshell.cpp
--- unity-5.20.0/plugins/unityshell/src/unityshell.cpp  2013-04-12 04:24:42.000000000 -0400
+++ unity-diff/plugins/unityshell/src/unityshell.cpp    2013-12-23 12:24:36.718966737 -0500
@@ -1909,7 +1909,8 @@

   auto results = launcher_controller_->GetAltTabIcons(show_mode == switcher::ShowMode::CURRENT_VIEWPORT);

-  if (!(results.size() == 1 && results[0]->GetIconType() == AbstractLauncherIcon::IconType::TYPE_DESKTOP))
+//  if (!(results.size() == 1 && results[0]->GetIconType() == AbstractLauncherIcon::IconType::TYPE_DESKTOP))
+  if (!(results.size() == 0))
     switcher_controller_->Show(show_mode, switcher::SortMode::FOCUS_ORDER, false, results);

   return true;

3) Install other packages:

sudo apt-get build-dep unity
sudo apt-get install cmake

5) Run cmake.

cd <source folder>
# from the INSTALL file
mkdir build; cd build
cmake .. -DCMAKE_BUILD_TYPE=Debug -DCOMPIZ_PLUGIN_INSTALL_TYPE=package -DCMAKE_INSTALL_PREFIX=/opt/unity
make
sudo make install

Note: if you set your DCMAKE_INSTALL_PREFIX folder to /usr instead of /opt/unity, you won't have to rsync later, but I wanted to try linking the file first. I gave up.

I suppose to undo the best option is to reinstall unity, which would put the standard files overtop.

6) Replace the files:

sudo rsync -av /opt/unity/ /usr/

7) Reinstall unity-greeter. Apparently the files rsynced break unity-greeter. Which is apparently needed to get unity running.

sudo apt-get install --reinstall unity-greeter


Unstable wifi Ubuntu 14.04 LTS Recently I had  Ubuntu 14.04 LTS installed due not liking  windows 8 and had trouble installing windows 7
Btw complete newb on Ubuntu !
My problem is that the wifi connection is horrible I cannot connect at all!  But did manage to have a connection when it was first installed then after that just didn't connect anymore

I've tried:

Deleting the wifi profile and reconnect
Reset network manager

Don't know what else to do.

Network card
     description: Ethernet interface
       product: RTL8111/8168/8411 PCI Express Gigabit Ethernet controller
       vendor: Realtek Semiconductor Co., Ltd.
       physical id: 0
       bus info: pci@0000:01:00.0
       logical name: eth0
       version: 10
       serial: 28:d2:44:f7:a7:30
       size: 10Mbit/s
       capacity: 1Gbit/s
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress msix vpd bus_master cap_list ethernet     physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000 bt 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=Half firmware=Rtl8168g-3_0.0.1 04/23/13 latency=0 link=No multicast=yes port=MII speed=10Mbit/s
       resources: irq:60
       ioport:4000(size=256) memory:c0504000-c0504ddd memory:c0500000-c0503fff
  *-network
       description: Wireless interface
       product: RTL8723BE PCIe Wireless Network Adapter
       vendor: Realtek semiconductor Co.,Ltd.
       physical id: 0
       bus info: pci@0000:02:00.0
       logical name: wlan0
       version: 00
       serial: 10:08:b1:71:65:59
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress bus_master cap_list rom ethernet physical wireless
       configuration: broadcast=yes driver=rtl8723be driverversion=3.13.0-45-generic    firmware=N/A ip=192.168.1.66 latency=0 link=No multicast=yes wireless=IEEE 802.11bgn
       resources: irq:19
       ioport:3000(size:256) memory:c0400000-c0403fff

add this option in kernel drivers settings

  $ sudo echo 'options iwlwifi 11n_disable=1' >>
  /etc/modprobe.d/iwlwifi.conf

Then restart the system this must fix wifi problem.

echo "options rtl8723be fwlps=N ips=N" | sudo tee /etc/modprobe.d/rtl8723be.conf

used this code line +restarted laptop and now my wi-fi connection is stable  :)


How do I resolve unmet dependencies after adding a PPA? Occasionally, when I'm installing stuff, I get an error like the following:

Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 package1 : Depends: package2 (>= 1.8) but 1.7.5-1ubuntu1 is to be installed
E: Unable to correct problems, you have held broken packages.

How can I resolve this?

APT is a package management system for Debian and other Linux distributions based on it, such as Ubuntu. For the most part, APT is easy to use for installing, removing, and updating packages. In rare instances, often when you are mixing in third-party dependencies, there is a chance that apt-get may end up giving you an error telling you that a package installation could not be completed.

Solutions:

It is always a good idea to back up configuration files like /etc/apt/sources.list, so you can revert the changes if needed.

If the error shows something like this:

<some-package>: Depends: <other-package> (= version) but this-version is to be installed

Then make sure that the restricted and universe repositories are enabled. Hit Alt+F2, type software-properties-gtk and hit Enter.

Under Ubuntu Software tab, enable all the repositories.

One possible cause of unmet dependencies could be corrupted package database, and/or some packages weren’t installed properly. To fix this problem, hit Alt+Ctrl+T to open terminal and try to run one of the following commands:

sudo apt-get clean

or,

sudo apt-get autoclean

apt-get clean clears out the local repository of retrieved package files (the .deb files). It removes everything but the lock file from /var/cache/apt/archives/ and /var/cache/apt/archives/partial/. apt-get autoclean clears out the local repository of retrieved package files, but unlike apt-get clean, it only removes package files that can no longer be downloaded, and are largely useless.
One of the most basic fixes to resolve dependencies problems is to run:

sudo apt-get -f install

The -f here stands for “fix broken”. Apt will attempt to correct broken dependencies. If you manually installed a package that had unmet dependencies, apt-get will install those dependencies, if possible, otherwise it may simply remove the package that you installed in order to resolve the problem.

Then run:

sudo dpkg --configure -a

Then run this again:

sudo apt-get -f install

If the output is:

0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.

That means it failed.
Next solution is to run:

sudo apt-get -u dist-upgrade

If it shows any held packages, it is best to eliminate them. Packages are held because of dependency conflicts that apt cannot resolve. Try this command to find and repair the conflicts:

sudo apt-get -o Debug::pkgProblemResolver=yes dist-upgrade

If it cannot fix the conflicts, it will exit with:

0 upgraded, 0 newly installed, 0 to remove and 6 not upgraded.

Delete the held packages one by one, running dist-upgrade each time, until there are no more held packages. Then reinstall any needed packages. Be sure to use the --dry-run option, so that you are fully informed of consequences:

sudo apt-get remove --dry-run package-name

Since removing the package you are trying to install may not be ideal, you might also try finding a repository that has the packages you need to satisfy the dependencies.

Finally, if all else fails, you can attempt to satisfy the dependencies yourself, either by finding and installing the necessary packages, or by installing them from source and then creating “deb” packages for them.

Disable/Remove/Purge PPAs:

PPAs (Personal Package Archive) are repositories hosted on Launchpad. You can use PPAs to install or upgrade packages that are not available in the official Ubuntu repositories.

One of the most common causes of unmet dependencies are PPAs, especially when used to upgrade the existing package in Ubuntu repositories. To solve the problem you have three options: disable, purge (revert back to original package in Ubuntu repositories) or remove PPA.

Disable:

Disabling a PPA means no more updates for the packages installed from that PPA. To disable a PPA: Open Software Center > Edit > Software Sources Or,

Hit Alt+F2 and run software-properties-gtk.

Click on Other Software tab, you'll see that each PPA have two lines here, one for the compiled packages and one for the source, Uncheck both lines to disable a PPA. Here you can also add and remove PPAs.

Purge:

Purging a PPA means, downgrading the packages in the selected PPA to the version in the official Ubuntu repositories and disabling that PPA. PPA Purge does exactly that. To install PPA Purge run the following command:

sudo apt-get install ppa-purge

But, considering the question apt is broken, the above command will fail. So use this command

mkdir ppa-purge && cd ppa-purge && wget http://mirror.pnl.gov/ubuntu/pool/universe/p/ppa-purge/ppa-purge_0.2.8+bzr56_all.deb && wget http://mirror.pnl.gov/ubuntu//pool/main/a/aptitude/aptitude_0.6.6-1ubuntu1_i386.deb && sudo dpkg -i ./*.deb

To use PPA Purge:

sudo ppa-purge ppa:someppa/ppa

If 'ppa-purge' command fails for some reason, you can't run 'ppa-purge' again unless you re-enable the PPA (To enable the PPA follow the same steps as disabling a PPA and Check the both lines of a particular PPA to enable it).

Note: PPA Purge doesn't remove PPAs (may be in future), So you'll have to manually remove the PPA.

Remove:

If the package installed from a PPA doesn't exist in official Ubuntu repositories then using PPA Purge is not recommended, because there's nothing to be downgraded and PPA Purge wouldn't delete it either. To remove a PPA and installed packages run the following commands: (Ignore the first command if you don't want to remove the installed packages)

sudo apt-get autoremove --purge package-name
sudo add-apt-repository --remove ppa:someppa/ppa
sudo apt-get autoclean

Alternatively you can use Y PPA Manager to disable/remove/purge PPA's (Details at the end of answer).

Preventive Measures:

So how can we avoid this from happening in the first place?

Keep Ubuntu Up to date. Ubuntu automatically notifies when updates are available, you can also check for available updates by clicking on Session Indicator in Unity panel:

Or, Hit Alt+Ctrl+T to open terminal and run following commands:

sudo apt-get update
sudo apt-get upgrade

Update: Synchronizes your list of available packages with the servers in source repositories.
Upgrade: Downloads & installs any newer versions of your installed packages.
If you decide to add other repositories to sources.list, make sure that the repository is meant to work (and known to work) with Ubuntu. Repositories that are not designed to work with your version of Ubuntu can introduce inconsistencies in your system and might force you to re-install. Also, make sure that you really need to add external repositories as the software package(s) you are looking for may already have been introduced into the official repositories! Source
Remove duplicate PPAs. Y PPA Manager (installation guide at the end of answer) can easily scan and remove duplicate PPAs.

Hit Alt+F2 and run y-ppa-manager to open Y PPA Manager.
Once open, double click or hit Enter on Advanced.
In resulting window select Scan and remove duplicate PPAs and click OK.

Getting Help:

When asking for help on Askubuntu or any other help forum, you should include the output of the following commands in your question:

Output of actual error:

sudo apt-get install package-name
This will show your sources.list:

cat /etc/apt/sources.list
This will show the list of PPAs (If any):

cat /etc/apt/sources.list.d/*

Additional Sources:

'apt' Ubuntu Manpage
'apt-get' Ubuntu Manpage
'apt-get/how-to' Community Ubuntu documentation
'Repositories/Ubuntu' Community Ubuntu documentation
'Repositories/CommandLine' Community Ubuntu documentation

Y PPA Manager:
 Y PPA Manager is an one stop shop for all of your PPA needs.

Here are some of its features:

search packages in all Launchpad PPAs
list and download packages in a PPA
add / remove / purge a PPA
backup and restore PPA sources
remove duplicate PPA sources

To install Y PPA Manager, open terminal by hitting Alt+Ctrl+T and run following commands:

sudo add-apt-repository ppa:webupd8team/y-ppa-manager
sudo apt-get update
sudo apt-get install y-ppa-manager

Considering the question, apt is broken, so use these commands instead

sudo su

and

32 Bit:

mkdir y-ppa-manager && cd y-ppa-manager && wget https://launchpad.net/~webupd8team/+archive/y-ppa-manager/+files/launchpad-getkeys_0.3.2-1~webupd8~oneiric_all.deb && wget https://launchpad.net/~webupd8team/+archive/y-ppa-manager/+files/y-ppa-manager_0.0.8.6-1~webupd8~precise_all.deb && wget https://launchpad.net/~webupd8team/+archive/y-ppa-manager/+files/yad_0.17.1.1-1~webupd8~precise_i386.deb && dpkg -i ./*.deb

64 Bit:

mkdir y-ppa-manager && cd y-ppa-manager && wget https://launchpad.net/~webupd8team/+archive/y-ppa-manager/+files/launchpad-getkeys_0.3.2-1~webupd8~oneiric_all.deb && wget https://launchpad.net/~webupd8team/+archive/y-ppa-manager/+files/y-ppa-manager_0.0.8.6-1~webupd8~precise_all.deb && wget https://launchpad.net/~webupd8team/+archive/y-ppa-manager/+files/yad_0.17.1.1-1~webupd8~precise_amd64.deb && dpkg -i ./*.deb

If you are getting an error like this:

This is telling you that the packages are already installed, but it has not installed all of the other packages it needs to work. You should be able to solve this by running this:

sudo apt-get -f install

(This command should automatically install the unmet dependencies.)

or something like this (with the relevant packages):

sudo apt-get install click curl dpkg-dev python-lzma python-requests imagemagick ubuntu-dev-tools

But if you end up with this sort of error:

You can then search for ways to install them here or here. With the above example, you should be able to find a page like this, and then use a PPA, or install a .deb for 32bit, or a .deb for 64bit.


Unable to install libmotif4 While installing dependencies for Oracle 11g setup on Ubuntu, I got the following error:

Package libmotif4 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

However the following packages replace it:
libxm4:i386 libuil4:i386 libmrm4:i386 libxm4 libuil4 libmrm4 libmotif-common

E: Package 'libmotif4' has no installation candidate

How to resolve this error?

I just had to fix this on Ubuntu 16.04 myself.  I did the following:

Navigate to https://launchpad.net/ubuntu/xenial/amd64/libmotif4/2.3.4-8ubuntu1 and download the .deb file.

Run the following from the directory where the file was downloaded to:

sudo dpkg -i libmotif4_2.3.4-8ubuntu1_amd64.deb

During this process it will complain abot not having libmrm4, libuil4, and libxm4 in that order.

Now simply run the following command to fix the unmet dependencies:

sudo apt-get -f install

You should be up and running.  As of June 1, 2017, the link above was good.  Hopefully it can last awhile longer.

On ubuntu 16.04 LTS:

sudo su

echo 'deb http://cz.archive.ubuntu.com/ubuntu trusty main universe' >> /etc/apt/sources.list.d/extra.list

sudo apt-get update

sudo apt-get install libmotif4

Optional: to disable the Ubuntu Extra Apt Repo:

mv /etc/apt/sources.list.d/extra.list /etc/apt/sources.list.d/extra.list.backup

sudo apt-get update


How can I adjust the resolution to avoid the damaged area on my screen? I have a laptop that has a damaged screen.  The 24 pixels (approximately) on the right side of the screen are damaged (this is definitely not a driver problem, it is physical damage).  It is not a straight bar, but rather a lot of black pixels that ebb and flow with some multicolored pixels around the edges.  I got this from someone so don't know the root cause: possibly water damage?

Anyway, the "power menu as well as any scroll bars (when applications are full screen) are hidden behind this damaged area.  Is there a way I can adjust the screen resolution or dimension so that these right side 24 pixels are not used?  So, the laptop is 1024 x 768.  Can I modify so that it is 1000 x 768 (and the 1000 are the leftmost 1000 pixels, not centered?)?

I was able to try using "xrandr" to force the screen to be 1000 wide, but then it is still centered, so it still only ignores 12 pixels on the right.

Thanks for any help.  This is with Ubuntu 11.10.

Here is a dirty hack... Since your damaged area is on the right side of the screen, you can create a panel with black background, align it to the right, and adjust the size carefully to cover the damaged area:

Make it opaque, so it looks really black.

Umm.. It seems you can even use a background image, to utilize the remaining good area... I had never use a background image, now I know why it comes..

In "System Settings", there is an icon called "displays". Click that, and you should be able to adjust the resolution. Hope this helps!


Laptop can't find my home wifi network The laptop has Ubuntu 14.04, it shows neighbors networks and it was working fine before.  My phone and desktop connect to my home Wi-Fi with no problems.  This has happened a few times before but in an hour or so I can resolve the problem by rebooting.  It has been almost a day and it didn't fix itself.

I have tried:

sudo apt-get purge bcmwl-kernel-source
sudo modprobe -rv wl
sudo modprobe -v brcmsmac

sudo service networking restart
sudo service network-manager restart

ifconfig wlan0 down
ifconfig wlan0 up

and:

iwconfig wlan0 txpower off
iwconfig wlan0 txpower auto

I rebooted after those were executed but it did nothing.

The OP answered the question themselves in a comment:

  switching the wireless channel fixed it - viale

Try:

nmcli dev wifi

a simple, clean and elegant way to get what you need.


Why does Firefox show a SSL warning In Ubuntu 14.10 (Firefox 36.0.1) this site shows a SSL warning:

https://robot.your-server.de/

(sec_error_unknown_issuer)

However on my Lubuntu 14.04 machine also with Firefox 36.0.1 there is no warning.

What does this warning mean exactly and is this a potential threat?

This looks like the typical problem where the server does not send the complete certificate chain, as explained here.

But this time it has an additional and interesting twist: if you check out the site with SSLLabs it does not report any chain issues. If you use openssl s_client... to connect to the site it also shows that the site sends the full chain (including the root certificate, which it should not). But if you take other tools to check you might fail instead because the site sends only the lead certificate and misses the necessary chain certificates.

It took me a while to figure it out, but at the end it turned out to be a misconfigured server: As long as you use IPv4 the server returns the full certificate chain, but if you use IPv6 the server returns only the leaf certificate. This means that all the successful tools used IPv4, all the tools with errors used IPv6. As for the browsers: the failed browser must have used IPv6, the other might have used it too, but might have this certificate cached from visiting other sites using the same chain certificate.

Check your system's time and date. Sometimes, SSL warnings are a result of the computer's time and date being set incorrectly meaning the certificate is invalid (either too new, or too old).

I've had this issue on my own website, which was resolved after I actually reset my system clock to an accurate time.


Error found when loading /home/[User]/.profile I installed homebrew last night to enable me to install wtfutil terminal on my Ubuntu 20.4. I did successfully and later decided to uninstall it.
It seems that it uninstalled alright but left some errors that I don't understand. I'm new to Ubuntu/Linux so this troubles me a lot since I cannot access my desktop after entering my password.
Here is the full error:
Error found when loading /home/[user]/.profile

/home/[user]/.profile: line 28: /home/linuxbrew/.linuxbrew/bin/brew: No such file or directory

As a result the session will not be configured correctly.
You should fix the problem as soon as feasible.

I had the exact same issue and this is really useful, and the comments from synacticgeorge up are the fix.

Reboot
On login screen, CTRL+ALT+F3 and login in TTY
nano .profile   (or vi, gedit, whatever)
Remove the offending brew line.
Profit

You probably copied the install instructions and added homebrew to your path. If you remove the reference to homebrew from /home/user/.profile it should work again
type in terminal
rm -rf /home/[user]/.profile


My computer refuses to use my NVIDIA driver I find this sort of issue everywhere, however I have been at this for just about two weeks and really need to fix this, as I need the functionality of my NVIDIA Geforce GT 540m.
Running an external monitor via HDMI (1920x1080) and using my laptop screen (1366x768) as my secondary screen.

My process:

Download the driver from Nvidia's site; Linux x64 for GT540m. (version 319.49) Renamed to NVIDIA.run

CTRL+ALT+F1
sudo bash
sudo service lightdm stop && sudo service gdm stop
sh /home/jake/Downloads/NVIDIA.run
->installer launches
Accepted the license
Install NVIDIA's 32-bit compatibility OpenGL libraries? Yes
Run nvidia-xconfig utility? Yes (supposed to create a file most likely about my monitors ie. 10.monitor.xml and/or xorg.conf)
->installer complete
reboot

My issue:

Could not apply stored configuration for monitors

none of the selected modes were compatible with the possible modes:
Trying modes for CRTC 63
CRTC 63: trying mode 640x480@60Hz with output at 1366x768@60Hz (pass 0)
CRTC 63: trying mode 640x480@60Hz with output at 1366x768@60Hz (pass 1)
Trying modes for CRTC 64
CRTC 64: trying mode 640x480@60Hz with output at 1366x768@60Hz (pass 0)
CRTC 64: trying mode 640x480@60Hz with output at 1366x768@60Hz (pass 1)

The screens are very small, but I manage to uncheck the "mirror displays" and set my external monitor to 1920x1080. However, my laptop screen is stuck at 640x480, with no other options available next to forcing it via command line from terminal. (a band-aid for a festering wound only covers it up)
I start up an application that requires java and/or opengl, Minecraft, of course, and it gives me org.lwjgl.LWJGLException: Could not init GLX

Any ideas?

Thanks.

UPDATE
I purged my old nvidia driver, ran sudo apt-get nvidia-319.
Restarted. Resolution is back to it's intended and desired settings! However: I start up nvidia xserver settings, and it gives me:
You do not appear to be using the NVIDIA X driver.  Please edit your X configuration file (just runnvidia-xconfigas root), and restart the X server.

I ran sudo nvidia-xconfig, rebooted, and my resolution issue returned (back to 640x480 on both screens).
Here is the xorg.conf:

nvidia-xconfig: X configuration file generated by nvidia-xconfig
 nvidia-xconfig:  version 325.15  (buildmeister@swio-display-x64-rhel04-03)  Wed Jul 31 19:04:27 PDT 2013

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0"
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
EndSection

Section "Files"
EndSection

Section "InputDevice"UPDATE

        # generated from default
        Identifier     "Mouse0"
        Driver         "mouse"
        Option         "Protocol" "auto"
        Option         "Device" "/dev/psaux"
        Option         "Emulate3Buttons" "no"
        Option         "ZAxisMapping" "4 5"
    EndSection

    Section "InputDevice"
        # generated from default
        Identifier     "Keyboard0"
        Driver         "kbd"
    EndSection

    Section "Monitor"
        Identifier     "Monitor0"
        VendorName     "Unknown"
        ModelName      "Unknown"
        HorizSync       28.0 - 33.0
        VertRefresh     43.0 - 72.0
        Option         "DPMS"
    EndSection

    Section "Device"
        Identifier     "Device0"
        Driver         "nvidia"
        VendorName     "NVIDIA Corporation"
    EndSection

    Section "Screen"
        Identifier     "Screen0"
        Device         "Device0"
        Monitor        "Monitor0"
        DefaultDepth    24
        SubSection     "Display"
            Depth       24
        EndSubSection
    EndSection

Unfortunately if your using a mobile nVidia on a laptop (the "m" after the graphic card name) it usually means it's an "Optimus" nVidia card. Optimus is an nVidia technology used on laptop for saving energy: the concept at its core is that when you're not using accelerated applications the integrated non-accelerated video chip (usually an Intel graphic card) is used, while the nVidia GPU is turned on only when necessary.

Problem is that nVidia still does not really support Optimus technology on Linux: simply installing the nVidia drivers as you tried to do won't work because of the hardware architecture of this "hybrid" nVidia cards.

One thing you can do is use Bumblebee which enables Optimus support on laptops (see https://wiki.ubuntu.com/Bumblebee) and should help with dual-monitor configuration (see http://blog.linuxacademy.com/linux/ubuntu-bumblebee-optimus-and-multi-monitor-support/)

The simplest way to ensure best possible performance with NVIDEA cards is to install the Steam client from valve and ask it to run Team Fortress 2 (huge download but free).

It then guides you to get your NVIDEA card up and running with the latest drivers good enough for gaming.

(You may get the diagnostics without downloading the game, but I am not certain).


bash: [: too many arguments? I'm trying to create a directory and cd into it:
In ~/.bashrc:
function abc() {
  appname=$1
  appdir="$HOME/code/$appname"
  if [ mkdir $appdir -a cd $appdir ]; then
    echo Success
  else
    echo Failed to create and switch directory
  fi
}

When I reload bashrc (. ~/.bashrc) I get the error:
bash: [: too many arguments
Failed to create and switch directory

How do I fix this? And what does [: in the error mean?
Ps. Could someone direct me to a "non-cryptic" bash scripting tutorial?

The main error in your script is that the [ command, equivalent to test command, is used to test conditions, like string comparison, existence of files, and so on.

To test the exit status of processes you have to use if without [, so your script could be

if mkdir "$appdir" && cd "$appdir"; then
  echo "Success"
else
  echo "Failed to create and switch directory"
fi

This is explained in Bash Pitfalls: 9. if [grep foo myfile.

I suggest you go through GrayCat Bash Guide to understand bash.

A prototype could be:

Create a file in your desktop: touch newDirectory.sh
Make file executable:  chmod +x newDirectory.sh
To call the script from a terminal in the desktop :   ./newDirectory.sh anyName

/

#!/bin/bash
function abc() {
  appname=${1}
  appdir="$HOME/Desktop/$appname"
  if (( mkdir "${appdir}" )) ; then
    cd "${appdir}"
    echo "Success"
  else
    echo "Failed to create and switch directory"
  fi
}
abc ${1}

Little recommendation: if you are new, do not mess with .bashrc :)


Unable to lock the administration directory (/var/lib/dpkg/) is another process using it? I get this error when trying to use apt-get:

E: Could not get lock /var/lib/dpkg/lock - open (11 Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/) is another process using it?

How can I fix this?

This should be used as last resort. If you use this carelessly you can end up with a broken system. Please try the other answers first before doing this.

You can delete the lock file with the following command:

sudo rm /var/lib/apt/lists/lock

You may also need to delete the lock file in the cache directory

sudo rm /var/cache/apt/archives/lock
sudo rm /var/lib/dpkg/lock

After that, try opening Synaptic again.

Like most everyone else I waited for the lock to be removed. After 30 minutes I gave up and hard booted to a different distribution. From there I used the internet for some research which landed me here.

It turns out unattended-upgrades.service is running. I found that be rebooting into the broken system and running:

sudo systemctl disable apt-daily.service
sudo systemctl disable unattended-upgrades.service
sudo systemctl disable apt-daily-upgrade.service
sudo systemctl disable apt-daily-upgrade.timer
sudo systemctl disable apt-daily.timer
sudo shutdown -r # Note it will take a couple minutes to reboot

allowed me to get the broken system working again for:

sudo apt update
sudo apt upgrade
sudo apt install -f

However it didn't fix the kept-back packages and impossible situation reported by apt in the first place. It would appear this was causing apt to lock up at boot in the first place.


Android Media sync LG Optimus L7 (P705) with ubuntu 12.04 LTS I can't connect my Android LG Optimus L7 (P705) with Ubuntu via media sync (MTP), just to see or transfer file / media inside my internal / external memory from computer to handphone vice versa, previously I used Windows XP and Windows 7, media sync no problem with both OS.

Please help regarding this issue. Thanks.

My phone is detected using lsusb command:

Bus 005 Device 027: ID 1004:631c LG Electronics, Inc.

but unfortunately, my phone still not detected when I open home folder.

I am still looking for solution regarding this MTP issue on my LG optimus L7 since my music player (Philips Go Gear) works on MTP also and did not detected by Ubuntu but detected even on Windows XP.

MTP doesn't work out of the box on linux. Inorder to transfer files to your phone's external_card you will have to change the usb connection mode on your phone to MSC(Mass Storage Mode).

If you want to access your phone storage and external_card on Linux then all you need is Airdroid.

If you're using Ubuntu and MTP or PTP are the only available options then AirDroid is the best thing since sliced bread.


Ubuntu installation freeze I got this when trying to install Ubuntu 14.04.3 (x64) (tried with DVD and Flash drive):

[     3.280511] ACPI PCC probe failed.

[    34.929862] ata8.00: exception Emask 0x52 SAct 0x0 SErr 0xffffffff action 0xe frozen

[    34.929870] ata8: SError: { RecovData RecovComm UnrecovData Persist Proto HostInt PHYRdyChg PHYInt CommWake 10B8B Dispar BadCRC Handshk LinkSeq TrStaTrns UnrecFIS

[    34.929875] ata8.00: failed command: IDENTIFY PACKET DEVICE

[    34.929880] ata8.00: cmd a1/00:01:00:00:00/00:00:00/00 tag 22 pio 512 in

[    34.929880]          res 40/00:00:00:00:00/00:00:00:00/00 Emask 0x56 (ATA bus error)

[    34.929885] ata8.00: status: { DRDY }

I tried with F6 key (selected nomodeset alone and nomodeset with acpi=off) but it won't load... tried "Try Ubuntu" and "Install Ubuntu" but nothing happens. My screen just freezes.

My PC specifications:

Motherboard: Asus P8Z77-V

CPU: Intel i5-3570

RAM: 8 GB DDR3

GPU: Gigabyte GTX 660 2 GB OC

If you still have Windows on your PC, you can try Wubi. I don't recommend it because it doesn't support 13.04+, and it isn't very compatible with Windows 8. But if there is really no way to get the CD/flashdrive version to work, you can give it a shot.

Wubi is a program that basically installs Ubuntu within Windows, so you would get a dual boot PC. The downside to this is that you can't delete Windows, or you'll delete Ubuntu as well. That said, Windows treats Ubuntu like a program so you can uninstall Ubuntu from Windows like you would with any other software.

For more information visit https://wiki.ubuntu.com/WubiGuide


nautilus-dropbox : Depends: dropbox but it is not going to be installed I was trying to install dropbox on ubuntu 13.10

My first attempt was to follow the steps from official site:

cd ~ && wget -O - "https://www.dropbox.com/download?plat=lnx.x86_64" | tar xzf -
~/.dropbox-dist/dropboxd

Also it installed dropbox, I was not able to see the icon on the panel (I tried this post, but the icon has not appeared). In addition to this, I was not starting automatically and I needed to do ~/.dropbox-dist/dropboxd on each start.

So I uninstalled dropbox with the commands from their website and tried to follow steps described here:

sudo apt-key adv --keyserver pgp.mit.edu --recv-keys 5044912E
sudo add-apt-repository "deb http://linux.dropbox.com/ubuntu precise main"
sudo apt-get update && sudo apt-get install nautilus-dropbox

But this resulted in the following error:

  Some packages could not be installed. This may mean that you have
  requested an impossible situation or if you are using the unstable
  distribution that some required packages have not yet been created or
  been moved out of Incoming. The following information may help to
  resolve the situation:

  The following packages have unmet dependencies:  nautilus-dropbox :
  Depends: dropbox but it is not going to be installed E: Unable to
  correct problems, you have held broken packages.

Any idea how it should be solved?

First of all, you could use deb http://linux.dropbox.com/ubuntu saucy main instead of precise, but since all the "versions" of the repository end up in the same package pool, that ought not to change anything.

Now, to your issue. I'm not sure, but since nautilus-dropbox is a transitional package for dropbox, try installing dropbox directly; it might solve your installation problem.

Step by step

First of all, let's assume you haven't downloaded any package from Dropbox's website.

Enable the repository:

Run these lines from the Terminal.

echo 'deb http://linux.dropbox.com/ubuntu saucy main'>>'dropbox.list'
chmod 644 'dropbox.list'
sudo chown root:root 'dropbox.list'
sudo mv 'dropbox.list' '/etc/apt/sources.list.d/dropbox.list'
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 5044912E

The first line creates a line containing the repository in a file named dropbox.list (note that this uses saucy, but you can use any previous version, as all repos end up in the same package pool). The second and the third give some necessary access and group permissions to the file. The fourth line moves the file to the place all repos are located. Finally, the fifth line adds the Key File so that the repository can be authenticated.

Now, let's install the package:

sudo apt-get update
sudo apt-get install dropbox

Now you can launch Dropbox from the application launcher of your choice.

I had the same problem. My solution was: Uninstall the existing Dropbox client from the Ubuntu Software Center and install the client version from the Dropbox website ( https://www.dropbox.com/install ).