Error installing vim

Status
Not open for further replies.

larzeb

Dabbler
Joined
Aug 13, 2011
Messages
42
I tried to install vim on 9.2.1.6 with the command:

Code:
# pkg_add -r -v vim-lite


but received the following error

Code:
Finished loading gettext-0.18.3.1 via a URL
Package 'gettext-0.18.3.1' depends on 'libiconv-1.14_1' with 'converters/libiconv' origin.
pkg_add: could not find package libiconv-1.14_1 !
pkg_add: 1 package addition(s) failed
pkg_add: pkg_add of dependency 'gettext-0.18.3.1' failed!
pkg_add: 1 package addition(s) failed


I did not see a pbi for vim so I tried this. What can I do?
 

larzeb

Dabbler
Joined
Aug 13, 2011
Messages
42
No, I just opened a terminal and typed in this command. I will read your link, thanks.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
larzeb,

Now would be a good time to get rid of the old package system and start using pkg-ng. If I'm not mistaken the old pkg system has like 30 days before it is shutdown. So you'll be plenty disgusted when you can never install or update your software.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
More to the point, @larzeb, if you aren't doing this in a jail, you're doing it wrong. FreeNAS is designed to be an appliance, and does not support having arbitrary software added to the base OS. If you install a port jail, you can add all the software you want there--but not to the base OS.
 

larzeb

Dabbler
Joined
Aug 13, 2011
Messages
42
First off, from http://doc.freenas.org/index.php/Installing_non-PBI_Software:

DANGER! do not use the pkg_add command in a FreeNAS® jail as it will cause inconsistencies in your package management database.

Do you get the same error when you pkg install vim ? You are doing this in a jail, correct?
More to the point, @larzeb, if you aren't doing this in a jail, you're doing it wrong. FreeNAS is designed to be an appliance, and does not support having arbitrary software added to the base OS. If you install a port jail, you can add all the software you want there--but not to the base OS.

OK, I get it. I've created a jail, got into the jail and said,
pkg install editors/vim
.
but it's asking me
The following 76 packages will be affected (of 184 checked):

I'm afraid to answer yes, but I think I must. Also, once it's installed, how does access from outside the jail get to invoke vim?
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Yes, I believe you'll need to answer yes to install the additional packages. To access the jail, from a root shell prompt, do
# jls
...which will return
Code:
   JID  IP Address      Hostname                      Path
    10  -               virtualbox2                   /mnt/tank/jail/virtualbox2
    11  -               plexmediaserver_1             /mnt/tank/jail/plexmediaserver_1

...or something similar. To enter the first jail (virtualbox2, in my example), run
# jexec 10 tcsh
(substituting whatever shell you want to use, as long as it's installed in the jail). You'll then be in the jail and can run vim, or whatever else you want. Out of curiousity, why are you wanting to install vim? If it's to edit the server's config files, refer back to the "it's an appliance" concept.
 

larzeb

Dabbler
Joined
Aug 13, 2011
Messages
42
Coming from Ubuntu, I'm used to it. I can use vi, however, and forget vim.
 

Whattteva

Wizard
Joined
Mar 5, 2013
Messages
1,824
OK, I get it. I've created a jail, got into the jail and said, .
but it's asking me

I'm afraid to answer yes, but I think I must. Also, once it's installed, how does access from outside the jail get to invoke vim?
That message sounds like you've already got existing packages installed (maybe under the old system of pkg_add or using make install).
You should probably do some research about ports in general on the FreeBSD handbook, but here are a few general things you should keep in mind about FreeBSD systems:
  1. Do NOT mix binary packages and source installations unless you absolutely can't help it. It's a recipe for dependency headaches down the line.
  2. Upgrade your database if you were using pkg_add to the new pkgng database first PRIOR to doing anything with the new package manager.
Once you've done those, then I would perform an update of all the packages first, then install vim-lite.
And vim is miles better than vi. vi lacks a lot of things that vim does... multiple undo history is one of the many things vi lacks. Honestly, I think vim is the first thing I install into any system that I use on a regular basis.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
larzeb,

In FreeBSD you invoke the package manager you want to use (there's 2 main ones right now), or the applicable ports (I'm aware of 2 main ones but there may be more). Depending on which one you plan to use will determine what command you run. ;)

Do you know what route you are planning to take?
 

larzeb

Dabbler
Joined
Aug 13, 2011
Messages
42
cyberjock, you mentioned above that the new way to go is pkg-ng, not pkg_add, so I would want to use that one.
 

Whattteva

