Why doesn't `sudo cd /var/named` work? I want to cd into /var/named but it gives me a permission denied error, and when I want to use sudo to do this I am not permitted. What is the technical reason for this, and is it possible to do this some other way?

The reason you can't do this is simple and two fold
1
cd is not a program but an in-built command and sudo only applies to programs.
sudo foo means run the program foo as root
sudo cd /path returns
sudo: cd: command not found

because cd is not a program.
2
If it were possible to use sudo to cd to a protected directory then having run the command sudo cd /var/named you would be in that directory as a normal user but normal users are not allowed to be in that directory.
This is not possible.
Workaround:
You can use sudo -i to elevate yourself to super user. For example:
sudo -i
cd /var/named

You are now logged on as root and can use whatever commands you wish. When finished type exit and you are back to being logged on as a normal user.

You can also change the permission temporarily if you are a sudo user.

sudo chmod 0775 path

or

sudo chmod +r folderpath

Make sure you put it back if necessary.


How do I upgrade Ubuntu 17.10 to 18.04? I was trying to upgrade to Ubuntu 18.04 from 17.10, and I used the Ubuntu Software / updates, but it gave an error. Also my laptop has logged me out of sessions/restart from Ubuntu login screen twice.

Is this due to not being on 18.04? Also I have used sudo to add Mint desktop repository as an option.

I see this error as shown in the photo:

tpw tpw0: A TPM error (325) occurred stopping the TPM

Ubuntu's own instructions specify how to upgrade from 17.10 on a desktop system:

Press Alt+F2 and type  update-manager -c   into the command box.

Update Manager should open up and tell you that Ubuntu 18.04 LTS is now available.
If not you can run  /usr/lib/ubuntu-release-upgrader/check-new-release-gtk

Click Upgrade and follow the on-screen instructions.

Comment from June 2019.
The above suggestion flat-out doesn't work any more. The update-manager fails to connect.
The check-new-release-gtk app fails.
You cannot even run apt-get update or apt-get upgrade and more
Here are screenshots from trying to do all of this on a freshly installed VirtualBox VM of the ubuntu-17.10 desktop ISO

It would appear that old versions of Ubuntu and their users have simply been dumped in a ditch and abandoned. These are the links to the screenshots.

apt-get upgrade fails
apt-get update fails, too
check-new-release-gtk fails ...
... and then core-dumps
update-manager also fails

In summary: you can't upgrade. The best you can do is backup all your stuff, all your customisations, all your additional software configurations. Then remember all the additional software and packages you installed.
Once you've done that you have to over-write your installation with an LTS version and then spend days trying to reconfigure all the new stuff with your old settings and whatever third party software that will run on the later version.


not able to update 12.10 I am not able to update 12.10 which my pc is showing to update.

following errors are coming

It seems you are trying to upgrade from 12.04 (which will be End-Of-Life soon) to a newer version.  First, make a backup of any important files.  Upgrades, while usually working just fine, rarely can leave you with a system that doesn't boot, so it is best to always be prepared for the worst (although personal files can usually be recovered with a LiveDVD in these situations).  Now run:

sudo apt-get update && sudo apt-get clean && sudo apt-get dist-upgrade

This will update your packages to their latest 12.04-based versions.  Next run:

sudo apt-get autoremove --purge && sudo apt-get purge $(dpkg -l | awk '/^rc/ { print $2 }')

This will remove old leftover packages and config files that could interfere with the upgrade.

Now try running Update Manager again and see if it offers an upgrade to 14.04.  If so, then just let it do the upgrade, and you should be done!  If not, go into "Software Sources", and under the "Updates" tab, change "Notify me of a new Ubuntu version:" to "For long-term support versions".  Try update manager again to see if it offers you 14.04.  If it still doesn't, open a Terminal and run:

sudo do-release-upgrade -c

If it offers Ubuntu 14.04, then run:

sudo do-release-upgrade

If it still offers Ubuntu 12.10, well, enlist the help of the kid down the block that has nothing better to do than fix people's computers. :)


Ubuntu LiveCd hangs on boot screen Every time I try to install or try Ubuntu I hit the booting screen  and it hangs there forever.

I've never had any issues installing Ubuntu.

Currently I've tried putting Ubuntu on a live USB(multiple writing softwares) and using live CD.

I've tried different computers but this one is the only one that failed to boot up.

Also the computer will install windows from an install CD perfectly.

I've tried booting with the following settings.

Acpi = off
noapic
nolapic
nomodeset

Again nothing worked. I've also tried several distros and encountered similar problems.

Is there something I could have missed here because I've hit a brick wall at this stage.

Well. There are really a number of reasons that your installation can stall. I stumbled upon your question while looking for an answer to my own current (and also first) Ubuntu installation problem.

I'm not versed well enough in Ubuntu (nor Linux in general) to be able to give your direct tips -- but I'll share some of my findings (some of which I have tried, others not):

1) See if your hardware is Linux/Ubuntu compatible. Here's for checking general Linux compatibility. See also Ubuntu Hardware support section in Ubuntu.com wiki.

... Now, I can't share more links in this answer as the Fabulous StackExchange system is limiting my links to 2 (due to my lacking reputation points). More in another answer. (and GRRrr. to CrapExchange for the dorky limitations).

I left mine doing the red dot thing for about 50 minutes then the DVD drive whirled into action and voilà desktop arrives.


Mcrypt extension is missing in 14.04 server for mysql The php mcrypt extension on ubuntu 14.04 shows that it is installed properly, but phpmyadmin says:

 The mcrypt extension is missing. Please check your PHP configuration.

My current php config is here. If you need anymore information, please contact me through the comments.

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

Try just doing this:

sudo php5enmod mcrypt

And then:

sudo service apache2 restart

I have installed fresh Ubuntu 14.04 (desktop version) to my computer. This way works for enabling mcrypt that was already installed.

You should be able to install the mcrypt extension for PHP by running:

sudo apt-get install php5-mcrypt


Can't write accent characters in Ubuntu 14.04 Alright. This is the scenery that I got:

1) I am using Ubuntu 14.04 LTS

2) I am using an american (international) keyboard

3) OS is in the following language: Portuguese Brazil (brazilian portuguese)

4) I am a new user of Linux. I am almost 30 years old and I have been using Windows for my WHOLE life, so I don't know NOTHING about how to configure or set Linux/Ubuntu.

5) I've JUST installed this OS for the first in my notebook.

6) Every letter that I try to write with an accent comes like in the examples above:

'a (when the correct should be á)
'c (when the correct should be ç)
~a (when the correct should be ã)
^o (when the correct should be ô)

Could please someone tell me how do I fix this?

Thank you all!

(I do not know Brazilian portuguese.) The name of the feature you are trying to use is "dead keys". A dead key is chosen so that it has a label which is similar to an accent and when it pressed it does not create a new letter, you have to press a second key too. Some combination results in the accented version of the second letter.

There are more than one builtin keyboard layouts in Ubuntu even for a single language. As I see there are five for your language:

Portuguese (Brazil)
Portuguese (Brazil, Dvorak)
Portuguese (Brazil, eliminate dead keys)
Portuguese (Brazil, Nativo)
Portuguese (Brazil, Nativo for US keyboards)

You have to choose either of 1, 4, 5. You can also choose the US international layout with dead keys, which seems to be popular among Brazilians:

English (US, international with dead keys)

You can add a new layout by

clicking on the input source (keyboard language layout) switcher near the right end of the panel to show the popup menu
selecting Text Entry Settings from the menu
Pressing the plus button below the Input sources to use list.

By the way, there is a keyboard icon on the right of the  plus button which displays the chosen layout.

If you have more than one keyboard layout in your Input sources to use list, then you can switch them by either clicking on the input source icon on the profile or pressing Super + Space.

For example, if I select  Portuguese (Brazil) I can type the letter á by pressing the English keys [a in sequence.

As usual, each of the things I mentioned above can be customized.

I had the same problem. Solved it reinstalling ibus:

sudo apt install --reinstall ibus

You may need to do a full purge and then reinstall:

sudo apt purge ibus && sudo apt install ibus


Missing Dropbox icon overlays after upgrade from 11.04 to 11.10 The upgrade went smoothly, Dropbox is working (i.e. it is syncing files), but the icon overlays aren't appearing no matter if I use Unity, Unity 2D or GNOME Shell.

Is there any setting that can fix this?
Is there a new version of the Dropbox extension for Oneiric?

Found the following post on the dropbox forums, so two things to try (I can confirm it is working on my computer with nautilus-dropbox 0.6.8-1).

1) Downgrade to nautilus-dropbox 0.6.8-1 if running a newer version.
2) Try running the following commands if on the newer version:

    sudo ln -s /usr/lib/nautilus/extensions-2.0/libnautilus-dropbox.a /usr/lib/nautilus/extensions-3.0/libnautilus-dropbox.a
    sudo ln -s /usr/lib/nautilus/extensions-2.0/libnautilus-dropbox.la /usr/lib/nautilus/extensions-3.0/libnautilus-dropbox.la
    sudo ln -s /usr/lib/nautilus/extensions-2.0/libnautilus-dropbox.so /usr/lib/nautilus/extensions-3.0/libnautilus-dropbox.so

Version 0.7.0 seems to solve this problem.

You can get the packages here: http://forums.dropbox.com/topic.php?id=46448


How do I remap certain keys or devices? I'm searching for a way to remap certain keys in ubuntu.

i.e.

I'd like to change PgUp to Home or PgDown to End.

Does a built-in command or a tool exist reassign keys in Ubuntu/GNOME?

Notice: As of 2013, Ubuntu and derivatives no longer use xmodmap, but instead use xkb. For more information see this answer. The answer below is no longer relevant for current releases.

For remapping certain keys you need two tools. First xev (command-line tool) and second xmodmap (also command-line tool). Both should be available in Ubuntu without extra installing them.

Start terminal window and run xev. Now it's active and waits for you to press a key. Then press the key whose behaviour you want to change. i.e. PgUp.
xev will output some information about the pressed key. The third line is important. It should look similar to:

state 0x10, keycode 110 (keysym 0xff55, Prior), same_screen YES,

in this example Prior is the name of the behaviour the key is assigned to at the moment, the number keycode is the internal id to recognize the key.
Now do this with another key i.e. PgDown give this output

state 0x10, keycode 115 (keysym 0xff56, Next), same_screen YES,

Here again the interesting part for us is keycode 115 and Next - the name of the behaviour.
now when you want to swap the two keys use xmodmap.

 xmodmap -e "keycode 110 = Next"

This changes the key with keycode 110 on your keyboard to the action Next. It's pretty simple.

Note that if the key you are mapping should have a different meaning when used with the Shift key (for example for British keyboard layouts, Shift+2 gives quotation marks) then you can simply list the secondary command after the first. For example if you want the key with code 53 to map to backslash normally, but to the bar symbol when used with shift, you might do:

 xmodmap -e "keycode 53 = backslash bar"

