How to modify an invalid '/etc/sudoers' file? How do I edit an invalid sudoers file? It throws the below error and it's not allowing me to edit again to fix it.

Here is what happens:

$ sudo visudo
>>> /etc/sudoers: syntax error near line 28 <<<
sudo: parse error in /etc/sudoers near line 28
sudo: no valid sudoers sources found, quitting

On a modern Ubuntu system (and many other GNU/Linux distributions), fixing a corrupted sudoers file is actually quite easy, and doesn't require rebooting, using a live CD, or physical access to the machine.

To do this via SSH, log in to the machine and run the command pkexec visudo. If you have physical access to the machine, SSH is unnecessary; just open a Terminal window and run that pkexec command.

Assuming you (or some other user) are authorized to run programs as root with PolicyKit, you can enter your password, and then it will run visudo as root, and you can fix your /etc/sudoers.

If you need to edit one of the configuration files in /etc/sudoers.d (which is uncommon in this situation, but possible), use pkexec visudo -f /etc/sudoers.d/filename.

If you have a related situation where you have to perform additional system administration commands as root to fix the problem (also uncommon in this circumstance, but common in others), you can start an interactive root shell with pkexec bash. Generally speaking, any non-graphical command you'd run with sudo can be run with pkexec instead.

(If there is more than one user account on the system authorized to run programs as root with PolicyKit, then for any of those actions, you'll be asked to select which one you want to use, before being asked for your password.)

If that doesn't work--for example, if there are no users authorized to run programs as root via PolicyKit--then boot from an Ubuntu live CD (like the CD you probably used to install Ubuntu) and mount the filesystem for the installed system. You can do this by running sudo parted -l to view your partitions--there is probably just one ext4 partition, and that's the root filesystem.

Suppose the installed Ubuntu system's root filesystem is on /dev/sda1. Then you could mount it with sudo mount /dev/sda1 /mnt. Then you can edit the installed system's sudoers file with sudo nano -w /mnt/etc/sudoers. Or, even better, you can edit it with

sudo visudo -f /mnt/etc/sudoers

(which will prevent you from saving a sudoers file with incorrect syntax).

You can edit your boot entry while in grub as well.

Simply reboot your pc, and wait for grub to show. Then press "e" on the "Ubuntu" entry to edit it.

Look for a line with "linux = " or "kernel = " and simply add an "single" to the end of that line.

Then press F10 to boot this temporarily modified boot entry.
This will give you a shell (without GUI) with root rights and you can edit the sudoers file with s.th. like nano /etc/sudoers back to its previous state.

Then reboot and its done.


What does the command "find ~/folder-name -type f | wc -l" do? The context  https://askubuntu.com/questions/523672/it-takes-forever-to-delete-a-particular-folder-created-by-bleach-bit-while-freei
Also, could you take a look at the context that suggested by @VolkerSiegel in her/him comment here.

Let's split it into parts:
find ~/folder-name -type f | wc -l

find is a program for, well, finding files and folders:

~/folder-name is the directory in which find will try to find files/folders
-type f tells find to look only for files (and not directories, special files, etc.)

wc is a program to count characters, words, and lines in some text (a file, or the input that you give it).

-l tells it to only count lines.

| sends the output of find to wc.

All told, it counts the total number of files in the directory ~/folder-name, and all its sub-directories. In your case you have 1305252 files, not counting links, directories and other special files. That's a pretty  big number (IIRC a MATLAB installation has around 500000 files, less than half that, and still takes forever to delete). That would go a long way in explaining the long times. The sheer amount of time find took should be hint.

As another reference point, my own home directory, with a total size of 361GB spanning a few partitions has only 282747 files (one fourth of your number!).

It counts (wc -l) the number of regular files (-type f) that are found - recursively - in the directory ~/folder-name.


How do I install the Firefox Developer Edition? Mozilla released the Firefox Developer Edition! How do I install it on Ubuntu?

Source:

Mozilla Releases 'Firefox Developer Edition' for Windows, Mac and Linux - OMG! Ubuntu!

Firefox Developer Edition

The Firefox Developer Edition is a modified version of Firefox, specifically designed for web developers. It uses a separate profile than the regular version of Firefox. Meaning you can have both Firefox or F-beta, installed next to the developer edition. Note that your F.D.E. will be a completely UN-customized browser. To unify settings, you can use Firefox sync.

Here's one of many perks when using F.D.E:

  "By using the Developer Edition, you gain access to tools and platform features at least 12 weeks before they reach the main Firefox release channel." - Developer Edition - Mozilla | MDN#The_latest_Firefox_features

Installation

There are currently three ways to do this, manually, PPA or via Ubuntu Make.

Manually

Download from Mozilla Firefox Developer Edition webpage. Extract it with file-roller and move the folder to its final location. A good practice is to install it in /opt/ or /usr/local/.

Once you moved the files to their final location (say /opt/firefox_dev/), you can create the following file ~/.local/share/applications/firefox_dev.desktop to get a launcher with an icon distinct from normal Firefox.

[Desktop Entry]
Name=Firefox Developer
GenericName=Firefox Developer Edition
Exec=/opt/firefox_dev/firefox %u
Terminal=false
Icon=/opt/firefox_dev/browser/chrome/icons/default/default128.png
Type=Application
Categories=Application;Network;X-Developer;
Comment=Firefox Developer Edition Web Browser.
StartupWMClass=Firefox Developer Edition

Please note, that the parameter StartupWMClass is added to prevent duplicate icons in the launcher, as explained here.

To mark the launcher as trusted, make it executable:

chmod +x ~/.local/share/applications/firefox_dev.desktop

To launch it, navigate to ~/.local/share/applications/ using your "Files" application (ensure you turn on hidden folders), then double-click firefox_dev.desktop. Alternatively, search for Firefox Developer, and simply run the firefox binary, and voilà.

Note that, when you install manually, the F.D.E. does not have the unity global menu by default.

PPA

Firefox for developers currently resides in Firefox Aurora builds : “Ubuntu Mozilla Daily Build Team” team. It should be noted that:

  "Firefox Developer Edition replaces the Aurora channel in the Firefox Release Process. Like Aurora, features will land in the Developer Edition every six weeks, after they have stabilized in Nightly builds." - Developer Edition - Mozilla | MDN #The_latest_Firefox_features

Also:

  "Version 35.0a2, first offered to Firefox Developer Edition users on November 10, 2014" - Firefox — Aurora Notes (35.0a2) — Mozilla#main-content

Install the Firefox Developer Edition, formerly know as Aurora, like so:

sudo add-apt-repository ppa:ubuntu-mozilla-daily/firefox-aurora
sudo apt-get update
sudo apt-get install firefox

The Mozilla PPA only holds packages for the supported Ubuntu releases, not EOL(End Of Life) releases.

Note that installing with the aforementioned ppa, will result in your current Firefox installation being replaced!

Ubuntu Make

This method has been provided by Jorge Castro. I am adding this here, because it's also an excellent way to install the Firefox Developer Edition(and many others dev tools).

sudo add-apt-repository ppa:lyzardking/ubuntu-make
sudo apt-get update
sudo apt-get install ubuntu-make

After you have installed ubuntu-make, tell it to install the web tool firefox-dev.

umake web firefox-dev

Uninstall

If you wish to keep the Current default Firefox, because The FDE has no new features you like, or for whatever reason, here are a few ways to uninstall it.

PPA

You can remove the ppa, and its packages, using ppa-purge.

Install it like so:

sudo apt-get install ppa-purge

The following will remove the PPA, and its packages:

sudo ppa-purge ppa:ubuntu-mozilla-daily/firefox-aurora

Manually

remove the binaries with the rm command(rename the path to the location you actually extracted FDE). Or with your file-manager:

sudo rm -r /opt/firefox_dev/

Also remove the firefox_dev.desktop

sudo rm ~/.local/share/applications/firefox_dev.desktop

After that you have successfully removed the Firefox Developer Edition.

Ubuntu Make

the following command will remove Firefox Developer Edition:

umake web firefox-dev -r

You can also remove umake and its PPA (ppa-purge needed, see installation instructions above):

sudo ppa-purge ppa:lyzardking/ubuntu-make

Screenshot

 Firefox Developer Edition on Ubuntu 14.04.1

Change Theme

At the time of writing, there are three themes available for F.D.E. Here is how to enable them.

Type in the url bar:

  about:config

When in the search filter type in theme. Then double click on devtools.theme. After that, type in light, and the theme will be applied.

Screenshot with multiple themes available for F.D.E.

Features

Some - but not all - features touted by Mozilla:

WebIDE:

allows you to develop, deploy and debug Web apps directly in your browser, or on a Firefox OS device. It lets you create a new Firefox OS app (which is just a web app) from a template, or open up the code of an existing app. From there you can edit the app’s files. It’s one click to run the app in a simulator and one more to debug it with the developer tools.
Web IDE - YouTube

Valence:

(previously called Firefox Tools Adapter) lets you develop and debug your app across multiple browsers and devices by connecting the Firefox dev tools to other major browser engines. Valence also extends the awesome tools we’ve built to debug Firefox OS and Firefox for Android to the other major mobile browsers including Chrome on Android and Safari on iOS. So far these tools include our Inspector, Debugger and Console and Style Editor.
Valence - YouTube

Responsive Design Mode:

see how your website or Web app will look on different screen sizes without changing the size of your browser window.

Page Inspector:

examine the HTML and CSS of any Web page and easily modify the structure and layout of a page.

Web Console:

see logged information associated with a Web page and use Web Console and interact with a Web page using JavaScript.

JavaScript Debugger:

step through JavaScript code and examine or modify its state to help track down bugs.

Network Monitor:

see all the network requests your browser makes, how long each request takes and details of each request.

Style Editor:

view and edit CSS styles associated with a Web page, create new ones and apply existing CSS stylesheets to any page.

Web Audio Editor:

inspect and interact with Web Audio API in real time to ensure that all audio nodes are connected in the way you expect.

Reference:

Mozilla Introduces the First Browser Built For Developers: Firefox Developer Edition ✩ Mozilla Hacks – the Web developer blog
Firefox — Aurora Notes (35.0a2) — Mozilla(Firefox Developer Edition Notes)

Version 35.0a2, first offered to Firefox Developer Edition users on November 10, 2014

Firefox Developer Edition — Mozilla
Firefox Aurora builds : “Ubuntu Mozilla Daily Build Team” team
Developer Edition - Mozilla | MDN

The problem is that when you downloaded the file, it didn't get saved with executable permissions.

Download the firefox developer edition here:
https://www.mozilla.org/en-US/firefox/developer/
Extract the file manually to /opt/firefox/
Open Nautilus: Go to Edit->Preferences-> Behavior-> click on "Run
executable text files when they are opened"
Go to the file 'firefox' in /opt/firefox/
Right click and select Properties--> Permissions--> Execute: Allow
executing file as a program.
Open terminal and type:

  gnome-desktop-item-edit ~/.local/share/applications --create-new

Create a shortcut and You're done !

If you're still unable to run it, you might be having problem with installing firefox even after following all the answers here. It might be because Firefox will not run at all without the following libraries or packages:

GTK+ 2.18 or higher
GLib 2.22 or higher
Pango 1.14 or higher
X.Org 1.0 or higher (1.7 or higher is recommended)
libstdc++ 4.3 or higher

libstdc++ is not included in Ubuntu by default.

For optimal functionality, the following are the recommended libraries or packages:

NetworkManager 0.7 or higher
DBus 1.0 or higher
HAL 0.5.8 or higher
GNOME 2.16 or higher

To install a package, open a terminal and type

sudo apt-get install [package-name]

I was not able to launch the executable script contained in file 'firefox' in firefox directory.


Raspberry Pi C++11 std::thread: pure virtual method called Ubuntu 14.04. I've installed gcc-arm-linux-gnueabihf, g++-arm-linux-gnueabihf (tried 4.8 and 4.9 from utopic).

Code that uses std::thread:

#include <iostream>
#include <chrono>
#include <future>

void secondList()
{
    const std::chrono::seconds twoSeconds(2);

    for (size_t i = 0; i != 300; ++i)
    {
        std::this_thread::sleep_for(twoSeconds);
        std::cout << "2s\n";
    }
}

int main(int, const char *[])
{
    auto secondThr = std::async(std::launch::async, secondList);

    return 0;
}

Compiling with:

arm-linux-gnueabihf-g++ --std=c++11 main.cpp -lpthread -o main

On RPI it fails:

pi@raspberrypi ~ $ ./main
pure virtual method called
terminate called without an active exception
Aborted

Compiling on RPI works:

pi@raspberrypi ~ $ g++ --std=c++0x main.cpp -lpthread -o main

Pi image 2015-02-16-raspbian-wheezy, g++ on Pi (Debian 4.6.3-14+rpi1) 4.6.3.

I've tried compiler options -mcpu=cortex-a7, -mcpu=cortex-a8 and -D__GCC_HAVE_SYNC_COMPARE_AND_SWAP_{1,2,4,8} that were mentioned in similar questions.

Also tried g++ from ppa: http://ppa.launchpad.net/linaro-maintainers/toolchain/ubuntu precise

Why it is happening and how to get a cross-compiler that works?


teach apt-get to not complain about a particular package I need to have xpra 0.15.10 installed on my system because the version that comes with trusty doesn't work. Now I downloaded the binary from http://xpra.org/#download which generally works fine only that apt-get wouldn't let me install anything else but complain that I need to run apt-get -f install first which will remove xpra again i.e. whenever I need to run apt-get I need to un- and re-install the xprapackage - not very convenient I must say. Is there either an option to tell apt-get to not worry about this particular package or manually tell apt-get where to install the deb from for this package?

You can use apt-mark to hold the package so that it does not get updated after you install it.  The command would be from a terminal window:

sudo apt-mark hold xpra

from the manpage for apt-mark:

   hold
       hold is used to mark a package as held back, which will prevent the
       package from being automatically installed, upgraded or removed.
       The command is only a wrapper around dpkg --set-selections and the
       state is therefore maintained by dpkg(1) and not affected by the
       --file option.

Hope this helps!

aptitude can be useful for resolving conflicts. sudo apt-get install aptitude
It will automatically suggest a few options to resolve any issues. It handles everything to do with apt (install/remove/update etc) with simple keypresses all in the CLI.

If apt-get has problems; then launching aptitude might give you a better understanding (or way of handling it). and avoids having to know most of the uncommon apt-get commands.

If anything is highlighted RED, press E to then examine the solutions. All required keys are shown while in that screen.

https://wiki.debian.org/Aptitude


Do I need to defrag EXT file systems? Possible Duplicate:
  Why is defragmentation unnecessary?

I've been told that EXT file systems don't need to be defreagged because of the way they handle writes. Is this true? Would I benefit from a defrag every now and then? If so, what tools are best?

The linux kernel and linux filesystems do a lot of things to minimize fragmentation, but it's not true that fragmentation isn't possible.  The amount of fragmentation is dependent on the type of usage of a filesystem (as Jeremy points to the Transmission bugtracker, large torrents can be an example of "bad" behaviour for fragmentation, depending on how applications work with them).  In general, it doesn't get really bad normally, unless you manage to almost fill up your disk.

Oh, and you get the best defragmentation by copying everything to another filesystem, deleting the old filesystem, and then copying everything back.  That's also true on Windows...  ;)

Actually, you can do the copy + delete trick on the same filesystem too, but remember that you need to make a copy, then delete the old one, and not do a move/rename!

The ext3 and ext4 filesystem do not need to be defragged, since they defragment themselves.
You can read this for more information: http://en.wikipedia.org/wiki/Ext3#Disadvantages (if it's necessary)


Why are Ubuntu One files in the cloud not the same size as the original? I tar ~/Documents to create backups.  My .tgz files are approximately 700MB.  I have created three such files over the past 3 weeks and I used Ubuntu One to protect these from loss.  In all three cases, the file size reported on the Ubuntu One website does not agree with the file size reported by Nautilus.  In all three cases, the file size in the cloud is several MB smaller than the one on the desktop file system.

Example: My 2012 May 10 backup is 761MB but on the cloud it is 726MB.

Why is this happening?

This is because Nautilus is showing you the file size in megabytes, while the Ubuntu One Web interface is showing you the file size in mibibytes. Compare:

1 kilobyte = 1000 byte
1 megabyte = 1000 kilobytes
1 gigabyte = 1000 megabytes
...

And:

1 kibibyte = 1024 byte
1 kibibyte = 1024 kibibytes
1 gibibyte = 1024 mibibytes
...

So, in your example: 761 are megabytes, 726 are mibibytes:

761 MB = 761 × 1000 kB = 761 × 1000 × 1000 B = 761'000'000 B

Now let's convert 761'000'000 B to mibibytes:

761'000'000 B = 761'000'000 ÷ 1024 KiB = 761'000'000 ÷ 1024 ÷ 1024 MiB ≈ 726 MiB

As you can see, the right symbol for mibibytes is not MB, but MiB. Unfortunately, mebibytes and related units have been defined just in recent times. Quoting Wikipedia:

  The mebi- prefix was defined by the International Electrotechnical Commission (IEC) in December 1998.

Therefore nowadays many people are used to write MB while they actually mean MiB. This is a common mistake that you will find in Ubuntu One and many other applications.

Ubuntu One uses zlib to compress data before sending it, to save some bandwidth when doing the transfer. It also stores the file content in the compressed form on the server, to avoid having to recompress it before sending it back down the stream.

The answer has nothing to do with file system block sizes.


Ubuntu booting issue after getting rid of Windows I used to have Windows and Ubuntu installed on my laptop but I've decided to wipe Windows and just go with Ubuntu. After installing Ubuntu with USB and wiping Windows I've gotten this booting issue.

I've tried reinstalling Ubuntu, having dual installed Ubuntu, and just desperate stuff in general. The error that I get before trying to boot off of my USB is:

Failed to open \EFI\BOOT\mmx64.efi - Not Found
Failed to load image \EFI\Boot\mmx64.efi: Not Found
Failed to start MokManager: Not Found

Current Disk situation from USB non-installed Ubuntu's disk utility:

partition 1

Size: 537 MB
Device: /dev/sda1
Partition Type: EFI System
Contents: FAT(32-bit version) - Not Mounted

partition 2

Size: 503 GB
Device: /dev/sda2
Partition Type: Linux Filesystem
Contents: Ext (version 1.0) - Not Mounted

partition 3

Size: 8.5 GB
Device: /dev/sda3
Partition Type: Linux Swap
Contents: Swap (version 1) - Active

I still have 489GB of free space from the dual boot partition. I'd want to get rid of the partition and just have 1TB Ubuntu but it doesn't even boot.

I've tried boot-repair but still same result.

This post on itsfoss helped me to solve this problem the most.

This isn't an MBR issue as you are using a UEFI system.

There should be 2 main boot EFI folders with the following paths: a) /boot/efi/EFI/Boot, and b) /boot/efi/EFI/ubuntu. a) should have these files: bkpbootx64.efi, bootx64.efi and grub64.efi. b) should include: fwupx64.efi, grub.cfg, grub64.efi,mmx64.efi and shimx64.efi. mmx64.efi operates Mokmanager and with shimx64.efi is responsible for booting up via a 'Secure Boot'. The Secure Boot option is available in your BIOS. So it seems likely that mmx64.efi is missing with Secure Boot enabled.