Wizard
Joined
Mar 5, 2013
Messages
1,824
First, you need to migrate your database from pkg_ style to pkgng style with the command pkg2ng (This step is irreversible btw).
Once you do that, you really only have a few commands you need to know:
  1. To install a package: pkg install pkg_name (equivalent to apt-get install)
  2. To list installed packages: pkg info (forgot the apt equivalent here)
  3. To remove a package: pkg remove pkg_name (equivalent to apt-get remove)
  4. To update your package catalog: pkg update (equivalent to apt-get update)
  5. To upgrade your packages: pkg upgrade (equivalent to apt-get upgrade)
  6. To remove unneeded dependencies: pkg autoremove (equivalent to apt-get autoremove)
  7. To search for packages: pkg search search_exp (equivalent to apt-cache search)
As with aptitude, you can use option -y with pkg to automatically confirm installations/removals.
More information here.

I happen to like the pkg system. IMO, this kind of robust package manager has been long overdue and one of the few things that I thought the BSD's lagged behind the Linuxes. This brings FreeBSD up to par. Not everyone cares or has enough time to wait to compile things from source. pkg greatly simplifies things.
 
Last edited:

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Thanks for the save Whattteva! That's what he was needing. ;)
 

Whattteva

Wizard
Joined
Mar 5, 2013
Messages
1,824
Thanks for the save Whattteva! That's what he was needing. ;)
Anything to make your job easier :cool:. I figured you don't have enough time to handle every issue under the sun :P.
 

larzeb

Dabbler
Joined
Aug 13, 2011
Messages
42
First, you need to migrate your database from pkg_ style to pkgng style with the command pkg2ng (This step is irreversible btw).
Once you do that, you really only have a few commands you need to know:
  1. To install a package: pkg install pkg_name (equivalent to apt-get install)
  2. To list installed packages: pkg info (forgot the apt equivalent here)
  3. To remove a package: pkg remove pkg_name (equivalent to apt-get remove)
  4. To update your package catalog: pkg update (equivalent to apt-get update)
  5. To upgrade your packages: pkg upgrade (equivalent to apt-get upgrade)
  6. To remove unneeded dependencies: pkg autoremove (equivalent to apt-get autoremove)
  7. To search for packages: pkg search search_exp (equivalent to apt-cache search)
As with aptitude, you can use option -y with pkg to automatically confirm installations/removals.
More information here.

I happen to like the pkg system. IMO, this kind of robust package manager has been long overdue and one of the few things that I thought the BSD's lagged behind the Linuxes. This brings FreeBSD up to par. Not everyone cares or has enough time to wait to compile things from source. pkg greatly simplifies things.

Thanks for taking the time to explain the package manager.

When I tried to use it, the results scared me:

Code:
freenas.local:/mnt/tank/jails$ pkg info
The package management tool is not yet installed on your system.
The mechanism for doing this is not secure on FreeBSD 9.2. To securely install
pkg(8), use ports from a portsnap checkout:
  # portsnap fetch extract
  # make -C /usr/ports/ports-mgmt/pkg install clean
Do you still want to fetch and install it now? [y/N]: n


I did this outside of any jail.
 

Whattteva

Wizard
Joined
Mar 5, 2013
Messages
1,824
Don't ever install anything outside of the jail; you'll bork your FreeNAS installation. Install extra stuff always in the jail.
The message you're getting is probably because the base OS (FreeNAS) doesn't have any pkg installed (for good reason, it doesn't need the extra bloat).
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Don't ever install anything outside of the jail; you'll bork your FreeNAS installation. Install extra stuff always in the jail.
The message you're getting is probably because the base OS (FreeNAS) doesn't have any pkg installed (for good reason, it doesn't need the extra bloat).

yeah.. we covered this in the first reply of the thread....

Whatcha trying to do larzeb? If this is too much for you you may want to look at another OS. Better to not use an OS you can't understand than to use it and lose your data later because of a CLI mistake.
 

Varun Chandak

Dabbler
Joined
Jul 20, 2014
Messages
29
Don't ever install anything outside of the jail; you'll bork your FreeNAS installation. Install extra stuff always in the jail.
The message you're getting is probably because the base OS (FreeNAS) doesn't have any pkg installed (for good reason, it doesn't need the extra bloat).

Hi... i didnt read this thread before pkg_add -r -v vim

Now its installing numerous packages in addition to vim. How do I clean up now ?

Also, my / has gone up to 100%... Please help to clean up / as it is a production server, urgently.
 

Varun Chandak

Dabbler
Joined
Jul 20, 2014
Messages
29
alright... i have removed some packages that were installed during vim installation. Now the graphs are missing from the Reporting section of FreeNAS GUI. How to bring them back.

Yes, I know I might have removed the package that was required by it.
 
Status
Not open for further replies.
Top