Additional information: The sequence of these mappings is Key, Shift+Key, mode_switch+Key, mode_switch+Shift+Key, AltGr+Key, AltGr+Shift+Key. To skip a column use NoSymbol. Moreover, here is a comprehensive list of all keysyms.

Note: These change are for the active X session only and will be lost after reboot.
When you want to save the changes permanently you have to run the following commands after the ones above:

xmodmap -pke >~/.Xmodmap

(it creates a file named .Xmodmap in your home directory (~))

Then you have to create a file named .xinitrc in your home directory where you put command xmodmap .Xmodmap in.

You can now modify .Xmodmap and run xmodmap .Xmodmap from console to see the changes immediately. The changes in .Xmodmap will persist.

source: Ubuntu Foruns

Bonus stuff:

If the key you are remapping has different behavior depending on a state (
like how the keys in the numeric keyboard depend on NumLock) you simply have to do xmodmap -pm to get a list of modifiers and then do:

xmodmap -e "KEYCODE MODIFIER = behaviour behaviour_with_modifier"

Suppose, for example, that you want to get a period instead of a comma on the numeric keyboard (useful for most programmers), but you want to keep the "delete" behavior when NumLock is off.

xmodmap -e "keycode 91 mod2 = KP_Delete period"

mod2, because xmodmap -pm tells us that mod2 is Num_Lock, the other names are obtained by pressing the keys in xev.

Non-Persistant remap via .desktop shortcut
In my case I wanted to remap the keypad decimal point to a comma, but only temporarily, so xmodmap satisfies this requirement in my case

Find out what is the keycode for the specific key to remap and the keysym I want to map too.

:~$ xev | grep keycode

Press the keys of interest and monitor the stdout

    state 0x10, keycode 91 (keysym 0xffae, KP_Decimal), same_screen YES,
    XKeysymToKeycode returns keycode: 129
    state 0x10, keycode 59 (keysym 0x2c, comma), same_screen YES,

1st I pressed the key I want to remap and 2nd I pressed the key I want to map to.