First of all I'd go into BIOS and disable Secure Boot, then save settings and see if GRUB menu appears and you can boot from it. If not, then boot up from live flash drive, mount sda1 and check in terminal to see if all 'efi' files are present as well as in the relevant folders as above. If they are there and you weren't able to boot on your HDD then a re-install is probably necessary, but then  mount sda2, find your 'home' folder and back it up if you haven't done so. While you're in live Ubuntu I'd give boot-repair one more try. It's not let me down on the rare occasion I've had boot problems.

I experienced exactly the above error message but after grub was updated on on my Dual Boot box.

After trying all sorts of solutions I finally realised it was signing issue. The file, /boot/efi/EFI/ubuntu/grubx64.efi had, been updated and was no longer signed.

Into the BIOS settings, (F2 on my ACER), 'Security', 'Add file to EFI Trusted Dbases' (or something similar), navigate to the file I mention above and select it.

All good.


Do I need any drivers? I am new to Ubuntu so I have some doubts regarding Ubuntu. My system is Dell Inspiron N4010 with 3GB RAM and preloaded with Windows 64 bit. I would like to install Ubuntu 12.04 LTS. So I downloaded the 64 bit version. Will it work perfectly on my machine? Last time I used some old versions of Ubuntu and the WiFi was not working properly. Will there be any issue like that?

Thanks in advance

You could try the live CD and check if it works or not? It will not install anything to your harddrive, all you have to do is run it from a disk or USB drive.

This Ubuntu wiki article is a good place to start with if you are unsure about booting from the live CD. The live CD is essentially a full Ubuntu install, except it runs on CD/DVD/USB, doesn't modify your harddrive in anyway (unless instructed to explicitly) and it does not save any changes you make.  This way you can check if everything you need works or not.

You can still try NDisWrapper, if your wifi does not work. It is wrapper around windows wifi drivers.


installing drivers for intel 910 series SSD (data center hdd), how it it possible? I got my hands on a Intel 910 series 800GB SSD, now I have a hard time installing it since Ubuntu is not mentioned as a supported OS for it. And I might add that I am a newbie with Linux as well so this is a shot in the dark.

