Delete configuration files apt-get




















I knew the supervisor package was removed, and I assumed that the package didn't remove the config files to avoid losing custom configurations. In my case I wanted to start over from scratch, so deleting the directory sounded like a reasonable thing.

Shouldn't the package installation deploy the supervisord. Well, technically no. Not with the way I removed the supervisor package. If we look at apt-get 's man page a little closer we can see why the configuration files are still there. As the manpage clearly says, remove will remove the package but leaves configuration files in place.

If we use dpkg to look at the supervisor package, we will start to see the issue. With the dpkg package manager a package can have more states than just being installed or not-installed.

In fact there are several package states with dpkg. If you look at the first column of the dpkg --list it shows rc. The r in this column means the package is remove , which as we saw above means the configuration files are left on the system. The c in this column shows that the package is in the state of config-files.

Meaning, only the configuration files are deployed on this system. When running apt-get install the apt package manager will lookup the current state of the package, when it sees that the package is already in the config-files state it simply skips the configuration file portion of the package installation. Since I manually removed the configuration files outside of the apt or dpkg process the configuration files are gone and will not be deployed with a simple apt-get install.

At this point, I found myself with a broken installation of supervisor. Luckily, we can fix the issue by using the purge option of apt-get. The purge option of apt-get is similar to the remove function however with one difference. If a program tries to access a file known to belong in an uninstalled package, auto-apt will install that package using apt-get. This feature requires apt and sudo to work. Auto-apt keeps databases which need to be kept up-to-date in order for it to be effective.

This is achieved by calling the commands auto-apt update, auto-apt updatedb and auto-apt update-local. Usage example You're compiling a program and, all of a sudden, there's an error because it needs a file you don't have.

The program auto-apt asks you to install packages if they're needed, stopping the relevant process and continuing once the package is installed. If you're running X, a graphical interface will replace the default text interface. Run this command periodically to make sure your source list is up-to-date. This is the equivalent of "Reload" in Synaptic or "Fetch updates" in Adept. This is the equivalent of "Mark all upgrades" in Synaptic. It tells APT to use "smart" conflict resolution system, and it will attempt to upgrade the most important packages at the expense of less important ones if necessary.

It does an update of the package lists and checks for broken dependencies. Do this if you get complaints about packages with "unmet dependencies". This may not be desirable if you have a slow Internet connection, since it will cause you to redownload any packages you need to install a program.

For example: dpkg-reconfigure fontconfig-config will present you with a "wizard" on configuring fonts in Ubuntu. The note above about sudo usage applies to this command. While there is no built in way to remove all of your configuration information from your removed packages you can remove all configuration data from every removed package with the following command.

Similar to apt-cache search , but also shows whether a package is installed on your system by marking it with ii installed and un not installed. Note that foo. Use this command on. Consider this to be a "reverse lookup" utility. If you have very little space left on your computer, you can choose to delete the downloaded archive files using the apt-get clean command.

Note that broken packages also eat up a huge chunk of your system storage. Therefore, it is important that you know how to fix broken packages on Linux. Advanced Packaging Tool or simply Apt provides all the important utilities that you need for managing packages on your system. You can install, uninstall, purge, and clean up packages using this tool. If you are new to Linux, then knowing which distribution is the best for you is essential. Several websites are available that allow you to run and test Linux distributions right from your browser.

Interested in trying Linux but don't want to install it on your computer? Try Linux in your browser instead with DistroTest. He writes informational guides on Linux, aiming to provide a blissful experience to all newcomers. Not sure about movies, but if you want to talk about technology, he's your guy. Let's look at the correct way to get rid of an application in Linux using Apt. How to Remove a Package With Apt Apt offers various commands that you can use to remove packages from your Linux computer.

Uninstall a Package With Apt-Get Remove Apt-get remove uninstalls the package from your system but keeps the configurations and other user settings associated with the package.

To get a list of all the packages on your system, type: dpkg --list Search for the package you want to delete and note down its complete name. Related: What Does "Bash" Mean in Linux Remove a Package With Apt-Get Purge Unlike apt-get remove , apt-get purge completely removes the package from your system, along with the personalized settings and configurations. Launch your terminal and type in the following command to remove the package completely: sudo apt-get purge randompackage You will be asked for the root password; type it in and press Enter.



0コメント

  • 1000 / 1000