Keycode of key I want to remap : ..., keycode 91 (...
Keysym I want that keycode to map to: ...(keysym 0x2c, comma),...

Find out what the current mapping for the keycode to remap is:

:~$ xmodmap -pke | grep "keycode\s*91"

keycode  91 = KP_Delete KP_Decimal KP_Delete KP_Decimal

As specified in the manpage of xmodmap: Up to eight keysyms may  be attached to a key.. : 1st keysym is used when no modifier key, 2nd with Shift, etc... This does not correspond exactly to what was happening in my case but trial and error allowed me to discover the the 2nd positional argument was the one I was after

Map to the new config.

:~$ xmodmap -e "keycode 91 = KP_Delete comma KP_Delete KP_Decimal"

Map back to original config.

:~$ xmodmap -e "keycode 91 = KP_Delete KP_Decimal KP_Delete KP_Decimal"

I created a couple .desktop shortcuts in ~\.local\share\applications\ to easily switch to one or the other configuration:

[Desktop Entry]
Name=KeyPad comma
Exec=xmodmap -e "keycode 91 = KP_Delete comma KP_Delete KP_Decimal"
Terminal=false
Type=Application
Icon=/home/paui/.icons/KP_comma.png

Extra info:
state field output of xev,
The state field is the "sum" of current active modifiers. These are the ones I deciphered.
    0x01 Shift
    0x02 Caps
    0x04 Control
    0x08 Alt
    0x10 NumLock
    0x80 Alt Gr


understanding bash redirection using > char I am learning bash and am not able to understand what is going wrong with the output redirection in the following example:

I have a file called myfile.txt with the following content.

Practice makes Perfect

I am going to use tr command to replace P with p:

cat myfile.txt | tr P p

This does what I want, now I am going to put the result back into the original file:

cat myfile.txt | tr P p > myfile.txt

But after executing the above command myfile.txt is empty... why is this happening?

Update:

If I send the output to a different file, then it works as expected:

cat myfile.txt | tr P p > anotherfile.txt

Bash (and other POSIX-compliant shells) follow two  rules that explain this behavior:

Redirection happens before commands run.
If a file exists, it is truncated (emptied) when redirection goes to the file as in > myfile.txt.

So because there is > redirection the contents of the myinput.txt get discarded and cat prints nothing, cat exits and closes the pipe and tr closes the file without writing anything to it. Order in which commands start is not particularly important ( and it is not guaranteed, see Gille's answer here). But what is important is that redirection occurring before commands starting; that is each command's standard streams are prepared, and that's what causes empty file in the end.

But it is possible to edit the same file  tools like sponge, just not in this particular case.

See also:

Redirection executed before a command

In my opinion cat is not used in the correct intention. Normally cat is used to combine files, but often also misused to just use display simple files.

In your case I would use the tr command in the following way:

tr P p < myInput.txt > myOutput.txt


How to prevent nautilus from launching? I'm running i3-wm under a gnome session in 12.04.

Nautilus is not normally running.

I regularly loop-mount ISO and other filesystem image files, and every time I do this nautilus pops up both a desktop window and a window opened at the new mount point.

Uninstalling nautilus is not an option -- I tried this, but apt reports that dozens of packages depend on it (directly and indirectly).

This question is similar, but only talks about preventing launching on USB stick insertion. I don't want nautilus to run, ever -- removal would be ok with me if it didn't require uninstalling the world.

Run in terminal :

gsettings set org.gnome.desktop.background show-desktop-icons false

Try to disable automount with the dconf editor. You can find a good tutorial right here.


How do I prevent mouse movement from waking up a suspended computer? It's really annoying as I have to unplug the mouse after a suspend to ensure that an occasional bump doesn't wake up the system. I haven't found anything in system settings which could disable this neither by googling around.

I haven't checked the BIOS yet, but I've found a solution!

Short summary: In /proc/acpi/wakeup, you can see which devices are currently enabled to resume from suspend. That list shows names (abbreviated) of so called "Devices". Example "PWRB" means "power button".

If you write device-names to that file, you toggle them between enabled/disabled.

I wrote a small HowTo for disabling wakeup-by-mouse, based on a blog where I found that info.

There may be a way specific to your hardware, in which case the option may be available through your system's BIOS settings.

Getting to your BIOS menu to change settings is also system specific. Usually you press a key just after rebooting, and the key to press is often displayed on the screen.

However, user138339's answer seems like a more general way to achieve what you need, and you can do this from the running system.


How to change and save mouse settings? My cursor got all jumpy lately and I want to lower touchpad sensitivity, how can I do it? Mouse&Touchpad menu allows me to make changes but doesn't save them after I close its window. And there's no discernible change.

Also, where is the option to disable mouse/touchpad acceleration. Do I need to edit Xorg.conf and reboot like it's 2002?

I'm on a regular Ubuntu 13.04 with Unity.

Try gpointing-device-settings from the software center.

If that doesn't expose the needed features, use synclient in a terminal window. For example, to reduce the acceleration, use
synclient AccelFactor=XXX, where XXX is a number such as 0.144509 or whatever suites the touchpad.

Go to "System Settings -> Mouse and Touchpad" You can choose the sensitivity, the clickers (left and right) and others.


How can I mount a fat filesystem automatically as Ubuntu starts? I have a dual boot System with an Ubuntu-Filesystem a Windows Filesystem and another FAT Filesystem on my harddrive. My Thunderbird configuration is on that FAT partition.
I tried different tools, but they are mounting the filesystem as root, so thunderbird cannot read and write on it. Sorry for my bad english and thanks for your answers.

Let us name your data partition as FAT for simplicity, and it's device name as /dev/sda11. Of course the actual partition Label and device name could be different.

You can check your device name and it's Label (If you set label, otherwise you will be given UUID of the device) with this command. Don't worry, if you see different UUID value for your system. Just open a terminal by Pressing Ctrl+Alt+T shortcut and type

sudo blkid | grep vfat

For my system, the output is like this,

/dev/sda11: LABEL="FAT" UUID="28D3-995A" TYPE="vfat"

You can see, I've only one FAT partition whose Label is FAT and It's device name is /dev/sda11. The most important bit of information is this device name.  After you have known the device name of your Fat partition, proceed as follows:

Open a terminal by Pressing Ctrl+Alt+T shortcut.
Type The below command

gksu gedit /etc/fstab

and hit Enter. This step will open /etc/fstab file in your gedit text editor. If you are using Kubuntu, replace "gedit" with kwrite. For Xubuntu and Lubuntu, use leafpad instead of gedit.
At the end of this file, Add the below line

/dev/sda11  /media/Fat   vfat   defaults,rw,users,uid=1000,gid=1000  0    0

My user id is 1000 and group id is 1000, so I added uid=1000 and gid=1000. Check what is your user id and group id and use them as the value of uid and gid.

To Find your user id, type id -i your-user-name and to find your group id, type id -g your-user-name.

After adding the line,  save the file by Pressing Ctrl + S keyboard shortcut. Then exit the Text editor by Pressing Alt+F4. You can also use close

Don't simply paste the line, replace /dev/sda11 with the actual device name of your FAT partition you found by executing sudo blkid | grep vfat command early in the answer
Then Again return to the terminal and type the below command

sudo mkdir /media/Fat

and hit Enter.
Restart your PC and see if your fat partition is correctly mounted.

To mount an NTFS partition at boot you need to modify the /etc/fstab file.

Use Disk Utility or the sudo blkid command to find out what is the name of the partition (sda?) then add a line to the fstab file.

Create a folder in the /media or /mnt folder (/media/Data in the following example) and add the corresponding line.

This is an example line for an NTFS partition:

/dev/sda4 /media/Data ntfs auto,rw,users,exec,nls=utf8,fmask=0022,umask=000,uid=1000,gid=1000 0 0

To modify the fstab you could press Alt+F2 and type gksudo gedit /etc/fstab. Save and reboot to test it worked.


Installation of Ubuntu 14.10 alongside Windows 7 I want to install Ubuntu 14.10 64bit version in my pc alongside Windows 7 64bit OS. So I have installed Windows 7 and now when I tried to install Ubuntu, it doesn't detect any OS and shows it doesn`t have any OS. What to do now?

First you need to create a new partition from windows for installing ubuntu (around 20 GB) or more if you need

Then follow these instruction
To install ubuntu alongside windows.


Is there any version of VMware player for ubuntu available? Possible Duplicate:
  How to install VMware Player 4.0.2?

Is there any version of VMware player for ubuntu available?

How can I install it, if there is?

Virtualbox is available from repositories, it is a very similar program that will do equally well in most situations.


Change network mac address using "ip" command Usually I would be able to change my wifi mac address with the ifconfig command like :

ifconfig <iface> hw ether XX:XX:XX:XX:XX:XX

Ubuntu have however deprecated ifconfig in behalf of the "ip" command, so I was wondering if there is an way to get similar functionality using that command?

First run:

ip link show

This will list your network devices. Find the one you want to change. Next, run:

sudo ip link set dev <your device here> down

Then:

sudo ip link set dev <your device here> address <your new mac address>

Finally:

sudo ip link set dev <your device here> up

To change the MAC (Media Access Control) address of an eth0 network interface, use the following command with argument “hw ether“. For example, see below.

[root@tecmint ~]# ifconfig eth0 hw ether AA:BB:CC:DD:EE:FF

use this article, i hope this very helpfull for you!


MongoDB loads but breaks, returning status=14 So im trying to setup Mongodb on Ubuntu 16.04 but im running into trouble.

when running :

sudo systemctl status mongodb

I get the following:

 mongodb.service - High-performance, schema-free document-oriented database
   Loaded: loaded (/etc/systemd/system/mongodb.service; disabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Sat 2016-09-10 14:02:22 CEST; 14s ago
     Docs: https://docs.mongodb.org/manual
  Process: 8724 ExecStart=/usr/bin/mongod --quiet --config /etc/mongod.conf (code=exited, status=14)
 Main PID: 8724 (code=exited, status=14)

According to the mongo-docs, status=14 is:

"Returned by MongoDB applications which encounter an unrecoverable error, an uncaught exception or uncaught signal. The system exits without performing a clean shut down."

I doesnt really point me in any particular direction.

My /etc/systemd/system/mongodb.service looks like this:

[Unit]
Description=High-performance, schema-free document-oriented database
After=network.target

[Service]
User=mongodb
ExecStart=/usr/bin/mongod --quiet --config /etc/mongod.conf

[Install]
WantedBy=multi-user.target

Any thought on what may be the cause of this?

Thank you

After googling around for a while. I found that that is because the permission setting on
/var/lib/mongodb and /tmp/mongodb-27017.lock are wrong. You will have to change the owner to monogdb user
chown -R mongodb:mongodb /var/lib/mongodb
chown mongodb:mongodb /tmp/mongodb-27017.sock

sudo service mongod restart

My /var/lib/mongodb was corrupt, rming it and reinstalling mongo worked.


Unable to get dual boot grub menu when I connect to a external monitor I am using ubuntu 20.04 with windows as a dual boot. Everytime i restart I normally get dual boot grub menu (without connecting to an external display), but when I connect to an external monitor, this doesn't happen. I have looked up some answers on the same question but still I am unable to get it. Here's my grub file
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
#   info -f grub -n 'Simple configuration'

GRUB_DEFAULT=on
GRUB_TIMEOUT_STYLE=hidden
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
GRUB_GFXMODE=1920x1080

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"

I too had the same issue. And I was able to correct this by holding the shift key when the computer was booting. Hope you find it helpful.


Broken dependencies after attempting to install ApacheOpenOffice So a few days ago i tried installing ApacheOpenOffice, and the instructions i read was to uninstall LibreOffice-Common so i did that with the terminal. Then all the sudden I’m seeing all these errors come up and I’m getting confused. So i uninstall ApacheOpenOffice and just try to go back to LibreOffice. And i get these errors: http://paste.ubuntu.com/6763795/ If this keeps happening I’m going to be left with just having to reinstall Ubuntu. If i do so I'll make sure to check the MD5SUM of the ISO this time. But if anyone can help me fix this i would be happy.

try to run this command

sudo apt-get -f install

if it does not work try removing java and re-installing it again


Ubuntu does not recognize external monitors when attached through docking station I just bought a Lenovo USB 3.0 Docking Station.
It works with my keyboard, but not with the monitors: ubuntu just does no recognize the external monitors when I connect them.

Sorry for the lack of details, I am a newbie and I really do not know where to look for. It would be really good if anyone can help me with that.

thanks

EDIT:

Computer: Lenovo Thinkpad T480s
Ubuntu: 18.04
Docking station: Thinkpad USB 3.0 Ultra: https://www.lenovo.com/de/de/accessories-and-monitors/docking/universal-cable-docks-usb/ThinkPad-USB-3-0-Ultra-Dock/p/40A80045EU

Posting as posted by "danzel" in comments above. All credit to the guy. Hence posting this as a guest:
"USB 3.0 docking stations in most cases use DisplayLink hardware for video output. You can find the necessary drivers and installation instructions here. "


What does "${debian_chroot:+($debian_chroot)}" do in my terminal prompt? In my terminal prompt definition in my .bashrc file, among other things, I have this snippet of code:

${debian_chroot:+($debian_chroot)}

What does this do, and do I need it?

The important part to answer this question is this snippet from /etc/bash.bashrc:

if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
    debian_chroot=$(cat /etc/debian_chroot)
fi

It means if the variable $debian_chroot is empty and the file /etc/debian_chroot exists and is readable the variable is set to the content of the file.

Now what is this for? The file /etc/debian_chroot is when you have a chrooted debian system inside another debian system (ubuntu is based on debian). So this is for a better overview. To distinguish whether you are in the chroot or not.

When you have a chroot of another system for example in /srv/nfs4/netboot/ you can set a name for this chroot in /srv/nfs4/netboot/etc/debian_chroot (in my case it's a nfs4 pxe netboot drive):

user@host:~# echo "netboot" >/srv/nfs4/netboot/etc/debian_chroot

And then when you chroot inside:

chroot /srv/nfs4/netboot/

Your prompt looks like this:

(netboot)user@host:~#

If you never need to use debian_chroot then it's a handy place to put the time the command prompt was displayed by using:

export PROMPT_COMMAND='debian_chroot=$(date +%r)'

Type this in your terminal and watch your command prompt change with the time:

rick@alien:~$ export PROMPT_COMMAND='debian_chroot=$(date +%r)'

(09:14:59 PM)rick@alien:~$

After the time is set once, to get a running clock which updates every second use:

while sleep 1;do tput sc;tput cup $(($(tput lines)-1)) 1;printf `date +%r`;tput rc;done &


Mouse lagging on Ubuntu 17.10 I have downloaded Ubuntu 17.10 recently, and I found out that if you move the cursor on the top bar the mouse is starting to lag. (especially if you open one of the tabs on the top bar, and then move you mouse across the bar).

I thought that's the only problem with the mouse, but then when I opened a game that is working on OPEN-GL, the mouse just didn't stop lagging, of course, when I closed the game, the mouse was working ok. (by the way, it happend with every steam game).

I was looking for an answer, but all I found is this solution How can I get rid of mouse lag under Ubuntu?.

It did not happen when I used Ubuntu 17.04.

I have Intel Core i5-6198DU CPU @ 2.30GHz x 4, Intel HD Graphics 510(Skylake GT1), GNOME 3.26.1, 64-bit.

Can you please help me find a solution? Thank you very much :)

"Gnome/Wayland has mouse tracking issues (see https://bugzilla.gnome.org/show_bug.cgi?id=745032)."

Ubuntu 17.10 uses wayland by default. however, you can switch back to Xorg, without to install anything, all you need to do is:

Log out from you current user.
Under the password, near the "unlock" button, you will have something like a settings-icon.
Click it, and choose the second option(the one says "xorg")
And there you have it! the good old xorg session, with no more cursor lags!

"Switching to an Xorg session from the log in screen should solve it."

Just sharing my case.

My laptop : i7(kabylake) + HD620 graphics card. I read that usually its the driver's problem. so,

Installed Intel HD620 graphics driver, and mouse lagging was solved. Intel driver currently only support 17.04. So I followed below answer.

How to Install the latest Intel Graphics Driver in Ubuntu 17.10?

(edited following the advice)

Basically,

Backup and edit your /etc/lsb-release file to fool the installer.
Download and install Intel driver.
Change /etc/lsb-release back to original.

But, mouse lagging still happens when I use Transmission(torrent client) downloading about 5 files. other than that, looks good.

Another thing is by installing the graphics driver, it solved the problem of a blank tool tip when moused over anything first time, so I had to put mouse over repeatedly, but it's now solved too.


vlc player doesn't run with optirun I have installed bumblebee. Other applications are working with optirun instead of vlc.

optirun -b primus vlc

error

VLC media player 2.0.8 Twoflower (revision 2.0.8a-0-g68cf50b)
[0x19d0108] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
../../../include/vlc_xlib.h:46:vlc_xlib_init: Xlib not initialized for threads.
This process is probably using LibVLC incorrectly.
Pass "--no-xlib" to libvlc_new() to fix this.
[0x1d8e5e8] qt4 interface error: Xlib not initialized for threads
../../../include/vlc_xlib.h:46:vlc_xlib_init: Xlib not initialized for threads.
This process is probably using LibVLC incorrectly.
Pass "--no-xlib" to libvlc_new() to fix this.
[0x1d8e5e8] skins2 interface error: Xlib not initialized for threads
[0x1d8e5e8] skins2 interface error: initializing xlib for multi-threading failed
[0x1d8e5e8] skins2 interface error: cannot initialize OSFactory
[0x1d8e5e8] [cli] lua interface: Listening on host "*console".
VLC media player 2.0.8 Twoflower
Command Line Interface initialized. Type `help' for help

System info

Ubuntu 13.10 (64bit)
optirun (Bumblebee) 3.2.1

Is there any workaround?? Thanks..

Edit

This issue fixed in VLC media player 2.1.6

This is saying that it doesn't support the GUI of VLC but wel on command line. You can play , for example a video, if you put the file name as a a parameter:

optirun vlc /path/of/gamesofvideo.mkv

The problem is that is very painful to use vlc in text mode :-(

(this would be a comment, but I need 50 reputation before I can post comments.)

I have vlc working on Ubuntu 12.04 with Bumblebee, although I can't get it if I enable primus bridge. optirun vlc seems to work fine though. Does it fail if you let it set bridge as auto with just optirun <app>?


Can you publish your app in Software Center via a PPA? I have my free open source desktop app in a PPA. Is it possible to get it in the Software Center so that it is installed from the PPA (so that the user don't need to add my PPA)?

Or should I now use a Click package or what? Changing the packaging from .deb is a bit of a pain.

Go to  myapps portal  and follow the instructions there.


Generate md5 checksum for all files in a directory I would like to create a md5 checksum list for all files in a directory.

I want to cat filename | md5sum > ouptput.txt. I want to do this in 1 step for all files in my directory.

Any assistance would be great.

You can pass md5sum multiple filenames or bash expansions:

$ md5sum * > checklist.chk  # generates a list of checksums for any file that matches *
$ md5sum -c checklist.chk   # runs through the list to check them
cron: OK
database.sqlite3: OK
fabfile.py: OK
fabfile.pyc: OK
manage.py: OK
nginx.conf: OK
uwsgi.ini: OK

If you want to get fancy you can use things like find to drill down and filter the files, as well as working recursively:

find -type f -exec md5sum "{}" + > checklist.chk

I hit this issue, and while the solutions above are elegant, I wanted a quick and dirty hack for this situation: 1 directory, with subdirectories one level deep inside it.

So, enter the directory in a shell and run:

md5sum * */* 2>/dev/null > md5sum.md5

This gets all the files in the top level directory, removes the error warning about the sub directories being directories, and then runs md5sums on the subdirectory contents. Advantage: easy to remember, does exactly what it's supposed to do. I always get confused by find syntax and can never remember it off the top of my head, so no need to loop etc, dealing with spaces in directory names, this one liner worked fine. Not a robust powerful solution, no good for > 1 level of subdirectories, but a quick and easy fix for the problem.


Which release should I use for an ACER Aspire 1640 laptop? I have an Acer Aspire 1640 laptop with the following specs:

Processor:  Intel Centrino 1.7 cache 2MB
RAM: 1 GB
Hard disk: 60 GB

Which Ubuntu release should I use? I am new to Linux.

It seems your laptop will just barely meet the minimum recommended system requirements for regular Ubuntu, particularly with regards to the amount of RAM present.

You can always try making a LiveCD/LiveUSB of Ubuntu to try on your machine and see how it performs before doing an actual installation. Keep in mind the performance will be slightly lower than once it is actually installed, however. If you decide that Ubuntu's performance is not good enough for you on that machine, you may also want to take a look at Xubuntu and Lubuntu, both of which are officially-recognized derivatives which aim to have better performance on low-end systems.

No doubt! It's Ubuntu 10.04 LTS version. Every release after that is buggy until the next LTS release. I'm running it on an Intel Atom, which is weaker than yours. Remember to install ccsm (CompizConfig Settings Manager) after the installation for cool effects.


Can't load webpages from applications I am using Ubuntu 12.04 64 bit, Firefox 16.0.01.

Whenever I try to open a webpage in a browser from within any application, the browser opens but nothing gets loaded.

For eg: From DropBox if I click Launch DropBox Website, Firefox opens but all I get is the Firefox Home Page.

How can I solve this problem?

After experimenting for some time, I finally figured out the problem.

Ubuntu somehow does not use the gconf key for handling URLs, but rather uses the Exec entry in the firefox.desktop file.

So change the Exec entry in your firefox.desktop to firefox %u.

Firefox updates as of late seem broken in Ubuntu. not sure if its a Mozilla issue or a Ubuntu issue. my guess if Mozilla, given the frequency of there updates.

recommended solution? reinstall Firefox completely. open a terminal and type:

sudo apt-get purge firefox firefox-globalmenu firefox-gnome-support

then type:

sudo apt-get install firefox firefox-globalmenu firefox-gnome-support

these 2 commands will wipe out Firefox, then reinstall it to the latest version. it resolved a lot of issues I had.


how to install g77 on ubuntu 12.04 I want a workin g77 compiler on my Ubuntu 12.04 64 bit laptop.
so did the following:

I change the sources.list by adding the following lines:

  deb http...hu.archive.ubuntu.com/ubuntu/ hardy universe
  deb-src ..//hu.archive.ubuntu.com/ubuntu/ hardy universe
  deb http:...hu.archive.ubuntu.com/ubuntu/ hardy-updates universe
  deb-src ..//hu.archive.ubuntu.com/ubuntu/ hardy-updates universe

2. then I on a terminal i did the following:

sudo apt-get update
sudo apt-get install g77

Things looked very nice then. But when I tried to compile with g77 on my Fortran77 program. I got the following errors:

/usr/bin/ld: cannot find crt1.o: No such file or directory
/usr/bin/ld: cannot find crti.o: No such file or directory
/usr/bin/ld: cannot find -lgcc_s
collect2: ld returned 1 exit status

3. Why doesn't the g77 work properly. Many people need g77 why cannot Ubuntu offer a workable g77?

4. Please Help me !
Thanks from a ubuntu-beginner

I had the same problem, with SAME SYSTEM today and SOLVED. It may serve for you.

If you are an expert, you can jump to the end for a 3 line solution or follow my way,

that was:
1)
$ locate crt1.o
/usr/lib/x86_64-linux-gnu/Mcrt1.o
/usr/lib/x86_64-linux-gnu/Scrt1.o
/usr/lib/x86_64-linux-gnu/crt1.o
/usr/lib/x86_64-linux-gnu/gcrt1.o
/usr/lib32/Mcrt1.o
/usr/lib32/Scrt1.o
/usr/lib32/crt1.o
/usr/lib32/gcrt1.o

As I'm using x86_64, just copied "/usr/lib/x86_64-linux-gnu/"

2)
$ locate crti.o
/usr/lib/x86_64-linux-gnu/crti.o
/usr/lib32/crti.o

It was the same as above, so, nothing new.

3a)
$ locate lgcc_s
NOTHING

panic...

But, I tried:

3b)
$ locate gcc_s
/lib/i386-linux-gnu/libgcc_s.so.1
/lib/x86_64-linux-gnu/libgcc_s.so.1
/usr/lib/gcc/x86_64-linux-gnu/4.4/libgcc_s.so
/usr/lib/gcc/x86_64-linux-gnu/4.6/libgcc_s.so
/usr/lib/gcc/x86_64-linux-gnu/4.6/libgcc_s_32.so
/usr/lib/gcc/x86_64-linux-gnu/4.6/32/libgcc_s.so
/usr/lib32/libgcc_s.so.1
/usr/libexec/autopackage/libgcc_s.so.1

Now, I just choose the older version, 4.4, so just copied "/usr/lib/gcc/x86_64-linux-gnu/4.4/"

The software in question was in a makefile. Openned the one and changed:

(from)
FFLAGS=-g -O2

(to)
FFLAGS=-g -O2 -B/usr/lib/x86_64-linux-gnu/ -B/usr/lib/gcc/x86_64-linux-gnu/4.4/

To be simple: I just add -B for each path I copied

If you are using the g77 direct in terminal, may be:

$ g77 (...) -B/usr/lib/x86_64-linux-gnu/ -B/usr/lib/gcc/x86_64-linux-gnu/4.4/ (...)

Expert:

1) Use the locate to find the path of crt1.o, crti.o and-lgcc_s (search for gcc_s);
2) Copy the paths for your distro/bits;
3) Add a "-B path_1" "-B path_2" (where path_i are the paths above) in your g77 compile call.

EDIT
cogitoergosum,  In my case, the software is VERY old and fort77, gfortran and f77 gave tons of problems. I first successfully compiled with ifort (Intel Fortran compiler). But I tried g77 for an opensource alternative. And it works!

Try installing fort77 (sudo apt-get install fort77) which also installs f2c. Use f77 which invokes f2c translator to compile/link. Good luck.


Trouble Installing Nvidia Driver First time user here;

Just installed Ubuntu 14.04 and I am currently desperate to install 970 Nvidia Drivers.

It gives me an error saying that X server is currently running and needs to be stopped, however, every time I try to kill its process(lightdm), I get a black screen and I am only able to force restart computer. I have searched the web but no luck.

I wrote a blog post about this problem here:  http://cloojure.blogspot.com/2015/05/how-to-install-nvidia-video-card.html

...which is pasted below. Please see the blog post for the missing screenshots.

Tuesday, May 26, 2015
How to Install NVIDIA Video Card Drivers for Ubuntu/Kubuntu Install or Kernel Upgrade
I have a nice new Linux computer I got from ZaReason this past Christmas, and I decided to install Kubuntu (KDE + Ubuntu) in order to more nearly match my (really slick) XPS 13 Sputnik system from Dell, which comes pre-installed with Ubuntu.  I had previously used Fedora 20 on my desktop computer, but wanted to keep the OS on both computers more in sync, and Ubuntu also has better integration with sound, video, peripherals, and other desktop (i.e. non-server) hardware concerns.

The problem is that my nice new EVGA brand video card (with NVIDIA GPU) is not natively supported by Linux, so you have to download and install the drivers from the NVIDIA website. A current driver as of this writing can be found at http://www.nvidia.com/object/unix.html (it might be easier to google "nvidia linux driver download" than to directly navigate the NVIDIA website).  Look under the "Linux x86_64" category.  I always choose the "Latest Short Lived Branch" since it will have the most bug fixes (e.g. Latest Short Lived Branch version: 349.16).  Download this file to your computer, the do a power-off restart.

The power-off part here is important. In configuring the video card, we have a fundamental conflict between the motherboard's built-in video output and the "non-standard" video card output.  When you perform a fresh Linux install or upgrade the OS kernel, you are starting from ground zero and the video card will no longer work.  Unfortunately, the Ubuntu software update system seems to come up with a semi-major patch every month or two which requires the re-installation of the video drivers. While I could avoid the problem by refusing to perform software updates, I am always eager to get bug fixes and new features in all my other packages, and I just try to minimize the inconvenience of re-installing the video card driver on the new OS kernel.

The problem is that, when the video card quits working, you can't tell what is going on, much less fix it!  The following steps are the fastest way I've found to get around these difficulties.

My video card has three (yes, count 'em, three!) video outputs, and I have become addicted to using all three monitors.  Yes, I know, it might seem excessive, but trust me:  once you've tried three monitors, you'll never (voluntarily) go back to dual monitors again.  Of course, the motherboard built-in video output makes it four video output ports in total.

Most monitors (I prefer the excellent 27 inch LG IPS 27MP65) have at least 2 inputs, both HDMI and VGA.  The trick is to use all three HDMI outputs from the NVIDIA video card to the three HDMI monitor inputs, and also connect a VGA cable from the motherboard built-in video output to one of the monitors (preferably the least-used monitor as the NVIDIA card sees it).

If only one video input is active, your monitor should normally be able to switch to the active input (HDMI or VGA) port automatically (especially when the monitor powers up).  If this sometimes fails, there should be a button labled "Input" or similar that will allow you to manually switch to the desired video input port.  Remember this, in case the monitor is displaying the VGA input and what you need to see is on the HDMI input, or vice versa.  If you find this problem is occurring, move the VGA cable to a monitor that is not trying to display HDMI.  It is much easier if you can see all active inputs simultaneously on different monitors.

When you first install Linux (or after a kernel upgrade), the new kernel will not find the drivers for the NVIDIA video card and the built-in video output will be used.  The monitor connected to the built-in VGA output should show the single-monitor display, and you'll be able to install Linux and boot up. At this point, you need to learn a few tricks.

The first trick is knowing that the NVIDIA driver cannot be installed when Linux is in the normal multi-user mode with the graphical X-Windows display active.  You must boot into a single-user, text-only mode before installing the driver.  On Kubuntu (my favorite) or plain Ubuntu this requires a power-off restart.

When booting, the GRUB bootloader will give you a 10-12 second countdown allowing you to select boot options before it attempts to auto-boot the newest kernel.  One of the options is to type the letter "e" in order to Edit the boot options.  This is what we need.  Type the "e" before the countdown timer expires.

At this point, you should see a screen such as this one:

The important part is in the lower-right-hand corner, where you can see the words "quiet splash" near the end of the next-to-the-last line.  The "quiet" part means that status messages to the console during boot are suppressed.  The "splash" part means that the OS boots into the multi-user, graphical X-Windows mode.  Both of these must be disabled in order to install the NVIDIA video driver.

Using the arrow keys, maneuver to the "quite splash" words, then use the Backspace or Delete key to remove the offending words and replace them with the single word "text".  When you are done, the screen should appear like this:

You may now follow the instructions at the bottom of the screen to continue the boot with your modified boot params (e.g. Crtl-X). You should see boot status/progress messages scrolling past on your VGA-port connected monitor.  Upon successful boot, the VGA-port monitor will look like this:

Voila!  You have booted into single-user text mode.  Go ahead & login and navigate to the directory containing the new video driver (typically ~/Downloads).

In this screen shot, you can see that I have three NVIDIA drivers downloaded (I keep forgetting to delete the older two).  Note that I don't always download the absolute most recent driver for each OS kernel update (maybe 2-3 times/year I'll download the latest driver from the NVIDIA website). Pick the newest (or only) driver you have, and invoke it as shown with "sudo bash NVIDIA-xxxxyyyyzzz.run":

While the driver is a shell script, I find it easier to invoke it using bash rather than change permissions and invoke it directly.  You need the "sudo" part since the video driver installation script must run with root permissions.  At this point, the driver will use "ASCII graphics" to complete the installation process.  It will stop about a half-dozen times to ask your permission for things.  Use the arrow keys to highlight the "Yes" answer, then hit  to invoke your selection.  Keep doing this until the installation is complete.

At the end of the installation, your VGA screen will be blank, and you'll be back at the command prompt.  Here, we need another power-off reboot.  Using "sudo poweroff" is a quick & easy way to do that.

Once the system has powered-off, hit the power button and begin a normal boot.  After the GRUB timer countdown, you will likely see an "Ubuntu" splash screen for a few seconds on the VGA output.  At this time, the computer should recognize your new video driver and switch to the three HDMI outputs of the video card and complete the boot process.  The VGA output will be unused from here on.

If your monitor is like mine, it may be confused by having VGA input that is active for 5-10 seconds, but then dies.  It keeps looking for the VGA input to come back and does not switch over the the (now active) HDMI input.  You can either use the monitor's Input switch to manually switch over to the HDMI input, or perform a quick power-cycle which should cause it to recognize the active HDMI input and ignore the inactive VGA input.

That's all, folks!  Happy Linuxing!

Alan Thompson

P.S.  For some cool stuff that you wish was in Clojure, you may wish to visit:  https://github.com/cloojure/cooljure     :)

You can log to the machine using another machine, for example like this:

ssh login@machine

download drivers from here:

wget http://us.download.nvidia.com/XFree86/Linux-x86_64/346.59/NVIDIA-Linux-x86_64-346.59.run

install them and configure system to use them.


How do I get Ubuntu 12.04 to detect my monitor correctly? I am using an old CTX monitor (CRT).  The computer is also old (processor is Pentium 4, 2.8 GHz) operating with VESA drivers.  Ubuntu 12.04 detects this monitor as "Laptop" (even though it is a CRT)and will not give me any higher resolution than 1024x768, even though xrandr tells me that the monitor can go to 1280x960 with the graphics card installed (SIS661/741/760 PCI/AGP).  The SIS drivers are installed but the machine will not use them.  I have also used xrandr to add a new mode but the "Display" GUI does not show it.  Ubuntu 11.10 gave no problems.  Can anyone help?

Same issues here. I have an intel integrated graphics. Doesn't detect my display, lets me get 1024x768 res when I should be able to get 1680x1050. They have seriously messed this one up and I dont think they'll fix it as I've been having these issues for over a month. There's a dirty fix it do every time i turn on my computer but it causes lots of errors and crashing but it gives me the right resolution i suppose.. Think I'm going to switch to Winblows tonight, it's more stable and these issues just don't exist.

$ xrandr --newmode "1680x1050" 146.25 1680 1784 1960 2240 1050 1053 1059 1089 -hsync +vsync

$ xrandr --addmode VGA1 1680x1050

$ xrandr -s 1680x1050

I'm experiencing a similar problem.  Both the proprietary NVIDIA drivers are the problem.  Once installed they both identify my monitors as Laptop.  Once I reverted back to the open source nouveau driver, it properly identified both monitors by the hardware ID, but also allowed me to select a primary monitor for the unity launcher.  The display control panel now works properly, but when I had either of the two proprietary drivers installed, the display control panel only identified one large monitor as laptop which then limited my ability to control which screen I wanted the unity launcher.  The Nvidia setting manager properly identified the two screen, but I could not override whatever is feeding the Display control panel.  Very strange.  Simply reverting to the open source default driver corrected the propblem for me, with the only annoying caveat that the GPU fan now runs rather loudly compared to the silky smooth quiet of the proprietary driver.  For me its listening to the fan and having the desktop look and feel like I want or run the nvidia drivers and have a quiet running GPU, but a desktop that misidentifies my monitor and limits my ability to control my desktop.  GRRRRRRRRR......


Very UGLY font rendering in java apps Does anybody in here knows how to fix these fugly fonts?
I've got installed java openjdk 8 and im running on ubuntu 15.04.
I tried installing java oracle jdk 8 but it didn't help, then i deleted it and installed openjdk 7, rebooted my pc, it didn't help then i installed openjdk 8, rebooted pc...same thing again.

Adapted from my answer here.

Adding this line:

_JAVA_OPTIONS='-Dawt.useSystemAAFontSettings=on -Dswing.aatext=true'

to /etc/environment should fix this issue.

If you can't edit your /etc/environment for some reason or it doesn't work then you can try running this command instead in a terminal and then launching the app (from the same terminal):

export _JAVA_OPTIONS='-Dawt.useSystemAAFontSettings=on -Dswing.aatext=true'

This fix works as of Ubuntu 16.04 and OpenJDK 8u151 (haven't checked with Oracle JDK or Java 9) on the jEdit text-editor and other Java Swing applications.

Working example (jEdit):

Note: Some fonts and AA settings complicate the problem. In jEdit, I use the default Java fonts ("Dialog" as it's called) for everything. You can probably use a different font for the Text-Area but Dialog is the best for buttons, etc. The best Text-Area AA setting I've found is standard but your mileage may vary.

You have to change default font in windows that you provide above.
For IDE I love to use Hack, or Inconsolata
Those fonts are located in here https://github.com/powerline/fonts

Please see readme.md for installing


How do I correctly install libpcre3-dev:i386? I want to install libpcre3-dev:386 onto 64-bit Ubuntu 14.04.

I have libpcre3:i386 installed, as well as the :x64 -dev version. But if I run 'sudo apt-get install libpcre3-dev:i386', apt wants to remove "all" of my build tools:

Reading package lists... Done
Building dependency tree
Reading state information... Done
...
The following extra packages will be installed:
  libc6-dev:i386 libpcrecpp0:i386 linux-libc-dev:i386
Suggested packages:
  glibc-doc:i386 manpages-dev:i386
Recommended packages:
  gcc:i386 c-compiler:i386
The following packages will be REMOVED:
  build-essential camlp4 dkms dpkg-dev g++ g++-4.7 g++-4.7-multilib g++-4.9
  g++-4.9-multilib gcc gcc-4.7 gcc-4.7-multilib gcc-4.9 gcc-4.9-multilib
  gcc-multilib hardening-includes lcov libtool lintian ocaml
  ocaml-compiler-libs ocaml-interp ocaml-nox pepperflashplugin-nonfree
  sa-compile virtualbox-dkms
The following NEW packages will be installed:
  libc6-dev:i386 libpcre3-dev:i386 libpcrecpp0:i386 linux-libc-dev:i386
0 upgraded, 4 newly installed, 26 to remove and 11 not upgraded.

Any idea what it's doing and/or how I can get it to install the 32-bit -dev library?

Disclaimer: I installed GCC 4.9 from a PPA (ppa:ubuntu-toolchain-r/test). After installing, I removed it as a repository; if I re-add it, then gcc-4.9 and its associated packages disappear from the list of things that will be removed:

The following packages will be REMOVED:
  build-essential camlp4 dkms dpkg-dev g++ g++-4.7 g++-4.7-multilib gcc
  gcc-4.7 gcc-4.7-multilib gcc-4.8 gcc-4.8-multilib gcc-multilib
  hardening-includes lcov lintian ocaml ocaml-compiler-libs ocaml-interp
  ocaml-nox pepperflashplugin-nonfree sa-compile virtualbox-dkms
The following NEW packages will be installed:
  gcc-5-base gcc-5-base:i386 libc6-dev:i386 libpcre3-dev:i386 libpcrecpp0:i386
  linux-libc-dev:i386

I see GCC 5 in that list. Is that causing the problem somehow? I'll leave it enabled for everything else here.

If I download the .deb for libpcre3-dev directly and try to install it with dpkg -i, it says:

dpkg: dependency problems prevent configuration of libpcre3-dev:i386:
 libpcre3-dev:i386 depends on libc6-dev.
 libpcre3-dev:i386 depends on libpcrecpp0 (= 1:8.31-2ubuntu2).

Earlier, I tried installing libc6-dev:i386 but it gave me the same list of packages that would be removed.

Also, now if I try to run apt-get again, it complains

You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 libpcre3-dev:i386 : Depends: libc6-dev:i386 but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

and if I try to run apt-get -f install, it gives me the same list of packages to remove.

(Incidentally, I've obviated the need for actually installing this for now, by manually unpacking the .deb file in a different location. So now advice for getting apt back into a happy state is more important, though I would still like to know what was going wrong originally.)

See this StackOverflow post. It's trying to purge your package (and dependencies) and redownload it all back. Instead, try running sudo apt-get install --reinstall libc6-dev-i386


14.04 Nvidia issues - black screen, freeze etc I have some issues with nvidia drivers on ubuntu 14.04, switchable graphics (intel HD + nvidia GT 740M).

Currently installed (from xorg-edgers repository): nvidia-352 (was recommended by ubuntu-drivers devices) + nvidia-prime + nvidia-settings.

Issues (appears only when nvidia is selected in prime, with intel no problems):

Blackscreen on login screen (I can hear sound, if I run startx from ctrl-alt-f1 and then stop it, or suspend/standby my pc and turn it on again - display appears).
when using touchpad it freezes every few minutes, and ctrl-alt-f1 then ctrl-alt-f7 unfreezes it. I saw bug report regarding this issue and it was marked as patched/fixed so not sure what the problem is.

Nvidia settings can show temp etc and seems like the driver has good communication with nvidia card.

I tried to purge nvidia*. I tried using different drivers (nvidia-331). Both cause the same issues.

The problem with hybrid graphics (aka switchable, etc) and nVidia Optimus technology is that nVidia doesn't give support of Optimus to Linux.  Meaning, you will always have problems of black screen when trying to run your machine with nVidia video chip directly.

To avoid this problem, there is a project called Bumblebee, which runs as main video chip the intel video integrated chip, turns off the nvidia to save power, and when you need video acelerating you can use optirun command to activate the nvidia chip.

You can find help about Bumblebee in the Ubuntu Help page:
https://wiki.ubuntu.com/Bumblebee

Hope that helps you solve your problem


How to specify which hidden files should remain hidden and choose which files are to be seen? For example, I have two folders .history and .trash

they both are from the same "tribe" but I never need to use the .history folder so it is useless to keep it in the explorer while .trash is useful to me and I need to view it regularly.
I want to hide .history even when "show hidden items" is checked on or view .trash when "show hidden items" is checked off.

can it be done?

There is a way to do exactly what you want. You can "show" a hidden folder without removing the dot in front. You have to create a symbolic link.

Open a terminal
Go to the folder containing the .trash hidden folder.
type ln -s .trash Trash

Now you have a symbolic link to .trash that shows even when hidden files are not shown.

The files or directories with . before its name is hidden. To make it hidden/unhidden simply add/remove respectively.
In your case:

Rename .history to history
Rename .trash to trash

Both will be no more hidden.
WARNING
This may cause breaks that may be simple or even complicated depended on the applications using it.
Do this with caution !!!
Hope this helps.


Onenote web doesn't work on Xubuntu 16.04 I have a desktop with Xubuntu 16.04 (fresh-installed a month ago): Onenote web doesn't work with both Firefox (onenote page remain white forever) and Chromium (it opens the page, but the loading icon on the adress bar keep running and the links on notes are disactive, the coursor doesn't change).

Had anyone the same problem and knows how to fix it? If i have to use another browser, i'll install it.

(I also tried to install the windows app on wine, but setup failed).

Thanks!

Their site is broken, maybe on purpose (although the Hanlon's razor and wide experience with their broken standards, non-conformant hardware, lack of drivers, suggests that MS just lacks good engineers). The problem is that it shows empty page for most (all?) browsers except of Internet Explorer.

How did I know it? I assumed it because in ancient past existed sites that only worked with Internet Explorer, so I installed addon to fake user agent, made it to look like IE8, and — voilà — site suddenly works!

To solve the problem you have to do the same. Also, I'd highly recommend to create a forum topic about the problem on MS site (so that the problem was publicly known by MS), and, perhaps, send a bug-report to MS support.

MS is known to have bad support for many apps (skype, drivers, just out off top of my head), so I'd also recommend to check an alternative to One Note (I can't adice it myself, because I didn't use anything like this, but linked suggestions are highly upvoted, perhaps worth a try; or, at least, leaving a comment what do you miss. And remember, those apps are FOSS, so you can easily find their bugtracker, and create a new "feature request" there.).

There seems to be a fairly simple workaround for this. Go to https://onedrive.live.com first, log in there and then open your OneNote documents from there. I was able to do this on Firefox after first getting a blank page when trying to get straight to https://www.onenote.com/. I have Linux Mint 18.1 installed.


Is there a way to lock a specific application, in ubuntu, with 'sudo' method For instance, if I needed to lock firefox, and whenever someone needs to access it (under the same username as mine) the usual sudo password prompt should appear. I have disabled password prompt by default under visudo by giving my username 'nopasswd' privilege.

Generally, the owner of the applications in Ubuntu is root. For example check the applications from /usr/bin. You can check this with ls -l /usr/bin. For Firefox Web Browser, the result is:

ls -l /usr/bin/firefox
lrwxrwxrwx 1 root root 25 aug  3 23:37 /usr/bin/firefox -> ../lib/firefox/firefox.sh

So, to lock Firefox for other users than root, you need to take out the execute permission for group and others. You can do this with the following command:

sudo chmod 766 /usr/bin/firefox

or

sudo chmod go-x /usr/bin/firefox

as you have mentioned in your question that , if you want to lock an application that could be accessed by only root means , just change the permissions.

sudo chown root:root /usr/bin/firefox
sudo chmod 700 /usr/bin/firefox

for example I made it for pidgin:

jai@frank-Jai:~$ sudo chown root:root /usr/bin/pidgin
[sudo] password for jai: $$$$$$
jai@frank-Jai:~$ sudo chmod 700 /usr/bin/pidgin
jai@frank-Jai:~$ pidgin
 bash: /usr/bin/pidgin: Permission denied

jai@frank-Jai:~$

next time onwards if you would like to open firefox means type as

sudo firefox

Please note that in some rare cases (but it is something that is true for e.g. Firefox and Chromium), when a command is called, there is a script that is called first and then it is the one that launches the "normal" program executable. If you disable the script from running you will prevent anyone from running the application normally (e.g. from shortcuts or commands e.g. firefox). If someone knows where the "normal" executable of that application is located, then he will be able to launch it without any problem through a terminal. In order to avoid this, you have to change the permissions of that executable as well. Firefox's executable is located at /usr/lib/firefox/firefox.

For Deluge as OP mentioned :

Deluge Consists of Deluge and Deluge-gtk . so you have to do that for both .


Why does installing node 6.x on Ubuntu 16.04 actually install node 4.2.6? These were my steps to install node on Ubuntu 16.04:

curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get install -y nodejs
sudo apt-get install -y npm

which are the official instructions:

https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions

After doing this, running nodejs --version returns v4.2.6.

As I used setup_6.x I was assuming a version beginning with 6 would be installed?

I thought perhaps setup_6.x should be setup_6.2.1, but that page returns a 404, see:

https://deb.nodesource.com/setup_6.x (there is a page there)

https://deb.nodesource.com/setup_6.2.1 (returns a 404)

How do I install the latest stable version of node on Ubuntu 16.04?

Edit:

These are results after running sudo apt-get install -y nodejs:

sudo apt-get install -y nodejs
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  gyp libboost-python1.58.0 libjs-inherits libjs-node-uuid libjs-underscore
  libssl-dev libssl-doc libuv1-dev linux-headers-4.4.0-18
  linux-headers-4.4.0-18-generic linux-headers-4.4.0-21
  linux-headers-4.4.0-21-generic linux-image-4.4.0-18-generic
  linux-image-4.4.0-21-generic linux-image-extra-4.4.0-18-generic
  linux-image-extra-4.4.0-21-generic linux-signed-image-4.4.0-18-generic
  linux-signed-image-4.4.0-21-generic python-configobj python-pycurl
  python-pyexiv2 python-pyexiv2-doc
Use 'sudo apt autoremove' to remove them.
The following NEW packages will be installed:
  nodejs
0 to upgrade, 1 to newly install, 0 to remove and 0 not to upgrade.
Need to get 0 B/3,162 kB of archives.
After this operation, 13.2 MB of additional disk space will be used.
Selecting previously unselected package nodejs.
(Reading database ... 329473 files and directories currently installed.)
Preparing to unpack .../nodejs_4.2.6~dfsg-1ubuntu4_amd64.deb ...
Unpacking nodejs (4.2.6~dfsg-1ubuntu4) ...
Processing triggers for doc-base (0.10.7) ...
Processing 1 added doc-base file...
Registering documents with scrollkeeper...
Processing triggers for man-db (2.7.5-1) ...
Setting up nodejs (4.2.6~dfsg-1ubuntu4) ...
update-alternatives: using /usr/bin/nodejs to provide /usr/bin/js (js) in auto mode

Edit:

Results of apt-cache policy nodejs:

apt-cache policy nodejs
nodejs:
  Installed: 4.2.6~dfsg-1ubuntu4
  Candidate: 4.2.6~dfsg-1ubuntu4
  Version table:
 *** 4.2.6~dfsg-1ubuntu4 500
        500 http://au.archive.ubuntu.com/ubuntu xenial/universe amd64 Packages
        100 /var/lib/dpkg/status

The core reason is that the setup script didn't run correctly.  Therefore, thanks to the updated data from the OP which supports this,  the data from the NodeSource repository was never seen by apt because it was not properly configured by the script.

The script, therefore, may not have found your distribution, or it may have messed up when configuring the repository, or there may have been a network interruption, or any of a thousand reasons it was disrupted and didn't do its job.

The fact you are seeing version 4.x getting installed means that the script didn't do its job right, so the script is not necessarily at fault.  This just means we have to potentially do this a harder way.

  I should point out: the script doesn't actually do any installing - all it does is determine the Debian/Ubuntu version you're on, and configure the repository for it to get data from.  The installation part is actually the sudo apt-get install step you ran by hand.

  Also of note: this will remove the npm package but that's because nodejs with this upstream packaging will include npm with it - no need for the npm package.

Rather than rely on the script, we can do what the script is doing the old-school way: by hand, ourselves, set up the repository configuration and install NodeJS.

Here's the manual way of making this work, and it is basically what the script does (except for Step 4, which is to make sure you are getting accurate version data):

Create a new file: /etc/apt/sources.list.d/nodesource.list

You'll need to create this file with sudo, but when you create the file, put this inside it:

deb https://deb.nodesource.com/node_6.x xenial main
deb-src https://deb.nodesource.com/node_6.x xenial main

Then, save the file. (replace node_6.x with node_7.x or node_8.x, etc. for newer Node versions)
Download the GPG Signing Key from Nodesource for the repository.  Otherwise, you may get NO_PUBKEY errors with apt-get update (use wget in this command if curl isn't installed, and if neither are installed, install one of them):

curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | sudo apt-key add -

Manually run sudo apt-get update.

This refreshes the data from the nodesource repo so apt knows a newer version exists.

If you get a NO_PUBKEY GPG error, then go back to Step 2
Check apt-cache policy nodejs output.

This is not done by the script, but you want to make sure you see an entry that says something like this in the output (though the version might be different if you are not using 6.x as the version string; the only thing we care about is that there's a newer version number provided via nodesource):

Version table:
    6.2.1-1nodesource1~xenial1 500
       500 https://deb.nodesource.com/node_6.x xenial/main amd64 Packages
    4.2.6~dfsg-1ubuntu4 500
       500 http://archive.ubuntu.com/ubuntu xenial/universe amd64 Packages

If you do not see entries like this, and only see 4.2.6, start over.  Otherwise, proceed.
Install the nodejs binary.  Now that you have confirmed 6.x is available on your system, you can install it: sudo apt-get install nodejs
nodejs --version should now show v6.2.1 or similar on output (as long as it starts with v6. you're on version 6 then; this may be a higher version number if you're using a newer version than 6 but as long as it is not 4.2.6 you should be good to go).

I found this link and it help me to install Nodejs8____https://www.ubuntuupdates.org/ppa/nodejs_7.x . I had to join Nojs8https in that line because it was saying that I needed to be level two to be able to post more than two links. I thinks that is random but whatever.

Before installing it I ran the command: apt-get remove --purge version nodejs

To verify you don't have any version installed run: apt-cached policy nodejs and or nodejs --version

I was able to install Node js 8 by just changing the 7 to 8 and I ended up with version 8.1.3.  To do that I ran the commands that are in that page I posted above but here are the commands anyways:

Download the the repository key with:

curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -

Then setup the repository::

sudo sh -c "echo deb https://deb.nodesource.com/node_7.x zesty main \ > /etc/apt/sources.list.d/nodesource.list"

sudo apt-get update

sudo apt-get install nodejs

Again, if you want node js 8 you can change number 7 in that command line to 8 and voila!


How to SSH into a Juju instance? I'm writing a charm that I deploy on a local juju instance. Works great, but it would help debugging the charm if I were able to SSH into the instance. Is there a way to do this?

Yes, you can ssh directly into any juju node with juju ssh, for example:

juju ssh mysql/0

or just the machine # if you want to do it that way:

juju ssh 0

This will ssh you into whichever unit of whichever service. I prefer to do it by service name because I tend to mix up numbers. If you're looking to debug a charm however, you should check out juju debug-hooks, which is an interactive ssh/tmux session designed to do exactly what you're doing.

If you're not on a Juju enabled box and need to SSH in, you need to find the IP/hostname of the machine to ssh to. In the case of Amazon or HP Cloud you can get this information via the usual CLI tools or by using the web console to get the IP that the provider has assigned the instance.

https://jujucharms.com/docs/stable/developer-debugging

Sorry for the necrobump!

I found the correct key. It is in the folder /home/$user/.juju/ssh/juju-id-rsa.pub.

Grab a copy of the two keys in that folder and point ssh to use them to gain access anywhere! :)


What happened to the ia32-libs package? The ia32-libs package is no longer present in Ubuntu 12.04 repositories for a 64bit system.
Are there any available replacement packages available for download?

The ia32-libs package was a hack to get 32-bit packages installed on a 64-bit installation. Since Ubuntu version 11.10 (Oneiric), Multi Arch has been added. One of the objectives for it is removing the ia32-libs package. Instead, you have to install the 32-bit libraries of a package with:

sudo apt-get install package-name:i386

You don't have to worry about this for packages in the standard repositories (e.g. the wine package). For external software, it's a bit more difficult because you have to find the dependencies manually. In that case, use your favorite search engine to find which libraries you need.

It seems that ia32-libs still exist, but merely as a convenience package to include common 32-bit libraries. This package now uses Multi Arch to install the 32-bit packages correctly.

I installed the ia32-libs like this (I run Ubuntu 13.04 Raring Ringtail on a 64 bit machine):

Check own architecture:

$ dpkg --print-architecture

Check if a foreign architecture is installed:

$ dpkg --print-foreign-architectures

Depending on the results of the two commands above, the following three commands might work (took a long time to process in my case):

$ sudo dpkg --add-architecture i386 && sudo apt-get update && sudo apt-get install ia32-libs


How to go about trying to access files stored on mobile phone (via USB)? I'd like to transfer files (photos and audio mainly) from my phone, to my Ubuntu PC. Unfortunately upon plugging it in (through Micro USB) nothing is automatically mounted. If I insert a memory card into the phone, then that is automatically mounted.

There is software I can run on Windows XP that allows me to transfer files (although it does not make the phone show up as a volume in Windows Explorer).

The phone is a 3 Skypephone S2 (manufactured by Amoi). Everything I find on the internet suggests it should have a mass storage mode. When connnecting the phone to the computer a "PC Suite" mode can be enabled, however this does not seem to make a difference.

I tried to install the Windows Software through Wine, however this didn't work. (Probably unsurprising that Wine doesn't help with hardware related problems.)

I looked at this page but was unable to get "1614:0407", although I doubt that it would have helped if I had been able to.

Running udisks --mount /dev/sr2 gives me a 'CD' with some Windows driver files. If I run sudo usb_modeswitch --default-vendor 0x1614 --default-product 0x1000 then this goes 'CD' away, but I do not get access to the phone's memory.

Below are the new entries in dmesg when the phone is connected. Entering PC Suite mode does not cause any more messages.

[  683.140030] usb 7-1: new full-speed USB device number 2 using uhci_hcd
[  683.312734] scsi8 : usb-storage 7-1:1.0
[  684.317071] scsi 8:0:0:0: CD-ROM            S2       Driver CDROM     2.31 PQ: 0 ANSI: 2
[  684.331067] sr2: scsi3-mmc drive: 0x/0x caddy
[  684.331241] sr 8:0:0:0: Attached scsi CD-ROM sr2
[  684.331799] sr 8:0:0:0: Attached scsi generic sg9 type 5

When plugging in, I get the following extra entries in /dev:

lrwxrwxrwx  1 root root           3 Feb 29 18:22 cdrom2 -> sr2
crw-rw----+ 1 root cdrom    21,   9 Feb 29 18:22 sg9
brw-rw----+ 1 root cdrom    11,   2 Feb 29 18:22 sr2

Below is the output from lsusb:

Bus 007 Device 003: ID 1614:1000 Amoi Electronics
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0        64
  idVendor           0x1614 Amoi Electronics
  idProduct          0x1000
  bcdDevice            0.00
  iManufacturer           1
  iProduct                2
  iSerial                 3
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           32
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0xa0
      (Bus Powered)
      Remote Wakeup
    MaxPower              500mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         8 Mass Storage
      bInterfaceSubClass      6 SCSI
      bInterfaceProtocol     80 Bulk (Zip)
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x84  EP 4 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x05  EP 5 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
cannot read device status, Operation not permitted (1)

It looks like they are using that silly trick where the device pretends to be a cdrom to get windows to autorun a program to install their software ( since windows foolishly won't autorun from usb mass storage ).

You might look at the usb-modeswitch package and see if it can flip the device into mass storage mode.

Further information from the authors web-site.

Okay first off, use apt-get in terminal to get a virtual box if you don't have one already and install a windows XP OS .iso on it. If you don't have the .iso, you know where to get one ;). Once it is install, install the extensions pack for it and you should be able to install the program for your phone in the virtual machine and access your phone through it as well after you select it in on the 'devices' > 'usb' drop-down menu. If you have issues after doing this, let me know.


What actually slows down Ubuntu running from USB stick I wanted to get portable working Ubuntu on the go, so I got a USB stick (DT50/64) about 100MB read speed by the spec and installed (persistent installation, not a live USB) Ubuntu 18.04 on it. Even during installation I noticed that the process took a lot longer than I expected it would take. After installation I realized how slow it is. Long boot time and it constantly hangs when it is working. I noted that USB stick heats a lot while it works. After some googling I have disabled swap file, switched logs to RAM, but still the system works really slowly in this setup.

So I wonder what is bottleneck in this case? Is it the USB drive as it is, is it slow USB drive speed, USB port limitations, would I gain much more speed if I used an external USB SSD?

btw, I'm plugging into a USB 3.0 port.

Update: as a conclusion of all answers here, the bottleneck is in USB Stick technology itself, but not in USB port, and a cheap external SSD should give me acceptable speed of work (something like an internal HDD or even better). I will update this thread as soon as I get SSD and test system on it. (external SSD)

Update: Thanks to @thomasrutter. I did find an old HDD with USB pocket for it and that is what I've got after some tests:

gdisk benchmark shows R/W: 105/80 MB/s for my USB stick and 44/40 for HDD connected to USB. Despite visible overcome in average speed USB stick graphics had a sawtooth pattern (jumps to top speed and to bottom through all the timeline) and the HDD had a stable "line".
Installing Ubuntu on a USB stick takes more than 30 min. and less than 10 min. on an HDD (connected to a USB port)
Booted from a USB stick Ubuntu after tweaks like: noswap, disabled logs... works like a slowpoke - constantly hangs for a while. HDD works pretty good, can without distractions clone git repositories and install node modules, apps work pretty fast and they start quite fast too.

Conclusion: I'll choose some mid SSD with a pocket and will use it.

The bottleneck is specifically the random write speed of the drive.

For read-only workloads, USB sticks are fast.  For continuous writing, USB sticks are fast (enough).  But for random writing, they are very, very slow.

Here's a typical speed test of a USB stick:

Note how in the right column, the write speed of 512KB blocks is poor (less than 2MB/s) but the write speed of 4KB blocks is very poor (less than 0.03MB/s)!  Your system drive needs to be able to do frequent small writes for temporary files, logging, and caching (eg by web browsers) and these activities choke up a USB stick.

This particular drive also has fairly slow random 4K read speed too, but at 0.76 MB/s that is still an order of magnitude faster than 4K writes.

By comparison here's the result from a typical SSD:

An SSD uses wear-levelling and write remapping, sophisticated techniques which both prolong drive life and drastically speed up writes.

For comparison, traditional HDDs are about 1.0 - 1.5MB/s at 4K writes.  SSDs became practical as system drives once they reached that performance level (which they've now surpassed many times over).

There are some rare USB sticks (such as recent models in the Sandisk Extreme range) which use SSD-like techniques to achieve respectable speeds, but these cost a premium and 99.9% of USB sticks in use do not do this. When comparing drive performance it can be useful to Google for CrystalDiskMark benchmarks of the drive.

I Agree with @user535733 - I/O speed. The flash tech used in these little thumb drives as pretty cheap stuff - you get what you pay for unfortunately and the manufacturer probably isn't focused on the users trying to boot from them - even with high-end desktops / PCI - USB3 isn't all that great compared to SATA. You cloud try an "NVMe PCIe" drive and USB3 NVMe PCIe enclosure (just have to check the details and make sure the enclosure is high end)

I'm sure most of them will be very fast though.

https://www.amazon.com/Samsung-970-EVO-250GB-MZ-V7E250BW/dp/B07BN5FJZQ/ref=sr_1_1?s=electronics&ie=UTF8&qid=1534807995&sr=1-1&keywords=samsung+nvme+pcie

https://www.amazon.com/KINGSHARE-USB3-0-External-Enclosure-SATAIII/dp/B076DYH5NC/ref=sr_1_fkmr1_1?s=electronics&ie=UTF8&qid=1534808107&sr=1-1-fkmr1&keywords=nvme+pcie+m.2+usb3+enclosure


Does 'rm files*' remove all matches from all sub-directories? I want to remove any file that looks like wordpress-891.sql from the current directory (not inside sub-directories).

Will rm wordpress-*.sql do the trick or will it also remove matches from sub-directories?

No. Normal globbing * is not recursive and neither is rm.

If a directory name matches, it won't be removed - you need the -r flag to delete a directory.

So it's safe to do that if you're sure you want to delete those files.

You can also make rm interactive

rm -i wordpress-*.sql

then it will ask for confirmation before deleting each file

If you would like to find and delete all matching files such as wordpress-*.sql, you can use find command. :)

For instance, you would like to remove all matching files with wordpress-*.sql under test_dir, do like the following.

cd test_dir
find . -name "wordpress-*.sql" -exec rm -f {} \;

Whenever find program really finds a matching file, it tries to execute a command following after -exec option. In this case rm -f {} will be executed and {} will be changed to the match file name.
E.g.

rm -f wordpress-169.sql

You can also set the depth of sub-directories with -maxdepth option.

cd test_dir
find . -maxdepth 3 -name "wordpress-*.sql" -exec rm -f {} \;

Please note that you must specify -maxdepth option before other options.
Otherwise you may meet the results what you really don't want to see.


Installed as a dual boot ubuntu 13.04 alongside win8 and no grub? i previously had windows 7 on my machine when i bought it i installed win8 now but i wanted to try out ubuntu so i installed alongside win8 but there was no grub screen to choose ubuntu.. if anyone knows of a way to fix this please let me know !! THANK YOU

Boot up a live cd that is the same version and bit as your Ubuntu OS. Use boot-repair to reinstall grub. Here is how first open up a terminal in put in this code.

Installing boot-repair

sudo add-apt-repository ppa:yannubuntu/boot-repair && sudo apt-get update

than

sudo apt-get install -y boot-repair && (boot-repair &)

Opening boot-repair

sudo boot-repair

Using boot-repair

Then puss "Recommended repair" and before that, you need to make sure the default setting is right for your system, so just look over the Advanced options.

After you have done that reboot your computer and you will see grub again!

source :
https://help.ubuntu.com/community/Boot-Repair

You could download EasyBCD for Windows, and add Grub2 to the Windows bootloader (only works for Vista or newer visions of Windows). You may have to manually specify which partition Grub2 is located on.


Is there an alternative to k3dsurf in 12.10? I've just upgraded to Quantal Quetzal on my home computer and discovered that the program K3dSurf has been removed from the repositories. (Presumably since it doesn't seem to be in active development and still depends on qt3 libraries.)
Does anyone know of a similar program (user-friendly and versatile) for drawing 3D surfaces? This has been a mission-critical program for me when teaching multivariable calculus, so I won't be able to upgrade at work unless I can find a replacement.
(Yes, I could install directly from the program's website, but dealing with obsolete libraries sounds like a giant headache.)

No, but you can install it using the following packages from Debian Squeeze:
k3dsurf and libqt3-mt.

It works well.

Just to say that now there is a new replacement to K3DSurf, check this discussion for more informations.


how can a bash file run without needing to enter sudo pass-phrase manually? I write a bash file thus:

#!/bin/bash
echo 1000 |sudo tee /sys/class/backlight/intel_backlight/brightness

(that changes the screen's brightness)

I need it to run at startup, but because it requires the sudo pass-phrase I must enter the pass-phrase manually. How can I reform this code not to require the sudo pass-phrase at run time?

For this particular problem, you could probably just stick echo 1000 > /sys/class/backlight/intel_backlight/brightness in /etc/rc.local (before the exit-line). That would run it on boot, as root before the desktop was loaded.

But in general (how do I run a script as root?) things are a bit sticker...

You could just run sudo ./myscript (by editing sudoers) but just allowing ./myscript to be run without a password would mean you (or a program running as you) could edit that file and suddenly you can run anything as root without going through the proper procedures. Uber-poor security.

Instead I would suggest:

sudo mv myscript /sbin/myscript
sudo chown root:root /sbin/myscript
sudo chmod 700 /sbin/myscript

The ch* commands now mean only root can read/run the script. Sticking it in /sbin/ is just incidental - you don't have to do that.

Now you need to edit /etc/sudoers. The Wiki has a good example and you'll just need to substitute the shutdown commands with your script's path (use a full, absolute path). NOPASSWD is the key keyword here. It allows you to run something as sudo without the password. So then you can just add sudo /sbin/myscript to your startup jibberyboo and you're flying.

I'm just taking a shot in the dark, but try to change permissions on the file

  chmod 777 [file path]


After login in the desktop remains blank I have installed Ubuntu 10 last night and finished all upgrading stuff, in the time when updates are applied I downloaded a torrent file. As soon as download is finished I rebooted my system. As usual at start up it asked my login and I did the same.

After a successful login It should show me the desktop, or show an error message in case anything has gone wrong. But what I had is only a cursor and a blank wall paper.

Can anybody tell me what is the problem and how to resolve this?

Thanks

Press Ctrl+Alt+F1
Login
Type

sudo apt-get update
sudo apt-get install --reinstall ubuntu-desktop
sudo reboot

Ctrl Alt F1
sudo apt-get install update
sudo startx


How to use ZTE AX326 Modem on Ubuntu 10.10? I want to use zte ax 326 modem on ubuntu, but this is not working.
can you help me how can I use usb modem on ubuntu 10.10, please.

thanks.

there is an answer for that ;-)

http://unix-master.blogspot.com/2013/02/zte-ax326-4g-modem-drivers-for-linux.html


After 17.10 upgrade, can't use Nautilus and many applications I upgraded to 17.10 last night. Upon reboot, I noticed I couldn't launch gnome-terminal. This morning, I noticed I couldn't open any folders on the Desktop and many applications, whether from the desktop, or my favorites, or the command line. Examples: LibreOffice, evince, gedit. Applications that do work include Firefox and Emacs.

Here is what happens when I try to run Nautilus and evince from the console (Terminology):

rwhe@duell3:~$ nautilus
sys:1: PyGIWarning: Nautilus was imported without specifying a version
first. Use gi.require_version('Nautilus', '3.0') before import to ensure
that the right version gets loaded.
Initializing nautilus-dropbox 2015.10.28
Segmentation fault (core dumped)
rwhe@duell3:~$ evince
Segmentation fault (core dumped)
rwhe@duell3:~$

I've already googled the gi.require_version warning and a number of other related topics and followed the advice that worked for other people, with no results, so please don't mark this as a duplicate.

The only change I've made to my system since the upgrade is uninstalling the last vestiges of Ubuntu Mate, and then reinstalling them in the hope of fixing my issue. Again, no visible, relevant results.

Thanks for your time and expertise.

Ubuntu 17.10 will default to Wayland instead of X for display, but only when possible, then X is used.  The choice should be offered by clicking on the little gear beside the signin button on the login screen.  Choices with (Xorg) in them will run X, and should be used for maximum compatibility with programs (your case).  If you have a choice with just the "ubuntu" label, that is wayland, and as you have noticed, many programs have problems.  I have seen additional choices like "unity" which runs the old unity interface under X. Some people don't even get the gear (live media, virtual machines,...) so cannot even choose, but I think they are defaulting to X, so wont have Wayland issues.  It is unclear why Wayland is not even offered in some cases, maybe there were so many problems, there was a last second change.  Time will sort these issues out, but for now, if you can run X, you are better off doing so.


Looking for a countdown app where I can set value in days Looking for countdown app where I can set value in days.

There're apps that allow to set hrs:mins:secs, but I want to set in days.

For example, Windows 7 has this sort of countdown app.

You can use Screenlets:

sudo apt-get install screenlets screenlets-pack-all

Try this

If you can't see the picture, the app is called Alarm Clock.I hope this helped your issue, if you need any more help just ask!


Can't connect to smtp.gmail.com on port 465 or 587 I have an Ubuntu 14.04 (Trusty Tahr) is mounted on AWS and i cannot connect to the SMTP GMail service vía:

SSL(465):

## $ telnet smtp.gmail.com 465 ##
Trying 74.125.28.109...
Trying 74.125.28.108...
Trying 2607:f8b0:400e:c04::6c...
telnet: Unable to connect to remote host: Network is unreachable

TLS(587):

## $ telnet smtp.gmail.com 587 ##
Trying 74.125.28.108...
Trying 74.125.28.109...
Trying 2607:f8b0:400e:c04::6c...
telnet: Unable to connect to remote host: Network is unreachable

My open ports are:

## $ sudo netstat -tlnp ##
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      1069/mysqld
tcp        0      0 127.0.0.1:6379          0.0.0.0:*               LISTEN      1050/redis-server 1
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      959/sshd
tcp6       0      0 :::80                   :::*                    LISTEN      7716/apache2
tcp6       0      0 :::22                   :::*                    LISTEN      959/sshd

The UFW Firewall are inactive

## $ sudo ufw status verbose ##
Status: inactive

I already saved the firewall rules with:

$ sudo iptables -A INPUT -p tcp --dport 587 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
$ sudo iptables -A OUTPUT -p tcp --sport 587 -m conntrack --ctstate ESTABLISHED -j ACCEPT
$ sudo iptables-save

I had similar problem, VPS machine without firewall and with same error as you listed. I contacted support of VPS provider and it turned out they had one more firewall that was wrapping my machine. So they enabled port 587 on that firewall and everything was working smoothly.

This may be a firewall problem. I faced a similar problem in Ubuntu (Digital Ocean server). I tried to fix the issue for 3 days. I equally tried using auth2, and finally checked the Digital Ocean admin panel and created a firewall for the droplet.

The problem was solved by enabling TCP inbound and outbound in the firewall settings.


Login screen never appears I am not able to log in to Ubuntu. When I start my laptop and select Ubuntu, the screen with the Ubuntu logo and progress bar dots is shown. I wait for some time but it doesn't show me the login screen. I have tried to restart it but the same problem occurs.
I am new to Ubuntu.

Try this:

sudo gedit /etc/default/grub

Find the line: LINUX_CMDLINE_DEFAULT and add this between the "": quiet nosplash nohz=off

Then:

sudo update-grub

Do all this in a terminal window, of course, and then reboot.


Why is "No new release found" when upgrading from a LTS to the next? I'm following the upgrade instructions on Ubuntu's website, but on launching the upgrade tool I get this response:

Checking for a new ubuntu release
No new release found

Am I doing something wrong? Is there a workaround?

According to Ubuntu Engineering Foundations team manager Steve Langasek:

  Upgrades between LTS releases are not enabled by default until the first point release, 14.04.1, scheduled for July.  It is recommended that most LTS users wait until then before upgrading to 14.04.

If you choose to upgrade before then, you can pass the -d option to the upgrade tool, running do-release-upgrade -d or update-manager -d, to upgrade from vanilla 12.04 to 14.04. (-d stands for devel.)

This question explains the justification for waiting for the prompt:

Upgrading LTS to LTS (server) -- why wait for the first point release?

2 options :

Burn the iso and put it in your drive, it will detect the upgrade automatically
Go in you synaptics options, then Preference > distribution > Always prefer the highest version.

Problem solved ?


vim is not remembering last position My Ubuntu LTS 12.04 has vim editor. If I open a file, move to a paragraph and reopen vim, then the cursor goes to beginning of the file always.

This is not the expected behavior.  How the vim can remember last read position after closing a file?

I tried vi also, but the result is the same.

The file /etc/vim/vimrc already contains necessary feature. Just need to uncomment it:
" Uncomment the following to have Vim jump to the last position when
" reopening a file
if has("autocmd")
  au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
endif

(Infact, you can refer to /usr/share/vim/vim73/vimrc_example.vim also)

There is a mistake in Lunar Mushrooms solution. Here the correction:

if has("autocmd")
  " When editing a file, always jump to the last known cursor position.
  " Don't do it when the position is invalid or when inside an event handler
  " (happens when dropping a file on gvim).
  " Also don't do it when the mark is in the first line, that is the default
  " position when opening a file.
  autocmd BufReadPost *
    \ if line("'\"") > 1 && line("'\"") <= line("$") |
    \   exe "normal! g`\"" |
    \ endif

endif