The special thing with this SSD is that it requires drivers to be used and it will therefore not show up in BIOS or be bootable etc.

I found this blog-post about some guy using the SSD in Ubuntu during benchmarking:
http://www.percona.com/blog/2012/09/11/intel-ssd-910-vs-hdd-raid-in-tpcc-mysql-benchmark/

So it should be possible to use it in Ubuntu, the question is how.

In the readme for the linux-drivers (for redhat and suse) it mentions three ways of installing:

Installing from a Floppy disk
Installing from RPM
Installing from source

The first alternative involves creating a bootable floppy. When i look into the ISO file used it seems to still be using RPM's which I guess is not used by ubuntu.

The second alternative is also non-ubuntu(I guess?)

The third might be possible though. The driver bundle contains a folder named mpt2sas which contains .c and .h -files together with a Makefile. I've tried compiling it according to How do I install a driver provided as source code? but all I got was "target missing".

This is the complete readme file that was included:
http://marin-el.se/process/Intel_SSD%20910_Series_README_Linux.txt

It mentions moving the sourcefiles to certain location and after that I think the kernel needs to be rebuilt.

Is rebuilding the kernel the way to go? And would it be possible to follow the steps in the readme file for doing that or is it so difficult that it makes more sense to switch OS and use Suse instead(I'd rather not)?

//TB

You can try the .rpm package, its nothing but a different package type.

Theres a tool called Alien that adds .rpm support to debian variatives which Ubuntu is. The 910 works without special drivers in Ubuntu 14.04 you can partition, format and mount the 4 partitions as you like.


Spotify Quicklist for Unity How can I add a Unity "quicklist" for Spotify (installed from their website), so that when I right-click on the icon on my dock, I get: "Next, Previous, Stop, Play" and so on?

I think the answers given so far are a bit over-complicating things. There is no separate script required, the relevant DBus commands can be sent directly via dbus-send. Just make sure that the dbus package is installed and in the command line issue the following commands:

mkdir -p ~/.local/share/applications
cp /usr/share/applications/spotify.desktop ~/.local/share/applications/

Edit the file ~/.local/share/applications/spotify.desktop to read:

[Desktop Entry]
Name=Spotify
GenericName=Music Player
Comment=Listen to music using Spotify
Icon=spotify-client
Exec=spotify %U
TryExec=spotify
Terminal=false
Type=Application
Categories=Qt;Audio;Music;Player;AudioVideo
MimeType=x-scheme-handler/spotify
# ====> MODIFICATIONS START HERE <=====
Actions=PlayPause;Next;Previous

[Desktop Action PlayPause]
Name=Play/Pause
Exec=dbus-send --print-reply=literal --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause
OnlyShowIn=Messaging Menu;Unity;

[Desktop Action Next]
Name=Next
Exec=dbus-send --print-reply=literal --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next
OnlyShowIn=Messaging Menu;Unity;

[Desktop Action Previous]
Name=Previous
Exec=dbus-send --print-reply=literal --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous
OnlyShowIn=Messaging Menu;Unity;

And you're done.

Spotify will have a icon on the panel. Just click on that, and you get play, stop, pause, next etc (don't remember all). Not sure if that answers your question.


Can I delete Ktorrent *.dnd files? I've noticed that *.dnd files in ~/.kde/share/apps/ktorrent consumed 8 Gb of disk space.
As I understand, dnd means "do not download" -> just temp files? Wouldn't Ktorrent recreate/redownload it after deletion?

Is it safe to delete these files? Won't it affect my active torrents?

I've finally deleted it -> my 800 active torrents gone ^_^

Answer: don't delete *.dnd files if you don't want all your torrents to be deleted

From my simple understanding :

Torrent clients download pieces of data , maybe this piece for a file or another file or maybe it's the end of a file and the start of another one , or it's required to check the healthy of files

I used to use utorrent in the past/$windows$ and they end with .bat so i delete them after download and seeding a little . Although , I don't use ktorrent but I suppose the all follow the same principle

Read this from Bittorrent faq

Why does BitTorrent create or download parts of files I set to "Don't Download?"
This occurs because BitTorrent has no concept of files, only pieces. Because
multiple files can share the same piece, and BitTorrent has to download an entire
piece to check its hash, it will effectively download data for another file
(regardless of whether it was skipped). There is nothing you can do about
BitTorrent downloading data for another file if the data is a part of a piece that also
belongs to another file that you do want downloaded


How do I disable X at boot time so that the system boots in text mode? Is it possible to disable X at boot time? I'm setting up a server so it would be nice if it wouldn't load the graphical interface every time I boot.

Edit /etc/default/grub with your favourite editor, e.g. nano:
sudo nano /etc/default/grub

Find this line:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

Change it to:
GRUB_CMDLINE_LINUX_DEFAULT="text"

Update GRUB:
sudo update-grub

For systems that use systemd
This is an additional step for systemd releases, e.g. Ubuntu 15.04, the steps above for grub are still necessary.
You need to tell systemd to not load the graphical login manager:
sudo systemctl enable multi-user.target --force
sudo systemctl set-default multi-user.target

You will still be able to use X by typing startx after you logged in.

For Ubuntu 14.04 Trusty Tahr and Ubuntu 12.04 Precise Pangolin, systemd has been added to a third party PPA, so testing it on the latest Ubuntu LTS systems is easy. All you have to do is add the ppa to your system

sudo add-apt-repository ppa:pitti/systemd
sudo apt-get update
sudo apt-get dist-upgrade

Now Open the /etc/default/grub file by using any of the text editor (I used gedit here) with sudo privilege via Terminal to edit like follow:

sudo -H gedit /etc/default/grub

change the  line GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" to GRUB_CMDLINE_LINUX_DEFAULT = "init=/lib/systemd/systemd"

save the file and update the Grub:

sudo update-grub

Then restart now the system will boot in to text console tty1.

To Login in to GUI again run

sudo start lightdm

Note: Do not use startx or Ctrl+Alt+F7 For Ubuntu 15.04 that uses systemd use sudo service lightdm start


Why does restarting my laptop does not give me an option to go to Ubuntu? Yesterday I installed Ubuntu 12.04.1 64bit in my laptop with windows 7. The installation was dual. I did the required partition and kept a free space for linux. I gave the appropriate space for swap area and ext4. Ubuntu got installed well. Then finally after installation, I was asked to reboot my system.

While rebooting, as we expect, the system should ask me whether I want to start windows or linux. But it did'nt ask me any of it. The system directly takes me to windows without giving me any option for linux. I tried restarting again, but i was directly taken to windows. Can you help me know this ?  Did i go wrong somewhere with my installation? How can i correct it and get to linux ?

Thanks in advance..

I thank you for your reply. I am not sure in which partition did I install my grub. Honestly this is really new to me. I am trying to follow the instructions mentioned in the link you provided. It is really a clear description on how to install ubuntu step by step. But however, I am stuck at using the "EasyBCD" tool. I have tried installing several times, but after installing, when I try to run it, it gives me an error saying,

"error Opening BCD Registry"

I have attached the image as well.
Could you give me an alternative ? Or any way to resolve that?

It seems that GRUB was not installed on the MBR.

Follow these steps:

Boot using a LiveUSB.
Open a terminal. Run the following commands:

    sudo grub-install /dev/sda
    sudo update-grub

Reboot.

In which partition did you install grub?
If you didn't installed it on the same partition as Windows 7, then the default partition to boot will remain the Windows 7.

An easy way to fix this is to use EasyBCD to add ubuntu to Windows 7 boot entry menu.
This link should help you: dual boot ubuntu 12.04 and windows 7


How do I manage applications on startup in GNOME 3? I had a nice GUI for changing startup applications (after logging in) on GNOME 2. How can I start that application on GNOME 3?

Where can I download it? What is the package name? What command is used to launch it? I have Pidgin still launching on start, but I have converted back to Empathy, so I would like to know how I can remove Pidgin and start Empathy instead.

From terminal or Alt+F2 dialog run: gnome-session-properties.

For newer ( 3.14+ ) versions of Gnome just use the Tweak Tool from the applications menu.

To access System Settings, click the "Power" icon at the top right corner of the desktop and select "Sytem Settings". Under the "Personal" heading, click on "Startup Applications." This is the same GUI from previous versions of Ubuntu and Gnome.

To remove Pidgin from your Startup Applications, click on the row that says "Pidgin" in the list. Then, click the "Remove" button on the right, which will remove the entry altogether. Alternatively, you can disable the program from starting when you log in by simply unchecking the checkbox on the far left. This would allow you to re-check the box in the future, to re-enable Pidgin as a Startup Application.

To add Empathy to your Startup Applications, click the "Add" button. Choose a Name, such as "Empathy". It can be anything you like. Next to Command, type empathy. This will launch an Empathy window after you log in. If you would prefer to have Empathy start hidden in the Messaging Menu, enter the command empathy -h instead. Next to Comment, you can leave blank or you can add a descriptive comment. Then click Add.


How can I watch Amazon Prime videos using Firefox on Ubuntu 16.04? How can I watch Amazon Prime videos using Firefox on Ubuntu 16.04? Currently Firefox version is 48.0. When I attempt to watch a video, I get the following Digital Rights Error message:

Your web browser is missing a digital rights component.
In your web browser’s address bar, type about:addons, press Enter, and then on the left, click Plugins. For the Widevine Content Decryption Module, select Always Activate, and then refresh the video’s page and try watching the video.
If the video doesn’t play, go back to Plugins, click the gear icon at the top of the page, and then click Check for Updates. When the plugins have updated, refresh the video’s page, and then try watching the video.

I didn't find Widevine Content Decryption Module.
I searched for a solution, but it didn't work...
One solution I found was to sudo apt-get install flashplugin-installer and then do the following:
sudo apt-add-repository ppa:flexiondotorg/hal-flash
sudo apt-get update && sudo apt-get install libhal1-flash

However, it didn't work and I still got the same Digital Rights Error message.
I am able to watch Amazon Prime videos using Google Chrome, but not with Firefox. I want to know if it's possible on Firefox on Ubuntu 16.04.

This is actually a problem with enabling DRM content(atleast in the case of newer versions)

So if its an old version see the above accepted answer, and if you have a newer version and still things are not working, this answer is for you.

Firefox disables playing DRM content by default
To be able to watch DRM content enable it by Selecting "Play DRM Content" in Preferences -> Content.

Check this out for more info : https://support.mozilla.org/en-US/kb/enable-drm

Note that I tested this on Firefox 53, I am not sure about older versions.

It may be an issue of your browser version make sure your browser's updated. You can re-download it from the Firefox browser and try updating the module.

Make sure that your antivirus and firewall are disabled while updating that might just make some problem with the update process.

If you want a detailed description of the steps involved in updating content decryption module for Firefox I have it here in one of my blog posts feel free to check it out  here.

Download Firefox once again from the official page and follow the steps you can fix the issue.


How to chabge GDM Login theme in ubuntu 12.04 lts I have ubuntu 12.04 lts and I changed my login screen to GDM by typing

sudo apt-get install gdm

how do I change the theme in ubuntu 12.04? I downloaded a theme using gnome-look.org. Where do I extract the theme and how do I apply it?

Although this will change gdm by mdm this works and has been tested on 12.04.
How can I replace LightDM with MDM?


Lock screen - password incorrect I have upgraded Ubuntu to 12.04 and now I have a problem in logging in after locking the screen: it says the password is incorrect even though I provide the valid password. I found a temporary solution by switching users and logging in again with the same user.

I had the same issue.  It is likely the ownership is wrong for /etc/shadow (See section "gnome-screensaver authentication failure with incorrect /etc/shadow permissions" of this page).

You need to sudo chown root:shadow /etc/shadow then sudo chmod u=r,g=r /etc/shadow See this bug report.

The interesting question is "Why ownership changed?". Because I don't remember changing it.

I am using Ubuntu 14.04 and I had the same issue

By mistake I ran a chown on the root filesystem (Yikes!) and since then I started having the issue described here.

I ran the command given in oshobov's answer, but that did not work for me, but using my own account instead of root made it work.

sudo chown your-username:shadow /etc/shadow


How to remove offending key in git when you try to push your changes? I've done tons of search and tested different solutions, but gain no success!

When I want to push my codes, I receive the following error:

Warning: the ECDSA host key for 'git.mywebsite.ir' differs from the key for the IP address '164.138.23.11'
Offending key for IP in /home/alireza/.ssh/known_hosts:10
Matching host key in /home/alireza/.ssh/known_hosts:1
Are you sure you want to continue connecting (yes/no)? yes

What should I do to remove this message every time I push my changes? Any idea?

It says:

  Offending key for IP in /home/alireza/.ssh/known_hosts:10

So for some reason you have to delete 10-th line in known_hosts.

Run this command to delete 10-th line in known_hosts:

sed -i '10d' ~/.ssh/known_hosts

Or use ssh-keygen

ssh-keygen -R git.mywebsite.ir

Quote from man

 -R hostname
         Removes all keys belonging to hostname from a known_hosts file.
         This option is useful to delete hashed hosts (see the -H option
         above).

You have to edit your known_hosts file (located in ~/.ssh/known_hosts) and remove an entry asociated with this address.


How do I swap mouse buttons to be left handed from the terminal? I am left handed person.
Therefore I want to interchange the typical mouse buttons for right and left clicks.

I want to do this via terminal. May someone please suggest the command for it?

Is it possible to interchange these clicks at the login screen also? I am using Ubuntu 12.04.

xmodmap -e "pointer = 3 2 1"

in a terminal should work. If you want to run that command at the start of lightdm (the default login screen), you can edit /etc/lightdm/lightdm.conf like described here - use the xmodmap command instead of xbacklight in the script, of course.

Execute this code in command prompt, it will remove and reset Optical mouse and touchpad to default- left click is for clicking and right click is for options.

modprobe -r psmouse
modprobe psmouse proto=imps


How to remove kernel? I have installed two kernel version 3.10.48 and 3.17.6 for project. As I am not requiring 3.10.48 any more, I wanted to remove that version as it is taking up almost 10GB of my disk space. How should I go about it?

First boot the Kernel which you want to retain. Then use the below command to remove Kernel from your machine permanently,

sudo apt-get remove --purge $(dpkg -l 'linux-image-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d')

Hope this helps.


Trouble hosting a Minecraft server I've been trying to host a Minecraft server for some time now. I'm practically a complete beginner with Linux thus far, so you may have to explain things to me a bit. I was able to host servers on Windows in the past with relative ease. I'm hosting the server locally through a wireless router.

Through Google, I've done things involving uninstalling OpenJDK and installing Oracle's Java, doing something involving iptables, stopping the ufw service, updating LWJGL, and downloading Firewall software. Nothing has worked yet. I have 25565 forwarded. Neither me nor a friend are able to join via external IP, though I can connect through localhost. It says I'm connecting for some time, then gives me an error:

  Minecraft Version: 1.4.2
  Operating System: Linux (amd64) version 3.5.0-17-generic
  Java Version: 1.7.0_09, Oracle Corporation
  Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
  Memory: 396627816 bytes (378 MB) / 514523136 bytes (490 MB) up to 514523136 bytes (490 MB)
  JVM Flags: 2 total; -Xms512m -Xmx512m
  AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
  ModLoader: Mods loaded: 3 ModLoader 1.4.2 mod_MineLittlePony 1.4.2.3 Inventory Tweaks 1.44 (1.4.2)
  LWJGL: 2.8.4
  OpenGL: GeForce GTX 560 Ti/PCIe/SSE2 GL version 4.2.0 NVIDIA 304.43, NVIDIA Corporation
  Is Modded: Very likely
  Type: Client
  Texture Pack: Default
  Profiler Position: N/A (disabled)
  Vec3 Pool Size: ~ERROR~ NullPointerException: null   java.lang.NullPointerException
      at aww.a(SourceFile:57)
      at ayt.b(EntityRenderer.java:1149)
      at EntityRendererProxy.b(EntityRendererProxy.java:20)
      at net.minecraft.client.Minecraft.J(SourceFile:604)
      at net.minecraft.client.Minecraft.run(SourceFile:534)
      at java.lang.Thread.run(Unknown Source)

My friend doesn't get this error however, and instead gets a timeout message, so that's likely something on my end.

If there's any more information you need, I'll gladly supply it if I can.

For starters, there is a big chance those are two different issues

Your friend not connecting might be an incorrect port forward. Google around for a site that will do a port check on your IP (there are tons).

Your error is game client/java related. Verify that you have the correct java version installed (check the one your friend has, if it works for him) and install it like so:
How can I install Sun/Oracle's proprietary Java JDK 6/7/8 or JRE?

If that doesn't work try removing the mods? I haven't personally played minecraft (downvotes incoming i guess?) but that's one of the first things i'd try.

I think you just used the external IP. but you must log in with  How ever if you are on the same network as your server you can try to log inn with the internal IP from the server. for example: 10.0.0.347:25565
but i thing it doesn’t solve the crash error. But it can MABY be the RAM that is overloaded on your pc. (i am not an expert, but i have hosted some minecraft servers myself)


What PDF viewers are available for Ubuntu? Every second e-mail I get suggests to download Adobe Acrobat reader, but adobe.com doesn’t provide a Linux version.

Which PDF Viewer are there available for Ubuntu?
I’m fine with partial solutions, a perfect match however would not only display PDF files, but also be able to:

stageless zoom (not just predefined steps)
open files in tabs
display comments added with other PDF software
add and save comments
display forms filled in with other PDF software
fill in and save PDF forms
create and save bookmarks
have a presentation mode

Lightweight

evince - the default document viewer on Gnome/Ubuntu, with support for PDF, PostScript, and a few other formats. Can fill forms, highlight text, and annotate. Normal text selection. Remembers window size and document zoom. Dark mode. [install]

qpdfview (see answer) - tabbed interface, can fill forms, remembers window size and document zoom. Block selection by holding Shift. [install]

MuPDF - extremely fast and minimalistic. Block selection by dragging with the right mouse button, search with /. Can't annotate, fill forms, sign, or anything else. Doesn't remember the zoom factor, or the window size/position. [install]

Zathura - extremely fast and minimalistic (uses the MuPDF ending via a plugin system). Keyboard-navigation, bookmarks, auto-reload on changes. Block selection by dragging with the left mouse button. No form filling or other features. Doesn't remember the zoom factor, or the window size/position. [install]

xpdf - "Xpdf is a small and efficient program which uses standard X fonts". Lightweight, but with outdated interface. [install]

gv - an old lightweight pdf viewer with an old interface. Size of the package is only 580k. gv is an X front-end for the Ghostscript PostScript(TM) interpreter. [install]

Full-featured

okular - Multi-format document viewer (PDF, CHM, ePub, others). Requires many KDE prerequisites. Can easily copy text and images. May be slow and have issues with printing. [install]

Browsers like Firefox and Chromium derivatives also have great support for PDF viewing and form filling, but no support for annotations or signatures.

Non-FOSS

Foxit Reader - View, create, convert, annotate, print, collaborate, share, fill forms and sign.

PDF Studio Viewer - free version can annotate, fill&save forms. Paid versions can sign, OCR, split/merge/insert/remove/rotate pages, add watermarks/header/footer/bookmarks, edit, redact, compare, optimize, batch process etc.

Master PDF Editor - View, create, modify, fill forms, sign, scan, OCR, annotate, split/insert/remove/rotate pages, add bookmarks. Free version allows editing text and objects, annotating, and filling forms.

Unsupported/outdated

kpdf - Extremely outdated (2008) PDF viewer based on xpdf, for KDE 3. [install]
acroread - Adobe Acrobat Reader, no longer supported for Linux by Adobe, seems to be no longer supported by Ubuntu.


Eclipse Juno, need root access everytime I change the configuration I am trying to install eclipse Juno on 12.04. I did all the things instructed in this link.

But whenever I install any new software (Say CDT or Pydev) on Eclipse, the new softwares are gone upon opening the Eclipse app again. I then have to open Eclipse again with root privileges to install all the software.

I also ran into many problems with linking the include library for Eclipse CDT.

Can anyone help me with installing Juno in a way that I do not need root access every time I change configurations in Eclipse?

How to install Eclipse Juno WITHOUT the need to change permissions

First, remove all previous versions of Eclipse.  If you would like: save your /workspace directory (cut and post the entire directory into your ~/
Download Eclipse from their official website (I used "eclipse-mobile-juno-linux-gtk-x86_64.tar.gz") But like was stated earlier, make sure that you have 32 and/or 64 bit versions of java available to match your Eclipse install. (I have BOTH openjdk-6 and -7-jre installed from Synaptic Package Manager)

You can add package pieces later if the eclipse-mobile installation doesn't contain everything you want. For example, Linux Tools here.
Other package instructions are available from the download page, via the links on the left.

To avoid permissions issues, I unpacked it to ~/bin and archive manager put Eclipse into its own 'eclipse' subdirectory there.
Download the Android SDK, and so that future upgrades of Eclipse and Ubuntu don't break it, unpack it to ~/bin/eclipse/dropins.
Developer.android.com instructs you to:

  On Mac or Linux, open a terminal and navigate to the tools/ directory
  in the Android SDK, then execute android sdk.

However, when I downloaded the linux version of Android SDK, there was no file "android sdk."
Instead, navigate to to the tools path (in my case ~/bin/eclipse/dropins/android-sdk-linux/tools) and [right-click] on "android" to change its properties to executable.

Now you can double-click to run android, and download the packages you like.

Since everything is in your home directory, you don't need to modify your PATH environment variable (as per the developer instructions).

Download and install the ADT plugin from http://developer.android.com/sdk/installing/installing-adt.html as per the normal instructions.

Configure the plugin with the path used, in this example /home/clayton/bin/eclipse/dropins/android-sdk-linux
If you want to install more packages from step-8 after step-9, from the Eclipse drop-down menu choose Window > Android SDK Manager

Navigate to ~/bin/eclipse and make sure you mark "eclipse" as executable as well (see step 7 for a refresher). [Right-click] and [Make link].  Move this shortcut to the desktop.

I went to the extra step of changing the icon for eclipse to the provided "icon.xpm" in the same subdirectory.

From step 1, move your "workspace" directory...or don't.  But specify it as your application workspace in the dialog and you'll be able to import any existing projects with ease (those instructions would be for a different Q&A).

Generally, these contains source files and as far as I know you'll have to manually install them using the commands.

        Ubuntu software center can install only packaged files(i.e ".deb").

        Ubuntu software center can't install the source files that you have mentioned.


User in sudo group cannot use sudo command I have a user, supersecretuser, that is in the sudo group, but doesn't have sudo access. Is there something else that needs to be done to give this user sudo access?

$ ssh supersecretuser@myserver
supersecretuser@myserver:~$ groups
supersecretuser adm cdrom sudo dip plugdev lpadmin sambashare
supersecretuser@myserver:~$ sudo vim install.sh
[sudo] password for supersecretuser:
supersecretuser is not in the sudoers file.  This incident will be reported.

supersecretuser is the user we setup when doing the Ubuntu install.

Since you error message says your user is not in the sudoers file, could you please check your /etc/sudoers file, see if there is such a line:

%sudo   ALL=(ALL:ALL) ALL

If this line is missing, users in the sudo group will not be sudoers.  Edit the file using visudo command (checks for correct synthax and locks the file).

You can also try to add a customized line like this:

root    ALL=(ALL:ALL) ALL

Replace root with your username, reboot, and try if it works.

After you have checked that file privileges are right:

-r--r----- 1 root root x x x x:x /etc/sudoers

You most probably have lost the s-bit on file executable, it should read:

-rwsr-xr-x 2 root root x x x  x /usr/bin/sudo

if it doesn't: with root privileges give `

chmod u+s /usr/bin/sudo

and you
should be okay.. unless you know you have altered the sudoers file yourself! :)


How to download skyrim from steam and play on ubuntu I recently bought Skyrim on Steam and did not know that it can only be played on Windows. I was wondering how can I play Skyrim on my Ubuntu computer?

There is a project called PlayOnLinux that works to automatically setup many games devloped for Windows, to be played on Linux with minimal hassle.

You can get the program via the repositories using the command sudo apt-get install playonlinux or from the website playonlinux.com.

Once PoL is installed you can run the program. To install a game, click the button on the right-hand sidebar that says "Install a program". Once in that menu just use the search bar to find "The Elder Scrolls V : Skyrim", click to install. This will automatically download the version of WINE that is known to work with Skyrim as well as install Steam on the virtual drive, if you so select.

The installation may throw an error, but they usually provide you with information on how to fix it, commonly in the form of a link to a "How to fix problem X" type page. Just follow the prompts and it should work.

Alternatively, you can download and install it from playonlinux.com.

You just have to download the fresh version of Steam of Linux.

Just to let you know, before the release of Steam for Linux you would have to go through a non trivial process installing the Steam for windows version to Linux via Wine.

EDIT: Since Skyrim is not yet available, you would have to install it using wine. You could take a look here.


Multiple deployments, one machine, how to expose them all In juju, if you were to create multiple wordpress (or any other) deployments on the same machine, how would you set that up such that all of those sites could be simultaneously exposed while being viewable?

At this time there is no easy way to do this. There is some container support in Juju but network addressability issues still exist. In the near future you'll be able to deploy multiple charms to a single machine using either LXC or KVM containers.

You could fork the WordPress charm and add WordPress Multi User support. It's on the roadmap for that charm but progress is slow.

Unfortunately I don't know a lot about Juju specifically, but I suspect something like this may be possible:

wordpress1 deployed and listening on local port 8001
wordpress2 deployed and listening on local port 8002
wordpress3 deployed and listening on local port 8003

These sites would then be proxied to the outside world by something like Apache using name-based virtual hosts. Assuming you have only one routable IP address, you'd then set up Apache to listen on that IP and expose a reverse proxy in such a way that clients requesting wordpress1juju.com are connected to the server running on 8001, etc.

Someone with Juju experience would likely know how to do this sort of thing in more detail.


Mkvirtualenv: command not found 19.04 Trying to install Django Framework. This when I am trying to activate an virtual environment for the very first time:

mkvirtualenv test
mkvirtualenv: command not found

Location of the installation:

which virtualenvwrapper.sh
/usr/local/bin/virtualenvwrapper.sh

Update from research
I didn't use sudo when installing.
Here is tutorial one and tutorial two.

you use python3, but virtualenv uses python2 by default. So you need to modify it.

Add the following sentence at the end of the '~/.bashrc',to modify the default python and configure virtualenv：

VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3
export WORKON_HOME=~/.environments
source /usr/local/bin/virtualenvwrapper.sh

and then reload this configuration file with the command：

source ~/.bashrc

I needed to change the command to mkdir and follow different steps.


Do I need to have antivirus software installed? I thought that there was no need to scan for viruses either in Ubuntu or any Linux distros until I found virus scanner packages clamtk and klamav in Ubuntu software center yesterday.

This leads to the following questions:

How do viruses differ between Linux and Windows?
How do the strategies for protection differ between Linux and Windows?
Should a virus scanner package be installed on my system? If so, which would be a better option?

There are viruses for most all platforms (the first worm was for DEC VAX) , they are just more common on Windows.  Different platforms are more secure than others, but a virus can typically gain user level security, which is often good enough, on most platforms.  You can actually run Windows without a virus scanner if you keep it patched and are really careful.

Differences from Windows to Linux for viruses: On Linux it is harder for the virus to get root (or system) level access.  But it could probably still access your address book or saved passwords in Firefox (user level access).

Strategy: If you are really careful and know what you are doing you can get away without a scanner.  A good strategy is to have your scanner just scan downloads or if you are bringing a file from another computer on a USB drive or floppy disk (assuming you have one).  If you want you can have it do regular full system scans too.  It is all about how paranoid you are, and how likely you are to get a virus.

For your laptop I would suggest only having the scanner scan downloads and when you are brining files from another computer.  Having it do full system scans can be a battery drain.

A very important element of a virus scanner is having it updated with new signatures, so pick the package that has the best signature updates, and that works best for how you want to use it.

All software platforms need virus protection. However the majority of viruses are written for Windows and will not affect Linux. However, there is till the potential of cross-platform type viruses (Flash, Java PDF, etc) that can still do some damage on any system. Also, Linux can be a "carrier" and still spread viruses by e-mail or flash memories without you knowing about it because it had no effect on you. Therefore, I recommend installing Clam (Gnome) or Klam (KDE). This does not run in the background and needs to be updated and run manually about every week or so.


Terminal output scrolling is gone (Headless 11.10 Server, Upgraded from 10.10) I recently upgraded a 10.10 server (headless, EC2) to 11.04 and then to 11.10. Both upgrades seem to have worked, but now my terminal acts differently, particularly concerning output scrolling. I am accessing this server via Terminal on a 11.10 Desktop (GNOME fallback).

10.10 Behavior:

A scroll bar is displayed on the right side of my Terminal, allowing me to scroll back to older output
Turning the mouse wheel scrolls back to older output

11.10 Behavior:

No scroll bar is visible
Turning the mouse wheel cycles the current line through my command history (same as UP key)

This is a difficult issue to describe succinctly and I've had no luck finding any information about this. But I've performed the same upgrade several times (10.10->11.10) and the result is always the same concerning Terminal scrolling. Output scrolling is very important to me and something I take for granted - I'm concerned I'll be unable to work effectively on this server until I resolve this.

Update - Problem magically gone after logout/login
Well, as I said I've done the same upgrade several times and encountered the same problem. However, in the previous tries I was scared away and gave up. This time I was more determined to finish the upgrade and by simply logging out and back in to the server via SSH the problem has corrected itself.

The behaviour you describe sounds like your terminal was stuck in the full screen "cursor addressing" mode used by tools like less and vi.

The mode can become stuck if those programs do not exit cleanly.  For instance, if you kill -9 them, or are running them through an ssh session that disconnects.  You can exit this terminal mode by running the following command:

tput rmcup

Or just try browsing a file with less and quit as normal.  You should then have access to your scrollback and the contents of the screen when cursor addressing mode was entered.


Unable to use nvidia card I have dual graphics Intel 520 integrated and nVidia 930MX dedicated. I'm running 20.04.2 and installed nvidia-driver-460 through Additional Drivers, and intel-media-va-driver-non-free through terminal. Currently I'm only getting display (and successful boot) on intel GPU. After I run sudo prime-select nvidia and reboot, I'm no longer able to boot, and have to revert to intel through TTY. Running nvidia-smi gives following error:
NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.

The nvidia-xconfig generates a xorg.conf in which the 'Files' section is empty.
nvidia-settings gives error:
ERROR: NVIDIA driver is not loaded
ERROR: Unable to load info from any available system
(nvidia-settings:10549): GLib-GObject-CRITICAL **: 18:16:11.739: g_object_unref: assertion
'G_IS_OBJECT (object)' failed
** Message: 18:16:11.749: PRIME: Requires offloading
** Message: 18:16:11.749: PRIME: is it supported? yes
** Message: 18:16:11.857: PRIME: Usage: /usr/bin/prime-select nvidia|intel|on-demand|query
** Message: 18:16:11.857: PRIME: on-demand mode: "1"
** Message: 18:16:11.857: PRIME: is "on-demand" mode supported? yes

Running whereis nvidia gives:
nvidia: /usr/lib/x86_64-linux-gnu/nvidia /usr/lib/nvidia /usr/share/nvidia /usr/src/nvidia-460.73.01/nvidia

So driver is installed but not loading. How to get the driver working? I'd like to retain intel as well.
EDIT: running sudo prime-select nvidia, reboot with nomodeset, then running nvidia-smi from TTY (because there is no GUI) gives following output:
Tue May 25 18:33:17 2021
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 460.73.01    Driver Version: 460.73.01    CUDA Version: 11.2     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  GeForce 930MX       Off  | 00000000:01:00.0 Off |                  N/A |
| N/A   39C    P8    N/A /  N/A |     10MiB /  2004MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A      1063      G   /usr/lib/xorg/Xorg                  6MiB |
|    0   N/A  N/A      1292      G   /usr/bin/gnome-shell                2MiB |
+-----------------------------------------------------------------------------+

That shows nvidia driver is loading and working, but why the GUI isn't working is beyond me.
EDIT 2: running nvidia-settings and selecting any graphics from PRIME profiles results in Segmentation fault.

The answer posted by Celebre Asm worked for me.
First remove all the occurrences of xorg.conf and xorg.conf.old from /etc/X11/.
Then run inxi -Fxzc0 and note down the BusID of your GPUs. In my case intel was 00:02.0 = 0:2:0 and nvidia was 01:00.0 = 1:0:0.
Then create a xorg.conf.d folder, make 20-intel.conf file inside it with following content:
Section "Device"
    Identifier  "Intel Graphics"
    Driver "intel"
    Option "AccelMethod" "sna"
EndSection

And 90-nvidia.conf file with following content:
Section "ServerLayout"
    Identifier "layout"
    Screen 0 "iGPU"
    Option "AllowNVIDIAGPUScreens"
EndSection

Section "Device"
    Identifier "iGPU"
    Driver "modesetting"
    BusID "PCI:0:2:0"
EndSection

Section "Screen"
    Identifier "iGPU"
    Device "iGPU"
EndSection

Section "Device"
    Identifier "dGPU"
    Driver "nvidia"
    BusID "PCI:1:0:0"
EndSection

Additionally I removed xserver-xorg-video-intel because somehow I was getting  rectangles diagonally drawn on desktop and unreadable fonts, and removing it solved that.
Reboot.
**Footnote: This mess happened because I tried to boot my laptop using nvidia to use VDPAU. As of now, GM108 series of nvidia GPU doesn't have decoding support, and offloads decoding to intel counterpart. Everything was smooth as long as I didn't change "on-demand" option which was default since I first installed Ubuntu.

hesitate to ask this but...
you probably have two different slots on the back of your computer if it is a desktop, one for the intel graphics on your motherboard, and another where your nvicia card is slotted in.  You cannot run the nvidia one if you are only plugged into the one on your motherboard.  Does this make sense to you?


VLC player displaying a file with tilde I am using a VLC player for playing music and when I open the music directory in it, it shows all my directories in the music folder on my disk plus one additional file called song~. This file is not contained in my directory and I cannot remove it from VLC either. Does anyoen know what is it and how to remove it from the list?

It is in your directory, it is just a hidden file. If you are using Nautilus: find the folder, press Ctrl+H then simply delete it.

it's not necessary to delete it, it might be a codec for playing songs or hiden file within your folder (probably a hidden file)


RDP like tool on Ubuntu Just migrated from Windows to Linux. Now I'm on Ubuntu 14.04 x64.
My work requires to manage multiple servers with Windows on board, so I create many RDP connections.
Often I need to connect to PC placed in my workplace from Windows PC at home. When I was on Windows I used RDP for this.
But on Linux it became more difficult. I need RDP like tool which will help me to connect from Windows to Linux and solve problems in list below:

GUI, console is not enough because of reason above
connect to workplace PC in same session as I leave it
prevent anybody to see what I'm doing

I already tried:

x11vnc. Nice but I can't find the way to block local display and input devices
xrdp. Good but it does not support 3d desktops and I have problems to use keyboard in xrdp session
nomachine. Same as x11vnc.

Is there way to get what I need?

UPD. The best solution I could find for today described in this video tutorial. Best but not ideal.

The answer to your problems is remmina.

You should install this package first. After that start the GUI and create as many connection profiles you need using RDP protocol choice.

Good luck and let us know how it works for you!

you can use rdesktop install that package and run below command syntax

$ rdesktop -g 1400x1000 < remotehostname > or < IPADDress >


How do I overcome this "group 'libvirtd' does not exist" issue in installing juju? I'm trying to install juju on local environment. For that I installed Ubuntu Server 12.10 and I followed this juju Getting Started tutorial. At the step where I run the following command:

sudo usermod -a -G libvirtd <YOUR_USER>

The error is reported:

usermod : group 'libvirtd' does not exist

Does someone have ever had this problem and can help me?

You don't need to run this command. The guide states:

  pre v0.6 users only Then you need to add yourself to the libvirtd group:

sudo usermod -a -G libvirtd <YOUR_USER>

As Ubuntu 12.10 provides juju version 0.6, this does not apply.

To explain a bit more on the error you got, the libvirt-bin package (the base of Libvirt basically) will create this system user group for you. Because you don't need to install this for 0.6 version of Juju, it's not installed and you'll get the error about the group specified not being a valid existent group. The command is listed for pre-0.6 versions and the guide also lists this package to the lists of packages to install for these older versions.

log in as root using this command su -
than use the command  adduser  libvirtd
after that for checking it try the same cmd with same user name if it already added you than it will show you "The user your user name' is already a member oflibvirtd'."


How do I set up a Cron job? I want to schedule a task to run on a regular basis and have heard that Cron is the way to do this.

How do I add Cron jobs in Ubuntu?

Put a shell script in one of these folders: /etc/cron.daily, /etc/cron.hourly, /etc/cron.monthly or /etc/cron.weekly.

If these are not enough for you, you can add more specific tasks e.g. twice a month or every 5 minutes. Go to the terminal and type:

crontab -e

This will open your personal crontab (cron configuration file). The first line in that file explains it all! In every line you can define one command to run and its schedule, and the format is quite simple when you get the hang of it. The structure is:

minute hour day-of-month month day-of-week command

For all the numbers you can use lists, e.g. 5,34,55 in the minutes field will mean run at 5 past, 34 past, and 55 past whatever hour is defined.

You can also use intervals. They are defined like this: */20. This example means every 20th, so in the minutes column it is equivalent to 0,20,40.

So to run a command every Monday at 5:30 in the afternoon:

30 17 * * 1 /path/to/command

or every 15 minutes

*/15 * * * * /path/to/command

Note that the day-of-week goes from 0-6 where 0 is Sunday.

You can read more here.

Considering you have multiple cron jobs with particular user and they don't share same schedule. You can just simple create file under /etc/cron.d/
Lets say file name is myjobs then just write all your schedulers in that file and then run following command.

crontab -u <username> /etc/cron.d/myjobs


What is the difference between "systemctl start" and "systemctl enable"? I installed MariaDB-server to my machine. While setting up I met with a problem whether I have to enable it all the time as the document I follow is given with these steps,

sudo yum install mariadb mariadb-server
sudo systemctl start mariadb.service
sudo systemctl enable mariadb.service

systemctl start and systemctl enable do different things.

enable will hook the specified unit into relevant places, so that it will automatically start on boot, or when relevant hardware is plugged in, or other situations depending on what's specified in the unit file.

start starts the unit right now.

disable and stop are the opposite of these, respectively.

This means that when you first install MariaDB, you might want to run systemctl enable mariadb.service to enable it so it starts on boot. You might also want to run systemctl start mariadb.service, or just reboot, in order to start MariaDB. To stop MariaDB, run systemctl stop mariadb.service (it will start again on next boot or when you manually start it). To disable it so it doesn't start on boot anymore, run systemctl disable mariadb.service.

Source: systemctl man page

As of systemctl version 220, enable and disable support a --now switch to start / stop services concurrent with the enabling / disabling.

e.g. systemctl --now enable foobar.service

Use systemctl --version to check your installed version.


How can I get an iso image to boot from Ubuntu 16.04 grub 2 menu? I'm trying to boot Macrium Reflect backup iso. Based on my current configurations, it tries to load, but it just reboots.

I have installed Memdisk and the iso file is located under etc\images. The iso boot up worked when I used Ubuntu 15.04 so I know that did not change.

These are the configurations setting for the menu option (I'm using the Grub Customizer):
Macrium Reflect Rescue Boot

set root=(hd0,1)
set isofile="/boot/images/Rescue.iso

loopback loop /boot/images/Rescue.iso

linux (hd0,1)/boot/memdisk iso raw

initrd (hd0,1)/boot/images/Rescue.iso

I've tried multiple things but nothing has worked his point, if someone can help me I sure would appreciated it.

Power on you PC while continuously pressing the appropriate function key for your model to bring up the BIOS menu. In Lenovo it is F2, in Hp it is F12.

Go to BOOT tab by using right arrow key

Select Macrium Reflect by using down arrow key

Press F6 as many times as needed so that Macrium Reflect moves to the top of other BOOT options.

Press F10. A pop up box appears. Yes is selected by default. Press Enter.

Your PC will reboot and will now boot into Macrium Reflect


Tomcat shartup.sh command says permisison denied I have set CATALINA_HOME in ~/.bashrc file but on running

$CATALINA_HOME/bin/startup.sh

command it produces output like:

bash: /home/ravinder/Java_Folder/Important_Programs/Servers/Tomcat7/bin/startup.sh: Permission denied

Any help would be of great help.

This error is due to wrong file permission and may be due to two reasons:

the file is not executable or
the user does not have privileges to run

In order to check try:

  ls -l /home/ravinder/Java_Folder/Important_Programs/Servers/Tomcat7/bin/startup.sh

If file is not executable fix it with:

  chmod +x $CATALINA_HOME/bin/startup.sh

Or you could execute:

  bash $CATALINA_HOME/bin/startup.sh

If your user doesn't have right privilege, for example file is executable only by root user, try this:

  sudo $CATALINA_HOME/bin/startup.sh

This latter case, it should not happen if tomcat has been installed properly and you should avoid running a web server with root privileges mainly for security reasons.

just run chmod -R 777 {path to the bin directiry}, this will assign permissions to all sub-items of the bin directory.


How do I create a 32-bit WINE prefix? How do I create a 32-bit Wine prefix on Ubuntu 12.04 64-bit?

To create a 32-bit WINE prefix on a 64-bit Ubuntu system, you need to open a terminal and run the following command:

WINEPREFIX="$HOME/prefix32" WINEARCH=win32 wine wineboot

Where WINEPREFIX is the directory for the prefix
This directory must not already exist or you will get an error! Please do not manually create it in Nautilus or with mkdir./

After erasing .wine32, installing the .NET 4.0 with the command $ WINEPREFIX=~/.wine32 winetricks dotnet40, worked for me.

kudos Antonio


Ubuntu 12.10 upgrade stopped halfway through While upgrading from 12.04 to 12.10 the upgrade crashed while installing the upgrades.
It stopped while "configuring python3-aptdaemon.gtk3widgets" and the terminal says flashplugin-installer: downloading then shows the url for the flash plugin that its downloading.

I think it stopped working because my internet connection is a bit patchy, and it probably failed while downloading the installer, but what can I do to make it get going again?

You can give a try to fix your problem using Recovery Mode if none of the method works for you. If you are using wired connection then no problem, for wireless connection I'm not sure whether it will work or not, because I never tried to enable network in Recovery Mode when using wireless connection. Although you can give it a try.

When your system starts chose Recovery Mode (2nd option in grub menu).
From the Menu just go to Grub option, it will give a message like Updating grub will mount your system in read/write mode. Just chose yes to mount your system in read/write mode. It will update your grub and will exit from Grub menu.
chose network option it may enable your network.
Then chose dpkg menu from the list, chose yes for all.
Finally chose root option and login. Execute following commands one after another:

# apt-get autoremove
# apt-get autoclean
# apt-get update
# apt-get -f install
# apt-get dist-upgrade
# apt-get upgrade

Then reboot your system and check whether your issues are fixed or not. Run this command to reboot:

# reboot

Reply if something goes wrong.s

Keep in mind that upgrading to new release can take a long time depending on files and settings you have. There was a bug with python 3 with me upgrading to 12.10 while it was in early beta. If you decide to stop upgrade process i would try intalling aptitude cause it works better with dependencies then apt-get and finish upgrading

sudo apt-get aptitude  and run  sudo aptitude safe-upgrade

Also try

`sudo apt-get update -f && sudo apt-get upgrade -f

And

sudo apt-get dist-upgrade && sudo apt-get -f install

When upgrade failed for me once i booted to restore system mode in grub menu and after  enabling network i fixed broken packages for upgrade to finish its process and everything worked fine


How can I type a Unicode character (for example, em-dash —?) The title pretty much says it all: how can I type Unicode characters - specifically the em-dash —?

Ctrl+Shift+U, then 2 0 1 4 and Enter

or

Ctrl+Shift+U+2014

Control-capital-u means Unicode, and the four-digit hexadecimal number for em dash (or any other Unicode character) can be found via the Character Map in Ubuntu (gucharmap).

The first option allows you to separately type the correct digits for your character, which appears upon hitting Enter or Space. You can also edit the numbers you typed using backspace before pressing Enter.

If this shortcut doesn't work check if your input method is iBus.

To get xmodmap to run on startup in Ubuntu 12.10, Go to Dash Home. Type in Startup. Click on Startup Applications. Click Add. In the "add startup program" window, give it a name. In the command box, enter: xmodmap -e "keycode 94 = emdash ellipsis"

Then, click on Add. You'll see the program name you just gave this under startup applications. Close the windows. The command will run the next time you start the computer. (I just spent a week and many hours reading these posts here and finally figured it out on my own.) This might not be the best way to do this, but it works.


static ip network guide I have a fresh install of 13.10 and my networking works fine (cable model cloud router) via the standard network manager applet.

I'm trying to setup my box to a use static IP instead of dhcp and I'm trying to use your guide:
https://help.ubuntu.com/13.10/serverguide/network-configuration.html#ip-addressing

Basically, the settings via the networking applet seem to be conflicting with what I see on the command line.

a) The ifconfig -a shows eth0 with the inet address assigned via dhcp.

ifconfig -a

eth0      Link encap:Ethernet  HWaddr 44:87:fc:97:ed:24
      inet addr:192.168.1.100  Bcast:192.168.1.255  Mask:255.255.255.0
      inet6 addr: fe80::4687:fcff:fe97:ed24/64 Scope:Link
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:61170 errors:0 dropped:0 overruns:0 frame:0
      TX packets:41321 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000
      RX bytes:79517729 (79.5 MB)  TX bytes:4735861 (4.7 MB)

lo        Link encap:Local Loopback
      inet addr:127.0.0.1  Mask:255.0.0.0

.....
.....

b) However, the interfaces file does not have even eth0 defined.

cat /etc/network/interfaces
auto lo
iface lo inet loopback

c) I could not even do:

sudo ifdown eth0
ifdown: interface eth0 not configured

How is this possible or what am I basically missing ?
Will the steps in the link above for configuring a static IP work ?

Thanks,
Dinshaw

The instructions you have linked are for servers where Network Manager is not installed. In such cases, manual methods, in part /etc/network/interfaces, are the methods used to set up networking. On the other hand, in a desktop installation, one with the networking applet, Network Manager controls networking, not manual methods.

In such cases, in order to set a static IP, right-click the applet, also known as the Network Manager icon and select Edit Connections. Edit eth0, in your case, and select IPv4. Change the method to Manual. Fill in your selections and don't forget DNS nameservers. In most cases, the address of the router is sufficient for DNS. Also, be sure to use a static IP address outside the range used by the router for DHCP.

Please see: http://3.bp.blogspot.com/-zXKEt3vxNg4/T58h-Cm1HJI/AAAAAAAAAjs/uOC0tCLcS4w/s1600/ScreenHunter_02%2BApr.%2B30%2B16.37.gif

you need to set up a bridged connection at /etc/network/interfaces
Eg.

uto br0
iface br0 inet static

    address 192.168.0.10
    netmask 255.255.255.0
    broadcast 192.168.0.255
    gateway 192.168.0.1
    bridge_ports eth0
    bridge_stp off
    bridge_maxwait 5

Hope that helps
Larry Keenan


Ubuntu One file corruption I tar ~/Documents to create a backup and my .tgz file turns out to be about 683 MB.  I allow my Ubuntu One upload speed to be about 2.5 Mb/s.  The sync takes several hours.  My Power Management setting is "never suspend".  I might on some occasions reboot Ubuntu in the middle of the sync in order to switch to Windows to print a file since Ubuntu does not have a driver for my printer.  I get no complaints so this seems like a permissible operation.  After the sync completed I downloaded the file from the Ubuntu One website.  Strangely the file is now 619 MB and using the diff utility I can see a message that says the binary files are not identical.

Double-clicking the downloaded .tgz file opens the Archive Manager and I get this:

gzip: stdin: unexpected end of file
tar: Unexpected EOF in archive
tar: Error is not recoverable: exiting now

How did this file get corrupted?

I might on some occasions reboot Ubuntu in the middle of the sync

I think this will be the answer. Also, uploading a big file instead of a bunch of small files is more dangerous. I think you should drop the creating a compressed archive part, and just set Ubuntu One to synchronize your ~/Documents folder.

Alternative solution

I have read an issue in the comments to this question that the files should be revised between two occasions (version control). One way would be setting up a version control system, but that is a big amount of hassle for home usage.

So, if you wish to keep revisions of files, but to use a solution that does not compress the files, you can have a small file to create a copy of your Documents folder with an added timestamp, and let that folder (as the folder uncompressed) synced to Ubuntu One.

But if the size of the folder is big, this download causes too much write on the system (not very good for SSD-based storages) and increases latency. I'm not sure how Ubuntu One treates symbolical links, though... If symbolical links are treated as copies of the file (so the original content is uploaded, not the link inode), you can just create symlinks.

I have had problems with 5-6 MB zip files being corrupted by Ubuntu One. I create a ZIP in Windows, add them to an Ubuntu One folder in Linux and download the zip on another Windows machine. Corrupt file.

So, instead, I copy the zip from the Ubuntu One folder to a USB stick and open the the zip on the second Windows machine and it's OK. So the difference is the upload to Ubuntu One (via the Ubuntu One software in Ubuntu) and the download from the Ubuntu One website, using Internet Explorer.

The problem has happened two times to me, with similar files involved.

In your case, does the web site report the size 619 MB or 683 MB? This could indicate if the problem is caused during upload or download. If it reports 683 MB, then maybe it's worth trying a different browser to download with.


CPU stuck in energy save mode A few days ago, my computer started feeling very slow, and looking a CPU usage, I saw that even the simplest processes required a lot of CPU.

As far as I can tell, it's because the core are all down-clocked to 800Mhz, and won't up-clock again when it's needed.

$ cat /proc/cpuinfo | grep MHz
cpu MHz     : 800.000
cpu MHz     : 800.000
cpu MHz     : 800.000
cpu MHz     : 800.000

As a test, I then start up BOINC, to load all my cores to the max, using htop, I see all cores running at > 95%.

My cpu scaling settings:

$ for governor in $(ls /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor); do cat $governor; done
ondemand
ondemand
ondemand
ondemand

With 'ondemand, I expect the core to clock up, and go to full power, but a watch shows them steady on 800.

To get better performance, I need to manually force it:

sudo bash -c 'for governor in $(ls /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor); do
  echo"performance" > $governor;
done'

Whch immediately changes the frequency to:

$ cat /proc/cpuinfo | grep MHz
cpu MHz     : 2701.000
cpu MHz     : 2701.000
cpu MHz     : 2701.000
cpu MHz     : 2701.000

cat /proc/cpuinfo | grep MHz (or grep MHz /proc/cpuinfo) will only show you the standard clock speeds.

If you want live CPU frequency settings, you need something a little beefier. I know powertop works but for a something convenient all the time, indicator-cpu could be worth it:

sudo apt-get install indicator-cpufreq
indicator-cpufreq

You'll need to add indicator-cpufreq to the things to run at start-up, or you'll have to run it manually each login.


How to stay productive? What time management software is available? So since I started using askubuntu.com I've spent entirely too much time here answering other people's questions. Now maybe someone could help me with that by answering this one. I'm looking for time management software for Ubuntu.

There are a number of these programs floating around for Windows. RescueTime is one that is very popular. The key features that I'd like to see in a linux app that RescueTime has are:

Automatically records what application you are using, including what websites you visit.
Reports and graphs on your time usage.
Notifications for when you have spent too much time on "distractions."

While RescueTime doesn't officially support linux, there is an open source RescueTime Linux Uploader. Unfortunately, it seems to only support Firefox and Epiphany for website tracking. I'm a Chromium user.

The other major drawback to RescueTime is that it is a web service. I'd much rather not upload detailed information about how I spend my time to some third party. Google already knows too much about me as it is.

Project Hamster, a GNOME time management app, comes so close. Sadly, it does not automatically track what you are doing. If I had enough discipline to manually report to an applet what I was up to, I doubt I'd need this. (How cool would it be if they provided some Zeitgeist integration to handle that part?)

Hamster doesn't automatically track your actions, but it can be set to remind you every few minutes, which I actually find more useful.  You can ask yourself every n minutes "am I still doing what I was planning to do?", "should I stop now?", "why am I not doing what I planned to be doing?"  Then you can change course right away, rather than at the end of the day finding you spent three hours on askubuntu. :-)

Ultimately I want to develop more mindfulness of where I'm using my time, and these questions help.

Hmm...

Automatically records what application you are using, including what websites you visit.
Reports and graphs on your time usage.

Why you not using zeitgeist?


Ubuntu 14.04 installation issues on Dell poweredge 1950 using bootable USB I have a Dell poweredge 1950 server currently having windows 2008 server edition on top. The BIOS version that I currently have is 2.7.0. The system possesses SAS hard drives.

I am trying to install Ubuntu 14.04 desktop edition erasing windows using a bootable USB.

I see that I am able to select the USB to allow for the installation but the process seems stuck once I have selected the USB device. I am not able to proceed any further and only a Alt+Ctrl+Del seems to work.

As part of debugging the issue, I tried using both the rear and front USB ports. The USB drive was made using the startup disk creator from another Ubuntu machine. I ran into the same error while trying to install Lubuntu 14.04 made using a different ISO which seem have installed properly on a different machine. Thus I suspect there is some incompatibility with the existing hardware.

Is there some incompatibility with Ubuntu 14.04 and 1950? I did read that Ubuntu has been certified on the 1950 but dont seem to understand what is causing the issue.

Any help appreciated.

You need to go into the BIOS and change a setting on the usb boot option, so that the bios emulates it as a harddrive, it will then show up as C: to the installer. And when you select boot device you choose to boot from a harddrive with the name of your usb stick.


Build with clang for older ubuntu releases So the problem started as I lately updated my Ubuntu Vivid (15.04). Now clang-3.5 depends on libstdc++-4.9 (instead of previous version of 4.8) and my compiled programs fail to run on Trusty (14.04):

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

Both on the development machine and target machine g++ and gcc version 4.8.4 is installed. But the new clang version adds a version dependency required from libstdc++6 on GLIBCXX_3.4.20 which only exists on the development and not the target machine.

Any ideas how to solve this problem?

UPDATE:

There is a solution here suggesting to statically link to libstdc++ and there is good read here investigating pros and cons of such approach. But are there any other possibilities?

In case your problem has not been solved yet, I can suggest two options aside from static linking:

Bundle all libraries required with your apps and set up LD_LIBRARY_PATH and/or rpath for your binaries.
If you're developing server-side apps, shipping those as Docker images inherited from Ubuntu Vivid may also be an option.


Difference between systemctl and service commands systemd gives us the systemctl commands suite which is mostly used to enable services to start at boot time. We can also start, stop, reload, restart and check status of services with the help of systemctl.

We can do, for example, sudo systemctl enable service_name, and service_name will automatically start at boot time. We can also disable services not to start at boot time.

Is the only difference between the service and systemctl commands that systemctl can be used to enable the start of services at run time? Can we use systemctl on any service? What other significant differences are there?

The service command is a wrapper script that allows system administrators to start, stop, and check the status of services without worrying too much about the actual init system being used. Prior to systemd's introduction, it was a wrapper for /etc/init.d scripts and Upstart's initctl command, and now it is a wrapper for these two and systemctl as well.

Use the source, Luke!

It checks for Upstart:

# Operate against system upstart, not session
unset UPSTART_SESSION
if [ -r "/etc/init/${SERVICE}.conf" ] && which initctl >/dev/null \
   && initctl version 2>/dev/null | grep -q upstart \
   && initctl status ${SERVICE} 2>/dev/null 1>/dev/null
then
   # Upstart configuration exists for this job and we're running on upstart

If that doesn't work, it looks for systemd:

if [ -d /run/systemd/system ]; then
   is_systemd=1
fi

...

# When this machine is running systemd, standard service calls are turned into
# systemctl calls.
if [ -n "$is_systemd" ]
then

And if that fails as well, it falls back to System V /etc/init.d scripts:

run_via_sysvinit() {
   # Otherwise, use the traditional sysvinit
   if [ -x "${SERVICEDIR}/${SERVICE}" ]; then
      exec env -i LANG="$LANG" LANGUAGE="$LANGUAGE" LC_CTYPE="$LC_CTYPE" LC_NUMERIC="$LC_NUMERIC" LC_TIME="$LC_TIME" LC_COLLATE="$LC_COLLATE" LC_MONETARY="$LC_MONETARY" LC_MESSAGES="$LC_MESSAGES" LC_PAPER="$LC_PAPER" LC_NAME="$LC_NAME" LC_ADDRESS="$LC_ADDRESS" LC_TELEPHONE="$LC_TELEPHONE" LC_MEASUREMENT="$LC_MEASUREMENT" LC_IDENTIFICATION="$LC_IDENTIFICATION" LC_ALL="$LC_ALL" PATH="$PATH" TERM="$TERM" "$SERVICEDIR/$SERVICE" ${ACTION} ${OPTIONS}
   else
      echo "${SERVICE}: unrecognized service" >&2
      exit 1
   fi
}

...
run_via_sysvinit

Since the service command is a fairly simple wrapper, it only supports a limited subset of actions compared to what the actual init system might provide.

For portability over various versions of Ubuntu, users can reliably use the service command to start, stop, restart or examine the status of a service. For more complex tasks, however, the actual command being used, be that initctl or systemctl or the /etc/init.d script might have to be used directly.

Further, being a wrapper, the service script in some cases also does more than the direct equivalent command might do. For example:

It always executes /etc/init.d scripts in a clean environment. (Note the long env command invocation in the run_via_sysvinit function above.)
It maps restart on Upstart systems to a combination of stop/start, since a plain initctl restart will error out if the service isn't running already.
It stops sockets when stopping systemd services which have associated sockets:

case "${ACTION}" in
  restart|status)
     exec systemctl $sctl_args ${ACTION} ${UNIT}
  ;;
  start|stop)
     # Follow the principle of least surprise for SysV people:
     # When running "service foo stop" and foo happens to be a service that
     # has one or more .socket files, we also stop the .socket units.
     # Users who need more control will use systemctl directly.

Upstart services were enabled directly in the service configuration file (or disabled via overrides), and System V scripts were enabled or disabled with the update-rc.d command (which managed symlinks in the /etc/rc* directories), so the service command was never involved in enabling or disabling services on boot.

systemd is backwards compatible with SysV.
loads services parallel at startup
it's provides on-demand activation of a service
it's dependency based
and a lot more I guess...

There are a lot more than what you mentioned that systemctl is capable of.

systemd works with units, there are different type of units: targets, services, sockets, etc. targets are same concept as runlevels, they are a bunch of units together.

You can use systemctl to set or get the default system target.

systemctl get-default

You can go into other targets:

systemctl isolate multiuser.target

Other targets are: multiuser, graphical, recue, emergency, reboot, poweroff.

As you said, you can use systemctl to manage services, some of the other commands related to service management which I'm aware of are:

# Restarts a service only if it is running.
systemctl try-restart name.service

# Reloads configuration if it's possible.
systemctl reload name.service

# try to reload but if it's not possible restarts the service
systemctl reload-or-restart name.service

You can use it to find out about a service status:

systemctl status name.service

systemctl is-active name.service # running
systemctl is-enabled name.service # will be activated when booting
systemctl is-failed name.service # failed to load

You can mask or unmask a service:

systemctl mask name.service
systemctl unmask name.service

Wen you mask a service it will be linked to /dev/null, so manually or automatically other services can't active/enable it. (you should unmask it first).

Another usage of systemctl is to list units:

systemctl list-units

Which list all kind of units, loaded and active.

List service units:

systemctl list-units --type=service

Or to list all available units not just loaded and activated ones:

systemctl list-unit-files

You can create aliases or even control remote machines

systemctl --host ravexina@192.168.56.4 list-units

At the other hand service does what it have to do, managing services and having nothing to do with other peoples business ;)


dpkg: "Package is in a very bad inconsistent state" how to fix it? When I run command

sudo apt-get -f

I get this error

dpkg: error processing gcc-4.8-base:i386 (--configure):
Package is in a very bad inconsistent state - you should
reinstall it before attempting configuration.
Errors were encountered while processing:
gcc-4.8-base:i386
E: Sub-process /usr/bin/dpkg returned an error code (1)

I'm using Ubuntu 13.10

Package is in a very bad inconsistent state - you should
  reinstall it before attempting configuration.

You have to reinstall the package:

sudo apt-get --reinstall install gcc-4.8-base:i386

Actually the problem is related to gcc 4.8 ,use the following to solve this issue -

Remove gcc-

sudo apt-get purge gcc-4.8

now check -

sudo apt-get -f

for correcting all broken downloads.

Add repository-

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

install again -

sudo apt-get install gcc-4.8

hope it will work.


Unable to sudo apt-get install ubuntu-desktop --reinstall I installed some packages, to see a list of the installed packages see here. I walked away from my desk, locked the computer and returned to a black screen, before logging in.

I searched Google and found this telling ,me to restart a service, so I ran sudo service lightdm --full-restart it opened to my login screen, input my password, and logged into a black screen with a Komodo icon on it and my mouse cursor. So I searched some more and found this and this. Tried both of those and nothing happened.

So I'm assuming that I'm going to have to reinstall the Ubuntu desktop, or run from a backup. Only issue I'm having when running sudo apt-get install ubuntu-desktop --reinstall is a bunch of unable to correct problems, you have held broken packages:

The following packages have unmet dependencies:
  ubuntu-desktop : Depends: software-center but it is not going to be installed
                   Depends: ubuntu-sso-client but it is not going to be installed
                   Depends: unity but it is not going to be installed
                   Recommends: bluez-alsa but it is not going to be installed
                   Recommends: empathy but it is not going to be installed
                   Recommends: firefox but it is not going to be installed
                   Recommends: gnome-disk-utility but it is not going to be installed
                   Recommends: gnome-orca but it is not going to be installed
                   Recommends: landscape-client-ui-install but it is not going to be installed
                   Recommends: pulse-audio-module-x11 but it is not going to be installed
                   Recommends: python3-aptdaemon.pkcompat but it is not going to be installed
                   Recommends: totem-mozilla but it is not going to be installed
                   Recommends: ttf-punjabi-fonts but it is not going to be installed
                   Recommends: vino but it is not going to be installed
E: Unable to correct problems, you have held broken packages

These all sound pretty important, and like they should probably be installed already, so my question is pretty simple, what in the heck am I suppose to do now? How can I fix this successfully?

First clear cache by sudo apt-get autoremove && sudo apt-get clear cache and then type sudo apt-get update && sudo apt-get upgrade.
I think this will definitely gonna work.

Replaced the sources.list with new one

apt-get dist-upgrade

and then

apt-get install ubuntu-desktop

now it works fine


Can not access windows 8 drive from Ubuntu I am dual booting Windows 8 and Ubuntu ...i finally got them both working

my problem is i can not see my windows drive from ubuntu ....i can see it listed with i open up nautilus  ...but when i click on on it i get an error and can not read it

how do i fix this ....what did i do wrong in my install that would give me a mounting error

I have another dual boot machine and that machine mounted the windows drive automatically

When you turn off the computer using Windows 8, the system actually hibernate, and the windows partition is marked as being used. That prevents other OSes to access the data on the partition. Try to reboot the computer (not turn off) from windows 8, enter ubuntu and access the windows partition

Same Problem i faced few days back and I just followed the tutorial from
imacify.com/2013/07/how-to-transfer-files-between-windows-8-and-ubuntu-operating-systems/

It helped and solved this problem.