Why use apt-get upgrade instead of apt-get dist-upgrade?

[Origin]: http://askubuntu.com/questions/194651/why-use-apt-get-upgrade-instead-of-apt-get-dist-upgrade

I typically upgrade my machines with:

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

Below is an excerpt from man apt-get. Using upgrade keeps to the rule: under no circumstances are currently installed packages removed, or packages not already installed retrieved and installed. If that’s important to you, use apt-get upgrade. If you want things to “just work”, you probably want apt-get dist-upgrade to ensure dependencies are resolved.

To expand on why you’d want upgrade instead of dist-upgrade, if you are a systems administrator, you need predictability. You might be using advanced features like apt pinning or pulling from a collection of PPAs (perhaps you have an in-house PPA), with various automations in place to inspect your system and available upgrades instead of always eagerly upgrading all available packages. You would get very frustrated when apt performs unscripted behavior, particularly if this leads to downtime of a production service.

upgrade
    upgrade is used to install the newest versions of all packages
    currently installed on the system from the sources enumerated in
    /etc/apt/sources.list. Packages currently installed with new
    versions available are retrieved and upgraded; under no
    circumstances are currently installed packages removed, or packages
    not already installed retrieved and installed. New versions of
    currently installed packages that cannot be upgraded without
    changing the install status of another package will be left at
    their current version. An update must be performed first so that
    apt-get knows that new versions of packages are available.

dist-upgrade
    dist-upgrade in addition to performing the function of upgrade,
    also intelligently handles changing dependencies with new versions
    of packages; apt-get has a "smart" conflict resolution system, and
    it will attempt to upgrade the most important packages at the
    expense of less important ones if necessary. So, dist-upgrade
    command may remove some packages. The /etc/apt/sources.list file
    contains a list of locations from which to retrieve desired package
    files. See also apt_preferences(5) for a mechanism for overriding
    the general settings for individual packages.
shareimprove this answer

Exclude packages from `apt-get upgrade`

[Origin]: http://askubuntu.com/questions/99774/exclude-packages-from-apt-get-upgrade

To hold a package:

In short: sudo apt-mark hold <package>

or

echo <package> hold | sudo dpkg --set-selections

To unhold a package:

In short: sudo apt-mark unhold <package>

or

echo <package> install | sudo dpkg --set-selections
shareimprove this answer

How can I change the date modified/created of a file?

[From]: http://askubuntu.com/questions/62492/how-can-i-change-the-date-modified-created-of-a-file

Easiest way – accessed modified will be the same:

touch -a -m t 201512180130.09 fileName.ext

Where:

-a = accessed
-m = modified
t  = timestamp - use [[CC]YY]MMDDhhmm[.ss] time format

If you wish to use NOW just drop the t and the timestamp

To verify they are all the same: stat fileName.ext

See: touch man

shareimprove this answer

Manage Processes with killall and kill

https://www.linode.com/docs/tools-reference/tools/manage-processes-with-killall-and-kill

killall is a tool for ending running processes on your system based on name. In contrast, killterminates processes based on process ID number or “PID.” kill and killall can also send specific system signals to processes. Use killall and kill in conjunction with tools including ps to manage processes and end processes that have become stuck or unresponsive when necessary.

Usage

killall

The killall command takes the following form:

killall [process name]

Replace [process name] with the name of any process that you wish to terminate. killall will terminate all programs that match the name specified. Without arguments, killall sends SIGTERM, or signal number 15, which terminates running processes that match the name specified. You may specify a different signal using the -s option as follows:

killall -s 9 [process name]

This sends the SIGKILL signal which is more successful at killing some particularly unruly processes. You may also specify signals in one of the following formats:

killall -KILL [process name]
killall -SIGKILL [process name]
killall -9 [process name]

The above group of commands are equivalent.

kill

The kill command terminates individual processes as specified by their process ID numbers or “PIDs.” Commands take the following form:

kill [PID]

This sends SIGTERM to the PID specified. You may specify multiple PIDs on the command line to terminate processes with kill. You may also send alternate system signals with kill. The following examples all send the SIGKILL signal to the PID specified:

kill -s KILL [PID]
kill -KILL [PID]

System Signals

