• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here:Home » Useful apt Tricks For SSH (Ubuntu, Debian and Deb Linux)

By Abhishek Ghosh October 8, 2014 6:17 pm Updated on October 8, 2014

Useful apt Tricks For SSH (Ubuntu, Debian and Deb Linux)

Advertisement

Here are some apt tricks for SSH, manly useful to Debian, Ubuntu and deb Linux servers. There are some lesser known commands related to apt. Previously we talked about Advanced Packaging Tool (apt) and aptitude, probably this will be a practical and useful to the readers. You can read about the package managers. We can have apt-get on OS X too.

 

Useful apt Tricks For SSH

 

Everyone knows these three commands :

Vim
1
2
3
apt-get update
apt-get upgrade
aptitude upgrade

apt-get and aptitude are both front ends to dpkg. Use one or the other but be consistent. aptitude is newer and is suppose to be easier to use. It also unifies some of the apt-* functions. We can add flags to apt-get :

Advertisement

---

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
apt-get update -y
# no need to accept the prompt
apt-get -u install apache2
# updates only apache2
apt-get install packageName --only-upgrade
# understandable
apt-get install '*ngin*'
# wildcard for nginx
apt-get download nginx
# only download
apt-get check
# if you got disconnected while installing...
sudo apt-get --compile source nginx
# download, unpack and compile from source code
apt-get remove --purge <dist>
# remove is identical to install except that packages are removed
        instead of installed. Note that removing a package leaves its
        configuration files on the system. If a plus sign is appended to the
        package name (with no intervening space), the identified package
        will be installed instead of removed.
apt-get purge <dist>
# purge is identical to remove except that packages are removed and
        purged (any configuration files are deleted too).
apt-get autoremove <dist>
# dangerous, removes all the dependencies too
apt-cache pkgnames
# dot it!
apt-get dist-upgrade
# intelligently handles changing dependencies with new versions
       of packages
sudo do-release-upgrade
# distribution upgrade, dangerous from ssh
man do-release-upgrade
# distribution upgrade manual
man apt-get
# manual !

Useful apt Tricks For SSH (Ubuntu, Debian and Deb Linux)

Now, something more with dpkg

Vim
1
2
3
4
5
6
7
8
9
dpkg --get-selections
# View all the packages installed on a system
dpkg --get-selections > installed_packages.txt
# get a list
#
# Ok, make apt-get ignore updating a package
echo package-name hold | dpkg --set-selections
echo package-name install | dpkg --set-selections
dpkg --get-selections | grep hold

Removal of unused package files :

Vim
1
2
3
4
5
du -h /var/cache/apt/archives/
apt-get clean
# remove all the packages except files which are locked. There is another command
apt-get autoclean
#  remove all the packages which are no longer available in the repository

Search function :

Vim
1
2
3
4
5
6
7
8
9
10
11
12
apt-cache search ^apache2$
# example shows how to search the repository
apt-cache show apache2
# displays basic information about apache2
apt-cache showpkg apache2
# displays detailed information about apache2
apt-file list nginx | more
# display all the files located inside nginx
apt-cache depends mysql
# show dependencies
apt-cache stats
# do it!

There are huge tricks, we listed some commonly used.

Tagged With paperuri:(396709b4f2c73bd30c0665b1d0468c16) , ssh service ubuntu ssh service Loaded: not-found (Reason: No such file or directory) Active: inactive (dead)
Facebook Twitter Pinterest

Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to Useful apt Tricks For SSH (Ubuntu, Debian and Deb Linux)

  • Nginx WordPress Installation Guide (All Steps)

    This is a Full Nginx WordPress Installation Guide With All the Steps, Including Some Optimization and Setup Which is Compatible With WordPress DOT ORG Example Settings For Nginx.

  • aptitude vs apt-get vs apt

    aptitude update, apt-get update, apt update do the same job. Then what is the difference between them? We explained the basic of Advanced Packaging Tool (apt) and aptitude in the linked old article. Let us first discuss aptitude and apt-get. aptitude, apt-get and apt are front ends to dpkg. aptitude provides a terminal menu interface […]

  • Steps To Install Nginx Plus on Ubuntu Server (HP Cloud)

    Here Are the Steps To Install Nginx Plus on Ubuntu Server Running on HP Cloud. Nginx Plus is the Paid Version of Nginx with Extra Features.

  • WordPress Multisite on Nginx on Ubuntu 14.04 on HP Cloud

    Here is a Step by Step Guide on Setting Up WordPress Multisite on Nginx on Ubuntu 14.04 on HP Cloud with All Commands and the Configuration.

performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

Get new posts by email:

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (24.3K Followers)
  • Twitter (5.8k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • What is Hardware Security Module (HSM)September 30, 2023
  • Transducer Technologies of HeadphonesSeptember 28, 2023
  • What is Analog-to-Digital Converter (ADC)September 27, 2023
  • Comparison of Tube Amplifiers and SemiconductorsSeptember 26, 2023
  • What is a Digital-to-Analog Converter (DAC)September 25, 2023
PC users can consult Corrine Chorney for Security.

Want to know more about us?

Read Notability and Mentions & Our Setup.

Copyright © 2023 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy