arrow_upward

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SOME EVERGREEN USEFUL LINUX COMMANDS
#1
Hello Friends:
Today i wish to share with you some very easy but useful commands for linux Debian/Ubuntu . The experts can't really like it but newbies really want to know those commands.
two most used commands as everyone know as "apt-get update , apt-get upgrade"
so with this you can install any package with "apt-get install [package name]
But mostly we got problem when we wish to uninstall or remove any app who misbehave or unused. and mostly running apps are difficult to be remove with simple remove command.
so i like to share some special commands.
if you victim with broken package. try this sequence of any one of those.

sudo apt-get clean

it will clean registry or cache.

sudo dpkg --configure -a

it will auto configure package list again.

sudo apt-get autoremove

This command simply helps you to remove broken package.
but mostly with this command you reply from server that package not found. try to reinstall or etc....
then you try this command to install selected package again with good complete files.

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


"-f" is use for force process. you can use it for various process.you can also use it as simple as

sudo apt-get -f install package_name #(force install)

sudo apt-get -f remove package_name  #(force remove)

but if you again get any error you try this

sudo dpkg --remove --force-remove-reinstreq package_name

it will again try to force remove your unwanted package.
at the end try this to purge if your package are distributed on different places. and simple remove command can't collect full data.

sudo apt-get autoremove --purge

removing package with all cache and check the availability on package list.

sudo rm -rf  /var/cache/apt/archives/nodejs_0.10.28-1chl1~trusty1_amd64.deb

also this if above are mot works.

sudo dpkg -i --force-overwrite /var/cache/apt/archives/nodejs_0.10.28-1chl1~trusty1_amd64.deb


Hope you like it and it's makes your work more easy to install and remove any package..

Regards
Sagher
Heart LOVE FOR ALL  HATRED FOR NONE Heart
#2
can you please make one for cent os ?
some commands wont work on cent os :3

Thanks to @Post4VPS & @Racknerd for Providing thier : VPS 2

#3
@YOuNeS_Dz : can you please define me which one are not working for you. then i try to fix it as per centOS.
But remember one thing. "apt-get" command are only for Debian and Ubuntu. for CentOS you can use "yum" command to install something.
Heart LOVE FOR ALL  HATRED FOR NONE Heart
#4
for Centos just change the"apt-get" command into "yum", if you experience some errors you can post it here and our brothers can help you out.
#5
Well,
the problem was here


sudo apt-get -f install package_name #(force install)

sudo apt-get -f remove package_name  #(force remove)


i forget to put sudo :Tongue .. now done, thank you Smile

Thanks to @Post4VPS & @Racknerd for Providing thier : VPS 2

#6
Some Basic Commands For CentOS are not too different as Debian or Ubuntu.
For example

yum install <package name>

yum update <package name>

yum check-update

yum remove <package name>

 
Used to remove specified packages, along with any other packages dependent on the packages being removed. 

yum provides <file name>


Used to determine which packages provide a specific file or feature.


yum search <keyword>


This command is used to find any packages containing the specified keyword in the description, summary, packager and package name fields of RPMs in all repositories.


yum localinstall <absolute path to package name/s>

Second is to install RPM packages.
if you have backup of package
Use -ivh switch along with rpm command as shown below

# cd /root/rpms
# rpm -ivh cvs-1.11.23-16.el6.i686.rpm
Preparing...                ########################################### [100%]
   1:cvs                    ########################################### [100%]





If directly from web link.But for this you need to have the proper link of the rpm you want to download or install:

# rpm -ivh ftp://ftp.pbone.net/mirror/ftp.centos.org/6.5/os/i386/Packages/cvs-1.11.23-16.el6.i686.rpm
Retrieving ftp://ftp.pbone.net/mirror/ftp.centos.org/6.5/os/i386/Packages/cvs-1.11.23-16.el6.i686.rpm
warning: /var/tmp/rpm-tmp.z3VsTc: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Preparing... ########################################### [100%]
1:cvs ########################################### [100%]

if not don normally then use force installation method.Use --force argument along with -ivh switch as shown below to install forcefully without dependencies


# rpm -ivh vsftpd-2.2.2-11.el6_4.1.i686.rpm --force
warning: vsftpd-2.2.2-11.el6_4.1.i686.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Preparing... ########################################### [100%]
1:vsftpd ########################################### [100%]


Finally. Upgrading or removing the RPM packages.Use -Uvh switch along with rpm command
Upgrade:

# rpm -q vsftpd
vsftpd-2.0.5-28.el5.i386
# rpm -Uvh vsftpd-2.2.2-11.el6_4.1.i686.rpm
warning: vsftpd-2.2.2-11.el6_4.1.i686.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Preparing... ########################################### [100%]
1:vsftpd ########################################### [100%]


Remove:

You can uninstall a package using -e switch along with rpm command

# rpm -qa | grep cvs
cvs-1.11.23-16.el6.i686

# rpm -e cvs-1.11.23-16.el6.i686

Use an extra argument --nodeps along with rpm command to remove/uninstall a package without dependencies


# rpm -e vsftpd-2.2.2-11.el6_4.1.i686 --nodeps
[code]
[/code]

Regards:
Sagher


Heart LOVE FOR ALL  HATRED FOR NONE Heart
#7
Really basic, but useful for beginners I would say. Anyways, it would be better if you explain what commands do, because it helps beginners to learn basic Linux commands.
#8
@Jayce : yes i definitely do it on demand. i make it simple in first step. if any member need further detail. i like to explain as required.
Heart LOVE FOR ALL  HATRED FOR NONE Heart


Possibly Related Threads…
Thread
Author
Replies
Views
Last Post

person_pin_circle Users browsing this thread: 1 Guest(s)
Sponsors: VirMach - Host4Fun - CubeData - Evolution-Host - HostDare - Hyper Expert - Shadow Hosting - Bladenode - Hostlease - RackNerd - ReadyDedis - Limitless Hosting