You may use kill and killall to send any of the following signals.

  1. SIGHUP
  2. SIGINT
  3. SIGQUIT
  4. SIGILL
  5. SIGTRAP
  6. SIGABRT
  7. SIGIOT
  8. SIGFPE
  9. SIGKILL
  10. SIGUSR1
  11. SIGSEGV
  12. SIGUSR2
  13. SIGPIPE
  14. SIGALRM
  15. SIGTERM
  16. SIGSTKFLT
  17. SIGCHLD
  18. SIGCONT
  19. SIGSTOP
  20. SIGSTP
  21. SIGTTIN
  22. SIGTTOU
  23. SIGURG
  24. SIGXCPU
  25. SIGXFSZ
  26. SIGVTALRM
  27. SIGPROF
  28. SIGWINCH
  29. SIGIO and SIGPOLL
  30. SIGPWR
  31. SIGSYS

Issue one of the following commands to get a list of all of the available signals:

kill -l
killall -l

If you need to convert a signal name into a signal number, or a signal number into a signal name consider the following examples:

$ kill -l 9
KILL

$ kill -l kill
9 

Finding Running Processes

You may use a utility like htop </using-linux/administration-basics#monitor_processes__memory__and_cpu_usage_with_htop> or top` to view a real time list of process and their consumption of system resources. You may also use the ps command to view processes that are currently running and their PIDs.

$ ps aux | grep "emacs" 
username  3896  0.0  2.2  56600 44468 ?        Ss   Sep30   4:29 emacs
username 22843  0.0  0.0   3900   840 pts/11   S+   08:49   0:00 grep emacs

This command filters the list of all processes that are currently running for the string emacs usinggrep. The number listed in the second column is the PID, which is 3896 in the case of the emacsprocess. The grep process will always match itself for a simple search, as in the second result. To view a hierarchical tree of all running processes, issue the following command:

ps auxf

Once you have obtained the PID or process name, use killall or kill to terminate the process as above.

Verifying Process Termination

The -w option to the killall command causes killall to wait until the process terminates before exiting. Consider the following command:

killall -w irssi

This command issues the SIGTERM system signal to the process with a name that matchesirssi.killall will wait until the matched processes have ended. If no process matches the name specified, killall returns an error message, as below:

$ killall -w irssi
irssi: no process found

This guide is published under a CC BY-ND 3.0 license.

Two simple yaourt tips

http://kissmyarch.blogspot.ca/2012/05/two-simple-yaourt-tips.html

Just a quick post to improve your experience with yaourt. For many it will be straighforward but maybe it will be useful for others.

If yaourt asks too much…

If you fed up with these questions asked all the time by yaourt:
Edit PKGBUILD ? [Y/n] (“A” to abort)
Edit <pkg_name>.install ? [Y/n] (“A” to abort)
Continue building <pkg_name> ? [Y/n]

The simple solution is to create a .yaourtrc under your home directory and configure yaourt to your taste. You can use the global /etc/yaourtrc file as a sample:

cp /etc/yaourtrc ~/.yaourtrc

Edit .yaourtrc to your liking according to http://archlinux.fr/man/yaourtrc.5.html

I simply edited two lines:

BUILD_NOCONFIRM=1
EDITFILES=0

These two will prevent yaourt to ask for editing anything and for continuing the build, it will skip these steps and will build the packages for you automatically. Still it will leave you some manual controls not to install anything unintentionally:

  • When you do system upgrade ( yaourt -Syua ), it will tell you what packages are to be installed and will ask “Continue upgrade ? [Y/n]”.
  • It will always ask the last question for installing a package after building it: “Proceed with installation? [Y/n]”.
Search and install interactively

If you use yaourt without options ( i.e. yaourt <pattern> ) it will search packages just it would do with the -Ss option ( i.e. yaourt -Ss <pattern> ) but it will mark the results with numbers and ask if you want to install one of them. Just type the number of the chosen package and hit Enter to install it. If you hit Enter without a number yaourt will quit.

Specific Wine Applications don’t have Internet Access

http://askubuntu.com/questions/657081/specific-wine-applications-dont-have-internet-access

There is a solution suggested in this post: How to configure wine to install Evernote?, explained further here: instalar-evernote-en-linux (is in Spanish but it has a lot of images)

You could install playonlinux. Once PlayOnLinux is installed, goto manage wine versions, and install wine 1.4.1 32bit.

Then click install program -> install a non-listed program -> Install a program in a new virtual drive.

Give a name for your application virtual drive (“evernote” or whatever you like), then mark Use another version of wine and select the 1.4.1 that you’ve just installed. Kind of virtual drive I choose32bit windows installation.

Browse for the installer in your drive, wait for the installation to finish and close Evernote, so PlayOnLinux can notice that the installation has finished.

This works for Evernote_5.8.13.8152 in Ubuntu 15.04.

shareimprove this answer

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